diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 2a5235dede..323fc3c1da 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -18,11 +18,36 @@ body: - type: input attributes: label: OpenRCT2 build - placeholder: e.g. OpenRCT2, v0.3.4.1 (d76611e on develop) provided by GitHub + placeholder: e.g. OpenRCT2, v0.4.2-53-g3fa7d59 (3fa7d59 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: dropdown + attributes: + label: Base game + description: With what base game do you have OpenRCT2 loaded? Did you test it with the other (select both if so)? + multiple: true + options: + - RollerCoaster Tycoon 2 + - RollerCoaster Tycoon Classic + validations: + required: true + +- type: dropdown + attributes: + label: Area(s) with this issue? + description: What things had an issue? Check all that apply. + multiple: true + options: + - The bug also exists in the original game (RCT2/RCTC) + - This bug is specific to multiplayer + - This bug is a graphical glitch or error + - This issue has to do with park objects and/or asset packs + - Issues building the game + validations: + required: false + - type: textarea attributes: label: Describe the issue @@ -30,19 +55,6 @@ body: 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e91a2cf501..79dbc7ebd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,12 @@ env: OPENRCT2_ORG_TOKEN: ${{ secrets.OPENRCT2_ORG_TOKEN }} BACKTRACE_IO_TOKEN: ${{ secrets.BACKTRACE_IO_TOKEN }} OPENRCT2_VERSION: 0.4.2 + +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: lint-commit: name: Lint Commit Message @@ -317,18 +323,6 @@ jobs: name: OpenRCT2-AppImage path: artifacts if-no-files-found: error - linux-flathub-beta: - name: Linux (Flathub beta channel) - if: github.repository == 'OpenRCT2/OpenRCT2' && github.ref == 'refs/heads/develop' && github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - name: Send dispatch event to OpenRCT2 Flathub repository - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.OPENRCT2_FLATHUB_TOKEN }} - repository: flathub/io.openrct2.OpenRCT2 - event-type: openrct2_develop_push - client-payload: '{ "commit": "${{ github.sha }}" }' linux-docker: name: Linux (docker) needs: check-code-formatting diff --git a/.gitignore b/.gitignore index b9c21990e3..9af002316d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ libversion data/g2.dat data/sequence data/object +data/assetpack ################# ## Eclipse diff --git a/CMakeLists.txt b/CMakeLists.txt index 74ce3bd06d..76a17f2438 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,13 +64,21 @@ set(TITLE_SEQUENCE_VERSION "0.4.0") set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip") set(TITLE_SEQUENCE_SHA1 "4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0") -set(OBJECTS_VERSION "1.3.5") +set(OBJECTS_VERSION "1.3.7") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") -set(OBJECTS_SHA1 "58bddc5f845d8c7eb5d9fd25e52ab1fed24c85db") +set(OBJECTS_SHA1 "82930d549e0b3c3bce29718d5390c5cd474d0f28") -set(REPLAYS_VERSION "0.0.69") +set(OPENSFX_VERSION "1.0.1") +set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip") +set(OPENSFX_SHA1 "8f04aea33f8034131c3069f6accacce0d94f80c1") + +set(OPENMSX_VERSION "1.0.1") +set(OPENMSX_URL "https://github.com/OpenRCT2/OpenMusic/releases/download/v${OPENMSX_VERSION}/openmusic.zip") +set(OPENMSX_SHA1 "8ff94490180e2fbfdd13a4130eb300da726ca406") + +set(REPLAYS_VERSION "0.0.70") set(REPLAYS_URL "https://github.com/OpenRCT2/replays/releases/download/v${REPLAYS_VERSION}/replays.zip") -set(REPLAYS_SHA1 "3EC20AA2C90FDEEB08C26B6DA6D111C9C5C9B694") +set(REPLAYS_SHA1 "09B339E86AAE81580C5AC3E23AC4BC9E030DA076") option(FORCE32 "Force 32-bit build. It will add `-m32` to compiler flags.") option(WITH_TESTS "Build tests") @@ -436,6 +444,26 @@ if (NOT MACOS_BUNDLE OR (MACOS_BUNDLE AND WITH_TESTS)) SHA1 ${OBJECTS_SHA1} )") endif () + if (DOWNLOAD_OPENSFX) + install(CODE " + include(${ROOT_DIR}/cmake/download.cmake) + download_openrct2_zip( + ZIP_VERSION ${OPENSFX_VERSION} + DOWNLOAD_DIR \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ + ZIP_URL ${OPENSFX_URL} + SHA1 ${OPENSFX_SHA1} + )") + endif () + if (DOWNLOAD_OPENMSX) + install(CODE " + include(${ROOT_DIR}/cmake/download.cmake) + download_openrct2_zip( + ZIP_VERSION ${OPENMSX_VERSION} + DOWNLOAD_DIR \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ + ZIP_URL ${OPENMSX_URL} + SHA1 ${OPENMSX_SHA1} + )") + endif () if (DOWNLOAD_REPLAYS) # Checks if this version of the replays are already installed, updates if necessary install(CODE " diff --git a/CMakeLists_mingw.txt b/CMakeLists_mingw.txt index ffb338d416..830c5031e4 100644 --- a/CMakeLists_mingw.txt +++ b/CMakeLists_mingw.txt @@ -23,3 +23,6 @@ SET(CMAKE_FIND_ROOT_PATH ${TARGET_ENVIRONMENT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# Enable Unicode +add_compile_options(-municode) diff --git a/contributors.md b/contributors.md index b85d7472eb..92818ab9b2 100644 --- a/contributors.md +++ b/contributors.md @@ -21,6 +21,8 @@ Includes all git commit authors. Aliases are GitHub user names. ## Long term contributors The following people are not part of the development team, but have been contributing for a long time. +* Edward Calver (X7123M3-256) +* Karst van Galen Last (AuraSpecs) * Matte Andersson (Nubbie) * Kenton Boadway (Krutonium) * Joe Minor Jr (wolfreak99) @@ -57,7 +59,7 @@ The following people are not part of the development team, but have been contrib * Inseok Lee (dlunch) - Load save files from command line * Jørn Lomax (jvlomax) - Configuration parser * Alexander Overvoorde (Overv) - OpenGL improvements, Steam overlay detection, various bugfixes. -* (eezstreet) - Add finances button to toolbar +* (eezstreet) - Add finances button to toolbar, various bugfixes. * Hielke Morsink (Broxzier) - Tile inspector, heightmap loader, misc. * Joe Minor Jr (wolfreak99) - Various cheats, bugfixes, new About and Changelog windows. * Thomas den Hollander (ThomasdenH) - Dithering in sprite importer, invert viewport dragging, park rating cheats misc. @@ -97,7 +99,7 @@ The following people are not part of the development team, but have been contrib * Bas Cantrijn (Basssiiie) - Various plugin additions, misc. * Adrian Zdanowicz (CookiePLMonster) - Misc. * Andrew Pratt (andrewpratt64) - Added api hook for vehicle crashes, api function to get entities on a tile -* Karst van Galen Last (AuraSpecs) - Misc. +* Karst van Galen Last (AuraSpecs) - Ride paint (bounding boxes, extra track pieces), soundtrack, sound effects, misc. * (8street) - Misc. ## Bug fixes @@ -197,6 +199,12 @@ The following people are not part of the development team, but have been contrib * Huu Kim Nguyen (CoderUndefined) * Henry Cheng (jazzysoggy) * Dan Stevens (MajeureX) +* 73 (733737) +* Raymond Zhao (rzhao271) +* Xixiang Chen (jacknull1991) +* (ReticulatingSplines) +* Conrad Cash (HouseholdVTuber) + ## Toolchain * (Balletie) - macOS @@ -217,6 +225,7 @@ The following people are not part of the development team, but have been contrib * (MaxBareiss) * Mithun Hunsur (Philpax) * (RollingStar) +* (That Human Being) ## Translation * Extracting from original files: Ted John (IntelOrca) @@ -232,6 +241,7 @@ The following people are not part of the development team, but have been contrib * Czech - Martin Černáč (octaroot), (Clonewayx), Tomáš Pazdiora (Aroidzap) * Danish - Lars P. Sørensen (LPSGizmo) * Dutch - Michael Steenbeek (Gymnasiast), Yannic Geurts (xzbobzx), (mrtnptrs), Thomas den Hollander (ThomasdenH), (hostbrute), Marijn van der Werf (marijnvdwerf), Tom Kroes (ThePsionic); reviewing and discussion: Aaron van Geffen (AaronVanGeffen), (Balletie) and Sijmen Schoon (SijmenSchoon). +* Esperanto - (tellovishous), Raymond Zhao (rzhao271) * Finnish - (DJHasis), (Zode), (TheWing) * French - (fbourigault), Joël Troch (JoelTroch), Michael Steenbeek (Gymnasiast), Romain Vigier (rmnvgr), (AziasYur), Hugo Courtial (s0r00t), David Delobel (incyclum), Nicolas Hawrysh (xp4xbox) * German - (danidoedel), (atmaxinger), (Yepoleb), Daniel Kessel (dkessel), Leon (AllGoodNamesAreTaken), (raidcookie) @@ -261,4 +271,4 @@ Representation by Jacqui Lyons at Marjacq Ltd. Thanks to: Peter James Adcock, Joe Booth, and John Wardley -Licensed to Infogrames Interactive Inc. +Licensed to Infogrames Interactive Inc. \ No newline at end of file diff --git a/data/language/ar-EG.txt b/data/language/ar-EG.txt index 75a096dc8e..d766642676 100644 --- a/data/language/ar-EG.txt +++ b/data/language/ar-EG.txt @@ -753,7 +753,7 @@ STR_1363 :Too high for supports! STR_1364 :Supports for track above can’t be extended any further! STR_1365 :In-line Twist (left) STR_1366 :In-line Twist (right) -STR_1367 :Half Loop +STR_1367 :نصف حلقة صغيرة STR_1368 :Half Corkscrew (left) STR_1369 :Half Corkscrew (right) STR_1370 :Barrel Roll (left) @@ -2713,8 +2713,6 @@ STR_5503 :Enter hostname or IP address: STR_5504 :Show multiplayer status STR_5505 :Unable to connect to server. STR_5506 :Guests ignore intensities -STR_5508 :Allow loading files with incorrect checksums -STR_5509 :Allows loading scenarios and saves{NEWLINE}that have an incorrect checksum,{NEWLINE}like the scenarios from the demo{NEWLINE}or damaged saves. STR_5510 :جهاز الصوت الإفتراضي STR_5511 :(غير معروف) STR_5512 :حفظ اللعبة كـ @@ -3594,14 +3592,16 @@ STR_6487 :تفعيل شاهد من خلال العاملون STR_6488 :{RED}يشكو الضيوف من طوابير الإنتظار الطويلة بحديقتك.{NEWLINE}قلل الطوابير الطويلة المسببة للمشكلة، أو زد عدد الرحلات. STR_6489 :خطأ: نسخة حديقة غير مدعومة STR_6490 :تحذير: نسخة حديقة شبه مدعومة -STR_6491 :حُفظت هذه الحديقة في نسخة أحدث من اللعبة. الحديقة نسخة {INT32} و تتطلب علي الأقل نسخة{INT32}. STR_6492 :حُفظت هذه الحديقة في نسخة قديمة من اللعبة، ولا يمكن فتحها في النسخة الحالية من اللعبة. نسخة الحديقة هي{INT32}. -STR_6493 :حُفظت هذه الحديقة في نسخة أحدث من اللعبة، ربما فُقدت بعض البيانات. نسخة الحديقة هي{INT32} وتتطلب علي الأقل نسخة{INT32}. STR_6494 :تجميع حسب نوع الرحلة STR_6495 :مجموعة الرحلات حسب نوع الرحلة بدلاً من عرض كل مركبة على حدة. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} STR_6497 :اظغط علي البلاط لعرض عناصره.{NEWLINE}Ctrl + ظغطة لتحديد عنصر البلاط تحديداً. STR_6498 :غير قادر على إبقاء شكل الخريطة بهيئة مربع. +STR_6499 :نوع السيارة غير مدعوم بتنسيق تصميم المسار +STR_6500 :عناصر المسار غير مدعومة بتنسيق تصميم المسار +STR_6501 :لون عشوائي +STR_6514 :ارتفاع غير صحيح! ############# # Scenarios # @@ -4053,36 +4053,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :سقف -[TTRFWD01] -STR_NAME :سقف - -[TTRFWD02] -STR_NAME :سقف - -[TTRFWD03] -STR_NAME :سقف - -[TTRFWD04] -STR_NAME :سقف - -[TTRFWD05] -STR_NAME :سقف - -[TTRFWD06] -STR_NAME :سقف - -[TTRFWD07] -STR_NAME :سقف - -[TTRFWD08] -STR_NAME :سقف - -[ACWW33] -STR_NAME :حائط خشبي - -[ACWWF32] -STR_NAME :حائط خشبي - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/ca-ES.txt b/data/language/ca-ES.txt index 385283b22d..fa383c0dda 100644 --- a/data/language/ca-ES.txt +++ b/data/language/ca-ES.txt @@ -102,7 +102,7 @@ STR_0512 :Muntanya russa compacta amb una pujada en espiral i caigudes sinuos STR_0513 :Muntanya russa amb inversions en la qual els passatgers es mantenen drets. STR_0514 :Els cotxes que pengen per sota dels rails es balancegen cap a fora en les corbes. STR_0515 :Muntanya russa d’acer amb cotxes que pengen per sota de la via i amb un recorregut molt complex i sinuós. -STR_0516 :Muntanya russa suau per gent que encara no s’atreveix amb muntanyes russes grans. +STR_0516 :Muntanya russa suau per a gent que encara no s’atreveix amb muntanyes russes grans. STR_0517 :Els passatgers viatgen en trens diminuts per una via estreta. STR_0518 :Els passatgers viatgen en trens elèctrics per una via monorail. STR_0519 :Els passatgers viatgen en vagons petits que pengen de la via d’un sol rail, balancejant-se lliurement d’un costat a l’altre en les corbes. @@ -112,10 +112,10 @@ STR_0522 :Muntanya russa petita en la que els passatgers estan asseguts per d STR_0523 :Els passatgers viatgen poc a poc en vehicles autopropulsats sobre la ruta que segueix la via. STR_0524 :Es llença un vagó cap amunt amb aire comprimit per una torre d’acer i després se’l deixa caure. STR_0525 :Els passatgers circulen per un camí tortuós guiat només per la curvatura i peralt de vies semicirculars. -STR_0526 :Els passatgers entren a una cabina rotatòria d’observació que els puja per a dalt de tot de la torre. +STR_0526 :Els passatgers entren a una cabina rotatòria d’observació que els puja dalt de tot de la torre. STR_0527 :Muntanya russa suau de vies d’acer i que permet inversions verticals. STR_0528 :Els passatgers viatgen en bots inflables a través de tubs semicirculars o tubs totalment tancats. -STR_0529 :Muntanya russa amb temàtica minera per vies d’acer preparades per simular vies fèrries de tren. +STR_0529 :Muntanya russa amb temàtica minera per vies d’acer preparades per a simular vies fèrries de tren. STR_0530 :Els vagons pengen d’un cable d’acer que recorren contínuament d’un extrem a l’altre de l’atracció. STR_0531 :Muntanya russa compacta amb vies d’acer per la qual els vagons passen per tirabuixons i inversions. STR_0532 :El laberint està format per bardisses o murs de dos metres. Els visitants es mouen pels camins del laberint buscant la sortida. Només abandonaran l’atracció si aconsegueixen trobar la sortida! @@ -127,7 +127,7 @@ STR_0537 :Els passatgers condueixen cotxes de xoc elèctrics i xoquen entre e STR_0538 :Vaixell pirata enorme que es balanceja d’un costat a l’altre. STR_0539 :El vaixell està unit a un braç amb un contrapès a l’altre extrem. El vaixell es balanceja i arriba a fer una volta de 360°. STR_0540 :Un estand on els visitants poden comprar menjar. -STR_0542 :Un estand per comprar begudes. +STR_0542 :Un estand per a comprar begudes. STR_0544 :Un estand que ven objectes de record de la visita al parc. STR_0545 :Els cavallets tradicionals que giren i giren i giren… STR_0547 :Un estand on els visitants poden aconseguir un mapa del parc i comprar paraigües. @@ -137,23 +137,23 @@ STR_0550 :Els passatgers veuen una pel·lícula dins del simulador mentre aqu STR_0551 :Un cinema que projecta pel·lícules en 3D dins d’un edifici en forma d’esfera. STR_0552 :Les cabines dels passatgers pengen dels braços als que estan lligades girant-les, balancejant-les i movent-les cap endavant i cap enrere. STR_0553 :Anells concèntrics pivotats que permeten als que hi pugen donar voltes en totes les direccions. -STR_0554 :El vagó accelera sortint de l’estació per una via llarga i anivellada usant motors d’inducció lineal. Llavors, es mou cap amunt per una secció vertical que acaba en punta i cau en caiguda lliure per retornar després a l’andana. -STR_0555 :Els passatgers pugen o baixen per una torre vertical per arribar a diferents nivells del parc. +STR_0554 :El vagó accelera sortint de l’estació per una via llarga i anivellada usant motors d’inducció lineal. Llavors, es mou cap amunt per una secció vertical que acaba en punta i cau en caiguda lliure per a tornar després a l’andana. +STR_0555 :Els passatgers pugen o baixen per una torre vertical per a accedir a diferents nivells del parc. STR_0556 :Vagons extraamples descendeixen per una secció vertical per a l’experiència definitiva de les caigudes lliures en muntanyes russes. STR_0557 :Un caixer automàtic que poden usar els visitants que tinguin pocs diners a la butxaca. STR_0558 :Els passatgers van aparellats als seients que giren respecte les puntes de tres braços llargs que també giren. STR_0559 :Edifici enorme de temàtica terrorífica amb passadissos esgarrifosos i sales horripilants. -STR_0560 :Un lloc que els visitants amb nàusees visiten per recuperar-se més de pressa. +STR_0560 :Un lloc que els visitants amb nàusees visiten per a recuperar-se més de pressa. STR_0561 :Espectacle de circ dins d’una tenda enorme. STR_0562 :Els vagons autopropulsats viatgen per una via a diferents nivells que recorre paisatges fantasmagòrics amb efectes especials. STR_0563 :Els passatgers drets amb unes subjeccions simples dintre els vagons travessen i gaudeixen de caigudes i girs enrevessats, així com d’una part «a l’aire lliure» damunt dels turons. STR_0564 :Movent-se per vies de fusta, aquesta muntanya russa és ràpida, rústica, sorollosa i dóna una sensació d’experiència «fora de control» a l’aire lliure. STR_0565 :Una muntanya russa senzilla de fusta que només és capaç de fer inclinacions i girs suaus, mentre que els vagons es mantenen a la via mitjançant la gravetat i unes rodes laterals de fricció. STR_0566 :Els vagons individuals giren per un difícil tram zigzaguejant amb girs pronunciats i caigudes brusques curtes. -STR_0567 :Seient suspesos a ambdós laterals de la via, els passatgers són penjats cap per avall mentre són sotmesos a caigudes pronunciades i passen per inversions. +STR_0567 :Seient suspesos a ambdós laterals de la via, els passatgers són penjats cap per avall mentre són sotmesos a caigudes pronunciades i inversions. STR_0569 :Lligats amb arnesos especials per sota de la via, els passatgers experimenten la sensació de volar mentre baixen en picat. STR_0571 :Vagons circulars que giren i reboten mentre es mouen per un camí de fusta zigzaguejant. -STR_0572 :Bots de gran capacitat que es mouen per un canal d’aigua, propulsats cap amunt per cintes transportadores i accelerant per baixades pronunciades per mullar els passatgers amb una esquitxada espectacular. +STR_0572 :Bots de gran capacitat que es mouen per un canal d’aigua, propulsats cap amunt per cintes transportadores i accelerant per baixades pronunciades que mullen els passatgers amb una esquitxada espectacular. STR_0573 :Disposa de vagons amb forma d’helicòpters que es mouen per una via d’acer controlats pels pedals dels passatgers. STR_0574 :Els passatgers estan lligats amb arnesos especials cara avall, movent-se per una via amb girs i inversions o bé d’esquena o bé de cara al terra. STR_0575 :Transport de persones pel parc a través de vagons penjants que circulen per un únic rail. @@ -163,24 +163,24 @@ STR_0579 :Els visitants podran gaudir d’una tranquil·la partida de minigol STR_0580 :Muntanya russa gegant d’acer capaç de suaus baixades i pujades de més de 90 m. STR_0581 :Una anella de seients que puja per una torre alta mentre va rotant suaument, després cau en caiguda lliure i, al final, para delicadament usant frens magnètics. STR_0582 :Els passatgers condueixen lliurement aquests vehicles aerolliscadors. -STR_0583 :Edifici format per habitacions deformades i passadissos angulars per desorientar la gent quan hi passa. +STR_0583 :Edifici format per habitacions deformades i passadissos angulars que desorienten a la gent quan hi passa. STR_0584 :Bicicletes especials que es mouen per vies monorails gràcies al pedaleig dels passatgers. -STR_0585 :Els passatgers seuen per parelles penjant per sota de la via passant per tirabuixons i inversions. +STR_0585 :Els passatgers seuen per parelles penjant per sota de la via i experimenten tirabuixons i inversions. STR_0586 :Els vagons en forma de bot circulen per la via de la muntanya russa. Hi ha girs abruptes i descensos pronunciats, esquitxant quan passa per algunes seccions amb aigua. -STR_0587 :Després d’un llançament excitant per aire comprimit, el vagó accelera per una via vertical fins a dalt de tot i baixa per l’altre costat per tornar a l’andana. +STR_0587 :Després d’un llançament excitant per aire comprimit, el vagó accelera per una via vertical fins a dalt de tot i baixa per l’altre costat per a tornar a l’andana. STR_0588 :Disposa de vagons individuals que es mouen per una via zigzaguejant amb girs de forquilla i caigudes pronunciades. STR_0589 :Tematitzat com una enorme catifa voladora, un vago es mou amunt i avall cíclicament gràcies a quatre braços mecànics. STR_0590 :Els passatgers fan un viatge en un submarí a través d’un curs sota l’aigua. STR_0591 :Bots en forma de barques soleres que serpentegen a través d’una via en forma de riu. STR_0593 :Roda que gira amb els passatgers en cabines. Primer comença girant i després s’inclina gràcies a un braç que l’aixeca. -STR_0598 :Els vagons de la muntanya russa invertida acceleren per l’andana per passar per un tram de via vertical. Llavors, tornen marxa enrere passant per l’andana i pujant per un altre tram de via vertical. +STR_0598 :Els vagons de la muntanya russa invertida acceleren per l’andana i passen per un tram de via vertical. Llavors, tornen marxa enrere passant per l’andana i pugen per un altre tram de via vertical. STR_0599 :Muntanya russa que compta amb vagons individuals i caigudes i girs suaus. STR_0600 :Trens d’estil miner autopropulsats per un recorregut amb girs suaus. -STR_0602 :Els vagons d’aquesta muntanya russa s’acceleren fora de l’andana per motors d’inducció lineal per accelerar durant les inversions tortuoses. +STR_0602 :Els vagons d’aquesta muntanya russa s’acceleren fora de l’andana per motors d’inducció lineal per a accelerar durant les inversions tortuoses. STR_0603 :Una muntanya russa de fusta amb una via d’acer, el que permet unes caigudes empinades i inversions. STR_0604 :Els passatgers van en fila per una via monorail estreta i passen a gran velocitat per tirabuixons i inversions. -STR_0605 :Els passatgers baixen per una via d’acer sinuosa, frenant per controlar la velocitat. -STR_0606 :Una muntanya russa d'estil antic i de fusta, on els cotxes es mouen de pressa amb gran part al descobert, algunes accelerades laterals i dissenyada perquè els passatgers es sentin com si l'atracció estigués fora de control. +STR_0605 :Els passatgers baixen per una via d’acer sinuosa, frenant per a controlar la velocitat. +STR_0606 :Una muntanya russa d’estil antic i de fusta, on els cotxes es mouen de pressa amb gran part al descobert, algunes accelerades laterals i dissenyada perquè els passatgers es sentin com si l’atracció estigués fora de control. STR_0767 :Visitant {INT32} STR_0768 :Encarregat de neteja {INT32} STR_0769 :Mecànic {INT32} @@ -238,7 +238,7 @@ STR_0825 :El nom ja està en ús. STR_0826 :S’estan usant massa noms. STR_0827 :No hi ha prou diners - fan falta {CURRENCY2DP}. STR_0828 :Tanca la finestra. -STR_0829 :Títol - Arrossegueu-lo per moure la finestra. +STR_0829 :Títol - Arrossegueu-lo per a moure la finestra. STR_0830 :Apropa la vista. STR_0831 :Allunya la vista. STR_0832 :Gira la càmera 90° en sentit horari. @@ -317,7 +317,7 @@ STR_0924 :Helicoide cap avall STR_0925 :Helicoide cap amunt STR_0926 :No es pot treure… STR_0927 :Això no es pot construir aquí… -STR_0928 :Cadena elevadora per pujar vagons per un pendent. +STR_0928 :Cadena elevadora per a pujar vagons per un pendent. STR_0929 :Corba en «S» (a l’esquerra) STR_0930 :Corba en «S» (a la dreta) STR_0931 :Inversió vertical (a l’esquerra) @@ -446,13 +446,13 @@ STR_1054 :Escull el nom d’atracció STR_1055 :Escull el nom de persona STR_1056 :Escull el nom de l’empleat STR_1057 :Nom de l’atracció -STR_1058 :Escolliu el nom nou per l’atracció: +STR_1058 :Trieu el nom nou de l’atracció: STR_1059 :No s’ha pogut canviar el nom de l’atracció… STR_1060 :Nom d’atracció no vàlid STR_1061 :Mode normal STR_1062 :Mode circuit continu STR_1063 :Mode de llançament invertit/inclinat -STR_1064 :Llançament impulsat (passa per andana) +STR_1064 :Llançament impulsat (passa per l’andana) STR_1065 :Mode llançadora STR_1066 :Mode lloguer de bots STR_1067 :Llançament cap amunt @@ -487,35 +487,35 @@ STR_1095 :Mode circuit continu amb blocs de seccions STR_1096 :Llançament impulsat (sense passar per l’andana) STR_1097 :Mode llançament impulsat seccionat per blocs STR_1098 :Movent-se cap al final de {POP16}{STRINGID} -STR_1099 :Esperant passatgers en {POP16}{STRINGID} -STR_1100 :Esperant per sortir de {POP16}{STRINGID} -STR_1101 :Sortint de {POP16}{STRINGID} -STR_1102 :Movent-se a {VELOCITY} -STR_1103 :Arribant a {POP16}{STRINGID} -STR_1104 :Descarregant passatgers en {POP16}{STRINGID} -STR_1105 :Viatjant a {VELOCITY} +STR_1099 :S’esperen passatgers en {POP16}{STRINGID} +STR_1100 :S’espera per a sortir de {POP16}{STRINGID} +STR_1101 :Es surt de {POP16}{STRINGID} +STR_1102 :Es mou a {VELOCITY} +STR_1103 :S’arriba a {POP16}{STRINGID} +STR_1104 :Es descarreguen els passatgers en {POP16}{STRINGID} +STR_1105 :Va a {VELOCITY} STR_1106 :S’estavella! STR_1107 :Sinistre! -STR_1108 :Viatjant a {VELOCITY} -STR_1109 :Balancejant-se -STR_1110 :Girant -STR_1111 :Girant -STR_1112 :Operant -STR_1113 :Reproduint una pel·lícula -STR_1114 :Girant -STR_1115 :Operant -STR_1116 :Operant -STR_1117 :Oferint espectacle de circ -STR_1118 :Operant -STR_1119 :Esperant el cable d’ascens -STR_1120 :Viatjant a {VELOCITY} -STR_1121 :Parant-se -STR_1122 :Esperant passatgers -STR_1123 :Esperant per començar -STR_1124 :Començant -STR_1125 :Operant -STR_1126 :Parant-se -STR_1127 :Descarregant passatgers +STR_1108 :Circula a {VELOCITY} +STR_1109 :Es balanceja +STR_1110 :Gira +STR_1111 :Gira +STR_1112 :Opera +STR_1113 :Reprodueix una pel·lícula +STR_1114 :Gira +STR_1115 :Opera +STR_1116 :Opera +STR_1117 :Ofereix espectacle de circ +STR_1118 :Opera +STR_1119 :Espera el cable d’ascens +STR_1120 :Circula a {VELOCITY} +STR_1121 :Es para +STR_1122 :Espera passatgers +STR_1123 :Espera per a començar +STR_1124 :Comença +STR_1125 :Opera +STR_1126 :Es para +STR_1127 :Es descarreguen passatgers STR_1128 :Parat pels frens del bloc STR_1129 :Tots els vagons del mateix color STR_1130 :Colors diferents per {STRINGID} @@ -551,8 +551,8 @@ STR_1159 :Afegeix decoracions, jardins i altres accessoris. STR_1160 :Crea i ajusta llacs i zones d’aigua. STR_1161 :No es pot posar aquí… STR_1162 :{OUTLINE}{TOPAZ}{STRINGID} -STR_1163 :{STRINGID}{NEWLINE}(Clic dret per modificar-ho) -STR_1164 :{STRINGID}{NEWLINE}(Clic dret per treure-ho) +STR_1163 :{STRINGID}{NEWLINE}(Clic dret per a modificar-ho) +STR_1164 :{STRINGID}{NEWLINE}(Clic dret per a treure-ho) STR_1165 :{STRINGID} - {STRINGID} {COMMA16} STR_1166 :No es pot baixar el nivell d’aigua… STR_1167 :No es pot pujar el nivell d’aigua… @@ -594,7 +594,7 @@ STR_1202 :1 persona a la cua STR_1203 :{COMMA16} persones a la cua STR_1204 :{COMMA16} minuts de cua STR_1205 :{COMMA16} minuts de cua -STR_1206 :{WINDOW_COLOUR_2}Càrrega per arrencar: +STR_1206 :{WINDOW_COLOUR_2}Càrrega per a arrencar: STR_1207 :{WINDOW_COLOUR_2}Arrenca el tren en espera si un altre arriba a l’estació STR_1208 :{WINDOW_COLOUR_2}Arrenca el bot en espera si un altre arriba a l’estació STR_1209 :Seleccioneu si cal esperar una certa quantitat de passatgers abans d’arrencar. @@ -752,7 +752,7 @@ STR_1360 :{WINDOW_COLOUR_2}Temps d’espera: {BLACK}{COMMA16} min STR_1361 :La velocitat no es pot canviar… STR_1362 :La velocitat de llançament no es pot canviar… STR_1363 :Massa alt per als suports! -STR_1364 :Els suports per a la secció no es poden fer més llargs. +STR_1364 :Els suports de la secció no es poden fer més llargs. STR_1365 :Gir en línia (a l’esquerra) STR_1366 :Gir en línia (a la dreta) STR_1367 :Mitja volta petita @@ -794,7 +794,7 @@ STR_1402 :Construïu o moveu l’entrada de l’atracció. STR_1403 :Construïu o moveu la sortida de l’atracció. STR_1404 :Gira 90° STR_1405 :Reflexa (simetria axial) -STR_1406 :Mostra o amaga el decorat (si n’hi ha de disponible per aquest disseny). +STR_1406 :Mostra o amaga el decorat (si n’hi ha de disponible per a aquest disseny). STR_1407 :{WINDOW_COLOUR_2}Construeix… STR_1408 :{WINDOW_COLOUR_2}Cost: {BLACK}{CURRENCY} STR_1409 :Andana d’entrada/sortida @@ -819,29 +819,29 @@ STR_1427 :{WINDOW_COLOUR_2}Clients: {BLACK}{COMMA32} per hora STR_1428 :{WINDOW_COLOUR_2}Preu de l’entrada: STR_1429 :{POP16}{POP16}{POP16}{CURRENCY2DP} STR_1430 :Gratuïta -STR_1431 :Caminant -STR_1432 :Dirigint-se cap a {STRINGID} -STR_1433 :Fent cua per {STRINGID} -STR_1434 :Ofegant-se +STR_1431 :Camina +STR_1432 :Es dirigeix cap a {STRINGID} +STR_1433 :Fa cua per {STRINGID} +STR_1434 :S’ofega STR_1435 :En {STRINGID} STR_1436 :En {STRINGID} STR_1437 :En {STRINGID} STR_1438 :Assegut STR_1439 :(seleccioneu-ne la nova ubicació) -STR_1440 :Segant la gespa -STR_1441 :Netejant el terra -STR_1442 :Buidant una paperera -STR_1443 :Regant els jardins -STR_1444 :Mirant {STRINGID} -STR_1445 :Mirant la construcció de {STRINGID} -STR_1446 :Mirant el paisatge -STR_1447 :Sortint del parc -STR_1448 :Mirant com es construeix una nova atracció +STR_1440 :Sega la gespa +STR_1441 :Neteja el terra +STR_1442 :Buida una paperera +STR_1443 :Rega els jardins +STR_1444 :Mira {STRINGID} +STR_1445 :Mira la construcció de {STRINGID} +STR_1446 :Mira el paisatge +STR_1447 :Surt del parc +STR_1448 :Mira com es construeix una nova atracció STR_1449 :{SPRITE} {STRINGID}{NEWLINE}({STRINGID}) STR_1450 :{INLINE_SPRITE}{09}{20}{00}{00}{SPRITE} {STRINGID}{NEWLINE}({STRINGID}) STR_1451 :{STRINGID}{NEWLINE}({STRINGID}) STR_1452 :Nom del visitant -STR_1453 :Trieu un nom per aquest visitant: +STR_1453 :Trieu un nom per a aquest visitant: STR_1454 :No es pot posar el nom al visitant… STR_1455 :El nom per al visitant no és vàlid. STR_1456 :{WINDOW_COLOUR_2}Diners gastats: {BLACK}{CURRENCY2DP} @@ -850,7 +850,7 @@ STR_1458 :{WINDOW_COLOUR_2}Temps al parc: {BLACK}{REALTIME} STR_1459 :Estil de via STR_1460 :Via oberta en forma d’«U» STR_1461 :Via tancada en forma d’«O» -STR_1462 :Massa inclinat per usar cadenes d’elevació +STR_1462 :Massa inclinat per a fer servir cadenes d’elevació STR_1463 :Visitants STR_1464 :Hèlix amunt (petita) STR_1465 :Hèlix amunt (gran) @@ -873,10 +873,10 @@ STR_1481 :«He gastat tots els diners». STR_1482 :«Estic marejat». STR_1483 :«Estic molt marejat». STR_1484 :«Vull provar alguna atracció més intensa que {STRINGID}». -STR_1485 :«{STRINGID} sembla massa intensa per mi». +STR_1485 :«{STRINGID} sembla massa intensa per a mi». STR_1486 :«Encara no m’he acabat {STRINGID}». STR_1487 :«Em marejo només veure {STRINGID}». -STR_1488 :«No penso pagar tant per pujar a {STRINGID}». +STR_1488 :«No penso pagar tant per a pujar a {STRINGID}». STR_1489 :«Vull anar-me’n a casa». STR_1490 :«{STRINGID} està bé de preu». STR_1491 :«Ja tinc {STRINGID}». @@ -886,13 +886,13 @@ STR_1494 :«No tinc set». STR_1495 :«Ajuda! M’ofego!» STR_1496 :«M’he perdut!» STR_1497 :«{STRINGID} ha estat bé». -STR_1498 :«He fet cua per {STRINGID} durant una eternitat». +STR_1498 :«He fet cua per a {STRINGID} durant una eternitat». STR_1499 :«Estic cansat». STR_1500 :«Tinc gana». STR_1501 :«Tinc set». STR_1502 :«He d’anar al lavabo». STR_1503 :«No puc trobar {STRINGID}». -STR_1504 :«No penso pagar tant per {STRINGID}». +STR_1504 :«No penso pagar tant per a {STRINGID}». STR_1505 :«No vull pujar a {STRINGID} mentre plou». STR_1506 :«Això està molt brut». STR_1507 :«No puc trobar la sortida». @@ -1055,7 +1055,7 @@ STR_1665 :{WINDOW_COLOUR_2}Gana: STR_1666 :{WINDOW_COLOUR_2}Set: STR_1667 :{WINDOW_COLOUR_2}Orina: STR_1668 :{WINDOW_COLOUR_2}Satisfacció: {BLACK}desconeguda -STR_1669 :{WINDOW_COLOUR_2}Satisfacció: {BLACK}{COMMA16}% +STR_1669 :{WINDOW_COLOUR_2}Satisfacció: {BLACK}{COMMA16} % STR_1670 :{WINDOW_COLOUR_2}Clients en total: {BLACK}{COMMA32} STR_1671 :{WINDOW_COLOUR_2}Benefici total: {BLACK}{CURRENCY2DP} STR_1672 :Frens @@ -1064,7 +1064,7 @@ STR_1674 :Velocitat dels frens STR_1675 :{POP16}{VELOCITY} STR_1676 :Estableix el límit de velocitat per als frens. STR_1677 :{WINDOW_COLOUR_2}Popularitat: {BLACK}desconeguda -STR_1678 :{WINDOW_COLOUR_2}Popularitat: {BLACK}{COMMA16}% +STR_1678 :{WINDOW_COLOUR_2}Popularitat: {BLACK}{COMMA16} % STR_1679 :Hèlix cap amunt (a l’esquerra) STR_1680 :Hèlix cap amunt (a la dreta) STR_1681 :Hèlix cap avall (a l’esquerra) @@ -1094,7 +1094,7 @@ STR_1704 :No es poden contractar empleats nous… STR_1705 :Acomiada aquest empleat STR_1706 :Moure aquesta persona a un altre lloc STR_1707 :Hi ha massa empleats a la partida. -STR_1708 :Estableix la zona de patrulla per aquest empleat. +STR_1708 :Estableix la zona de patrulla per a aquest empleat. STR_1709 :Acomiada l’empleat STR_1710 :Sí STR_1711 :{WINDOW_COLOUR_1}Esteu segur que voleu acomiadar el {STRINGID}? @@ -1140,7 +1140,7 @@ STR_1753 :Mostra una llista resumida dels visitants del parc STR_1754 :{BLACK}{COMMA32} visitants STR_1755 :{BLACK}{COMMA32} visitant STR_1756 :{WINDOW_COLOUR_2}Preu de l’entrada: -STR_1757 :{WINDOW_COLOUR_2}Fiabilitat: {MOVE_X}{255}{BLACK}{COMMA16}% +STR_1757 :{WINDOW_COLOUR_2}Fiabilitat: {MOVE_X}{255}{BLACK}{COMMA16} % STR_1758 :Mode construir STR_1759 :Mode desplaçar-se STR_1760 :Mode omplir @@ -1195,7 +1195,7 @@ STR_1812 :{BLACK}{STRINGID} STR_1813 :Altres objectes STR_1814 :Accions STR_1815 :Pensaments -STR_1816 :Seleccioneu el tipus d’informació per mostrar en la llista de visitants +STR_1816 :Seleccioneu el tipus d’informació per a mostrar en la llista de visitants STR_1817 :({COMMA32}) STR_1818 :{WINDOW_COLOUR_2}Tots els visitants STR_1819 :{WINDOW_COLOUR_2}Tots els visitants (resum) @@ -1204,7 +1204,7 @@ STR_1821 :{WINDOW_COLOUR_2}Visitants que pensen {SMALLFONT}{STRINGID} STR_1822 :{WINDOW_COLOUR_2}Visitants pensant en {POP16}{STRINGID} STR_1823 :Mostra els pensaments dels visitants sobre aquesta atracció STR_1824 :Mostra els visitants en aquesta atracció -STR_1825 :Mostra els visitants que fan cua per aquesta atracció +STR_1825 :Mostra els visitants que fan cua en aquesta atracció STR_1826 :Estat STR_1827 :Popularitat STR_1828 :Satisfacció @@ -1215,15 +1215,15 @@ STR_1832 :Fiabilitat STR_1833 :Temps d’avaria STR_1834 :Preferida pels visitants STR_1835 :Popularitat: desconeguda -STR_1836 :Popularitat: {COMMA16}% +STR_1836 :Popularitat: {COMMA16} % STR_1837 :Satisfacció: desconeguda -STR_1838 :Satisfacció: {COMMA16}% -STR_1839 :Fiabilitat: {COMMA16}% -STR_1840 :Temps avariada: {COMMA16}% +STR_1838 :Satisfacció: {COMMA16} % +STR_1839 :Fiabilitat: {COMMA16} % +STR_1840 :Temps avariada: {COMMA16} % STR_1841 :Benefici: {CURRENCY2DP} per hora STR_1842 :Preferida de: {COMMA16} visitant STR_1843 :Preferida de: {COMMA16} visitants -STR_1844 :Seleccioneu el tipus d’informació per mostrar a la llista d’atraccions +STR_1844 :Seleccioneu el tipus d’informació que voleu veure a la llista d’atraccions STR_1845 :{MONTHYEAR} STR_1846 :{COMMA32} visitants STR_1847 :{INLINE_SPRITE}{11}{20}{00}{00}{COMMA32} visitants @@ -1267,7 +1267,7 @@ STR_1885 :mai STR_1886 :Inspeccionant {STRINGID} STR_1887 :{WINDOW_COLOUR_2}Temps des de l’última inspecció: {BLACK}{COMMA16} minuts STR_1888 :{WINDOW_COLOUR_2}Temps des de l’última inspecció: {BLACK}more than 4 hores -STR_1889 :{WINDOW_COLOUR_2}Percentatge de temps avariada: {MOVE_X}{255}{BLACK}{COMMA16}% +STR_1889 :{WINDOW_COLOUR_2}Percentatge de temps avariada: {MOVE_X}{255}{BLACK}{COMMA16} % STR_1890 :Seleccioneu cada quan temps algun mecànic hauria de revisar aquesta atracció. STR_1891 :Al parc encara no hi ha {STRINGID}! # The following two strings were used to display an error when the disc was missing. @@ -1289,7 +1289,7 @@ STR_1907 :{WINDOW_COLOUR_2}Salaris d’empleats STR_1908 :{WINDOW_COLOUR_2}Màrqueting STR_1909 :{WINDOW_COLOUR_2}Recerca i desenvolupament STR_1910 :{WINDOW_COLOUR_2}Interessos del préstec -STR_1911 :{BLACK} al {COMMA16}% per any +STR_1911 :{BLACK} al {COMMA16} % per any STR_1912 :{MONTH} STR_1913 :{BLACK}+{CURRENCY2DP} STR_1914 :{BLACK}{CURRENCY2DP} @@ -1307,7 +1307,7 @@ STR_1927 :{YELLOW}{STRINGID} s’ha avariat STR_1928 :{RED}{STRINGID} sinistrada! STR_1929 :{RED}{STRINGID} encara no s’ha arreglat.{NEWLINE}Comproveu on estan els mecànics i penseu si cal organitzar-los millor. STR_1930 :Activa/Desactiva el seguiment d’aquest visitant (si s’activa el seguiment, a l’àrea de missatges n’apareixeran les accions que faci). -STR_1931 :{STRINGID} fa cua per l’atracció {STRINGID}. +STR_1931 :{STRINGID} fa cua a l’atracció {STRINGID}. STR_1932 :{STRINGID} està a {STRINGID}. STR_1933 :{STRINGID} està a {STRINGID}. STR_1934 :{STRINGID} ha sortit de {STRINGID}. @@ -1651,7 +1651,7 @@ STR_2286 :es va dissenyant. STR_2287 :es completa el disseny. STR_2288 :desconeguda STR_2289 :{STRINGID} {STRINGID} -STR_2291 :Seleccioneu l’escenari per una nova partida +STR_2291 :Seleccioneu l’escenari de la partida nova STR_2292 :{WINDOW_COLOUR_2}Atraccions visitades: STR_2293 :{BLACK} Cap STR_2294 :Canvia l’estil del terreny @@ -1681,8 +1681,8 @@ STR_2321 :{WINDOW_COLOUR_2}Nombre d’atraccions: {BLACK}{COMMA16} STR_2322 :{WINDOW_COLOUR_2}Empleats: {BLACK}{COMMA16} STR_2323 :{WINDOW_COLOUR_2}Extensió del parc: {BLACK}{COMMA32} m² STR_2324 :{WINDOW_COLOUR_2}Mida del parc: {BLACK}{COMMA32} ft² -STR_2325 :Compreu terreny per estendre el parc. -STR_2326 :Compreu drets de construcció per construir per dalt i per baix del terreny exterior del parc. +STR_2325 :Compreu terreny per a ampliar el parc. +STR_2326 :Compreu drets de construcció per a construir per dalt i per sota del terreny exterior del parc. STR_2327 :Opcions STR_2328 :{WINDOW_COLOUR_2}Moneda: STR_2329 :{WINDOW_COLOUR_2}Longitud i velocitat: @@ -1745,12 +1745,12 @@ STR_2387 :{BLACK}Aconseguir una valoració del parc d’almenys {POP16}{POP16 STR_2388 :{BLACK}Divertiu-vos! STR_2389 :{BLACK}Construïu el millor {STRINGID} que pugueu! STR_2390 :{BLACK}Tenir 10 tipus diferents de muntanyes russes operant al parc, cadascuna d’elles amb un valor d’emoció d’almenys 6,00. -STR_2391 :{BLACK}Tenir almenys {COMMA16} visitants al parc. No podeu deixar que la valoració del parc caigui per baix de 700 en cap moment! -STR_2392 :{BLACK}Aconseguir uns ingressos mensuals per entrades d’atraccions d’almenys {POP16}{POP16}{CURRENCY}. +STR_2391 :{BLACK}Tenir almenys {COMMA16} visitants al parc. No podeu deixar que la valoració del parc caigui per sota de 700 en cap moment! +STR_2392 :{BLACK}Aconseguir uns ingressos mensuals amb les entrades d’atraccions d’almenys {POP16}{POP16}{CURRENCY}. STR_2393 :{BLACK}Tenir 10 tipus diferents de muntanyes russes operant al parc, cadascuna amb una longitud mínima de {LENGTH} i un valor d’emoció d’almenys 7,00. -STR_2394 :{BLACK}Acabar de construir les cinc muntanyes russes que s’havien començat a construir al parc, dissenyant-les per aconseguir un nivell d’emoció d’almenys {POP16}{POP16}{COMMA2DP32} per cada una d’elles. +STR_2394 :{BLACK}Acabar de construir les cinc muntanyes russes que s’havien començat a construir al parc, dissenyant-les per a aconseguir un nivell d’emoció d’almenys {POP16}{POP16}{COMMA2DP32} per cada una d’elles. STR_2395 :{BLACK}Retornar el préstec i aconseguir una valoració del parc d’almenys {POP16}{POP16}{CURRENCY}. -STR_2396 :{BLACK}Aconseguir un benefici mensual per la venda de menjar, beguda i altres productes d’almenys {POP16}{POP16}{CURRENCY}. +STR_2396 :{BLACK}Aconseguir un benefici mensual amb la venda de menjar, beguda i altres productes d’almenys {POP16}{POP16}{CURRENCY}. STR_2397 :Cap STR_2398 :Nombre de visitants en una data determinada STR_2399 :Valoració del parc en una data determinada @@ -1758,11 +1758,11 @@ STR_2400 :Divertiu-vos! STR_2401 :Construir la millor atracció que pugueu STR_2402 :Construir 10 muntanyes russes STR_2403 :Nombre de visitants al parc -STR_2404 :Ingressos mensuals per entrades d’atraccions +STR_2404 :Ingressos mensuals de les entrades d’atraccions STR_2405 :Construir 10 muntanyes russes amb una longitud donada STR_2406 :Acabar de construir 5 muntanyes russes STR_2407 :Retornar el préstec i assolir una valoració del parc determinada -STR_2408 :Benefici mensual per vendes +STR_2408 :Benefici mensual de les vendes STR_2409 :{WINDOW_COLOUR_2}Campanyes de màrqueting en marxa STR_2410 :{BLACK}Cap STR_2411 :{WINDOW_COLOUR_2}Campanyes de màrqueting disponibles @@ -1774,18 +1774,18 @@ STR_2416 :{WINDOW_COLOUR_2}Ítem: STR_2417 :{WINDOW_COLOUR_2}Duració: STR_2418 :Entrada gratuïta a {STRINGID} STR_2419 :Viatge gratuït per {STRINGID} -STR_2420 :Entrada a meitat de preu per {STRINGID} +STR_2420 :Entrada a meitat de preu per a {STRINGID} STR_2421 :{STRINGID} gratis STR_2424 :{WINDOW_COLOUR_2}Cupons d’entrada gratuïta al parc -STR_2425 :{WINDOW_COLOUR_2}Cupons de viatge gratis per una de les atraccions -STR_2426 :{WINDOW_COLOUR_2}Cupons de descompte del 50% per a l’entrada al parc +STR_2425 :{WINDOW_COLOUR_2}Cupons de viatge gratis per a una atracció +STR_2426 :{WINDOW_COLOUR_2}Cupons de descompte del 50 % per a l’entrada al parc STR_2427 :{WINDOW_COLOUR_2}Cupons de menjar i beguda gratis STR_2428 :{WINDOW_COLOUR_2}Campanya de publicitat del parc STR_2429 :{WINDOW_COLOUR_2}Campanya de publicitat per a una atracció STR_2430 :{BLACK}Cupons d’entrada gratis a {STRINGID} STR_2431 :{BLACK}Cupons de viatge gratis a {STRINGID} -STR_2432 :{BLACK}Cupons d’entrada a meitat de preu per {STRINGID} -STR_2433 :{BLACK}Cupons per {STRINGID} gratis +STR_2432 :{BLACK}Cupons d’entrada a meitat de preu per a {STRINGID} +STR_2433 :{BLACK}Cupons per a {STRINGID} gratis STR_2434 :{BLACK}Campanya de publicitat de {STRINGID} STR_2435 :{BLACK}Campanya de publicitat de {STRINGID} STR_2436 :1 setmana @@ -1987,7 +1987,7 @@ STR_2782 :SHIFT + STR_2783 :CTRL + STR_2784 :Canvia la drecera de teclat STR_2785 :{WINDOW_COLOUR_2}Premeu la nova drecera de teclat per:{NEWLINE}«{STRINGID}» -STR_2786 :Feu clic a la descripció d’una drecera per canviar-ne les tecles assignades. +STR_2786 :Feu clic a la descripció d’una drecera per a canviar-ne les tecles assignades. STR_2787 :{WINDOW_COLOUR_2}Valoració del parc: {BLACK}{CURRENCY} STR_2788 :{WINDOW_COLOUR_2}Felicitats!{NEWLINE}{BLACK}Heu aconseguit el vostre objectiu amb un valor d’empresa de {CURRENCY}! STR_2789 :{WINDOW_COLOUR_2}No heu aconseguit els vostres objectius! @@ -2013,8 +2013,8 @@ STR_2808 :{RED}Els visitants es queixen del vandalisme.{NEWLINE}Comproveu on STR_2809 :{RED}Els visitants tenen gana i no troben cap lloc on comprar menjar. STR_2810 :{RED}Els visitants tenen set i no troben cap lloc on comprar begudes. STR_2811 :{RED}Els visitants es queixen perquè no troben els lavabos. -STR_2812 :{RED}Els visitants es perden o es bloquegen.{NEWLINE}Comproveu com estan posats els camins i si cal reorganitzar-los per facilitar el moviment pel parc. -STR_2813 :{RED}L’entrada al parc és massa cara.{NEWLINE}Reduïu-ne el preu o milloreu la valoració del parc per atreure més visitants. +STR_2812 :{RED}Els visitants es perden o es bloquegen.{NEWLINE}Comproveu com estan posats els camins i si cal reorganitzar-los per a facilitar el moviment pel parc. +STR_2813 :{RED}L’entrada al parc és massa cara.{NEWLINE}Reduïu-ne el preu o milloreu la valoració del parc per a atreure més visitants. STR_2814 :{WINDOW_COLOUR_2}Premi al parc més brut STR_2815 :{WINDOW_COLOUR_2}Premi al parc més net STR_2816 :{WINDOW_COLOUR_2}Premi al parc amb millors muntanyes russes @@ -2066,7 +2066,7 @@ STR_2974 :Esquema de color alternatiu 3 STR_2975 :Seleccioneu l’esquema de color que voleu canviar o amb el que voleu pintar l’atracció. STR_2976 :Pinta només una àrea d’aquesta atracció usant l’esquema de color seleccionat. STR_2977 :Posa nom a l’empleat -STR_2978 :Escriviu un nom per aquest empleat: +STR_2978 :Escriviu un nom per a aquest empleat: STR_2979 :No es pot posar el nom a l’empleat… STR_2980 :Hi ha massa cartells a la partida. STR_2981 :{RED}No passeu @@ -2133,7 +2133,7 @@ STR_3041 :Estil modern STR_3042 :Estil pirata STR_3043 :Estil rock 3 STR_3044 :Estil caramel -STR_3045 :Escolliu l’estil de música que ha de reproduir. +STR_3045 :Trieu l’estil de música que ha de reproduir. STR_3047 :Les autoritats pertinents no permeten enderrocar o modificar aquesta atracció. STR_3048 :Les autoritats pertinents no permeten realitzar campanyes de màrqueting. STR_3049 :Forat A @@ -2148,23 +2148,23 @@ STR_3060 :Blocs de gel STR_3061 :Tanques de fusta STR_3062 :Via estàndard de muntanya russa STR_3063 :Canal d’aigua (via submergida) -STR_3064 :Parcs per principiants +STR_3064 :Parcs per a principiants STR_3065 :Parcs desafiants -STR_3066 :Parcs per experts +STR_3066 :Parcs per a experts STR_3067 :Parcs «reals» STR_3068 :Altres parcs STR_3069 :Secció superior STR_3070 :Nivella la inclinació STR_3071 :{WINDOW_COLOUR_2}Mateix preu per tot el parc STR_3072 :Seleccioneu si aquest preu s’ha d’aplicar a aquest producte en totes les botigues del parc. -STR_3073 :{RED}Avís: La valoració del parc ha caigut per baix de 700!{NEWLINE}Si no la milloreu en 4 setmanes, el parc es clausurarà. -STR_3074 :{RED}Avís: La valoració del parc continua per sota de 700!{NEWLINE}Disposeu de 3 setmanes per millorar-la. -STR_3075 :{RED}Avís: La valoració del parc continua per sota de 700!{NEWLINE}Només us queden 2 setmanes per millorar-la o clausuraran el parc. +STR_3073 :{RED}Avís: La valoració del parc ha caigut per sota de 700!{NEWLINE}Si no la milloreu en 4 setmanes, el parc es clausurarà. +STR_3074 :{RED}Avís: La valoració del parc continua per sota de 700!{NEWLINE}Disposeu de 3 setmanes per a millorar-la. +STR_3075 :{RED}Avís: La valoració del parc continua per sota de 700!{NEWLINE}Només us queden 2 setmanes per a millorar-la o clausuraran el parc. STR_3076 :{RED}Últim avís: La valoració del parc continua per sota de 700!{NEWLINE}En set dies, es clausurarà el parc si la valoració no millora suficientment. STR_3077 :{RED}Avís de tancament: El parc tanca definitivament les seves portes! STR_3090 :Trieu el tipus d’entrada, de sortida i d’estació. -STR_3091 :No teniu permís per treure aquesta secció! -STR_3092 :No teniu permís per moure o modificar l’estació d’aquesta atracció! +STR_3091 :No teniu permís per a treure aquesta secció! +STR_3092 :No teniu permís per a moure o modificar l’estació d’aquesta atracció! STR_3093 :{WINDOW_COLOUR_2}Preferida: {BLACK}{STRINGID} STR_3094 :Cap STR_3095 :{WINDOW_COLOUR_2}Velocitat de cadenes d’elevació: @@ -2182,8 +2182,8 @@ STR_3107 :Tanca STR_3108 :Prova STR_3109 :Obre STR_3110 :{WINDOW_COLOUR_2}Seccions de bloc: {BLACK}{COMMA16} -STR_3111 :Cliqueu el disseny per construir-lo. -STR_3112 :Cliqueu el disseny per canviar-ne el nom o per esborrar-lo. +STR_3111 :Cliqueu el disseny per a construir-lo. +STR_3112 :Cliqueu el disseny per a canviar-ne el nom o per a esborrar-lo. STR_3113 :Selecciona un altre disseny STR_3114 :Torna a la finestra de selecció de dissenys. STR_3115 :Desa el disseny de via @@ -2191,19 +2191,19 @@ STR_3116 :Desa el disseny de via (no es podrà desar fins que l’atracció s STR_3117 :{BLACK}Es truca al mecànic… STR_3118 :{BLACK}{STRINGID} va cap a l’atracció STR_3119 :{BLACK}{STRINGID} arregla l’atracció -STR_3120 :Localitza el mecànic disponible més proper o el mecànic assignat per la reparació. +STR_3120 :Localitza el mecànic disponible més proper o el mecànic assignat per a reparar-ho. STR_3121 :No es pot trobar cap mecànic lliure. STR_3122 :{WINDOW_COLOUR_2}Preferida de: {BLACK}{COMMA16} visitant STR_3123 :{WINDOW_COLOUR_2}Preferida de: {BLACK}{COMMA16} visitants STR_3124 :{STRINGID} avariada -STR_3125 :{WINDOW_COLOUR_2}Factor d’emoció: {BLACK}+{COMMA16}% -STR_3126 :{WINDOW_COLOUR_2}Factor d’intensitat: {BLACK}+{COMMA16}% -STR_3127 :{WINDOW_COLOUR_2}Factor de nàusea: {BLACK}+{COMMA16}% +STR_3125 :{WINDOW_COLOUR_2}Factor d’emoció: {BLACK}+{COMMA16} % +STR_3126 :{WINDOW_COLOUR_2}Factor d’intensitat: {BLACK}+{COMMA16} % +STR_3127 :{WINDOW_COLOUR_2}Factor de nàusea: {BLACK}+{COMMA16} % STR_3128 :Desa el disseny de via STR_3129 :Desa el disseny de via i el decorat STR_3130 :Desa STR_3131 :Cancel·la -STR_3132 :{BLACK}Cliqueu elements del decorat per seleccionar-los i desar-los amb el disseny de via. +STR_3132 :{BLACK}Cliqueu elements del decorat per a seleccionar-los i desar-los amb el disseny de via. STR_3133 :No es pot construir a sobre d’un pendent. STR_3134 :{RED}(El disseny inclou algun decorat no disponible) STR_3135 :{RED}(Disseny de vehicle no disponible - Això pot afectar al rendiment de l’atracció) @@ -2226,7 +2226,7 @@ STR_3170 :No hi ha prou espai per als gràfics. STR_3171 :S’han seleccionat massa objectes d’aquest tipus. STR_3172 :Abans s’ha d’escollir aquest objecte: {STRING} STR_3173 :Aquest objecte ja està en ús. -STR_3174 :Aquest objecte és necessari per un altre. +STR_3174 :Aquest objecte és necessari per a un altre objecte. STR_3175 :Aquest objecte és necessari sempre. STR_3176 :Aquest objecte no es pot seleccionar. STR_3177 :Aquest objecte no es pot treure de la selecció. @@ -2234,7 +2234,7 @@ STR_3179 :S’ha de seleccionar almenys una atracció. STR_3180 :Selecció d’objectes no vàlida STR_3181 :Selecció d’objectes - {STRINGID} STR_3182 :S’ha de seleccionar el tipus d’entrada al parc. -STR_3183 :S’ha d’escollir el tipus d’aigua. +STR_3183 :S’ha de triar el tipus d’aigua. STR_3184 :Atraccions STR_3185 :Decoracions petites STR_3186 :Decoracions grans @@ -2248,9 +2248,9 @@ STR_3193 :Aigua STR_3195 :Llista de recerques STR_3196 :{WINDOW_COLOUR_2}Grup de recerca: {BLACK}{STRINGID} STR_3197 :{WINDOW_COLOUR_2}Elements ja recercats a l’inici de la partida: -STR_3198 :{WINDOW_COLOUR_2}Elements per recercar durant la partida: +STR_3198 :{WINDOW_COLOUR_2}Elements que es poden recercar durant la partida: STR_3199 :Barreja aleatòria -STR_3200 :Mescla aleatòriament la llista d’elements per recercar durant la partida. +STR_3200 :Mescla aleatòriament la llista d’elements per a recercar durant la partida. STR_3201 :Selecció d’objectes STR_3202 :Editor de paisatges STR_3203 :Configuració de recerques @@ -2297,7 +2297,7 @@ STR_3243 :{WINDOW_COLOUR_2}Taxa d’interès anual: STR_3244 :Sense campanyes de màrqueting STR_3245 :Prohibeix la publicitat, promocions i altres campanyes de màrqueting. STR_3246 :{WINDOW_COLOUR_2}{CURRENCY} -STR_3247 :{WINDOW_COLOUR_2}{COMMA16}% +STR_3247 :{WINDOW_COLOUR_2}{COMMA16} % STR_3248 :L’efectiu inicial no es pot augmentar més! STR_3249 :L’efectiu inicial no es pot reduir més! STR_3250 :El préstec inicial no es pot augmentar més! @@ -2307,9 +2307,9 @@ STR_3253 :El préstec màxim no es pot reduir més! STR_3254 :La taxa d’interès anual no es pot augmentar més! STR_3255 :La taxa d’interès anual no es pot reduir més! STR_3256 :Els visitants prefereixen atraccions menys intenses -STR_3257 :Escolliu si els visitants haurien de preferir només les atraccions menys intenses. +STR_3257 :Trieu si els visitants haurien de preferir només les atraccions menys intenses. STR_3258 :Els visitants prefereixen atraccions més intenses -STR_3259 :Escolliu si els visitants haurien de preferir només les atraccions més intenses. +STR_3259 :Trieu si els visitants haurien de preferir només les atraccions més intenses. STR_3260 :{WINDOW_COLOUR_2}Efectiu per visitant (mitjana): STR_3261 :{WINDOW_COLOUR_2}Felicitat inicial dels visitants: STR_3262 :{WINDOW_COLOUR_2}Gana inicial dels visitants: @@ -2338,7 +2338,7 @@ STR_3284 :Selecció de l’objectiu STR_3285 :Atraccions protegides STR_3286 :Seleccioneu l’objectiu d’aquest escenari. STR_3287 :{WINDOW_COLOUR_2}Objectiu: -STR_3288 :Escolliu el clima. +STR_3288 :Trieu el clima. STR_3289 :{WINDOW_COLOUR_2}Clima: STR_3290 :Fresc i humit STR_3291 :Càlid @@ -2364,7 +2364,7 @@ STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Atraccions protegides: STR_3313 :Nom de l’escenari -STR_3314 :Escolliu el nom de l’escenari: +STR_3314 :Trieu el nom de l’escenari: STR_3315 :Detalls del parc/escenari STR_3316 :Escriviu la descripció de l’escenari: STR_3317 :Encara no hi ha detalls @@ -2397,11 +2397,11 @@ STR_3347 :L’atracció és massa gran, conté massa elements o bé el decora STR_3348 :Canvia el nom STR_3349 :Esborra STR_3350 :Nom del disseny de via -STR_3351 :Escriviu un nom per aquest disseny de via: +STR_3351 :Escriviu un nom per a aquest disseny de via: STR_3352 :No es pot canviar el nom d’aquest disseny de via… STR_3353 :El nom conté caràcters no vàlids. STR_3354 :Ja existeix un fitxer amb aquest nom o bé no es pot modificar el fitxer existent. -STR_3355 :El fitxer existent està blocat, protegit o no teniu permisos suficients per modificar-lo. +STR_3355 :El fitxer existent està blocat, protegit o no teniu permisos suficients per a modificar-lo. STR_3356 :Esborra el fitxer STR_3357 :{WINDOW_COLOUR_2}Esteu segur que voleu esborrar permanentment {STRING}? STR_3358 :No es pot esborrar el disseny de via… @@ -2428,7 +2428,7 @@ STR_3380 :El disseny de via no s’ha pogut instal·lar… STR_3381 :El fitxer no és compatible o bé conté dades no vàlides. STR_3382 :Ha fallat la còpia del fitxer. STR_3383 :Seleccioneu un nom per al disseny de via. -STR_3384 :Ja existeix un disseny de via amb aquest nom. Si us plau, seleccioneu un nom nou per aquest disseny: +STR_3384 :Ja existeix un disseny de via amb aquest nom. Si us plau, seleccioneu un nom nou per a aquest disseny: STR_3389 :No es pot seleccionar l’element addicional de l’escenari… STR_3390 :S’han seleccionat massa elements. # Start of tutorial strings. Not used at the moment, so not necessary to translate. @@ -2474,7 +2474,7 @@ STR_5151 :. STR_5152 :, STR_5153 :Edita temes… STR_5154 :Renderitzat per maquinari -STR_5155 :Permet provar atraccions per acabar +STR_5155 :Permet provar atraccions sense acabar STR_5156 :Permet provar la majoria d’atraccions fins i tot si la via no està acabada. No s’aplica als modes de bloc de seccions. STR_5158 :Surt al menú principal STR_5159 :Surt de l’OpenRCT2 @@ -2559,8 +2559,8 @@ STR_5250 :Botó del títol de sortida STR_5251 :Botó del títol d’opcions STR_5252 :Selecció del títol d’escenaris STR_5253 :Informació del parc -STR_5256 :Crea un tema nou per fer-hi canvis. -STR_5257 :Duplica el tema actual per modificar-lo sense fer canvis a l’original. +STR_5256 :Crea un tema nou per a fer-hi canvis. +STR_5257 :Duplica el tema actual per a modificar-lo sense fer canvis a l’original. STR_5258 :Esborra el tema actual. STR_5259 :Canvia el nom del tema actual. STR_5260 :Captura de pantalla gegant @@ -2589,7 +2589,7 @@ STR_5283 :Llums del parc d’obert/tancat del RCT1 STR_5284 :Selecció de fonts d’escenari del RCT1 STR_5287 :L’atracció ja està avariada. STR_5288 :L’atracció està tancada. -STR_5289 :No es disposa d’avaries per aquest tipus d’atracció. +STR_5289 :No es disposa d’avaries per a aquest tipus d’atracció. STR_5290 :Repara l’atracció STR_5291 :No es pot forçar una avaria STR_5292 :Força una avaria @@ -2715,8 +2715,6 @@ STR_5503 :Escriviu el nom de l’hoste o de l’adreça IP: STR_5504 :Mostra l’estat multijugador STR_5505 :No s’ha pogut connectar al servidor. STR_5506 :Els visitants ignoren les intensitats -STR_5508 :Permet carregar fitxers danyats -STR_5509 :Permet carregar escenaris i partides desades{NEWLINE}que tenen una suma de comprovació no vàlida,{NEWLINE}com els escenaris de la demostració{NEWLINE}o partides danyades. STR_5510 :Dispositiu de so predeterminat STR_5511 :(desconegut) STR_5512 :Desa la partida com a… @@ -2767,7 +2765,7 @@ STR_5556 :Expulsa al jugador STR_5557 :Mantén la connexió després de la dessincronització (multijugador) STR_5558 :Aquest canvi s’aplicarà quan es reiniciï el joc. STR_5559 :Revisions cada 10 min -STR_5560 :Estableix revisions cada 10 minuts per totes les atraccions. +STR_5560 :Estableix revisions cada 10 minuts per a totes les atraccions. STR_5561 :L’idioma no s’ha pogut carregar. STR_5562 :Avís! STR_5563 :Aquesta funció actualment és inestable. Useu-la amb cautela. @@ -2882,7 +2880,7 @@ STR_5708 :No es pot canviar el grup de l’amfitrió. STR_5709 :Canvia el nom del grup STR_5710 :Nom del grup STR_5711 :Escriviu el nom del grup: -STR_5712 :No teniu permís per modificar els permisos mateixos. +STR_5712 :No teniu permís per a modificar els permisos mateixos. STR_5713 :Expulsa el jugador STR_5714 :Mostra la finestra d’opcions STR_5715 :Nova partida @@ -2930,7 +2928,7 @@ STR_5761 :Nou dòlar de Taiwan(NT$) STR_5762 :Iuan xinès (CN¥) STR_5763 :Tots els fitxers STR_5764 :Tipus d’atracció no vàlida -STR_5765 :Per editar una atracció, cal que tingui un tipus vàlid. +STR_5765 :Per a editar una atracció, cal que tingui un tipus vàlid. STR_5766 :Fòrint hongarès (Ft) STR_5767 :Ingressos STR_5768 :Clients en total @@ -2947,16 +2945,16 @@ STR_5778 :Construït fa {COMMA16} anys STR_5779 :Ingressos: {CURRENCY2DP} per hora STR_5780 :Cost de funcionament: {CURRENCY2DP} per hora STR_5781 :Cost de funcionament desconegut -STR_5782 :Esteu connectat. Premeu «{STRING}» per xatejar. +STR_5782 :Esteu connectat. Premeu «{STRING}» per a xatejar. STR_5783 :{WINDOW_COLOUR_2}Escenari blocat -STR_5784 :{BLACK}Completeu els escenaris anteriors per desblocar-lo. +STR_5784 :{BLACK}Completeu els escenaris anteriors per a desblocar-lo. STR_5785 :No es pot canviar el nom del grup… STR_5786 :Nom del grup no vàlid STR_5787 :{COMMA32} jugadors connectats STR_5788 :Interval de revisió per defecte: STR_5789 :Desactiva els efectes de llamps STR_5790 :Activa l’estil de pagaments del RCT1{NEWLINE}(es podran editar tant els preus d’entrada al parc com el de les entrades a les atraccions). -STR_5791 :Estableix la fiabilitat de totes les atraccions al 100%{NEWLINE}i n’estableix la data de construcció a «aquest any». +STR_5791 :Estableix la fiabilitat de totes les atraccions al 100 %{NEWLINE}i n’estableix la data de construcció a «aquest any». STR_5792 :Repara atraccions avariades STR_5793 :Esborra l’historial de sinistres de les atraccions,{NEWLINE}i els visitants no es queixaran de que no són segures. STR_5794 :Alguns escenaris desactiven l’edició{NEWLINE}d’algunes atraccions del parc.{NEWLINE}Aquesta trampa elimina aquesta restricció. @@ -2992,7 +2990,7 @@ STR_5824 :No mostris llampecs{NEWLINE}durant les tempestes. STR_5825 :Mantén el cursor del ratolí a la finestra. STR_5826 :Inverteix el desplaçament de la vista quan s’arrossega el ratolí amb el botó dret premut. STR_5827 :Escolliu l’esquema de colors (tema) que s’utilitzarà a la interfície gràfica. -STR_5828 :Canvia les unitats que s’usen per mesurar distàncies, velocitats i altres magnituds. +STR_5828 :Canvia les unitats que s’usen per a mesurar distàncies, velocitats i altres magnituds. STR_5829 :Canvia el format de moneda. Els efectes són només visuals, ja que no s’aplica cap tipus de canvi. STR_5830 :Canvia l’idioma de la interfície. STR_5831 :Canvia la unitat de mesura{NEWLINE}de la temperatura. @@ -3000,12 +2998,12 @@ STR_5832 :Mostra les alçades com a unitats genèriques (-2, -1, 0, +1, +2… STR_5833 :Canvia el format de les dates. STR_5834 :Trieu quin dispositiu de so ha de fer servir l’OpenRCT2. STR_5835 :Silencia el joc si la finestra perd el focus. -STR_5836 :Seleccioneu la peça de música per al menú principal.{NEWLINE}Si seleccioneu el tema de l’RCT1, cal que copieu «data/css17.dat» de la carpeta del RCT1 al directori del RCT2 com a «data/css50.dat», o bé establiu correctament la carpeta del RCT1 a la pestanya d’altres opcions. +STR_5836 :Seleccioneu la peça de música per al menú principal.{NEWLINE}Si seleccioneu el tema del RCT1, cal que establiu correctament la carpeta del RCT1 a la pestanya d’altres opcions. STR_5837 :Crea i gestiona els temes de la interfície personalitzats. -STR_5838 :Mostra un botó per a la finestra de finances a la barra d’eines. -STR_5839 :Mostra un botó per a la finestra de recerques a la barra d’eines. -STR_5840 :Mostra un botó per a la finestra de trampes a la barra d’eines. -STR_5841 :Mostra un botó per a la finestra de notícies recents a la barra d’eines. +STR_5838 :Mostra el botó de la finestra de finances a la barra d’eines. +STR_5839 :Mostra el botó de la finestra de recerques a la barra d’eines. +STR_5840 :Mostra el botó de la finestra de trampes a la barra d’eines. +STR_5841 :Mostra el botó de la finestra de notícies recents a la barra d’eines. STR_5842 :Ordena els escenaris en pestanyes segons la seva dificultat (com al RCT2) o pel seu origen (com al RCT1). STR_5843 :Activa el desbloqueig progressiu d’escenaris (com al RCT1). STR_5844 :Mantén la connexió al servidor multijugador{NEWLINE}fins i tot si es produeix un error de dessincronització. @@ -3016,10 +3014,10 @@ STR_5849 :Coloca automàticament{NEWLINE}els empleats acabats de contractar. STR_5851 :Estableix l’interval de revisió per defecte{NEWLINE}per a les atraccions noves. STR_5853 :Activa/Desactiva els efectes de so. STR_5854 :Activa/Desactiva la música de les atraccions. -STR_5855 :Escolliu el mode de pantalla completa normal,{NEWLINE}pantalla completa sense vores o bé finestra. +STR_5855 :Trieu el mode de pantalla completa normal,{NEWLINE}pantalla completa sense vores o bé finestra. STR_5856 :Trieu la resolució de la pantalla en mode pantalla completa. STR_5857 :Opcions del joc -STR_5858 :Usa la GPU per renderitzar gràfics en lloc de la CPU. Millora la compatibilitat amb el programari de captures de pantalla. Pot fer baixar lleugerament el rendiment. +STR_5858 :Usa la GPU per a renderitzar gràfics en lloc de la CPU. Millora la compatibilitat amb el programari de captures de pantalla. Pot fer baixar lleugerament el rendiment. STR_5859 :Activa la interpolació de fotogrames{NEWLINE}per una visualització de canvis més suau.{NEWLINE}El joc funcionara a 40 FPS si es desactiva. STR_5860 :Canvia entre mostrar les vies de forma original/alternativa. STR_5861 :S’ha produït un error en la verificació de la clau. @@ -3037,7 +3035,7 @@ STR_5872 :Desactiva que les plantes es facin mústigues. STR_5873 :Més cadenes d’elevació STR_5874 :Permet que qualsevol secció de via pugui incorporar cadenes d’elevació. STR_5875 :Motor gràfic: -STR_5876 :El programari que s’usarà per renderitzar els gràfics. +STR_5876 :El programari que s’usarà per a renderitzar els gràfics. STR_5877 :Programari STR_5878 :Programari (via maquinari) STR_5879 :OpenGL (experimental) @@ -3168,13 +3166,13 @@ STR_6004 :Vista retallada STR_6005 :Activa la vista retallada STR_6006 :La vista retallada només mostra els elements del mapa que estan a l’alçada de tall o per baix d’aquesta (retallat vertical) i dins de l’àrea seleccionada (retallat horitzontal). STR_6007 :Alçada de tall -STR_6008 :Feu clic per alternar entre el valor sense format i el valor amb unitats de mesura. -STR_6009 :Escolliu l’alçada de tall +STR_6008 :Feu clic per a alternar entre el valor sense format i el valor amb unitats de mesura. +STR_6009 :Trieu l’alçada de tall STR_6010 :{COMMA2DP32} m STR_6011 :{COMMA1DP16} ft STR_6012 :{COMMA1DP16} STR_6013 :Els visitants només paguen l’entrada al parc i algunes instal·lacions.{NEWLINE}Les atraccions són gratuïtes. -STR_6014 :Els visitants només pagaran per pujar a les atraccions i per usar la resta d’instal·lacions.{NEWLINE}L’entrada al parc és gratuïta. +STR_6014 :Els visitants només pagaran per a pujar a les atraccions i per a fer servir la resta d’instal·lacions.{NEWLINE}L’entrada al parc és gratuïta. STR_6015 :Inclinat STR_6016 :Modifica la casella STR_6017 :Si us plau, disminuïu la velocitat. @@ -3190,7 +3188,7 @@ STR_6026 :Construcció - Secció anterior STR_6027 :Construcció - Secció següent STR_6028 :Construcció - Construeix l’actual STR_6029 :Construcció - Elimina l’actual -STR_6030 :Seleccionador de decoracions. Seleccioneu una decoració del mapa per construir-ne més del mateix tipus. +STR_6030 :Seleccionador de decoracions. Seleccioneu una decoració del mapa per a construir-ne més del mateix tipus. STR_6031 :Descripció del servidor: STR_6032 :Missatge de benvinguda: STR_6033 :Camí de la instal·lació del RCT1: @@ -3198,7 +3196,7 @@ STR_6034 :{BLACK}{STRING} STR_6035 :Seleccioneu el camí d’instal·lació del RCT1 STR_6036 :Esborra STR_6037 :La carpeta seleccionada no conté una instal·lació del RCT1 vàlida. -STR_6038 :Si teniu instal·lat el RCT1, indiqueu a quina carpeta està per usar-ne els escenaris, la música, etc. +STR_6038 :Si teniu instal·lat el RCT1, indiqueu a quina carpeta està per a fer-ne servir els escenaris, la música, etc. STR_6039 :Retirada ràpida d’atraccions STR_6040 :Opcions d’edició d’escenaris STR_6041 :{BLACK}No s’han contractat mecànics! @@ -3216,7 +3214,7 @@ STR_6053 :Aquest mapa d’alçades no es pot normalitzar STR_6054 :Només es poden usar bitmaps de 24 bits STR_6055 :Fitxer de mapa d’alçades de l’OpenRCT2 STR_6056 :Botó de silenci -STR_6057 :Mostra un botó a la barra d’eines per activar o silenciar el so. +STR_6057 :Mostra un botó a la barra d’eines per a activar o silenciar el so. STR_6058 :Silencia STR_6059 :» STR_6060 :Mostra animacions de compres @@ -3271,7 +3269,7 @@ STR_6113 :Una muntanya russa alta sense inversions, amb llargues caigudes, al STR_6115 :Camions 4x4 gegants i autopropulsats que poden pujar per pendents empinades. STR_6116 :Muntanya russa amb vagons amples que llisca per una via d’acer llisa, passant per una bona varietat d’inversions. STR_6119 :Una muntanya russa barata i fàcil de construir, però amb una alçada limitada. -STR_6120 :{BABYBLUE}Nou vehicle disponible per {STRINGID}:{NEWLINE}{STRINGID} +STR_6120 :{BABYBLUE}Nou vehicle disponible per a {STRINGID}:{NEWLINE}{STRINGID} STR_6121 :Amplia els drets de construcció del parc fins a les vores del mapa. STR_6122 :No hi ha prou muntanyes russes en aquest escenari! STR_6123 :S’ha produït un error carregant els objectes del parc. @@ -3289,7 +3287,7 @@ STR_6134 :Neteja les decoracions STR_6135 :El client ha enviat una sol·licitud no vàlida. STR_6136 :El servidor ha enviat una sol·licitud no vàlida. STR_6137 :OpenRCT2, un clon de codi obert del Roller Coaster Tycoon 2. -STR_6138 :L’OpenRCT2 és obra de molts autors. En trobareu una llista completa en «contributors.md». Per més informació, visiteu http://github.com/OpenRCT2/OpenRCT2 +STR_6138 :L’OpenRCT2 és obra de molts autors. En trobareu una llista completa en «contributors.md». Per a més informació, visiteu http://github.com/OpenRCT2/OpenRCT2 STR_6139 :Tots els noms de productes i de noms de companyies pertanyen als seus propietaris. L’ús d’aquests noms no n’implica cap tipus d’afiliació o promoció. STR_6140 :Registre de canvis… STR_6141 :Barra d’eines inferior del RCT1 @@ -3312,7 +3310,7 @@ STR_6157 :Consola STR_6160 :{WINDOW_COLOUR_2}Vehicles disponibles: {BLACK}{STRING} STR_6161 :Mostra les línies de la quadrícula STR_6162 :«Wild Mouse» giratori -STR_6163 :Vagons amb forma de ratolí que es mouen a tota velocitat per giravolts i petits descensos, girant suaument per desorientar els passatgers. +STR_6163 :Vagons amb forma de ratolí que es mouen a tota velocitat per giravolts i petits descensos, girant suaument que desorienten els passatgers. STR_6164 :{WHITE}❌ STR_6165 :Sincronització vertical STR_6166 :Sincronitza cada fotograma anb la freqüència del monitor, evitant l’efecte de pantalla partida. @@ -3337,7 +3335,7 @@ STR_6199 :Estableix data STR_6200 :Restableix data STR_6201 :{MONTH} STR_6202 :Estil del terra virtual: -STR_6203 :Quan està activat, es dibuixarà un terra virtual mentre es prem Ctrl o Maj per facilitar el posicionament d’elements. +STR_6203 :Quan està activat, es dibuixarà un terra virtual mentre es prem Ctrl o Maj per a facilitar el posicionament d’elements. STR_6215 :Construcció STR_6216 :Funcionament STR_6217 :Disponibilitat d’atraccions i tipus de via @@ -3401,7 +3399,7 @@ STR_6277 :Índex d’estació: {BLACK}{STRINGID} STR_6278 :Nombre de desades automàtiques: STR_6279 :Nombre de desades automàtiques que es mantindran. STR_6280 :Xat -STR_6281 :Mostra un botó per la finestra del xat a la barra d’eines. +STR_6281 :Mostra el botó de la finestra del xat a la barra d’eines. STR_6282 :Xat STR_6283 :Ara mateix el xat no està disponible. Esteu connectats al servidor? STR_6293 :B @@ -3438,7 +3436,7 @@ STR_6323 :Es simula STR_6324 :Simula STR_6325 :Simula l’atracció STR_6326 :No es pot simular {STRINGID}… -STR_6327 :Fons transparent per captures de pantalla gegants +STR_6327 :Fons transparent per a les captures de pantalla gegants STR_6328 :Si s’activa, les captures de pantalla gegants tindran un fons transparent en lloc del color negre per defecte. STR_6329 :{STRING}{STRINGID} STR_6330 :Es carrega [{STRING}] de {STRING} ({COMMA16} / {COMMA16}) @@ -3510,18 +3508,18 @@ STR_6396 :Desactiva el protector de pantalla i l’estalviador d’energia STR_6397 :Si es selecciona, el protector de pantalla i altres funcions d’estalvi d’energia seran inhibides mentre s’executa l’OpenRCT2. STR_6398 :El fitxer conté atraccions incompatibles. Si us plau, actualitzeu l’OpenRCT2. STR_6399 :OpenRCT2 necessita fitxers del joc original RollerCoaster Tycoon 2 per a poder funcionar. Si us plau, establiu la variable «game_path» al config.ini apuntant al directori on vau instal·lar RollerCoaster Tycoon 2 i reinicieu l’OpenRCT2. -STR_6400 :Tinc descarregat l’instal·lador del GOG sense connexió a Internet del RollerCoaster Tycoon 2, però no l’he instal·lat -STR_6401 :Ja tinc el RollerCoaster Tycoon 2 instal·lat +STR_6400 :Tinc descarregat l’instal·lador del GOG sense connexió a Internet del RollerCoaster Tycoon 2, però no l’he instal·lat. +STR_6401 :Ja tinc el RollerCoaster Tycoon 2 instal·lat. STR_6402 :Configuració de dades de l’OpenRCT2 -STR_6403 :Escolliu quina opció us escau més +STR_6403 :Trieu quina opció us escau més: STR_6404 :Selecciona l’instal·lador del GOG del RollerCoaster Tycoon 2. STR_6405 :Selecciona l’instal·lador del GOG STR_6406 :Instal·lador del GOG del RollerCoaster Tycoon 2 STR_6407 :Pot trigar uns minuts. -STR_6408 :Instal·leu «innoextract» per extraure l’instal·lador del GOG i després reinicieu l’OpenRCT2. +STR_6408 :Instal·leu «innoextract» per a extraure l’instal·lador del GOG i després reinicieu l’OpenRCT2. STR_6409 :El fitxer seleccionat no és l’instal·lador del GOG sense connexió a Internet del RollerCoaster Tycoon 2. Potser heu descarregat el GOG Galaxy stub o heu seleccionat un fitxer erroni. STR_6410 :Apropa/Allunya -STR_6411 :Mostra botons a la barra d’eines per apropar o allunyar la vista. +STR_6411 :Mostra botons a la barra d’eines per a apropar o allunyar la vista. STR_6412 :Retorn del teclat numèric STR_6413 :Maj. STR_6414 :Maj. esquerra @@ -3600,13 +3598,11 @@ STR_6487 :Alterna veure a través dels treballadors STR_6488 :{RED}Els visitants es queixen de les llargues cues del parc.{NEWLINE}Considereu escurçar les més problemàtiques o augmentar el rendiment de les atraccions. STR_6489 :Error: Versió de parc no compatible STR_6490 :Avís: Versió de parc parcialment compatible -STR_6491 :Aquest parc es va desar amb una versió de l’OpenRCT2 posterior. La versió del parc és v{INT32} i es requereix almenys la versió v{INT32}. STR_6492 :Aquest parc es va desar amb una versió antiga de l’OpenRCT2 i no es pot obrir amb aquesta versió. La versió del parc és v{INT32}. -STR_6493 :Aquest parc es va desar amb una versió de l’OpenRCT2 posterior i es poden haver perdut dades. La versió del parc és v{INT32} i es requereix almenys la versió v{INT32}. STR_6494 :Agrupa per tipus d’atracció STR_6495 :Agrupa les atraccions per tipus en lloc de mostrar els vehicles per separat. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} -STR_6497 :Feu clic en una casella per mostrar els seus elements.{NEWLINE}Amb Ctrl + clic en una casella, seleccioneu l’element directament. +STR_6497 :Feu clic en una casella per a mostrar els seus elements.{NEWLINE}Amb Ctrl + clic en una casella, seleccioneu l’element directament. STR_6498 :Si s’activa, el mapa tindrà forma quadrada. STR_6474 :Visitants invisibles STR_6475 :Empleats invisibles @@ -3633,6 +3629,14 @@ STR_6516 :Un o més objectes que s’han afegit necessiten l’enllaç al RCT STR_6517 :Un o més objectes d’aquest parc necessiten l’enllaç al RCT1 per a veure’ls correctament. Es faran servir imatges alternatives. STR_6518 :{BLACK}Situeu el ratolí damunt d’un escenari per a veure la seva descripció i els seus objectius. Feu clic per a començar a jugar. STR_6519 :Extres +STR_6520 :Paquets de recursos +STR_6521 :Prioritat baixa +STR_6522 :Prioritat alta +STR_6523 :Redueix la prioritat del paquet de recursos. +STR_6524 :Augmenta la prioritat del paquet de recursos. +STR_6525 :Recarrega tots els recursos del joc amb els paquets de recursos activats. +STR_6526 :(gràfics base, música i efectes de so) +STR_6527 :Competicions ############# # Scenarios # @@ -3647,7 +3651,7 @@ STR_DTLS :Construïu un parc pròsper a l’àrea que s’ha netejat ben endi STR_SCNR :Les dunes Dinamita STR_PARK :Les dunes Dinamita -STR_DTLS :Construït al bell mig del desert, aquest parc temàtic només té una muntanya russa però disposa d’espai per expandir-se. +STR_DTLS :Construït al bell mig del desert, aquest parc temàtic només té una muntanya russa però disposa d’espai per a expandir-se. STR_SCNR :El llac frondós @@ -3677,7 +3681,7 @@ STR_DTLS :La base d’aquest parc la formen diverses illes. STR_SCNR :El món dels somnis de la Katie STR_PARK :El món dels somnis de la Katie -STR_DTLS :Un parc temàtic petit amb unes quantes atraccions i espai per expandir-lo. El vostre objectiu és doblar-ne el valor. +STR_DTLS :Un parc temàtic petit amb unes quantes atraccions i espai per a expandir-lo. El vostre objectiu és duplicar-ne el valor. STR_SCNR :El parc diminut @@ -3702,7 +3706,7 @@ STR_DTLS :Un parc gran amagat al bell mig dels boscos. Només té vies de kà STR_SCNR :El món d’en Mel STR_PARK :El món d’en Mel -STR_DTLS :Aquest parc temàtic té algunes atraccions modernes molt ben dissenyades i molt d’espai per expandir-se. +STR_DTLS :Aquest parc temàtic té algunes atraccions modernes molt ben dissenyades i molt d’espai per a expandir-se. STR_SCNR :La muntanya mística @@ -3717,7 +3721,7 @@ STR_DTLS :Convertiu l’atracció turística d’aquestes ruïnes egípcies e STR_SCNR :Els boscos llangorosos STR_PARK :Els boscos llangorosos -STR_DTLS :Un parc enorme amb atraccions ben dissenyades però que comencen a ser velles. Substituïu-les o afegiu-hi atraccions noves per fer que el parc sigui més popular. +STR_DTLS :Un parc enorme amb atraccions ben dissenyades però que comencen a ser velles. Substituïu-les o afegiu-hi atraccions noves per a fer que el parc sigui més popular. STR_SCNR :El moll paradisíac @@ -3727,7 +3731,7 @@ STR_DTLS :Convertiu aquest petit moll fantasma en una atracció pròspera. STR_SCNR :Els cims llampeguejants STR_PARK :Els cims llampeguejants -STR_DTLS :Els excursionistes ja coneixen aquestes magnífiques muntanyes. Useu el terreny disponible per atreure més clientela, especialment aquells que busquin emocions fortes. +STR_DTLS :Els excursionistes ja coneixen aquestes magnífiques muntanyes. Useu el terreny disponible per a atreure més clientela, especialment aquells que busquin emocions fortes. STR_SCNR :Les torres de vori @@ -3737,17 +3741,17 @@ STR_DTLS :Un parc ben establert que té alguns problemes. STR_SCNR :La vall de l’arc iris STR_PARK :La vall de l’arc iris -STR_DTLS :Les autoritats locals de la vall no permetran canvis en el terreny ni que es treguin arbres centenaris. L’haureu de desenvolupar amb molt de compte per convertir-la en un parc temàtic. +STR_DTLS :Les autoritats locals de la vall no permetran canvis en el terreny ni que es treguin arbres centenaris. L’haureu de desenvolupar amb molt de compte per a convertir-la en un parc temàtic. STR_SCNR :La roca del tro STR_PARK :La roca del tro -STR_DTLS :La roca del tro està al mig d’un desert i atrau molts turistes. Useu l’espai disponible per construir-hi atraccions per atreure més visitants. +STR_DTLS :La roca del tro està al mig d’un desert i atrau molts turistes. Useu l’espai disponible per a construir-hi atraccions i atreure més visitants. STR_SCNR :Megaparc STR_PARK :Megaparc -STR_DTLS :Només per divertir-se! +STR_DTLS :Només per a divertir-se! ## Added Attractions @@ -3758,7 +3762,7 @@ STR_DTLS :Desenvolupeu els penya-segats i convertiu-los en un parc d’atracc STR_SCNR :El parc de les tres mones STR_PARK :El parc de les tres mones -STR_DTLS :Al bell mig d’aquest gran parc en desenvolupament i hi ha una muntanya russa d’acer amb triple carril per competicions. +STR_DTLS :Al bell mig d’aquest gran parc en desenvolupament i hi ha una muntanya russa d’acer amb triple carril per a fer competicions. STR_SCNR :Les mines Canàries @@ -3783,7 +3787,7 @@ STR_DTLS :Les autoritats locals han acordat vendre barat el terreny proper d STR_SCNR :La fortalesa de la diversió STR_PARK :La fortalesa de la diversió -STR_DTLS :Aquest castell és tot vostre per convertir-lo en un parc temàtic. +STR_DTLS :Aquest castell és tot vostre per a convertir-lo en un parc temàtic. STR_SCNR :El món del futur @@ -3793,17 +3797,17 @@ STR_DTLS :Aquest parc futurístic disposa de molt d’espai lliure per a nove STR_SCNR :La vall tranquil·la STR_PARK :La vall tranquil·la -STR_DTLS :La població local prefereix atraccions suaus i relaxants. Així que la vostra feina és expandir aquest parc per satisfer els seus desitjos. +STR_DTLS :La població local prefereix atraccions suaus i relaxants. Així que la vostra feina és expandir aquest parc per a satisfer els seus desitjos. STR_SCNR :La selva alegre STR_PARK :La selva alegre -STR_DTLS :Ben endins de la selva hi ha una gran àrea de terreny preparat per convertir-se en un parc temàtic. +STR_DTLS :Ben endins de la selva hi ha una gran àrea de terreny preparada per a convertir-la en un parc temàtic. STR_SCNR :Els turons Hydro STR_PARK :Els turons Hydro -STR_DTLS :Una sèrie de llacs escalonats formen la base per aquest parc nou. +STR_DTLS :Una sèrie de llacs escalonats formen la base per a aquest parc nou. STR_SCNR :El parc alegre @@ -3813,12 +3817,12 @@ STR_DTLS :Aquest parc envellit té moltes atraccions històriques però està STR_SCNR :Els barris màgics STR_PARK :Els barris màgics -STR_DTLS :S’ha netejat una gran àrea de terreny i s’ha tematitzat parcialment per convertir-la en un parc temàtic paisatgístic. +STR_DTLS :S’ha netejat una gran àrea de terreny i s’ha tematitzat parcialment per a convertir-la en un parc temàtic paisatgístic. STR_SCNR :La granja de la fruita STR_PARK :La granja de la fruita -STR_DTLS :Una granja de fruites pròspera ha construït el ferrocarril per augmentar-ne els ingressos. La vostra feina és convertir-la en un parc d’atraccions plenament desenvolupat. +STR_DTLS :Una granja de fruites pròspera ha construït el ferrocarril per a augmentar-ne els ingressos. La vostra feina és convertir-la en un parc d’atraccions plenament desenvolupat. STR_SCNR :La presa Papallona @@ -3828,12 +3832,12 @@ STR_DTLS :L’àrea del voltant de la presa està disponible perquè hi desen STR_SCNR :Atraccions al canyó STR_PARK :Atraccions al canyó -STR_DTLS :Teniu un vast canyó per convertir-lo en un parc temàtic. +STR_DTLS :Teniu un vast canyó per a convertir-lo en un parc temàtic. STR_SCNR :Parc Tempesta STR_PARK :Parc Tempesta -STR_DTLS :El clima és tan humit que s’ha construït una piràmide gegant per construir-hi algunes atraccions a cobert. +STR_DTLS :El clima és tan humit que s’ha construït una piràmide gegant per a construir-hi algunes atraccions a cobert. STR_SCNR :Turons harmònics @@ -3853,12 +3857,12 @@ STR_DTLS :Construït parcialment en illes petites, aquest parc ja disposa d STR_SCNR :Els cims d’Adrenalina STR_PARK :Els cims d’Adrenalina -STR_DTLS :Construeix un parc per atreure a la gent dels voltants que busqui emocions d’alt voltatge. +STR_DTLS :Construeix un parc per a atreure a la gent dels voltants que busqui emocions d’alt voltatge. STR_SCNR :Parc Utopia STR_PARK :Parc Utopia -STR_DTLS :Un oasi al mig del desert ofereix una oportunitat poc usual per construir un parc d’atraccions. +STR_DTLS :Un oasi al mig del desert ofereix una oportunitat poc usual per a construir un parc d’atraccions. STR_SCNR :Els cims Mig-Podrits @@ -3868,12 +3872,12 @@ STR_DTLS :Descuidat i dilapidat, podreu ressuscitar aquest parc d’atraccion STR_SCNR :El bosc Fiasco STR_PARK :El bosc Fiasco -STR_DTLS :Ple d’atraccions perilloses i mal dissenyades, teniu un pressupost i temps molt limitat per arreglar-ne els problemes i tirar endavant el parc. +STR_DTLS :Ple d’atraccions perilloses i mal dissenyades, teniu un pressupost i temps molt limitat per a solucionar-ne els problemes i tirar endavant el parc. STR_SCNR :Parc dels cogombrets STR_PARK :Parc dels cogombrets -STR_DTLS :L’autoritat local no permetrà campanyes de màrqueting. El parc haurà d’aconseguir tirar endavant només per la seva reputació. +STR_DTLS :L’autoritat local no permetrà campanyes de màrqueting. El parc haurà d’aconseguir tirar endavant només amb la seva reputació. STR_SCNR :Baixades de riure @@ -3888,12 +3892,12 @@ STR_DTLS :Convertiu aquesta pedrera abandonada en un lloc on atreure als turi STR_SCNR :Vessants boges STR_PARK :Vessants boges -STR_DTLS :Disposeu de fons financers limitats però temps il·limitat per convertir aquesta àrea de muntanyes en un gran parc de muntanyes russes. +STR_DTLS :Disposeu de fons financers limitats però temps il·limitat per a convertir aquesta àrea de muntanyes en un gran parc de muntanyes russes. STR_SCNR :Parc urbà STR_PARK :Parc urbà -STR_DTLS :Un petit parc ha arribat a un acord amb una població propera per expandir-se pel mig de la mateixa població. +STR_DTLS :Un petit parc ha arribat a un acord amb una població propera per a expandir-se pel mig de la mateixa població. STR_SCNR :Jardins Geoffrey @@ -3934,7 +3938,7 @@ STR_DTLS :Aquest parc enorme ja té una hipermuntanya russa, però la vostra STR_SCNR :El moll paradisíac II STR_PARK :El moll paradisíac II -STR_DTLS :El moll paradisíac ha expandit la seva xarxa de camins pel mar i la vostra tasca és ampliar el parc per usar aquest espai extra. +STR_DTLS :El moll paradisíac ha expandit la seva xarxa de camins pel mar i la vostra tasca és ampliar el parc i fer servir aquest espai extra. STR_SCNR :La cova del drac @@ -3959,7 +3963,7 @@ STR_DTLS :Teniu aquesta vall ocupada per una glacera. Hi heu de desenvolupar STR_SCNR :Cràters bojos STR_PARK :Cràters bojos -STR_DTLS :En un món llunyà on els diners no fan falta, heu de construir un centre d’entreteniment per mantenir feliç a la gent. +STR_DTLS :En un món llunyà on els diners no fan falta, heu de construir un centre d’entreteniment per a mantenir feliç a la gent. STR_SCNR :Desert polsegós @@ -3969,12 +3973,12 @@ STR_DTLS :Cal completar 5 muntanyes russes en aquest parc situat al desert. STR_SCNR :Parc dels corcs STR_PARK :Parc dels corcs -STR_DTLS :Aquest parc històric només té permís per construir atraccions d’estil antic. +STR_DTLS :Aquest parc històric només té permís per a construir atraccions d’estil antic. STR_SCNR :Parc Ícar STR_PARK :Parc Ícar -STR_DTLS :Desenvolupa aquest parc alienígena per maximitzar-ne els beneficis. +STR_DTLS :Desenvolupeu aquest parc alienígena per tal de maximitzar-ne els beneficis. STR_SCNR :Pantans solejats @@ -4009,7 +4013,7 @@ STR_DTLS :Un paisatge gèlid que demana que el converteixin en un parc temàt STR_SCNR :Les arenes del sud STR_PARK :Les arenes del sud -STR_DTLS :Un parc al desert amb algunes muntanyes russes enginyosament dissenyades és tot vostre per expandir-lo. +STR_DTLS :Un parc al desert amb algunes muntanyes russes enginyosament dissenyades és tot vostre per a expandir-lo. STR_SCNR :Les torres petites @@ -4024,17 +4028,17 @@ STR_DTLS :Un parc gran amb un sistema de transport nou que el voreja. STR_SCNR :L’illa Pacífica STR_PARK :L’illa Pacífica -STR_DTLS :Aquesta enorme illa és tota vostra per desenvolupar-la com a parc d’atraccions. +STR_DTLS :Aquesta enorme illa és tota vostra per a desenvolupar-la com a parc d’atraccions. STR_SCNR :La jungla urbana STR_PARK :La jungla urbana -STR_DTLS :Un gratacels gegant abandonat és l’única opció per desenvolupar un parc temàtic. +STR_DTLS :Un gratacels gegant abandonat és l’única opció per a desenvolupar un parc temàtic. STR_SCNR :El poble Terror STR_PARK :El poble Terror -STR_DTLS :Aquesta àrea urbana és tota vostra per desenvolupar-la com a parc d’atraccions. +STR_DTLS :Aquesta àrea urbana és tota vostra per a desenvolupar-la com a parc d’atraccions. STR_SCNR :Megaworld Park @@ -4083,36 +4087,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Sostre -[TTRFWD01] -STR_NAME :Sostre - -[TTRFWD02] -STR_NAME :Sostre - -[TTRFWD03] -STR_NAME :Sostre - -[TTRFWD04] -STR_NAME :Sostre - -[TTRFWD05] -STR_NAME :Sostre - -[TTRFWD06] -STR_NAME :Sostre - -[TTRFWD07] -STR_NAME :Sostre - -[TTRFWD08] -STR_NAME :Sostre - -[ACWW33] -STR_NAME :Paret de pals de fusta - -[ACWWF32] -STR_NAME :Paret de pals de fusta - ## End OpenRCT2 Official ############################################################################### @@ -4141,7 +4115,7 @@ STR_DTLS :Construïu la vostra versió d’aquest parc Six Flag europeu. STR_SCNR :El vostre Six Flags Great Adventure STR_PARK :Six Flags Great Adventure -STR_DTLS :Empreu les vostres tècniques de disseny per recrear aquest parc Six Flag. +STR_DTLS :Empreu les vostres tècniques de disseny per tal de recrear aquest parc Six Flag. STR_SCNR :El vostre Six Flags Holland @@ -4166,7 +4140,7 @@ STR_DTLS :Construïu el vostre disseny del parc Six Flags. Construïu atracci STR_SCNR :El basar atrafegat STR_PARK :El basar atrafegat -STR_DTLS :Començant amb un petit basar, el repte consisteix en incrementar els beneficis de les paradetes construint atraccions i muntanyes russes per atreure més clients. +STR_DTLS :Començant amb un petit basar, el repte consisteix en incrementar els beneficis de les paradetes construint atraccions i muntanyes russes per a atreure més clients. STR_SCNR :Castell esbojarrat @@ -4176,7 +4150,7 @@ STR_DTLS :Heu heretat aquest enorme castell. La vostra feina consisteix en co STR_SCNR :Verds polsosos STR_PARK :Verds polsosos -STR_DTLS :Situat prop d’una sortida d’autopista al mig del desert, «Verds polsosos» és una oportunitat per desenvolupar un petit complex amb un camp de golf i convertir-lo en un parc temàtic pròsper. +STR_DTLS :Situat prop d’una sortida d’autopista al mig del desert, «Verds polsosos» és una oportunitat per tal de desenvolupar un petit complex amb un camp de golf i convertir-lo en un parc temàtic pròsper. STR_SCNR :Camps elèctrics @@ -4186,12 +4160,12 @@ STR_DTLS :Heu heretat una petita masoveria i teniu el repte de construir un p STR_SCNR :Alçades extremes STR_PARK :Alçades extremes -STR_DTLS :Sense restriccions financeres, el repte és expandir aquest parc desèrtic per atreure gent que busqui emocions fortes. +STR_DTLS :Sense restriccions financeres, el repte és expandir aquest parc desèrtic per a atreure gent que busqui emocions fortes. STR_SCNR :Aventures de la fàbrica STR_PARK :Aventures de la fàbrica -STR_DTLS :Un complex abandonat és una oportunitat per construir un parc d’atraccions de temàtica industrial. +STR_DTLS :Un complex abandonat és una oportunitat per a construir un parc d’atraccions de temàtica industrial. STR_SCNR :Boscos rancis @@ -4231,7 +4205,7 @@ STR_DTLS :Proveu a dirigir i millorar aquest parc Six Flags. STR_SCNR :Six Flags Great Adventure STR_PARK :Six Flags Great Adventure -STR_DTLS :Construïu les atraccions que li falten a aquest Six Flags, o creeu els vostres dissenys per millorar el parc! Però no oblideu el vostre objectiu final: atreure més clients al parc. +STR_DTLS :Construïu les atraccions que li falten a aquest Six Flags, o creeu els vostres dissenys per a millorar el parc! Però no oblideu el vostre objectiu final: atreure més clients al parc. STR_SCNR :Six Flags Holland @@ -4241,12 +4215,12 @@ STR_DTLS :Proveu a dirigir i millorar aquest parc Six Flags. STR_SCNR :Six Flags Magic Mountain STR_PARK :Six Flags Magic Mountain -STR_DTLS :Construïu les atraccions Six Flags que falten, o creeu els vostres dissenys per millorar el parc! Però no oblideu el vostre objectiu final: retornar el préstec mentre el parc manté una valoració alta. +STR_DTLS :Construïu les atraccions Six Flags que falten, o creeu els vostres dissenys per a millorar el parc! Però no oblideu el vostre objectiu final: retornar el préstec mentre el parc manté una valoració alta. STR_SCNR :Six Flags over Texas STR_PARK :Six Flags over Texas -STR_DTLS :Construïu les atraccions Six Flags que falten, o creeu els vostres dissenys per millorar el parc! Però no oblideu el vostre objectiu final: atreure més clients al parc. +STR_DTLS :Construïu les atraccions Six Flags que falten, o creeu els vostres dissenys per a millorar el parc! Però no oblideu el vostre objectiu final: atreure més clients al parc. ############################################################################### ## Wacky Worlds Scenarios @@ -4254,22 +4228,22 @@ STR_DTLS :Construïu les atraccions Six Flags que falten, o creeu els vostres STR_SCNR :Àfrica - Mines de diamants STR_PARK :Mines d’Àfrica -STR_DTLS :Heu heretat una mina de diamants que ja no s’explota, on hi heu trobat un diamant valuós. Voleu invertir els diners del diamant per construir un parc temàtic conegut a tot el món. +STR_DTLS :Heu heretat una mina de diamants que ja no s’explota, on hi heu trobat un diamant valuós. Voleu invertir els diners del diamant per tal de construir un parc temàtic conegut a tot el món. STR_SCNR :Àfrica - Oasi STR_PARK :La follia dels miratges -STR_DTLS :S’ha descobert un oasi que seria una bona localització per un parc. El transport fins l’oasi ja està preparat. +STR_DTLS :S’ha descobert un oasi que seria una bona localització per a fer-hi un parc. El transport fins l’oasi ja està preparat. STR_SCNR :Àfrica - Les cascades Victòria STR_PARK :A la vora -STR_DTLS :S’ha construït una presa que ofereix energia hidroelèctrica barata i abundant per fer funcionar un parc. Haureu d’obtenir una valoració del parc prou alta per poder retornar el préstec de la presa. +STR_DTLS :S’ha construït una presa que ofereix energia hidroelèctrica barata i abundant per a fer funcionar un parc. Haureu d’obtenir una valoració del parc prou alta per a poder retornar el préstec de la presa. STR_SCNR :Antàrtida - Rescat ecològic STR_PARK :Aventures gèlides -STR_DTLS :L’agència mediambiental us ha delegat la tasca de transformar aquesta monstruositat ecològica en forma de refineria de petroli en una atracció turística capdavantera. El terreny és barat però el tipus d’interès del prèstec és alt. Podeu vendre els vells edificis per treure’n profit. +STR_DTLS :L’agència mediambiental us ha delegat la tasca de transformar aquesta monstruositat ecològica en forma de refineria de petroli en una atracció turística capdavantera. El terreny és barat però el tipus d’interès del prèstec és alt. Podeu vendre els vells edificis per a treure’n profit. STR_SCNR :Àsia - Millores turístiques a la Gran Muralla @@ -4289,7 +4263,7 @@ STR_DTLS :El maharajà us ha destinat aquí per tal que proporcioneu entreten STR_SCNR :Austràlia - Uluru STR_PARK :L’aventura Uluru -STR_DTLS :Esteu ajudant els aborígens a construir un parc dins del programa de conciencació cultural. Necessiteu un gran nombre de visitants per instruir-los en l’herència cultural única de la població indígena. +STR_DTLS :Esteu ajudant els aborígens a construir un parc dins del programa de conciencació cultural. Necessiteu un gran nombre de visitants per a instruir-los en l’herència cultural única de la població indígena. STR_SCNR :Austràlia - Diversió a la platja @@ -4299,22 +4273,22 @@ STR_DTLS :El parc marítim d’un emprenedor local ha fet fallida. Ja teniu u STR_SCNR :Europa - Festival cultural europeu STR_PARK :Extravagància europea -STR_DTLS :Us han dut per dirigir una atracció cultural europea per als turistes i heu d’augmentar el nombre de visitants per tal de poder retornar la subvenció de la UE a finals de l’actual mandat del parlament europeu. +STR_DTLS :Us han dut per a dirigir una atracció cultural europea per als turistes i heu d’augmentar el nombre de visitants per tal de poder retornar la subvenció de la UE a finals de l’actual mandat del parlament europeu. STR_SCNR :Europa - Renovació STR_PARK :Des de les cendres -STR_DTLS :Aquest parc vell està en mal estat. Heu guanyat una subvenció per retornar aquesta àrea desafavorida a la seva antiga glòria! Heu de renovar el parc i retornar la subvenció. +STR_DTLS :Aquest parc vell està en mal estat. Heu guanyat una subvenció per a retornar aquesta àrea desafavorida a la seva antiga glòria! Heu de renovar el parc i retornar la subvenció. STR_SCNR :Nord-amèrica - Illa hawaiana llunyana STR_PARK :Wacky Waikiki -STR_DTLS :La gent de Hawaii s’avorreixen només fent surf i busquen alguna cosa més intensa. Heu de construir un parc amb això al cap per mantenir un interès turístic en la zona prou elevat. +STR_DTLS :La gent de Hawaii s’avorreixen només fent surf i busquen alguna cosa més intensa. Heu de construir un parc amb això al cap per tal de mantenir un interès turístic a la zona prou elevat. STR_SCNR :Nord-amèrica - El Gran Canyó STR_PARK :Calamitats del Canyó -STR_DTLS :Heu de construir un parc en el terreny limitat en les dues bandes d’aquest tresor natural. Teniu l’oportunitat de comprar terrenys adjacents dels nadius indis americans. Heu de completar l’objectiu per alimentar els habitants de la població local. +STR_DTLS :Heu de construir un parc en el terreny limitat en les dues bandes d’aquest tresor natural. Teniu l’oportunitat de comprar terrenys adjacents dels nadius indis americans. Heu de completar l’objectiu per a alimentar els habitants de la població local. STR_SCNR :Nord-amèrica - Rollercoaster Heaven @@ -4324,7 +4298,7 @@ STR_DTLS :Sou un magnat de les finances competent en període sabàtic que de STR_SCNR :Sud-amèrica - La ciutat inca perduda STR_PARK :La fundació de la ciutat perduda -STR_DTLS :Per augmentar el turisme local heu de construir un parc que s’adigui amb els seus voltants i que compleixi amb les restriccions d’alçada. +STR_DTLS :Per a augmentar el turisme local heu de construir un parc que s’adigui amb els seus voltants i que compleixi amb les restriccions d’alçada. STR_SCNR :Sud-amèrica - L’altiplà de la selva tropical @@ -4334,7 +4308,7 @@ STR_DTLS :En aquesta preciosa selva tropical, l’espai està limitat. Heu d STR_SCNR :Sud-amèrica - Carnaval de Rio STR_PARK :Costes del Pão de Açúcar -STR_DTLS :Dirigiu un petit parc prop de Rio, però el banc demana que se li pagui el préstec. Necessiteu augmentar ràpidament la vostra capacitat recaptatòria per retornar aquest deute inesperat. +STR_DTLS :Dirigiu un petit parc prop de Rio, però el banc demana que se li pagui el préstec. Necessiteu augmentar ràpidament la vostra capacitat recaptatòria per a retornar aquest deute inesperat. ############################################################################### ## Time Twister Scenarios @@ -4347,12 +4321,12 @@ STR_DTLS :Els membres locals de la societat de representacions de batalles es STR_SCNR :Medieval - Robin Hood STR_PARK :El bosc de Sherwood -STR_DTLS :Per robar als rics i repartir-ho entre els pobres, heu decidit juntament amb els vostres «homes feliços» construir un parc temàtic al bosc de Sherwood. +STR_DTLS :Amb la intenció de robar als rics i repartir el que aconseguiu entre els pobres, heu decidit que, amb l’ajuda dels vostres «homes feliços», construireu un parc temàtic al bosc de Sherwood. STR_SCNR :Futurístic - Primers encontres STR_PARK :Extravagància Extraterrestre -STR_DTLS :S’ha descobert vida en un planeta llunyà. Construïu un parc de temàtica alienígena per recaptar els diners d’aquesta onada d’interès sense precedent. +STR_DTLS :S’ha descobert vida en un planeta llunyà. Construïu un parc de temàtica alienígena per a recaptar els diners d’aquesta onada d’interès sense precedent. STR_SCNR :Futurístic - Món del futur @@ -4377,12 +4351,12 @@ STR_DTLS :Sou el propietari d’un vell cràter polsegós causat per un meteo STR_SCNR :Prehistòric - Safari juràssic STR_PARK :Atracciósaurus -STR_DTLS :Us han assignat la tasca de construir un parc de l’era juràssica. Per optimitzar l’accés dels visitants a les exhibicions de plantes i animals exòtics, haureu de construir atraccions per tota la vall. +STR_DTLS :Us han assignat la tasca de construir un parc de l’era juràssica. Per tal d’optimitzar l’accés dels visitants a les exhibicions de plantes i animals exòtics, haureu de construir atraccions per tota la vall. STR_SCNR :Prehistòric - L’edat de pedra STR_PARK :Passeig rocós -STR_DTLS :Per frustrar els plans dels constructors d’una autopista i per ajudar a preservar els misteriosos i antics cercles de pedra, haureu de construir un parc temàtic amb l’edat de pedra com a principal motiu i aconseguir treure’n beneficis. No obstant, atreure visitants pot suposar un repte, ja que el terrny és un poc inhòspit. +STR_DTLS :Per a frustrar els plans dels constructors d’una autopista i per a ajudar a preservar els misteriosos i antics cercles de pedra, haureu de construir un parc temàtic amb l’edat de pedra com a principal motiu i aconseguir treure’n beneficis. No obstant, atreure visitants pot suposar un repte, ja que el terrny és un poc inhòspit. STR_SCNR :Roaring Twenties - L’illa presó @@ -4397,12 +4371,12 @@ STR_DTLS :El 25è aniversari de la victòria del vostre avi a la Copa Schneid STR_SCNR :Els «Roaring Twenties» - Gratacels STR_PARK :Metròpoli -STR_DTLS :Disposeu d’un solar buit prop de la zona pobra de la població. Per treure profit d’aquests terrenys urbans, construïu un parc en forma de gratacels inspirat en el desorbitat art decó dels anys vint. +STR_DTLS :Disposeu d’un solar buit prop de la zona pobra de la població. Per a treure profit d’aquests terrenys urbans, construïu un parc en forma de gratacels inspirat en el desorbitat art decó dels anys vint. STR_SCNR :Rock ’n’ Roll - Flower Power STR_PARK :Woodstock -STR_DTLS :Hi ha un gran festival anual de música als teus terrenys. Construïu-hi un parc temàtic a la moda per mantenir els esperits lliures entretinguts. +STR_DTLS :Hi ha un gran festival anual de música als teus terrenys. Construïu-hi un parc temàtic a la moda per a mantenir els esperits lliures entretinguts. STR_SCNR :Rock ’n’ Roll - Rock ’n’ Roll diff --git a/data/language/cs-CZ.txt b/data/language/cs-CZ.txt index 29c93c852a..e0049f9da8 100644 --- a/data/language/cs-CZ.txt +++ b/data/language/cs-CZ.txt @@ -94,6 +94,10 @@ STR_0089 :Malá horská dráha STR_0090 :Mini dráha STR_0091 :Neznámá atrakce (59) STR_0092 :Horská dráha s elektromotorem +STR_0093 :Hybridní horská dráha +STR_0094 :Jednokolejná horská dráha +STR_0095 :Alpská horská dráha +STR_0096 :Klasická dřevěná horská dráha STR_0512 :Malá ocelová horská dráha se spirálovitým profilem a vozy se sedadly za sebou STR_0513 :Návštěvníci jedou po horské dráze s loopingy ve stoje STR_0514 :Vlaky zavěšené pod kolejí se v zatáčkách houpají do stran @@ -173,6 +177,10 @@ STR_0598 :Vozy vyrazí vstříc jednomu konci trati, poté prosviští pozpá STR_0599 :Malá horská dráha, na které vozy po jednom projíždí trať s kroucenými pády STR_0600 :Horská dráha s vozy ve stylu důlních vagónů, které jedou po hladkých kolejnicích skrze propletenou dráhu STR_0602 :Horská dráha s vozy poháněnými elektromotorem, které sviští skrze propletenou dráhu +STR_0603 :Dřevěná horská dráha s ocelovými kolejemi, umožňující strmé přepady a obraty. +STR_0604 :Jezdci jedou v jednom radě na úzké, jednokolejové dráze, při závodě úzkými obrátkami a změnami směru. +STR_0605 :Jezdci se kloužou zauzlenou ocelovou dráhou, brzdíc pro ovládání rychlosti +STR_0606 :Dřevěná horská dráha staršího stylu s drsnou a rychlou jízdou, koupou času ve vzduchu, bočným přetížením, navrhnutá pro pocit ‘ztracené kontroly’ STR_0767 :Návštěvník {INT32} STR_0768 :Údržbář {INT32} STR_0769 :Mechanik {INT32} @@ -407,7 +415,7 @@ STR_1023 :{POP16}{POP16}{POP16}{COMMA16} vagónů na vlak STR_1024 :{COMMA16} vagon na vlak STR_1025 :{COMMA16} vagónů na vlak STR_1026 :Nástupiště je příliš dlouhé! -STR_1027 :Najet na toto místo +STR_1027 :Najet na toto místo v Hlavním Pohledu STR_1028 :Mimo mapu! STR_1029 :Nelze stavět částečně pod a nad vodní hladinou! STR_1030 :Tohle lze stavět jen pod vodou! @@ -748,7 +756,7 @@ STR_1363 :Příliš vysoké podpěry! STR_1364 :Podpěry tratě nelze více zvyšovat! STR_1365 :Otočka kolem trati (levá) STR_1366 :Otočka kolem trati (pravá) -STR_1367 :Poloviční smyčka +STR_1367 :Malá poloviční smyčka STR_1368 :Poloviční vývrtka (levá) STR_1369 :Poloviční vývrtka (pravá) STR_1370 :Sudový výkrut (levý) @@ -1962,7 +1970,7 @@ STR_2754 :Zalít květiny STR_2755 :Opravit vandalismy STR_2756 :Odebrat odpadky STR_2763 :??? -STR_2765 :Plná tramvaj +STR_2765 :Velká tramvaj STR_2766 :Vyhrát scénář STR_2767 :Zakázat změny počasí STR_2769 :Otevřít park @@ -2234,7 +2242,7 @@ STR_3185 :Malé kulisy STR_3186 :Velké kulisy STR_3187 :Stěny/ploty STR_3188 :Cedule u cest -STR_3189 :Cesty +STR_3189 :Původní cesty STR_3190 :Doplňky cest STR_3191 :Skupiny kulis STR_3192 :Vstup do parku @@ -2707,8 +2715,6 @@ STR_5503 :Zadejte hostname, nebo IP adresu: STR_5504 :Zobrazit stav hry více hráčů STR_5505 :Nelze se připojit k serveru. STR_5506 :Návštěvníci ignorují intenzitu atrakcí -STR_5508 :Povolit nahrávání souborů s chybným kontrolním součtem -STR_5509 :Povolit nahrávání scénářů s neplatným{NEWLINE}kontrolním součtem - například{NEWLINE}scénáře demoverze, nebo{NEWLINE}poškozené uložené hry. STR_5510 :Výchozí zvukové zařízení STR_5511 :(UNKNOWN) STR_5512 :Uložit hru jako @@ -3022,7 +3028,7 @@ STR_5867 :{WINDOW_COLOUR_2}Jméno provozovatele: {BLACK}{STRING} STR_5868 :{WINDOW_COLOUR_2}E-mail provozovatele: {BLACK}{STRING} STR_5869 :{WINDOW_COLOUR_2}Web provozovatele: {BLACK}{STRING} STR_5870 :Zobrazovat informace o serveru -STR_5871 :Nevadnoucí květiny. +STR_5871 :Vypnout vadnutí květin. STR_5872 :Vypnout stárnutí a uvadání květin. STR_5873 :Povolit řetězové výtahy na všech částech trati STR_5874 :Umožní použít řetězový výtah na jakékoliv části dráhy @@ -3168,18 +3174,18 @@ STR_6014 :Návštěvníci platí pouze za služby a atrakce. Vstup do parku j STR_6015 :Nakloněný STR_6016 :Upravit dlaždici STR_6017 :Zpomalte prosím -STR_6018 :Stavba trati - zatáčka vlevo -STR_6019 :Stavba trati - zatáčka vpravo -STR_6020 :Stavba trati - použít výchozí díl -STR_6021 :Stavba trati - svah dolů -STR_6022 :Stavba trati - svah vzhůru -STR_6023 :Stavba trati - řetězový vlek -STR_6024 :Stavba trati - náklon vlevo -STR_6025 :Stavba trati - náklon vpravo -STR_6026 :Stavba trati - předchozí díl -STR_6027 :Stavba trati - následující díl -STR_6028 :Stavba trati - postavit aktivní část -STR_6029 :Stavba trati - odebrat aktivní část +STR_6018 :Stavba - zatáčka vlevo +STR_6019 :Stavba - zatáčka vpravo +STR_6020 :Stavba - použít výchozí díl +STR_6021 :Stavba - svah dolů +STR_6022 :Stavba - svah vzhůru +STR_6023 :Stavba - řetězový vlek +STR_6024 :Stavba - náklon vlevo +STR_6025 :Stavba - náklon vpravo +STR_6026 :Stavba - předchozí díl +STR_6027 :Stavba - následující díl +STR_6028 :Stavba - postavit aktivní část +STR_6029 :Stavba - odebrat aktivní část STR_6030 :Výběr kulis. Klikněte na jakoukoliv kulisu na mapě pro postavení její kopie. STR_6031 :Popis serveru: STR_6032 :Uvítací zpráva serveru: @@ -3423,7 +3429,7 @@ STR_6318 :Detekována síťová desynchronizace.{NEWLINE}Log: {STRING} STR_6319 :Uzavřený brzdný blok STR_6320 :Nezničitelné STR_6321 :Rozbitá část -STR_6322 :{WINDOW_COLOUR_2}Sprite Id: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}Entity ID: {BLACK}{INT32} STR_6323 :Probíhá simulace STR_6324 :Simulovat STR_6325 :Simulovat atrakci @@ -3433,7 +3439,7 @@ STR_6328 :Velké snímky obrazovky budou mít průhledné pozadí namísto v STR_6329 :{STRING}{STRINGID} STR_6330 :Stahování [{STRING}] od {STRING} ({COMMA16} / {COMMA16}) STR_6331 :Přivolat kachny -STR_6332 :Zmizet kachny +STR_6332 :Odstranit kachny STR_6333 :Zvýšit koeficient škálování STR_6334 :Snížit koeficient škálování STR_6336 :Průzkumník dlaždic: Kopírovat prvek @@ -3471,7 +3477,7 @@ STR_6367 :Snímek animace: STR_6368 :Z důvodů kompatibility není doporučeno spuštět OpenRCT2 pod Wine. OpenRCT2 má nativví podporu pro macOS, Linux, FreeBSD a OpenBSD. STR_6369 :Povolit stavbu trati v jakémkoliv výšce STR_6370 :Umožní stavět dráhu v neplatné výšce -STR_6371 :Vybraná složka obsahuje RollerCoaster Tycoon 1, ale chybí soubor „csg1i.dat“. Tento soubor je nutné překopírovat z RollerCoaster Tycoon 1 instalačního CD do složky „Data“ ve vaší složce s RollerCoaster Tycoon 1. +STR_6371 :Vybraná složka obsahuje RollerCoaster Tycoon 1, ale chybí soubor „csg1i.dat“. Tento soubor je nutné překopírovat z Loopy Landscapes nebo RCT Deluxe instalačního CD do složky „Data“ ve vaší složce s RollerCoaster Tycoon 1. STR_6372 :Vybraná složka obsahuje RollerCoaster Tycoon 1, ale nelze použít jeho verzi. OpenRCT2 potřebuje buď Loopy Landscapes nebo RCT Deluxe verzi, aby bylo možné převzít grafiku. STR_6373 :Přepnout kontroly křížení STR_6374 :K @@ -3493,6 +3499,138 @@ STR_6389 :Málo místa STR_6390 :OpenRCT2 potřebuje soubory originální hry RollerCoaster Tycoon 2. Zvolte prosím složku instalace RollerCoaster Tycoon 2. STR_6391 :Vyberte RCT2 složku STR_6392 :Ve zvolené složce se nepodařilo nalézt {STRING}. +STR_6393 :Výběr cíle +STR_6394 :Cíl +STR_6395 :Údržba +STR_6396 :Vypnout šetřič a úsporu energie monitoru +STR_6397 :{SMALLFONT}{BLACK}Při zvolení, šetřič obrazovky a funkce úspory energie monitoru budou pozastaveny pokud je OpenRCT2 spuštěno. +STR_6398 :Soubor obsahuje nepodporované atrakce. Prosím aktualizujte na novější verzi OpenRCT2. +STR_6399 :OpenRCT2 vyžaduje k fungování soubory původního RollerCoaster Tycoon 2. Nastavte “game_path” hodnotu v config.ini na složku instalace RollerCoaster Tycoon 2, poté restartujte OpenRCT2. +STR_6400 :Mám stažený GOG offline instalátor pro RollerCoaster Tycoon 2, ale není nainstalován +STR_6401 :Mám už nainstalován RollerCoaster Tycoon 2 +STR_6402 :OpenRCT2 Data Nastavení +STR_6403 :Vyberte co se na vás nejlépe vztahuje +STR_6404 :Prosím vyberte GOG RollerCoaster Tycoon 2 instalátor. +STR_6405 :Vyberte GOG Instalátor +STR_6406 :GOG RollerCoaster Tycoon 2 Instalátor +STR_6407 :Tohle může zabrat několik minut. +STR_6408 :Prosím nainstalujte “innoextract” pro extrakci GOG Instalátoru, pak restartujte OpenRCT2. +STR_6409 :Vybraný soubor není offline GOG Instalátor pro RollerCoaster Tycoon 2. Možná jste stáhnuli GOG Galaxy stahovací základ nebo vybrali špatný soubor. +STR_6410 :Přiblížit /Oddálit +STR_6411 :Zobrazit tlačítka přiblížení a oddálení na nástrojové liště +STR_6412 :Číselník Enter +STR_6413 :Shift +STR_6414 :L Shift +STR_6415 :P Shift +STR_6416 :Ctrl +STR_6417 :L Ctrl +STR_6418 :P Ctrl +STR_6419 :Alt +STR_6420 :L Alt +STR_6421 :P Alt +STR_6422 :Cmd +STR_6423 :L Cmd +STR_6424 :P Cmd +STR_6425 :Joy Levo +STR_6426 :Joy Pravo +STR_6427 :Joy Nahoru +STR_6428 :Joy Dolů +STR_6429 :Joy {INT32} +STR_6430 :LTM +STR_6431 :PTM +STR_6432 :Myš {INT32} +STR_6433 :Odstranit +STR_6434 :Odstranit všechny vazby pro tuhle zkratku. +STR_6435 :{WINDOW_COLOUR_2}Vandali zastaveni: {BLACK}{COMMA16} +STR_6436 :Přepnout neviditelnost +STR_6437 :Viditelný +STR_6438 :V +STR_6439 :Inspektor dlaždic: Přepnout neviditelnost +STR_6440 :Průhledná voda +STR_6441 :Alespoň jeden chodník který není fronta musí být vybrán. +STR_6442 :Alespoň jeden chodník fronty musí být vybrán. +STR_6443 :Alespoň jedno zábradlí chodníku musí být vybráno. +STR_6444 :Povrchy chodníků +STR_6445 :Zábradlí chodníků +STR_6446 :{WINDOW_COLOUR_2}Jméno povrchu: {BLACK}{STRINGID} +STR_6447 :{WINDOW_COLOUR_2}Jméno zábradlí: {BLACK}{STRINGID} +STR_6448 :Nepodporovaný formát objektu +STR_6449 :{WINDOW_COLOUR_2}Skladby: +STR_6450 :{BLACK}“{STRING}” +STR_6451 :{BLACK}“{STRING}” - {STRING} +STR_6452 :{WINDOW_COLOUR_2}Prodává: {BLACK}{STRING} +STR_6453 :Kopírovat informace o verzi +STR_6454 :Nemožno přejmenovat transparent… +STR_6455 :Nemožno přejmenovat nápis… +STR_6456 :Gigantický snímek obrazovky +STR_6457 :Nahlásit chybu na GitHub +STR_6458 :Sledovat v Hlavním Pohledu +STR_6460 :S +STR_6461 :Směr +STR_6462 :Nadšení +STR_6463 :Nadšení: {COMMA2DP32} +STR_6464 :Intenzita +STR_6465 :Intenzita: {COMMA2DP32} +STR_6466 :Nevolnost +STR_6467 :Nevolnost: {COMMA2DP32} +STR_6468 :Zatím neznámo +STR_6469 :Uprav menší oblast pochůzky +STR_6470 :Uprav větší oblast pochůzky +STR_6471 :Průhledná Vegetace +STR_6472 :Průhledná Vozidla +STR_6473 :Průhledné opory +STR_6474 :Neviditelní hosté +STR_6475 :Neviditelní zaměstnanci +STR_6476 :Neviditelná Vegetace +STR_6477 :Neviditelná Scenerie +STR_6478 :Neviditelné Cesty +STR_6479 :Neviditelné Dráhy +STR_6480 :Neviditelná Vozidla +STR_6481 :Nastavení průhlednosti +STR_6482 :Nastavení průhlednosti +STR_6483 :Otevřít nastavení průhlednosti +STR_6484 :Přepnutí průhledné Vegetace +STR_6485 :Přepnutí průhledných vozidel +STR_6486 :Skrýt přepnutí hostí +STR_6487 :Skrýt přepnutí zaměstnanců +STR_6488 :{RED}Hosté si stěžují na dlouhé fronty v parku.{NEWLINE}Zvažte zkrácení front, nebo zvýšení kapacit atrakcí. +STR_6489 :Chyba: Nekompatibilní verze parku +STR_6490 :Varování: Částečne kompatibilní verze parku +STR_6492 :Tenhle park byl uložen v staré verzi OpenRCT2, a nemůže být otevřen touhle verzí. Park je verze {INT32}. +STR_6494 :Zoskupit podle typu atrakce +STR_6495 :Zoskupit atrakce podle druhu místo zobrazení každé odděleně. +STR_6496 :{WINDOW_COLOUR_2}{STRINGID} +STR_6497 :Kliknutím na dlaždici zobrazíte její části.{NEWLINE}Ctrl + kliknutí a části dlaždice pro její příme zvolení. +STR_6498 :Zapnout pro udržování čtvercové mapy +STR_6499 :Druh vozidla není podporován formátem návrhu tratě +STR_6500 :Prvky trate nejsou podporovány formátem návrhu tratě +STR_6501 :Náhodná barva +STR_6502 :Vlož hodnotu mezi {COMMA16} a {COMMA16} +STR_6503 :Alespoň jedna stanice musí bejt vybrána +STR_6504 :Alespoň jeden povrch terénu musí bejt vybrán +STR_6505 :Alespoň jedna hrana terénu musí bejt vybrána +STR_6506 :Velká poloviční vývrtka (levá) +STR_6507 :Velká poloviční vývrtka (pravá) +STR_6508 :Střední polovičná slučka (levá) +STR_6509 :Střední polovičná slučka (pravá) +STR_6510 :Nula G Kotoul (levý) +STR_6511 :Nula G Kotoul (pravý) +STR_6512 :Velký Nula G Kotoul (levý) +STR_6513 :Velký Nula G Kotoul (pravý) +STR_6514 :Chybná vejška! +STR_6515 :{BLACK}RCT1 není nalinkováno - budou použity záložné obrázky. +STR_6516 :Jeden nebo více přidaných objektů vyžaduje nalinkované RCT1 pro správné zobrazení. Budou použity záložné obrázky. +STR_6517 :Jeden nebo více přidaných objektů v tomto parku vyžaduje nalinkované RCT1 pro správné zobrazení. Budou použity záložné obrázky. +STR_6518 :{BLACK}Přejeď nad scenářem pro zobrazení popisu a cíle. Klikni pro začatí hry. +STR_6519 :Extra +STR_6520 :Balíčky doplňků +STR_6521 :Nízká priorita +STR_6522 :Vysoká priorita +STR_6523 :Znížit prioritu zvoleného balíčku doplňků. +STR_6524 :Zvýšit prioritu zvoleného balíčku doplňků. +STR_6525 :Znovu načítat všechny doplňky ve hře se zapnutými balíčkami doplňků. +STR_6526 :(základní grafika, hudba a zvukové efekty) +STR_6527 :Soutěže ############################################################################### ## RCT2 Scenarios @@ -3787,3 +3925,8 @@ STR_DTLS :Obrovský každoroční hudební festival se bude konat na vašem p STR_SCNR :Rock ’n’ Roll - Rock ’n’ Roll STR_PARK :Rock ’n’ Roll Revival STR_DTLS :Tento stárnoucí zábavní park už viděl lepší dny. Pomozte majiteli dát parku retro rock ’n’ roll vzhled a udělat z něho vyhledávané místo. + + +STR_SCNR :Panda World +STR_PARK :Panda World +STR_DTLS :Přidejte další atrakce a přilákejte více lidí do pandího zábavního parku. diff --git a/data/language/da-DK.txt b/data/language/da-DK.txt index a865fe4065..0f561fcb46 100644 --- a/data/language/da-DK.txt +++ b/data/language/da-DK.txt @@ -96,6 +96,7 @@ STR_0091 :Ukendt Forlystelse (59) STR_0092 :LIM Accelereret Rutschebane STR_0093 :Hybrid Rutschebane STR_0094 :Enkelt skinde rutchebane +STR_0096 :Klassisk træ rutsjebane STR_0512 :En kompakt rutschebane med en spiral stigning og bløde, snoede fald. STR_0513 :En loopende rutschebane hvor passagerne er i en stående position STR_0514 :Vogne suspenderet under rutschebane sporet, svinger ud til siden i svingene @@ -177,6 +178,7 @@ STR_0600 :Selvkørende togvogne kører igennem en sen snoet bane af spor STR_0602 :Rutsjebanetog accelereres ud af stationen af lineære induktionsmotorer for at suse gennem snoede inversioner STR_0603 :En rutsjebane i træ stil, med stål spor, Med stejle fald og hurtige sving. STR_0604 :Gæster sider i en enkelt række, på et smalt monorail spor, imens de suser igennem skarpe sving ,snoninger og hurtige vridninger. +STR_0606 :En ældre stils trærutsjebane med en hurtig og ujævn tur med masser af luft tid, laterale G'er, og designet til at føles som ‘ude-af-kontrol’ STR_0767 :Gæst {INT32} STR_0768 :Handymand {INT32} STR_0769 :Mekaniker {INT32} @@ -750,7 +752,7 @@ STR_1363 :For højt til understøttelse! STR_1364 :Understøttelse til banen kan ikke forlænges yderligere! STR_1365 :In-line Twist (venstre) STR_1366 :In-line Twist (højre) -STR_1367 :Halvt Loop +STR_1367 :Lille halvt Loop STR_1368 :Halvt Corkscrew (venstre) STR_1369 :Halvt Corkscrew (højre) STR_1370 :Tønderul (venstre) @@ -2706,8 +2708,6 @@ STR_5503 :Angiv computernavn eller IP adresse: STR_5504 :Vis multiplayer status STR_5505 :Kan ikke forbinde til server server. STR_5506 :Gæster ignorer intensitet -STR_5508 :Tilland indlæsning af filer med forkert checksums -STR_5509 :Tillad indlæsning af gemte spil og scenarier{NEWLINE}der har en forkert checksum,{NEWLINE}Som scenarierne fra demoen{NEWLINE}Eller beskadiget gemte spil. STR_5510 :Standard lydenhed STR_5511 :(UKENDT) STR_5512 :Gem spil som @@ -3591,9 +3591,46 @@ STR_6487 :Skift gennemsigtig personale STR_6488 :{RED}Gæster klager over længden af køerne i din park.{NEWLINE}Overvej at forkorte problematiske køer eller øge forlystelsernes gennemstrømning. STR_6489 :Fejl: Inkompatibel Park Version STR_6490 :Advarsel: Semi-kompatibel Park Version -STR_6491 :Denne park blev gemt i en nyere version af OpenRCT2. Parken er v{INT32} og kræver mindst v{INT32}. STR_6492 :Denne park er gemt i en ældre version af OpenRCT2, og kan ikke åbnes med denne version af OpenRCT2. Parken er v{INT32}. -STR_6493 :Denne park blev gemt i en nyere version af OpenRCT2, nogle data kan gå tabt. Parken er v{INT32} og kræver mindst v{INT32}. +STR_6497 :Klik på et felt for at vise dets felt elementer.{NEWLINE}Ctrl + Klik et felt element for at vælge det direkte. +STR_6498 :Aktiver for at fastholde kvadratisk kortfacon. +STR_6499 :Køretøjstype understøttes ikke af spor design formatet +STR_6500 :Spor elementerne understøttes ikke af spor design formatet +STR_6501 :Tilfældig farve +STR_6502 :Indtast en værdi mellem {COMMA16} og {COMMA16} +STR_6503 :Der skal vælges mindst ét station objekt +STR_6504 :Der skal vælges mindst én terræn overflade +STR_6505 :Der skal vælges mindst én terræn kant +STR_6506 :Stor halv proptrækker (venstre) +STR_6507 :Stor halv proptrækker (højre) +STR_6508 :Mellem halv loop (left) +STR_6509 :Mellem halv loop (right) +STR_6510 :Nul G Rul (venstre) +STR_6511 :Nul G Rul (højre) +STR_6512 :Stor nul G Rul (venstre) +STR_6513 :Stor nul G Rul (højre) +STR_6514 :Ugyldig højde! +STR_6515 :{BLACK}RCT1 er ikke linket - Reserve billeder vil blive brugt. +STR_6516 :Et eller flere objekter tilføjet kræver at RCT1 er linket for ordenlig visning. Reserve billeder vil blive brugt. +STR_6517 :Et eller flere objekter i denne park kræver at RCT1 er linket for ordenlig visning. Reserve billeder vil blive brugt. +STR_6518 :{BLACK}Hold over et scenarie for at se beskrivelse og mål. Klik for at starte med at spille. +STR_6519 :Ekstra +STR_6520 :Materiel pakker +STR_6521 :Lav prioritet +STR_6522 :Høj prioritet +STR_6523 :Sænk prioriteten for den valgte materiel pakke. +STR_6524 :Øg prioriteten for den valgte materiel pakke. +STR_6525 :Genindlæs alle aktiver i spillet med de aktiverede materiel pakker. +STR_6526 :(basis grafik, musik og lydeffekter) +STR_6527 :Konkurrencer +STR_6528 :Ugyldig spor parameter! +STR_6529 :Invalid farve skema parameter! +STR_6530 :User Created Expansion Set +STR_6531 :The Time Machine +STR_6532 :Katy’s Dreamworld +STR_6533 :{WINDOW_COLOUR_2}Spændings Faktor: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Intensitets Faktor: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Kvalme Faktor: {BLACK}-{COMMA16}% ############# # Scenarios # @@ -4045,36 +4082,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Tag -[TTRFWD01] -STR_NAME :Tag - -[TTRFWD02] -STR_NAME :Tag - -[TTRFWD03] -STR_NAME :Tag - -[TTRFWD04] -STR_NAME :Tag - -[TTRFWD05] -STR_NAME :Tag - -[TTRFWD06] -STR_NAME :Tag - -[TTRFWD07] -STR_NAME :Tag - -[TTRFWD08] -STR_NAME :Tag - -[ACWW33] -STR_NAME :Træ stolpe væg - -[ACWWF32] -STR_NAME :Træ stolpe væg - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index 68c3b86fe9..aca7a1c337 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -2711,8 +2711,6 @@ STR_5503 :Hostnamen oder IP-Adresse eingeben: STR_5504 :Mehrspielerstatus anzeigen STR_5505 :Verbindung zum Server konnte nicht hergestellt werden STR_5506 :Besucher ignorieren Bahnintensität -STR_5508 :Laden von Dateien mit unzul. Prüfsummen erlauben -STR_5509 :Erlaubt das Laden von Szenarios und gespeicherten Spielständen, die eine unzulässige Prüfsumme haben, wie Szenarios aus der Demo oder fehlerhafte Spielstände STR_5510 :Standard Audiogerät STR_5511 :(UNBEKANNT) STR_5512 :Spiel speichern unter @@ -2992,7 +2990,7 @@ STR_5832 :Zeigt Höhen als generische Einheiten,{NEWLINE}anstelle der unter STR_5833 :Verändert das verwendete Datumsformat STR_5834 :Das zu verwendende Audiogerät auswählen STR_5835 :Schaltet das Spiel stumm, wenn das{NEWLINE}Spiel nicht mehr im Vordergrund ist -STR_5836 :Die im Hauptmenü verwendete{NEWLINE}Musik auswählen.{NEWLINE}{NEWLINE}Die RCT1-Musik erfordert das Kopieren von „data/css17.dat“,{NEWLINE}aus dem RCT1-Ordner, nach „data/css50.dat“ im{NEWLINE}RCT2-Ordner oder versichern Sie sich, dass der Pfad zur RCT1-Installation in den Optionen korrekt angegeben ist. +STR_5836 :Die im Hauptmenü verwendete Musik auswählen.{NEWLINE}Die Auswahl der RCT1-Musik erfordert, dass der Pfad zu RCT1 im Reiter „Erweitert“ festgelegt wird. STR_5837 :Benutzerdefinierte GUIs{NEWLINE}erstellen und verwalten STR_5838 :Zeigt für die Finanzen in der Symbolleiste{NEWLINE}eine gesonderte Schaltfläche an STR_5839 :Zeigt für die Forschung & Entwicklung{NEWLINE}in der Symbolleiste eine gesonderte Schaltfläche an @@ -3425,7 +3423,7 @@ STR_6318 :Netzwerkdesynchronisation erkannt.{NEWLINE}Logdatei: {STRING} STR_6319 :Blockbremse geschlossen STR_6320 :Unzerstörbar STR_6321 :Zusatz ist kaputt -STR_6322 :{WINDOW_COLOUR_2}Sprite-ID: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}Entity-ID: {BLACK}{INT32} STR_6323 :Simulierend STR_6324 :Simulieren STR_6325 :Fahrgeschäft/Attraktion simulieren @@ -3592,9 +3590,7 @@ STR_6487 :Personal ausblenden STR_6488 :{RED}Die Gäste beschweren sich über die Länge der Warteschlangen in ihrem Park.{NEWLINE}Verkürzen Sie problematische Warteschlangen oder erhöhen Sie den Durchsatz der Fahrgeschäfte. STR_6489 :Fehler: Inkompatible Parkversion STR_6490 :Warnung: Teilkompatible Parkversion -STR_6491 :Dieser Park wurde in einer späteren Version von OpenRCT2 gespeichert. Park ist v{INT32} und benötigt mindestens v{INT32}. STR_6492 :Dieser Park wurde in einer alten Version von OpenRCT2 gespeichert und kann nicht mit dieser Version von OpenRCT2 geöffnet werden. Park ist v{INT32}. -STR_6493 :Dieser Park wurde in einer späteren Version von OpenRCT2 gespeichert, einige Daten können verloren gehen. Park ist v{INT32} und benötigt mindestens v{INT32}. STR_6494 :Nach Fahrgeschäftstyp gruppieren STR_6495 :Fahrgeschäfte nach Fahrgeschäftstyp gruppieren, anstatt jedes Fahrzeug separat anzuzeigen. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3616,11 +3612,23 @@ STR_6511 :Null-G-Rolle (rechts) STR_6512 :Große Null-G-Rolle (l.) STR_6513 :Große Null-G-Rolle (r.) STR_6514 :Ungültige Höhe! -STR_6515 :{BLACK}RCT1 nicht verknüpft - Es werden Fallback-Bilder verwendet. -STR_6516 :Eines oder mehrere der hinzugefügten Objekte benötigen eine Verknüpfung mit RCT1 für eine korrekte Anzeige. Es werden Fallback-Bilder verwendet. -STR_6517 :Eines oder mehrere Objekte in diesem Park benötigen eine Verknüpfung mit RCT1 für eine korrekte Anzeige. Es werden Fallback-Bilder verwendet. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 nicht verknüpft - Es werden Fallback-Bilder verwendet. +STR_6516 :Eines oder mehrere der hinzugefügten Objekte benötigen eine Verknüpfung mit RollerCoaster Tycoon 1 für eine korrekte Anzeige. Es werden Fallback-Bilder verwendet. +STR_6517 :Eines oder mehrere Objekte in diesem Park benötigen eine Verknüpfung mit RollerCoaster Tycoon 1 für eine korrekte Anzeige. Es werden Fallback-Bilder verwendet. STR_6518 :{BLACK}Zeigen Sie auf ein Szenario, um seine Beschreibung und sein Ziel zu sehen. Klicken Sie, um das Spiel zu beginnen. STR_6519 :Extras +STR_6520 :Medienpakete +STR_6521 :Niedrige Priorität +STR_6522 :Hohe Priorität +STR_6523 :Die Priorität des gewählten Medienpakets verringern. +STR_6524 :Die Priorität des gewählten Medienpakets erhöhen. +STR_6525 :Alle Mediendaten im Spiel mit den aktivierten Medienpaken neu laden. +STR_6526 :(Basisgrafiken, -musik und -toneffekte) +STR_6527 :Wettbewerbe +STR_6528 :Ungültige Streckenparameter! +STR_6529 :Ungültiger Farbschemaparameter! +STR_6531 :Die Zeitmaschine +STR_6532 :Katys Traumwelt ############# @@ -4073,36 +4081,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Dach -[TTRFWD01] -STR_NAME :Dach - -[TTRFWD02] -STR_NAME :Dach - -[TTRFWD03] -STR_NAME :Dach - -[TTRFWD04] -STR_NAME :Dach - -[TTRFWD05] -STR_NAME :Dach - -[TTRFWD06] -STR_NAME :Dach - -[TTRFWD07] -STR_NAME :Dach - -[TTRFWD08] -STR_NAME :Dach - -[ACWW33] -STR_NAME :Holzpfostenwand - -[ACWWF32] -STR_NAME :Holzpfostenwand - ## End of OpenRCT2 Official ############################################################################### @@ -4406,3 +4384,101 @@ STR_DTLS :Dieser Freizeitpark ist ein wenig in die Jahre gekommen. Helfen Sie STR_SCNR :Pandawelt STR_PARK :Pandawelt STR_DTLS :Bauen Sie weitere Fahrgeschäfte und ziehen Sie neue Gäste in diesem Park im Pandastil an + +### + +STR_SCNR :Cemetery Ridge +STR_PARK :Cemetery Ridge +STR_DTLS :Es ist Halloween, UCES-Halloween. Kürbisse kreischen in der kalten toten Nacht! Dieser Friedhof ist in Gefahr, und es liegt an Ihnen, ihn zu retten, während Sie die Toten in Frieden ruhen lassen. Können Sie die Geister in ihren Gräbern halten und Ihren Kunden das Fürchten lehren?{NEWLINE}Autor: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :Der Leuchtturm von Alexandria +STR_PARK :Der Leuchtturm von Alexandria +STR_DTLS :Alexander erbaute die Stadt; Griechen, Römer, Ägypter hinterließen ihre Spuren. Aber die größte Ehre war ein Wunder der Antiken Welt - der Leuchtturm. Statten Sie ihm einen Besuch ab und bauen Sie einen Park.{NEWLINE}Autor: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :So, wie er am Eröffnungstag war, den 18. Mai 1905.{NEWLINE}Autor: Aetherwave + + +STR_SCNR :Vesuv +STR_PARK :Vesuv +STR_DTLS :Pompeji and Herculaneum wurden vom Vesuv in 79 v. Chr. zerstört. Besuchen Sie die Ausgrabungen und bauen Sie einen Park!{NEWLINE}Autor: Katatude + + +STR_SCNR :Der Sandkasten +STR_PARK :Der Sandkasten +STR_DTLS :Was alle wollen - ein Sandkasten! Also schnappen Sie sich Eimer und Schaufel und bauen Sie einen Park!{NEWLINE}Autor: Katatude + + +STR_SCNR :Niagarafälle u. Schlucht +STR_PARK :Niagarafälle +STR_DTLS :Die American Falls, Bridal Falls und die kanadischen Horseshoe Falls am Niagara, 1850.{NEWLINE}Autor: Katatude + + +STR_SCNR :Rocky Mountain Miners +STR_PARK :Rocky Mountain Miners +STR_DTLS :Ein Steinschlag hat Ihre Eisenbahnstrecke beschädigt. Ihre Arbeiter sind auf die Suche nach Bodenschätzen gegangen. Gibt es Gold in Achterbahnen?{NEWLINE}Autoren: Squid, Buckone, Fossil + + +STR_SCNR :Die Zeitmaschine +STR_PARK :Die Zeitmaschine +STR_DTLS :Die Zeitmaschine. Bauen Sie, wann Sie wollen, wo Sie wollen. Die Ewigkeit wartet. Alles ist relativ.{NEWLINE}Autor: Katatude + + +STR_SCNR :Turmbau zu Babel +STR_PARK :Turmbau zu Babel +STR_DTLS :Wow! Schauen Sie, wohin uns die Zeitmaschine jetzt befördert hat! Wo sind alle hin?{NEWLINE}Autor: Fossil + + +STR_SCNR :Transformation +STR_PARK :Transformation +STR_DTLS :Wir haben auf Sie gewartet …{NEWLINE}Autor: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :Die Römer haben keine Lust mehr auf langweilige Gladiatorenkämpfe. Geben Sie ihnen etwas aufregenderes; verwandeln Sie eine römische Stadt zum großartigsten Vergnügungspark aller Zeiten!{NEWLINE}Autor: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Unter dem Weihnachtsbaum +STR_PARK :Winterwunderland +STR_DTLS :Mama hat diese Szenerie unter unserem Baum gebaut. Jetzt möchte sie darin einen Park gebaut haben! Können Sie helfen?{NEWLINE}Autor: Katatude + + +STR_SCNR :Bigrock Blast +STR_PARK :Bigrock Blast +STR_DTLS :Nach einer Explosion bei der Bigrock Mining Co. haben die Einwohner von Bigrock einen Vergnügungspark gebaut, um ihre Stadt am Leben zu halten.{NEWLINE}Autoren: rbarclay u. buckone + + +STR_SCNR :Camp Mockingbird +STR_PARK :Camp Mockingbird +STR_DTLS :Nur $500/Woche in diesem Sommercamp! Ziehen Sie Ihre Spendierhosen an, haben Sie Spaß und bauen Sie einen Park.{NEWLINE}Autor: Katatude + + +STR_SCNR :Töff-Töff-Land +STR_PARK :Töff-Töff-Land +STR_DTLS :Mama! Papa! Ich will ins Töff-Töff-Land!{NEWLINE}Autor: Fossil + + +STR_SCNR :Dracheninseln +STR_PARK :Dracheninseln +STR_DTLS :Dracheninseln? Ich bin mir nicht sicher, wie man da hinkommt …{NEWLINE}Autor: Fossil + + +STR_SCNR :Kiddie Karnival II +STR_PARK :Kiddie Karnival +STR_DTLS :Hallo Kinder! Lasst uns Spaß haben!{NEWLINE}Autoren: Piehead u. Fossil + + +STR_SCNR :Sanddüne +STR_PARK :Sanddüne +STR_DTLS :Als der Eigentümer eines kleinen Parks haben Sie sich ein größes Grundstück am Strand gekauft, um den Park zu erweitern, um mehr Gäste anzulocken, die schönen Sanddünen zu besuchen. Aber vorsicht: Sie dürfen die ökologisch fragilen Sanddünen nicht zerstören.{NEWLINE}Autor: rbarclay diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index b6af82a5b5..0ff09b543d 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -2710,8 +2710,6 @@ STR_5503 :Enter hostname or IP address: STR_5504 :Show multiplayer status STR_5505 :Unable to connect to server. STR_5506 :Guests ignore intensities -STR_5508 :Allow loading files with incorrect checksums -STR_5509 :Allows loading scenarios and saves{NEWLINE}that have an incorrect checksum,{NEWLINE}like the scenarios from the demo{NEWLINE}or damaged saves. STR_5510 :Default sound device STR_5511 :(UNKNOWN) STR_5512 :Save Game As @@ -2995,7 +2993,7 @@ STR_5832 :Show height as generic units instead of measurement format set unde STR_5833 :Changes what date format is used STR_5834 :Select which audio device OpenRCT2 will use STR_5835 :Mute the game if the window loses focus -STR_5836 :Select music to use on the main menu.{NEWLINE}Selecting the RCT1 theme requires that you set the path to RCT1 in the Miscellaneous tab. +STR_5836 :Select music to use on the main menu.{NEWLINE}Selecting the RCT1 theme requires that you set the path to RCT1 in the Advanced tab. STR_5837 :Create and manage custom UI themes STR_5838 :Show a separate button for the finance window in the toolbar STR_5839 :Show a separate button for the research and development window in the toolbar @@ -3428,7 +3426,7 @@ STR_6318 :Network desync detected.{NEWLINE}Log file: {STRING} STR_6319 :Block Brake Closed STR_6320 :Indestructible STR_6321 :Addition is broken -STR_6322 :{WINDOW_COLOUR_2}Sprite Id: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}Entity ID: {BLACK}{INT32} STR_6323 :Simulating STR_6324 :Simulate STR_6325 :Simulate ride/attraction @@ -3595,9 +3593,9 @@ STR_6487 :Hide staff toggle STR_6488 :{RED}Guests are complaining about the length of the queues in your park.{NEWLINE}Consider shortening problematic queues, or increasing the rides’ throughput. STR_6489 :Error: Incompatible Park Version STR_6490 :Warning: Semi-compatible Park Version -STR_6491 :This park was saved in a later version of OpenRCT2. Park is v{INT32} and requires at least v{INT32}. +STR_6491 :This park was saved in a later version of OpenRCT2. The park was saved in v{INT32} and requires at least v{INT32}. You are currently on v{INT32}. STR_6492 :This park was saved in an old version of OpenRCT2, and can not be opened with this version of OpenRCT2. Park is v{INT32}. -STR_6493 :This park was saved in a later version of OpenRCT2, some data may be lost. Park is v{INT32} and requires at least v{INT32}. +STR_6493 :This park was saved in a later version of OpenRCT2, some data may be lost. The park was saved in v{INT32}. You are currently on v{INT32}. STR_6494 :Group by ride type STR_6495 :Group rides by ride types instead of showing each vehicle separately. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3619,9 +3617,9 @@ STR_6511 :Zero G Roll (right) STR_6512 :Large Zero G Roll (left) STR_6513 :Large Zero G Roll (right) STR_6514 :Invalid height! -STR_6515 :{BLACK}RCT1 not linked - fallback images will be used. -STR_6516 :One or more objects added require RCT1 linked for proper display. Fallback images will be used. -STR_6517 :One or more objects in this park require RCT1 linked for proper display. Fallback images will be used. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 not linked - fallback images will be used. +STR_6516 :One or more objects added require RollerCoaster Tycoon 1 linked for proper display. Fallback images will be used. +STR_6517 :One or more objects in this park require RollerCoaster Tycoon 1 linked for proper display. Fallback images will be used. STR_6518 :{BLACK}Hover over a scenario to view its description and objective. Click it to start playing. STR_6519 :Extras STR_6520 :Asset Packs @@ -3631,6 +3629,16 @@ STR_6523 :Decrease the priority of the selected asset pack. STR_6524 :Increase the priority of the selected asset pack. STR_6525 :Reload all assets in the game with the enabled asset packs. STR_6526 :(base graphics, music and sound effects) +STR_6527 :Competitions +STR_6528 :Invalid track parameters! +STR_6529 :Invalid colour scheme parameter! +STR_6530 :User Created Expansion Set +STR_6531 :The Time Machine +STR_6532 :Katy’s Dreamworld +STR_6533 :{WINDOW_COLOUR_2}Excitement Factor: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Intensity Factor: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Nausea Factor: {BLACK}-{COMMA16}% +STR_6536 :This park was saved in a later version of OpenRCT2. The park was saved in v{INT32}, you are currently on v{INT32}. ############# # Scenarios # @@ -4083,36 +4091,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Roof -[TTRFWD01] -STR_NAME :Roof - -[TTRFWD02] -STR_NAME :Roof - -[TTRFWD03] -STR_NAME :Roof - -[TTRFWD04] -STR_NAME :Roof - -[TTRFWD05] -STR_NAME :Roof - -[TTRFWD06] -STR_NAME :Roof - -[TTRFWD07] -STR_NAME :Roof - -[TTRFWD08] -STR_NAME :Roof - -[ACWW33] -STR_NAME :Wooden Post Wall - -[ACWWF32] -STR_NAME :Wooden Post Wall - ## End OpenRCT2 Official ############################################################################### @@ -4416,3 +4394,101 @@ STR_DTLS :This aging theme park has seen better days. Help the owner give it STR_SCNR :Panda World STR_PARK :Panda World STR_DTLS :Add more rides and attract more people to this panda-themed park + +### + +STR_SCNR :Cemetery Ridge +STR_PARK :Cemetery Ridge +STR_DTLS :This is Halloween, UCES Halloween, pumpkins scream in the dead of night! This graveyard is in trouble and it’s up to you to save it, while letting the dead rest in peace! Can you keep the ghosts in their graves and bring chills to your customers?{NEWLINE}Author: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :The Lighthouse of Alexandria +STR_PARK :The Lighthouse of Alexandria +STR_DTLS :Alexander built the city; Greeks, Romans, Egyptians left their mark. But the biggest honor was a Wonder of the Ancient World - the Lighthouse. Visit and make a park!{NEWLINE}Author: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :As it was on its opening day - 18 May 1905.{NEWLINE}Author: Aetherwave + + +STR_SCNR :Mount Vesuvius +STR_PARK :Mount Vesuvius +STR_DTLS :Pompeii and Herculaneum were buried by Mt. Vesuvius in 79 A.D. Visit the excavations and build a park!{NEWLINE}Author: Katatude + + +STR_SCNR :The Sandbox +STR_PARK :The Sandbox +STR_DTLS :What everyone wants - a sandbox! So grab your l’il pail and shovel and build a park!{NEWLINE}Author: Katatude + + +STR_SCNR :Niagara Falls & Gorge +STR_PARK :Niagara Falls +STR_DTLS :American Falls, Bridal Falls & Canadian Horseshoe Falls on the Niagara Frontier, 1850.{NEWLINE}Author: Katatude + + +STR_SCNR :Rocky Mountain Miners +STR_PARK :Rocky Mountain Miners +STR_DTLS :A rockslide damaged your railway. Your workers have gone prospecting. Is there gold in roller coasters?{NEWLINE}Authors: Squid, Buckone, Fossil + + +STR_SCNR :The Time Machine +STR_PARK :The Time Machine +STR_DTLS :The Time Machine. Build to go - when you want, where you want. Eternity awaits. It’s all relative.{NEWLINE}Author: Katatude + + +STR_SCNR :Tower of Babel +STR_PARK :Tower of Babel +STR_DTLS :Whoaa! Look where the time machine took us now! Where did everybody go?{NEWLINE}Author: Fossil + + +STR_SCNR :Transformation +STR_PARK :Transformation +STR_DTLS :We were expecting you…{NEWLINE}Author: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :The Romans are tired of boring gladiator fights. Give them a better thrill, turn a Roman city into the greatest amusement park of all time!{NEWLINE}Author: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Beneath the Christmas Tree +STR_PARK :Winter Wonderland +STR_DTLS :Mum built this scene under our tree. Now she wants a park made in it! Can you help?{NEWLINE}Author: Katatude + + +STR_SCNR :Bigrock Blast +STR_PARK :Bigrock Blast +STR_DTLS :After an explosion at the Bigrock Mining Co., the people of Bigrock have to build an amusement park to keep their town alive.{NEWLINE}Authors: rbarclay & buckone + + +STR_SCNR :Camp Mockingbird +STR_PARK :Camp Mockingbird +STR_DTLS :Only $500/week to this summer camp! Break open your bank and then have fun and build a park.{NEWLINE}Author: Katatude + + +STR_SCNR :Choo-Choo Town +STR_PARK :Choo-Choo Town +STR_DTLS :Mommy! Daddy! I want to go to Choo-Choo Town!{NEWLINE}Author: Fossil + + +STR_SCNR :Dragon Islands +STR_PARK :Dragon Islands +STR_DTLS :Dragon Islands? I’m not sure I want to go there…{NEWLINE}Author: Fossil + + +STR_SCNR :Kiddie Karnival II +STR_PARK :Kiddie Karnival +STR_DTLS :Hey kids! Let’s have fun!{NEWLINE}Authors: Piehead & Fossil + + +STR_SCNR :Sand Dune +STR_PARK :Sand Dune +STR_DTLS :As the owner of a small park, you bought a large piece of land along the beach to expand and attract more guests to visit the beautiful sand dunes, but beware: you cannot disturb those ecologically fragile sand dunes.{NEWLINE}Author: rbarclay diff --git a/data/language/eo-ZZ.txt b/data/language/eo-ZZ.txt index 4ebe862220..725ee7d1bf 100644 --- a/data/language/eo-ZZ.txt +++ b/data/language/eo-ZZ.txt @@ -2710,8 +2710,6 @@ STR_5503 :Entajpu servilonomon aŭ IP-adreson: STR_5504 :Montri staton plurludantan STR_5505 :Ne eblas aliĝi al servilo. STR_5506 :Gastoj malatentas intensecojn -STR_5508 :Permesi ŝargadon de dosieroj kun nevalidaj kontrolsumoj -STR_5509 :Permesas ŝargadon de scenaroj kaj konservaĵoj{NEWLINE}kiuj havas nevalidan kontrolsumon,{NEWLINE}kiel la scenaroj de la demonstrado{NEWLINE}aŭ difektitaj konservaĵoj. STR_5510 :Defaŭlta sonludilo STR_5511 :(NEKONATA) STR_5512 :Konservi Ludon Kiel @@ -2995,7 +2993,7 @@ STR_5832 :Montri altecon per komunaj unuoj anstataŭ mezurformato agordita su STR_5833 :Ŝanĝas kiun datoformaton estas uzata STR_5834 :Elekti kiun sonludilon OpenRCT2 uzos STR_5835 :Silentigi la ludon se la fenestro perdas fokuson -STR_5836 :Elekti muzikon por uzi je la ĉefa menuo.{NEWLINE}Elekti RCT1-temon postulas, ke vi kopiu ‘data/css17.dat’ de via RCT1-ludodosierujo al ‘data/css50.dat’ en via RCT2-dosierujo, aŭ agordu la dosierindikon al RCT1 en la Diversaĵo-langeto. +STR_5836 :Elekti muzikon por uzi je la ĉefa menuo.{NEWLINE}Elekti la RCT1-temon postulas, ke vi agordu la dosierindikon al RCT1 en la Altnivela-langeto. STR_5837 :Krei kaj administri proprajn fasado-temojn STR_5838 :Montri apartan butonon por la fenestro de financoj en la ilobreto STR_5839 :Montri apartan butonon por la fenestro de esplorado kaj disvolvado en la ilobreto @@ -3428,7 +3426,7 @@ STR_6318 :Dissinkronigo de reto detektita.{NEWLINE}Protokolo-dosiero: {STRING STR_6319 :Bremso de Blokparto Fermita STR_6320 :Nemalkonstruebla STR_6321 :Aldonaĵo difektas -STR_6322 :{WINDOW_COLOUR_2}Identigilo de rastrumeto: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}Identigilo de ento: {BLACK}{INT32} STR_6323 :Simulas STR_6324 :Simuli STR_6325 :Simuli atrakcion @@ -3595,9 +3593,7 @@ STR_6487 :Baskuligi nevideblan dungitaron STR_6488 :{RED}Gastoj plendas pri la longeco de la atendovicoj en via parko.{NEWLINE}Konsideru mallongigi problemajn atendovicojn, aŭ pliigi la flukvanton de la atrakcioj. STR_6489 :Eraro: Malkongrua Versio de Parko STR_6490 :Averto: Parte Kongrua Versio de Parko -STR_6491 :Ĉi tiu parko estis konservita en pli nova versio de OpenRCT2. Parko estas v{INT32} kaj bezonas almenaŭ v{INT32}. STR_6492 :Ĉi tiu parko estis konservita en malnova versio de OpenRCT2, kaj ne povas esti malfermita per ĉi tiu versio de OpenRCT2. Parko estas v{INT32}. -STR_6493 :Ĉi tiu parko estis konservita en pli nova versio de OpenRCT2, kelkaj datumoj eble estas perditaj. Parko estas v{INT32} kaj bezonas almenaŭ v{INT32}. STR_6494 :Grupigi laŭ atrakciotipo STR_6495 :Grupigi atrakciojn laŭ akrakciotipoj anstataŭ montri ĉiun veturilon aparte. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3619,11 +3615,27 @@ STR_6511 :Sengravida Ruliĝo (dekstre) STR_6512 :Granda Sengravida Ruliĝo (maldekstre) STR_6513 :Granda Sengravida Ruliĝo (dekstre) STR_6514 :Nevalida alteco! -STR_6515 :{BLACK}RCT1 ne estas ligita - retropaŝaj bildoj estos uzitaj. -STR_6516 :Unu aŭ pli objektoj aldonitaj bezonas je RCT1 ligita por ĝusta montrado. Retropaŝaj bildoj estos uzitaj. -STR_6517 :Unu aŭ pli objektoj en ĉi tiu parko bezonas je RCT1 ligita por ĝusta montrado. Retropaŝaj bildoj estos uzitaj. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 ne estas ligita - retropaŝaj bildoj estos uzitaj. +STR_6516 :Unu aŭ pli objektoj aldonitaj bezonas je RollerCoaster Tycoon 1 ligita por ĝusta montrado. Retropaŝaj bildoj estos uzitaj. +STR_6517 :Unu aŭ pli objektoj en ĉi tiu parko bezonas je RollerCoaster Tycoon 1 ligita por ĝusta montrado. Retropaŝaj bildoj estos uzitaj. STR_6518 :{BLACK}Musumu super scenaro por vidi ĝian priskribon kaj celon. Alklaku ĝin por ekludi. STR_6519 :Ekstraĵoj +STR_6520 :Havaĵo-Pakoj +STR_6521 :Malalta Prioritato +STR_6522 :Alta Prioritato +STR_6523 :Malkreskigi la prioritaton de la elektita havaĵo-pako. +STR_6524 :Kreskigi ka prioritaton de la elektita havaĵo-pako. +STR_6525 :Reŝargi ĉiujn havaĵojn en la ludo kontraŭ la ŝaltitaj havaĵo-pakoj. +STR_6526 :(bazaj grafikoj, muziko kaj sonefikoj) +STR_6527 :Konkursoj +STR_6528 :Nevalidaj parametroj de trako! +STR_6529 :Nevalida parametro de kolorskemo! +STR_6530 :Uzantkreita Kompletiga Aro +STR_6531 :La Tempomaŝino +STR_6532 :La Revomondo de Katia +STR_6533 :{WINDOW_COLOUR_2}Faktoro de Eksciteco: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Faktoro de Intenseco: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Faktoro de Naŭzo: {BLACK}-{COMMA16}% ############# # Scenarios # @@ -4074,37 +4086,6 @@ STR_DTLS : ## Start OpenRCT2 Official [TTPIRF05] STR_NAME :Tegmento - -[TTRFWD01] -STR_NAME :Tegmento - -[TTRFWD02] -STR_NAME :Tegmento - -[TTRFWD03] -STR_NAME :Tegmento - -[TTRFWD04] -STR_NAME :Tegmento - -[TTRFWD05] -STR_NAME :Tegmento - -[TTRFWD06] -STR_NAME :Tegmento - -[TTRFWD07] -STR_NAME :Tegmento - -[TTRFWD08] -STR_NAME :Tegmento - -[ACWW33] -STR_NAME :Muro el Lignaj Fostoj - -[ACWWF32] -STR_NAME :Muro el Lignaj Fostoj - ## End OpenRCT2 Official ############################################################################### @@ -4408,3 +4389,101 @@ STR_DTLS :Ĉi tiu maljuniĝa amuzparko vidis pli bonajn tagojn. Helpu la pose STR_SCNR :Pando-Mondo STR_PARK :Pando-Mondo STR_DTLS :Aldonu pli da atrakcioj kaj allogu pli da homoj al ĉi tiu pando-temita amuzparko + +### + +STR_SCNR :Tombeja Kresto +STR_PARK :Tombeja Kresto +STR_DTLS :Ĉi Tio estas Haloveno, UCES Haloveno, kukurboj kriegas en la plena nokto! Ĉi tiu tombejo havas problemon kaj ĝi dependas de vi por savi ĝin, dum lasinte la mortinton ripozi en paco! Ĉu vi povas teni la fantomojn en iliaj tomboj kaj alporti frostotremojn al viaj klientoj?{NEWLINE}Aŭtoro: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :La Lumturo de Aleksandrio +STR_PARK :La Lumturo de Aleksandrio +STR_DTLS :Aleksandrio konstruis la urbon; Grekoj, romianoj, kaj egiptoj lasis siajn markojn. Sed la plej granda honoro estis Mirindaĵo de la Antikva Mondo - la Lumturo. Vizitu kaj farigu parkon!{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :Luna Parko, Klevlando +STR_PARK :Luna Parko +STR_DTLS :Kiel ĝi estis en ĝia inaŭgura tago - 18 Majo 1905.{NEWLINE}Aŭtoro: Aetherwave + + +STR_SCNR :Monto Vezuvio +STR_PARK :Monto Vezuvio +STR_DTLS :Pompejo kaj Herkulano estis enterigita de Monto Vezuvio en 79 p.K. Vizitu la elfosaĵojn kaj konstruu parkon!{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :La Sablokesto +STR_PARK :La Sablokesto +STR_DTLS :Kion ĉiuj volas - sablokesto! Do prenu vian etan sitelon kaj fosilon kaj konstruu parkon!{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :Niagara Akvofalaro & Valego +STR_PARK :Niagara Akvofalaro +STR_DTLS :Usona Akvofalo, Luna Akvofalo & Huffera Akvofalo sur la Niagara Limo, 1850.{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :Ministoj de Roka Montaro +STR_PARK :Ministoj de Roka Montaro +STR_DTLS :Terŝoviĝo damaĝis vian fervojon. Viaj laboristoj foriris por esplori. Ĉu estas oro en onda-fervojojn?{NEWLINE}Aŭtoroj: Squid, Buckone, Fossil + + +STR_SCNR :La Tempomaŝino +STR_PARK :La Tempomaŝino +STR_DTLS :La Tempomaŝino. Konstruu por iri - kiam vi volas, kien vi volas. Eterneco atendas. Ĉio estas relativa.{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :Babela Turo +STR_PARK :Babela Turo +STR_DTLS :Ho! Rigardu kien la tempomaŝino kondukis nin nun! Kien ĉiuj iris?{NEWLINE}Aŭtoro: Fossil + + +STR_SCNR :Transformiĝo +STR_PARK :Transformiĝo +STR_DTLS :Ni atendis vin…{NEWLINE}Aŭtoro: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :La romianoj lacas enuigajn gladiatorajn batalojn. Donu al ili pli bonajn ravojn, transformu roman urbon en la plej bonan amuzparkon de ĉiuj tempoj!{NEWLINE}Aŭtoro: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Sub la Kristnaska Arbo +STR_PARK :Vintra Mirlando +STR_DTLS :Panjo konstruis ĉi tiun scenon sub nia arbo. Nun ŝi volas parkon farigitan en ĝi! Ĉu vi povas helpi?{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :Rokega Eksplodo +STR_PARK :Rokega Eksplodo +STR_DTLS :Post eksplodo ĉe la Rokega Minada Kompanio, la homoj de Rokego devas konstrui amuzparkon por konservi ilian urbeton viva.{NEWLINE}Aŭtoroj: rbarclay & buckone + + +STR_SCNR :Mokbirdo-Kampejo +STR_PARK :Mokbirdo-Kampejo +STR_DTLS :Nur 500 dolaroj semajne por ĉi tiu somera kampejo! Disrompu vian ŝparmonujon kaj tiam amuziĝu kaj konstruu parkon.{NEWLINE}Aŭtoro: Katatude + + +STR_SCNR :Ĉu-Ĉu-Urbeto +STR_PARK :Ĉu-Ĉu-Urbeto +STR_DTLS :Panjo! Paĉjo! Mi volas iri al Ĉu-Ĉu-Urbeto!{NEWLINE}Aŭtoro: Fossil + + +STR_SCNR :Drakaj Insuloj +STR_PARK :Drakaj Insuloj +STR_DTLS :Ĉu Drakaj Insuloj? Mi ne estas certa, ke mi volas iri tien…{NEWLINE}Aŭtoro: Fossil + + +STR_SCNR :Infana Karnavalo 2 +STR_PARK :Infana Karnavalo +STR_DTLS :He infanoj! Ni amuziĝu!{NEWLINE}Aŭtoroj: Piehead & Fossil + + +STR_SCNR :Sabla Duno +STR_PARK :Sabla Duno +STR_DTLS :Kiel posedanto de malgranda parko, vi aĉetis grandan terpecon laŭ la marbordo por vastigi kaj allogi pli da gastoj viziti la belajn sablajn dunojn, sed singardu: vi ne povas perturbi tiujn ekologie delikatajn sablajn dunojn.{NEWLINE}Aŭtoro: rbarclay diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index a96f3e622f..6b64e1b472 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -2713,8 +2713,6 @@ STR_5503 :Escribe el nombre del host o la IP: STR_5504 :Mostrar estado multijugador STR_5505 :No se pudo conectar al servidor. STR_5506 :Visitantes ignoran intensidad de atracc. -STR_5508 :Permitir cargar ficheros dañados -STR_5509 :Permite cargar escenarios y partidas que tengan una suma de comprobación incorrecta, como los escenarios de la demo o partidas dañadas. STR_5510 :Dispositivo de sonido predeterminado STR_5511 :(DESCONOCIDO) STR_5512 :Guardar Partida como… @@ -2999,7 +2997,7 @@ STR_5832 :Mostrar marcas de altura con{NEWLINE}valores relativos{NEWLINE}(+1, STR_5833 :Cambiar el formato de fecha a usar en el juego. STR_5834 :Selecciona el dispositivo de sonido que OpenRCT2 debe usar. STR_5835 :Silenciar el juego si la ventana pierde el foco. -STR_5836 :Selecciona la música usada en el menú principal.{NEWLINE}Seleccionar el tema de RCT1 requiere copiar el archivo ‘data/css17.dat’ de la carpeta de RCT1 a ‘data/css50.dat’ en la carpeta de RCT2, o establece la ruta de RCT1 en ‘Otras Opciones’. +STR_5836 :Selecciona la música usada en el menú principal.{NEWLINE}Seleccionar el tema de RCT1 requiere establecer la ruta a RCT1 en las Opciones Avanzadas. STR_5837 :Crea y gestiona tus temas personalizados de la interfaz. STR_5838 :Mostrar un botón separado para las finanzas en la barra de herramienta superior. STR_5839 :Mostrar un botón separado para la investigación y desarrollo en la barra de herramienta superior. @@ -3432,7 +3430,7 @@ STR_6318 :Desincronización detectada.{NEWLINE}Log: {STRING} STR_6319 :Bloque de frenado cerrado STR_6320 :Indestructible STR_6321 :Agregado está roto -STR_6322 :{WINDOW_COLOUR_2}Id sprite: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}ID de la Entidad: {BLACK}{INT32} STR_6323 :Simulando STR_6324 :Simular STR_6325 :Simular Atracción @@ -3481,7 +3479,7 @@ STR_6368 :Por razones de compatibilidad, no se recomienda correr OpenRCT2 sob STR_6369 :Permitir construir en alturas inválidas STR_6370 :Permite construir rieles y piezas en cualquier intervalo de alturas STR_6371 :La ruta especificada contiene una instalación de RCT1, pero el archivo ‘csg1i.dat’ no existe. Este archivo NECESITA ser copiado desde el CD de RCT Deluxe o Loopy Landscapes, a la carpeta “Data” dentro de la instalación de RollerCoaster Tycoon 1 en tu disco duro. -STR_6372 :La ruta especificada contiene una instalación de RCT1, pero esta versión no es correcta. OpenRCT2 NECESITA una versión de RCT Deluxe o Loopy Landscapes para poder usar los archivos de Roller Coaster Tycoon 1. +STR_6372 :La ruta especificada contiene una instalación de RCT1, pero esta versión no es correcta. OpenRCT2 NECESITA una versión de RCT Deluxe o Loopy Landscapes para poder usar los Recursos de Roller Coaster Tycoon 1. STR_6373 :Habilitar comprobación de gálibo STR_6374 :G STR_6375 :Paseo Desconocido @@ -3599,9 +3597,7 @@ STR_6487 :Alternar empleados invisibles STR_6488 :{RED}Los visitantes se quejan de la longitud de las colas en tu parque.{NEWLINE}Considera acortar las colas problemáticas o aumentar el rendimiento de las atracciones. STR_6489 :{RED}ERROR: Versión de parque incompatible STR_6490 :{RED}ADVERTENCIA: Versión de parque no del todo compatible -STR_6491 :Este parque fue guardado en una versión más reciente de OpenRCT2. Este parque es de la versión {INT32} y requiere al menos {INT32}. STR_6492 :Este parque fue guardado en una versión más antigua de OpenRCT2 y no puede abrirse con esta versión de OpenRCT2. Este parque es la versión {INT32}. -STR_6493 :Este parque fue guardado en una versión más reciente de OpenRCT2, algunos datos podrían perderse. Este parque es de la versión {INT32} y requiere al menos {INT32}. STR_6494 :Agrupar por tipo de atracción STR_6495 :Agrupar las atracciones por tipo en vez de mostrar cada vehículo por separado. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3623,11 +3619,27 @@ STR_6511 :Giro de Gravedad Cero (der) STR_6512 :Giro de Gravedad Cero grande (izq) STR_6513 :Giro de Gravedad Cero grande (der) STR_6514 :¡Altura no válida! -STR_6515 :{BLACK}RCT1 no ha sido enlazado - se utilizarán imágenes alternativas. -STR_6516 :Uno o más objetos añadidos requieren haber enlazado RTC1 para su correcta visualización. Se utilizarán imágenes alternativas. -STR_6517 :Uno o más objetos de este parque requieren haber enlazado RTC1 para su correcta visualización. Se utilizarán imágenes alternativas. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 no ha sido enlazado - se utilizarán imágenes alternativas. +STR_6516 :Uno o más objetos añadidos requieren haber enlazado RollerCoaster Tycoon 1 para su correcta visualización. Se utilizarán imágenes alternativas. +STR_6517 :Uno o más objetos de este parque requieren haber enlazado RollerCoaster Tycoon 1 para su correcta visualización. Se utilizarán imágenes alternativas. STR_6518 :{BLACK}Posa el ratón sobre un escenario para ver su descripción y objetivos. Haz click para empezar a jugar. STR_6519 :Extras +STR_6520 :Paquetes de Recursos +STR_6521 :Prioridad baja +STR_6522 :Prioridad alta +STR_6523 :Disminuir la prioridad del paquete de recursos seleccionado. +STR_6524 :Aumentar la prioridad del paquete de recursos seleccionado. +STR_6525 :Recargar todos los recursos del juego con los paquete de recursos activados. +STR_6526 :(gráficos, música y efectos de sonido base) +STR_6527 :Competiciones +STR_6528 :¡Párametros de la vía no válidos! +STR_6529 :¡Parámatro del esquema de color no válido! +STR_6530 :User Created Expansion Set +STR_6531 :La Máquina del Tiempo +STR_6532 :Mundo de Katy +STR_6533 :{WINDOW_COLOUR_2}Factor de emoción: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Factor de intensidad: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Factor de náusea: {BLACK}-{COMMA16}% ############## # Escenarios # @@ -4079,36 +4091,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Techo -[TTRFWD01] -STR_NAME :Techo - -[TTRFWD02] -STR_NAME :Techo - -[TTRFWD03] -STR_NAME :Techo - -[TTRFWD04] -STR_NAME :Techo - -[TTRFWD05] -STR_NAME :Techo - -[TTRFWD06] -STR_NAME :Techo - -[TTRFWD07] -STR_NAME :Techo - -[TTRFWD08] -STR_NAME :Techo - -[ACWW33] -STR_NAME :Pared de Madera - -[ACWWF32] -STR_NAME :Pared de Madera - ## End OpenRCT2 Official ############################################################################### @@ -4415,3 +4397,101 @@ STR_DTLS :Este antiguo parque temático ha visto tiempos mejores. Ayuda al pr STR_SCNR :Mundo Panda STR_PARK :Mundo Panda STR_DTLS :Añade más atracciones y consigue más visitantes en este parque pandatemático. + +### + +STR_SCNR :Loma del cementerio +STR_PARK :Loma del cementerio +STR_DTLS :Esto es halloween, el Halloween UCES, ¡las calabazas gritan en la oscuridad de la noche! Este cementerio está en problemas y tu trabajo es salvarlo, ¡mientras dejas que los muertos descansen en paz! ¿Podrás mantener a los fantasmas en sus tumbas y escalofriar a tus clientes?{NEWLINE}Autor: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :El Faro de Alejandría +STR_PARK :El Faro de Alejandría +STR_DTLS :Alejandro construyó la ciudad; griegos, romanos y egipcios dejaron su huella. Pero el mayor honor fue una Maravilla del Mundo Antiguo - el Faro. ¡Visítalo y construye un parque!{NEWLINE}Autor: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :Tal y como era en el día de su inauguración - 18 de mayo de 1905.{NEWLINE}Autor: Aetherwave + + +STR_SCNR :Monte Vesubio +STR_PARK :Monte Vesubio +STR_DTLS :Pompeya y Herculano fueron sepultadas por el Vesubio en el año 79 d.C. ¡Visita las excavaciones y construye un parque!{NEWLINE}Autor: Katatude + + +STR_SCNR :La caja de arena +STR_PARK :La caja de arena +STR_DTLS :Lo que todo el mundo quiere - ¡una caja de arena! Así que coge tu cubito y pala, ¡y a construir un parque!{NEWLINE}Autor: Katatude + + +STR_SCNR :Cataratas y Cañón del Niágara +STR_PARK :Cataratas del Niágara +STR_DTLS :La catarata Estadounidense, la catarata Velo de Novia y la catarata Canadiense en la frontera del Niágara, 1850.{NEWLINE}Autor: Katatude + + +STR_SCNR :Mineros de las Montañas Rocosas +STR_PARK :Mineros de las Montañas Rocosas +STR_DTLS :Un desprendimiento de rocas ha dañado tu ferrocarril. Tus trabajadores se han ido de exploración. ¿Hay oro en las montañas rusas?{NEWLINE}Autores: Squid, Buckone, Fossil + + +STR_SCNR :La Máquina del Tiempo +STR_PARK :La Máquina del Tiempo +STR_DTLS :La Máquina del Tiempo. Construida para ir - cuando quieras, donde quieras. La eternidad espera. Todo es relativo.{NEWLINE}Autor: Katatude + + +STR_SCNR :Torre de Babel +STR_PARK :Torre de Babel +STR_DTLS :¡Whoaa! ¡Mira dónde nos ha llevado la Máquina del Tiempo! ¿Dónde se ha ido todo el mundo?{NEWLINE}Autor: Fossil + + +STR_SCNR :Transformación +STR_PARK :Transformación +STR_DTLS :Te estábamos esperando…{NEWLINE}Autor: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :Los romanos están cansados de las aburridas luchas de gladiadores. Dales una emoción mejor, ¡convierte una ciudad romana en el mayor parque de atracciones de todos los tiempos!{NEWLINE}Autor: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Bajo el Árbol de Navidad +STR_PARK :País de las Maravillas Invernal +STR_DTLS :Mamá construyó esta escena bajo nuestro árbol. ¡Ahora quiere que construyamos un parque en ella! ¿Puedes ayudar?{NEWLINE}Autor: Katatude + + +STR_SCNR :Explosión en Rocagrande +STR_PARK :Explosión en Rocagrande +STR_DTLS :Tras una explosión en la Compañía Minera Rocagrande, los habitantes de Rocagrande tienen que construir un parque de atracciones para mantener vivo su pueblo.{NEWLINE}Autores: rbarclay & buckone + + +STR_SCNR :Campamento Ruiseñor +STR_PARK :Campamento Ruiseñor +STR_DTLS :¡Sólo 500$/semana para ir a este campamento de verano! Abre tu banco y después diviértete construyendo un parque. {NEWLINE}Autor: Katatude + + +STR_SCNR :Pueblo Choo-Choo +STR_PARK :Pueblo Choo-Choo +STR_DTLS :¡Mami! ¡Papi! !Quiero ir al pueblo Coo-Choo!{NEWLINE}Autor: Fossil + + +STR_SCNR :Archipiélago Dragon +STR_PARK :Archipiélago Dragon +STR_DTLS :¿Archipiélago Dragon? No estoy seguro de querer ir ahí…{NEWLINE}Autor: Fossil + + +STR_SCNR :Carnaval Infantil II +STR_PARK :Carnaval Infantil +STR_DTLS :¡Hey, chavales! ¡Vamos a divertirnos!{NEWLINE}Autores: Piehead & Fossil + + +STR_SCNR :Sand Dune +STR_PARK :Sand Dune +STR_DTLS :Como propietario de un pequeño parque, has comprado un gran terreno junto a la playa para ampliarlo y atraer a más visitantes a las hermosas dunas, pero cuidado: no puedes perturbar esas dunas ecológicamente frágiles.{NEWLINE}Autor: rbarclay diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index 8023236afe..26aa2eb205 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -2715,8 +2715,6 @@ STR_5503 :Anna isäntänimi tai IP-osoite: STR_5504 :Näytä moninpelin tilanne STR_5505 :Yhdistäminen ei onnistunut. STR_5506 :Kävijät eivät piittaa intensiteetistä -STR_5508 :Salli lataus väärästä tarkistussummasta huolimatta -STR_5509 :Sallii skenaarioiden ja tallennustiedostojen latauksen vaikka tarkistussumma olisi väärä, kuten esim. demoskenaariot tai vaurioituneet tallennukset. STR_5510 :Oletusäänilaite STR_5511 :(TUNTEMATON) STR_5512 :Tallenna peli nimellä @@ -3600,9 +3598,7 @@ STR_6487 :Läpinäkyvä henkilöstö -kytkin STR_6488 :{RED}Kävijät valittavat pitkistä jonoista puistosi laitteisiin.{NEWLINE}Lyhennä ongelmallisia jonotusalueita, tai korota laitteiden kapasiteettia. STR_6489 :Virhe: Yhteensopimaton puistoversio STR_6490 :Varoitus: Jokseenkin yhteensopiva puistoversio -STR_6491 :Tämä puisto on tallennettu uudemmalla OpenRCT2-versiolla. Puisto on v{INT32} ja vaatii vähintään v{INT32}. STR_6492 :Tämä puisto on tallennettu vanhemmalla OpenRCT2-versiolla, eikä sitä voi avata tällä peliversiolla. Puisto on v{INT32}. -STR_6493 :Tämä puisto on tallennettu uudemmalla OpenRCT2-versiolla, ja jotkin tiedot ovat saattaneet kadota. Puisto on v{INT32} ja vaatii vähintään v{INT32}. STR_6494 :Ryhmitä laitetyypittäin STR_6495 :Ryhmitä laitteet laitetyypin perusteella, yksittäisten kulkuneuvojen sijaan. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -4060,36 +4056,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Katto -[TTRFWD01] -STR_NAME :Katto - -[TTRFWD02] -STR_NAME :Katto - -[TTRFWD03] -STR_NAME :Katto - -[TTRFWD04] -STR_NAME :Katto - -[TTRFWD05] -STR_NAME :Katto - -[TTRFWD06] -STR_NAME :Katto - -[TTRFWD07] -STR_NAME :Katto - -[TTRFWD08] -STR_NAME :Katto - -[ACWW33] -STR_NAME :Puinen tolppaseinä - -[ACWWF32] -STR_NAME :Puinen tolppaseinä - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index 0cd95cd340..018e0be8bd 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -2719,8 +2719,6 @@ STR_5503 :Saisir nom d’hôte ou adresse IP : STR_5504 :Afficher le statut multijoueur STR_5505 :Impossible de se connecter au serveur STR_5506 :Les visiteurs ignorent l’intensité -STR_5508 :Autor. charg. de fichiers avec une empreinte incorrecte -STR_5509 :Autorise le chargement de scénarios et sauvegardes ayant une empreinte incorrecte, par exemple les scénarios de la démo ou des sauvegardes corrompues STR_5510 :Périphérique audio par défaut STR_5511 :(UNKNOWN) STR_5512 :Sauvegarder partie sous @@ -3004,7 +3002,7 @@ STR_5832 :Affiche les hauteurs comme des unités génériques au lieu des uni STR_5833 :Change le format de date utilisé STR_5834 :Sélectionne le périphérique audio que doit utiliser OpenRCT2 STR_5835 :Coupe le son du jeu si la fenêtre passe à l’arrière-plan -STR_5836 :Sélectionne la musique du menu principal.{NEWLINE}La musique RCT1 nécessite que vous copiiez et renommiez le fichier {SMALLFONT}data/css17.dat{MEDIUMFONT} de votre dossier RCT1 en data/{SMALLFONT}css50.dat{MEDIUMFONT} dans votre dossier RCT2, ou que vous ayez défini le chemin d’installation de RCT1 dans les options diverses. +STR_5836 :Sélectionne la musique jouée dans le menu principal.{NEWLINE}Sélectionner le thème de RCT1 nécessite que le chemin d’installation de RCT1 soit défini dans les options avancées. STR_5837 :Créer et gérer des thèmes d’interface personnalisés STR_5838 :Affiche un bouton séparé pour les options financières dans la barre d’outils STR_5839 :Affiche un bouton séparé pour la recherche et développement dans la barre d’outils @@ -3437,7 +3435,7 @@ STR_6318 :Desynchronisation réseau détectée.{NEWLINE}Fichier journal : {S STR_6319 :Bloc de frein fermé STR_6320 :Indestructible STR_6321 :L’ajout est cassé -STR_6322 :{WINDOW_COLOUR_2}Identifiant image-objet : {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}ID de l’entité : {BLACK}{INT32} STR_6323 :Simulation STR_6324 :Simuler STR_6325 :Simule l’attraction @@ -3604,9 +3602,9 @@ STR_6487 :Employés invisibles STR_6488 :{RED}Les visiteurs se plaignent de la longueur des files d’attente dans votre parc.{NEWLINE}Songez à raccourcir les files problématiques ou à augmenter la capacité des attractions. STR_6489 :Erreur : Version de parc incompatible STR_6490 :Avertissement : Version de parc semi-compatible -STR_6491 :Ce parc a été sauvegardé dans une version plus récente d’OpenRCT2. Il est à la version {INT32} et requiert au moins la version {INT32}. -STR_6492 :Ce parc a été sauvegardé dans une ancienne version d’OpenRCT2, et ne peut être ouvert avec cette version. Il est à la version {INT32}. -STR_6493 :Ce parc a été sauvegardé dans une version plus récente d’OpenRCT2, certaines données pourraient être perdues. Il est à la version {INT32} et requiert au moins la version {INT32}. +STR_6491 :Ce parc a été sauvegardé dans une version plus récente d’OpenRCT2. Il a été sauvegardé avec la version {INT32} et requiert au moins la version {INT32}. Vous utilisez la version {INT32}. +STR_6492 :Ce parc a été sauvegardé dans une ancienne version d’OpenRCT2, et ne peut être ouvert avec cette version. Il a été sauvegardé avec la version {INT32}. +STR_6493 :Ce parc a été sauvegardé dans une version plus récente d’OpenRCT2, certaines données pourraient être perdues. Il a été sauvegardé avec la version {INT32}, vous utilisez la version {INT32}. STR_6494 :Grouper par type d’attraction STR_6495 :Groupe les attractions par type au lieu d’afficher chaque véhicule indépendamment. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3628,11 +3626,28 @@ STR_6511 :Zero-G roll (droite) STR_6512 :Grand zero-G roll (gauche) STR_6513 :Grand zero-G roll (droite) STR_6514 :Hauteur invalide ! -STR_6515 :{BLACK}RCT1 pas lié — des images de secours seront utilisées. -STR_6516 :Un ou plusieurs des objets ajoutés nécessitent que RCT1 soit lié pour être affichés correctement. Des images de secours seront utilisées. -STR_6517 :Un ou plusieurs objets de ce parc nécessitent que RCT1 soit lié pour être affichés correctement. Des images de secours seront utilisées. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 pas lié — des images de secours seront utilisées. +STR_6516 :Un ou plusieurs des objets ajoutés nécessitent que RollerCoaster Tycoon 1 soit lié pour être affichés correctement. Des images de secours seront utilisées. +STR_6517 :Un ou plusieurs objets de ce parc nécessitent que RollerCoaster Tycoon 1 soit lié pour être affichés correctement. Des images de secours seront utilisées. STR_6518 :{BLACK}Survolez un scénario pour afficher sa description et son objectif. Cliquez pour commencer à jouer. STR_6519 :Extras +STR_6520 :Packs de ressources +STR_6521 :Priorité basse +STR_6522 :Priorité haute +STR_6523 :Réduit la priorité du pack de ressources sélectionné +STR_6524 :Augmente la priorité du pack de ressources sélectionné +STR_6525 :Recharge toutes les ressources du jeu avec les packs de ressources sélectionnés +STR_6526 :(graphismes, musiques et effets sonores de base) +STR_6527 :Compétitions +STR_6528 :Paramètres de voie invalides ! +STR_6529 :Paramètre de palette de couleurs invalide ! +STR_6530 :User Created Expansion Set +STR_6531 :La machine temporelle +STR_6532 :Le monde de Katy +STR_6533 :{WINDOW_COLOUR_2}Indice d’excitation : {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Indice d’intensité : {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Indice de nausée : {BLACK}-{COMMA16}% +STR_6536 :Ce parc a été sauvegardé dans une version plus récente d’OpenRCT2. Il a été sauvegardé avec la version {INT32}, vous utilisez la version {INT32}. ############# # Scenarios # @@ -4378,6 +4393,104 @@ STR_SCNR :Monde de Panda STR_PARK :Monde de Panda STR_DTLS :Ajoutez davantage d’attractions et attirez plus de visiteurs avec ce parc autour du thème du panda +### + +STR_SCNR :Crête du cimetière +STR_PARK :Crête du cimetière +STR_DTLS :C’est Halloween, l’Halloween UCES, les citrouilles hurlent au milieu de la nuit ! Ce cimetière est en mauvaise posture et vous devez le sauver, tout en laissant les défunts reposer en paix ! Pouvez-vous garder les fantômes dans leurs tombes et faire frissonner vos clients ?{NEWLINE}Par : Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :Le Phare d’Alexandrie +STR_PARK :Le Phare d’Alexandrie +STR_DTLS :Alexandre a bâti la cité ; les Grecs, les Romains, les Égyptiens y ont laissé leur marque. Mais le plus grand accomplissement était une merveille de l’ancien monde — le Phare. Venez visiter et bâtir un parc !{NEWLINE}Par : Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :Comme à son jour d’ouverture — 18 mai 1905.{NEWLINE}Par : Aetherwave + + +STR_SCNR :Le mont Vésuve +STR_PARK :Le mont Vésuve +STR_DTLS :Pompeii and Herculaneum were buried by Mt. Vesuvius in 79 A.D. Visit the excavations and build a park!{NEWLINE}Author: Katatude + + +STR_SCNR :Le bac à sable +STR_PARK :Le bac à sable +STR_DTLS :Ce que tout le monde veut — un bac à sable ! Alors prenez votre pelle et votre rateau et contruisez un parc !{NEWLINE}Par : Katatude + + +STR_SCNR :Gorges et chutes du Niagara +STR_PARK :Chutes du Niagara +STR_DTLS :Les chutes américaines, les chutes du Voile de la Mariée et les chutes du Fer-à-Cheval sur la frontière du Niagara, 1850.{NEWLINE}Par : Katatude + + +STR_SCNR :Mineurs des montagnes rocailleuses +STR_PARK :Mineurs des montagnes rocailleuses +STR_DTLS :Un glissement de terrain a endommagé votre chemin de fer. Vos travailleurs sont partis prospecter. Y a-t-il de l’or dans les montagnes russes ?{NEWLINE}Par : Squid, Buckone, Fossil + + +STR_SCNR :La machine temporelle +STR_PARK :La machine temporelle +STR_DTLS :La machine temporelle. Construite pour partir — quand vous voulez, où vous voulez. L’éternité attends. Tout est relatif.{NEWLINE}Par : Katatude + + +STR_SCNR :La tour de Babel +STR_PARK :La tour de Babel +STR_DTLS :Ouaah ! Regardez où la machine temporelle nous a emmené ! Où est tout le monde ?{NEWLINE}Par : Fossil + + +STR_SCNR :Transformation +STR_PARK :Transformation +STR_DTLS :Nous vous attendions…{NEWLINE}Par : Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :Les Romains sont lassés des combats de gladiateurs ennuyants. Donnez-leur plus de frissons, faîtes d’une cité romaine le meilleur parc d’attractions de tous les temps !{NEWLINE}Par : Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Sous le sapin de Noël +STR_PARK :Pays de l’hiver +STR_DTLS :Maman a construit cette scène sous notre sapin. Maintenant elle veut qu’un parc y soit construit ! Pouvez-vous aider ?{NEWLINE}Par : Katatude + + +STR_SCNR :Explosion à Groscailloux +STR_PARK :Explosion à Groscailloux +STR_DTLS :Après une explosion à la Compagnie de Minage de Groscailloux, les habitants de Groscailloux doivent bâtir un parc d’attractions pour garder leur ville vivante.{NEWLINE}Par : rbarclay & buckone + + +STR_SCNR :Camp du geai moqueur +STR_PARK :Camp du geai moqueur +STR_DTLS :Seulement 500€ par semaine pour ce camp d’été ! Cassez votre tirelire et venez vous amuser et construire un parc.{NEWLINE}Par : Katatude + + +STR_SCNR :Tchoutchouville +STR_PARK :Tchoutchouville +STR_DTLS :Maman ! Papa ! Je veux aller à Tchoutchouville !{NEWLINE}Par : Fossil + + +STR_SCNR :Archipel du dragon +STR_PARK :Archipel du dragon +STR_DTLS :Archipel du dragon ? Je ne suis pas sûr de vouloir y aller…{NEWLINE}Par : Fossil + + +STR_SCNR :Carnaval des enfants II +STR_PARK :Carnaval des enfants +STR_DTLS :Eh les enfants ! Amusons-nous !{NEWLINE}Par : Piehead & Fossil + + +STR_SCNR :Dune ensablée +STR_PARK :Dune ensablée +STR_DTLS :En tant que propriétaire d’un petit parc, vous avez acheté un grand terrain le long de la plage pour vous étendre et attirer plus de visiteurs dans ces magnifiques dunes de sable, mais attention : vous ne pouvez pas perturber de fragile écosystème.{NEWLINE}Par : rbarclay + ########### # Scenery # ########### @@ -4387,34 +4500,4 @@ STR_DTLS :Ajoutez davantage d’attractions et attirez plus de visiteurs avec [TTPIRF05] STR_NAME :Toit -[TTRFWD01] -STR_NAME :Toit - -[TTRFWD02] -STR_NAME :Toit - -[TTRFWD03] -STR_NAME :Toit - -[TTRFWD04] -STR_NAME :Toit - -[TTRFWD05] -STR_NAME :Toit - -[TTRFWD06] -STR_NAME :Toit - -[TTRFWD07] -STR_NAME :Toit - -[TTRFWD08] -STR_NAME :Toit - -[ACWW33] -STR_NAME :Tableau d’affichage en bois - -[ACWWF32] -STR_NAME :Tableau d’affichage en bois - ## End OpenRCT2 Official diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 9ea42f5203..25a10016e4 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -153,6 +153,7 @@ STR_0566 :Különálló hullámvasút-kocsik száguldanak egy szoros, cikcakk STR_0567 :A pálya mindkét oldalán felfüggesztett ülésekben ülve az utasok bukfencezve forognak, miközben meredek eséseken és különböző fordítókon haladnak át STR_0569 :A pálya alatti speciális rögzítőhámokban utazva az utasok megtapasztalhatják a repülés élményét, ahogy szelik a levegőt STR_0571 :Kör alakú autók forognak körbe-körbe, miközben a cikkcakkos fa pályán haladnak +STR_0572 :A nagy kapacitású csónakok egy széles vízcsatornán haladnak, felfelé a lejtőkön futószalagon, majd a meredek lejtőkön lefelé gyorsulva óriási csobbanással áztatják el az utasokat STR_0573 :Motoros, helikopter formájú kocsik haladnak egy acélpályán, a pedálozó utasok irányításával STR_0578 :A kocsik egy abroncsokkal körbefogott, meredek esésekkel és palástorsókkal teli pálya mentén haladnak STR_0579 :Egy enyhe minigolf-játék @@ -907,7 +908,7 @@ STR_1522 :„{STRINGID} esernyője igazán megéri az árát” STR_1523 :„{STRINGID} üdítője igazán megéri az árát” STR_1524 :„{STRINGID} hamburgere igazán megéri az árát” STR_1525 :„{STRINGID} sült krumplija igazán megéri az árát” -STR_1526 :„{STRINGID} jégkréme igazán megéri az árát” +STR_1526 :„{STRINGID} jégkrémje igazán megéri az árát” STR_1527 :„{STRINGID} vattacukra igazán megéri az árát” STR_1528 : STR_1529 : @@ -941,7 +942,7 @@ STR_1556 :„{STRINGID} esernyője túl sokba kerül számomra” STR_1557 :„{STRINGID} üdítője túl sokba kerül számomra” STR_1558 :„{STRINGID} hamburgere túl sokba kerül számomra” STR_1559 :„{STRINGID} sült krumplija túl sokba kerül számomra” -STR_1560 :„{STRINGID} jégkréme túl sokba kerül számomra” +STR_1560 :„{STRINGID} jégkrémje túl sokba kerül számomra” STR_1561 :„{STRINGID} vattacukra túl sokba kerül számomra” STR_1562 : STR_1563 : @@ -2187,9 +2188,9 @@ STR_3121 :Nem található gépész, vagy az összes közeli gépész elfoglal STR_3122 :{WINDOW_COLOUR_2}Kedvenc játéka: {BLACK}{COMMA16} vendégnek STR_3123 :{WINDOW_COLOUR_2}Kedvenc játéka: {BLACK}{COMMA16} vendégnek STR_3124 :Hibás {STRINGID} -STR_3125 :{WINDOW_COLOUR_2}Izgalmi tényező: {BLACK}+{COMMA16}% -STR_3126 :{WINDOW_COLOUR_2}Intenzitási tényező: {BLACK}+{COMMA16}% -STR_3127 :{WINDOW_COLOUR_2}Émelygési tényező: {BLACK}+{COMMA16}% +STR_3125 :{WINDOW_COLOUR_2}Izgalmi faktor: {BLACK}+{COMMA16}% +STR_3126 :{WINDOW_COLOUR_2}Intenzitási faktor: {BLACK}+{COMMA16}% +STR_3127 :{WINDOW_COLOUR_2}Émelygési faktor: {BLACK}+{COMMA16}% STR_3128 :Játékterv mentése STR_3129 :Játékterv mentése díszletekkel STR_3130 :Mentés @@ -2207,6 +2208,7 @@ STR_3141 :Nem lehetséges többkörös utazás kábeles felvonószakasszal STR_3142 :{WINDOW_COLOUR_2}Befogadóképesség: {BLACK}{STRINGID} STR_3143 :Emberek megjelenítése a térképen STR_3144 :Játékok és bódék megjelenítése a térképen +STR_3160 :{SMALLFONT}{BLACK}A körök számának menetenkénti beállítása STR_3162 :Nem lehet elég memóriát lefoglalni STR_3163 :Új adat telepítése: STR_3164 :{BLACK}{COMMA16} kiválasztva (maximum {COMMA16}) @@ -2261,6 +2263,11 @@ STR_3217 :Birtokolt föld STR_3218 :Birtokolt építési jogok STR_3219 :Eladó föld STR_3220 :Eladó építési jogok +STR_3221 :{SMALLFONT}{BLACK}A park tulajdonába tartozó földterületek kijelölése +STR_3222 :{SMALLFONT}{BLACK}Kizárólag a park tulajdonában lévő építési jogok kijelölése +STR_3223 :{SMALLFONT}{BLACK}A park által megvásárolható földterületek kijelölése +STR_3224 :{SMALLFONT}{BLACK}A park által megvásárolható építési jogok kijelölése +STR_3225 :{SMALLFONT}{BLACK}A kiválasztott pozíció körül objektumok véletlenszerű halmazának építése be/ki STR_3226 :Parkbejárat építése STR_3227 :Túl sok a parkbejárat! STR_3228 :Kezdő pozíciók megadása az emberek számára @@ -2427,7 +2434,7 @@ STR_5120 :Pénzügyek STR_5121 :Kutatás STR_5122 :A játékok pályatípus szerinti kiválasztása (mint az RCT1-ben) STR_5123 :Játékok felújítása -STR_5125 :Minden lerombolható +STR_5125 :Minden rombolható STR_5126 :Véletlenszerű főcímzene STR_5128 :Kiválasztás mérete STR_5129 :Add meg a kiválasztás méretét {COMMA16} és {COMMA16} között @@ -2696,8 +2703,6 @@ STR_5503 :Add meg a gépnevet vagy IP-címet: STR_5504 :A többjátékos mód állapota STR_5505 :Nem lehet csatlakozni a szerverhez. STR_5506 :Vendégeket nem érdeklik az intenzitások -STR_5508 :Hibás ellenőrző összegű fájlok engedélyezése -STR_5509 :Engedélyezi a hibás ellenőrző összeggel{NEWLINE}rendelkező pályák és mentések{NEWLINE}betöltését, mint például a próbaverzió pályái vagy a sérült mentések. STR_5510 :Alapértelmezett hangeszköz STR_5511 :(ISMERETLEN) STR_5512 :Játék mentése másként @@ -2933,7 +2938,7 @@ STR_5784 :{BLACK}Teljesíts korábbi pályákat a feloldásához. STR_5785 :A csoport nem nevezhető át… STR_5786 :Érvénytelen csoportnév STR_5787 :{COMMA32} játékos van online -STR_5788 :Alapértelmezett ellenőrzési idő: +STR_5788 :Alap ellenőrzési időköz: STR_5789 :Villámhatás kikapcsolása STR_5791 :Az összes játék megbízhatóságát 100%-ra{NEWLINE}állítja és visszaállítja az építési idejüket „idén”-re STR_5792 :Megjavítja az összes meghibásodott játékot @@ -2971,20 +2976,28 @@ STR_5823 :Nagybetűs megjelenítés a hirdetőtáblákon (RCT1-beli viselked STR_5824 :A viharok alatti villámhatás{NEWLINE}kikapcsolása STR_5825 :Az egérmutató maradjon az ablakon belül STR_5826 :A látkép jobb egeres húzásának invertálása +STR_5827 :{SMALLFONT}{BLACK}A felhasználói felület színsémájának beállítása +STR_5828 :{SMALLFONT}{BLACK}Megváltoztatja a távolságok, sebesség stb. mérési formátumát. +STR_5829 :{SMALLFONT}{BLACK}Megváltoztatja a használatban lévő pénznem formátumot. Tisztán vizuális, a pontos árfolyam nincs implementálva. STR_5830 :A játék által használt nyelv megváltoztatása STR_5831 :A hőmérséklet kijelzéséhez{NEWLINE}használt mértékegység megváltoztatása. +STR_5832 :{SMALLFONT}{BLACK}A magasság általános mértékegységként való megjelenítése a "Távolság és sebesség" alatt beállított mérési formátum helyett STR_5833 :A játék által használt dátumformátum megváltoztatása STR_5834 :Az OpenRCT2 által használt hangeszköz kiválasztása STR_5835 :A játék némítása, ha az ablak elveszti a fókuszt -STR_5836 :A főmenüben használt zene kiválasztása.{NEWLINE}Az RCT1 témája csak akkor választható, ha az RCT1 játékmappájából a ’data/css17.dat’-ot átmásolod az RCT2 mappán belül a ’data/css50.dat’-ba, vagy megadod az RCT1 útvonalát az Egyéb fülön. +STR_5836 :A főmenüben használt zene kiválasztása.{NEWLINE}Az RCT1 témája csak akkor választható, ha megadod az RCT1 útvonalát a Haladó fülön. +STR_5837 :{SMALLFONT}{BLACK}Egyéni felhasználói felület témák létrehozása és kezelése STR_5838 :Külön gomb a pénzügyi ablak számára az eszköztáron STR_5839 :Külön gomb a kutatás-fejlesztés ablak számára az eszköztáron STR_5840 :Külön gomb a csalások ablak számára az eszköztáron STR_5841 :Külön gomb a legutóbbi hírek ablak számára az eszköztáron +STR_5842 :{SMALLFONT}{BLACK}A pályák nehézségük (RCT2-beli viselkedés) vagy forrásjátékuk (RCT1-beli viselkedés) szerinti fülekre csoportosítása STR_5843 :A pályák progresszív feloldásának engedélyezése (RCT1-beli viselkedés) STR_5844 :Tartsa fenn a kapcsolatot a többjátékos{NEWLINE}szerverrel akkor is, ha szinkronizációs vagy egyéb hiba jelentkezik STR_5845 :Hozzáadja a hibakereső{NEWLINE}eszközök gombját az eszköztárhoz.{NEWLINE}Engedélyezi a fejlesztői konzol gyorsbillentyűjét +STR_5846 :{SMALLFONT}{BLACK}Az OpenRCT2 milyen gyakran mentsen automatikusan STR_5849 :Az újonnan felvett alkalmazottak{NEWLINE}automatikus lerakása +STR_5851 :{SMALLFONT}{BLACK}Az alapértelmezett vizsgálati időköz megadása{NEWLINE}újonnan épített játékokra STR_5853 :A hanghatások be- és kikapcsolása STR_5854 :A játékok zenéjének be- és kikapcsolása STR_5855 :Váltás a hagyományos teljes képernyős,{NEWLINE}keret nélküli teljes képernyős és az{NEWLINE}ablakos megjelenítési módok között @@ -3029,6 +3042,8 @@ STR_5893 :Árfolyam STR_5894 :Írd be az árfolyamot STR_5895 :Terv mentése STR_5896 :Pálya mentése sikertelen! +STR_5898 :{BLACK}A pálya nem tölthető be, lehet, hogy a fájl {newline}sérült, törött vagy hiányzik! +STR_5899 :Festési hibakeresés ablak be/ki STR_5900 :Eredeti rajzolókód használata STR_5901 :Szegmensek magasságának mutatása STR_5902 :Határolókeretek mutatása @@ -3036,6 +3051,8 @@ STR_5904 :Dátum visszaállítása STR_5905 :Térképgeneráló eszköz, amely automatikusan létrehoz egy egyedi tájat STR_5906 :Nagyítás a mutató helyzetére STR_5907 :Ha be van kapcsolva, a nagyítás képernyő közepe helyett a mutatóra közelít +STR_5908 :Tetszőleges játék-változtatások +STR_5909 :{SMALLFONT}{BLACK}Lehetővé teszi a járműtípus szabad megváltoztatását. Összeomlásokat okozhat. STR_5910 :Alkalmazás STR_5911 :Átlátszó utak STR_5912 :Átlátszó utak be/ki @@ -3061,7 +3078,7 @@ STR_5931 :Hirdetőtábla részletei STR_5932 :Sérült elem részletei STR_5933 :Tulajdonságok STR_5934 :Terep textúrája: {BLACK}{STRINGID} -STR_5935 :Terep széle: {BLACK}{STRINGID} +STR_5935 :Terepszegély: {BLACK}{STRINGID} STR_5936 :Földtulajdon: {BLACK}{STRINGID} STR_5937 :Nincs tulajdonban és nem eladó STR_5938 :Vízszint: {BLACK}{COMMA16} @@ -3233,6 +3250,7 @@ STR_6105 :Hiperhullámvasút STR_6107 :Monster Truck-ok STR_6109 :Hiper-csavaró STR_6111 :Klasszikus mini hullámvasút +STR_6115 :Motoros óriás 4x4-es teherautók, amelyek meredek lejtőkön is felhajtanak STR_6119 :Ez a hullámvasút olcsó és könnyen építhető, de csak korlátozott magasságig STR_6120 :{BABYBLUE}Új jármű érhető el {STRINGID} számára:{NEWLINE}{STRINGID} STR_6121 :Kiterjeszti a park által birtokolt területet egészen a térkép széléig @@ -3352,7 +3370,7 @@ STR_6267 :Mezővizsgáló megnyitása STR_6268 :Megállított játék léptetése STR_6269 :Érvénytelen éghajlati ID STR_6270 :Terepfelületek -STR_6271 :Terep szélek +STR_6271 :Terepszegélyek STR_6272 :Állomások STR_6273 :Zene STR_6274 :Nem állítható be színséma… @@ -3394,7 +3412,7 @@ STR_6318 :Hálózati szinkronizációs hiba észlelve.{NEWLINE}Naplófájl: { STR_6319 :Blokkolófék zárva STR_6320 :Elpusztíthatatlan STR_6321 :Törött hozzáadott elem -STR_6322 :{WINDOW_COLOUR_2}Sprite Id: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}Entitás azonosító: {BLACK}{INT32} STR_6323 :Szimuláció folyamatban STR_6324 :Szimulálás STR_6325 :Játék/épület szimulálása @@ -3433,7 +3451,7 @@ STR_6358 :{UINT16}. oldal STR_6359 :{POP16}{POP16}{UINT16}. oldal STR_6360 :{BLACK}{COMMA32} STR_6361 :Fényhatások a játékokon (kísérleti) -STR_6362 :Ha be van kapcsolva, a pályával rendlekező játékokon a járművek éjjel ki lesznek világítva. +STR_6362 :Ha be van kapcsolva, a pályával rendelkező játékokon a járművek éjjel ki lesznek világítva. STR_6363 :A szöveg a vágólapra másolva STR_6364 :{RED}{STRINGID} balesete közben {COMMA16} ember meghalt STR_6365 :Játékok áldozatai @@ -3468,12 +3486,12 @@ STR_6393 :Cél kiválasztása STR_6394 :Cél STR_6395 :Karbantartás STR_6396 :Képernyővédő és a monitor energiagazdálkodása ki -STR_6397 :Ha ki van választva, szüneteltetve lesz a képernyővédő és a monitor egyéb energiagazdálkodásosi funkciói, amíg az OpenRCT2 fut. +STR_6397 :Ha ki van választva, szüneteltetve lesz a képernyővédő és a monitor egyéb energiagazdálkodási funkciói, amíg az OpenRCT2 fut. STR_6398 :A fájl nem támogatott játék-típusokat tartalmaz. Kérlek frissíts egy újabb OpenRCT2 verzióra. STR_6399 :Az OpenRCT2 működéséhez szükség van az eredeti RollerCoaster Tycoon 2 fájljaira. Kérlek állítsd be a „game_path” változót a config.ini-ben arra a mappára, amelybe telepítetted a RollerCoaster Tycoon 2-t, majd indítsd újra az OpenRCT2-t. STR_6400 :Letöltöttem a GOG RollerCoaster Tycoon 2 offline telepítőjét, de nincs telepítve STR_6401 :Már telepítettem a RollerCoaster Tycoon 2-t -STR_6402 :OpenRCT2 adatok beállítása +STR_6402 :OpenRCT2 adatok megadása STR_6403 :Válaszd ki a számodra legmegfelelőbbet STR_6404 :Kérlek válaszd ki a GOG RollerCoaster Tycoon 2 telepítőjét. STR_6405 :GOG telepítő kiválasztása @@ -3509,7 +3527,7 @@ STR_6434 :A jelenlegi gyorsbillentyű összes hozzárendelésének törlése. STR_6435 :{WINDOW_COLOUR_2}Megállított vandálok: {BLACK}{COMMA32} STR_6436 :Láthatatlanság be/ki STR_6437 :Látható -STR_6438 :L +STR_6438 :{MOVE_X}{2}👁 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. @@ -3561,9 +3579,7 @@ STR_6487 :Személyzet elrejtése be/ki STR_6488 :{RED}A vendégek panaszkodnak a parkban a sorok hosszára.{NEWLINE}Próbáld meg a problémás sorokat lerövidíteni, vagy növeld a játékok áteresztőképességét. STR_6489 :Hiba: Nem kompatibilis park verzió STR_6490 :Figyelmeztetés: Félig kompatibilis park verzió -STR_6491 :Ezt a parkot az OpenRCT2 egy későbbi verziójában mentették el. A park v{INT32}, és legalább v{INT32}-t igényel. STR_6492 :Ez a park az OpenRCT2 egy régi verziójában lett elmentve, és nem nyitható meg az OpenRCT2 ezen verziójával. A park v{INT32}. -STR_6493 :Ezt a parkot az OpenRCT2 egy későbbi verziójában mentették el, egyes adatok elveszhetnek. A park v{INT32}, és legalább v{INT32}-t igényel. STR_6494 :Játéktípus szerinti csoportosítás STR_6495 :Csoportosítsa a játékokat a játéktípusok szerint, ahelyett, hogy minden járművet külön-külön mutatna. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3585,11 +3601,26 @@ STR_6511 :Zéró G orsó (jobbra) STR_6512 :Nagy Zéró G orsó (balra) STR_6513 :Nagy Zéró G orsó (jobbra) STR_6514 :Érvénytelen magasság! -STR_6515 :{BLACK}Nincs összekapcsolódás az RCT1-el - tartalékképek lesznek használva. -STR_6516 :Egy vagy több hozzáadott objektum RCT1 összekapcsolást igényel a megfelelő megjelenítéshez. Tartalékképek lesznek használva. -STR_6517 :Egy vagy több objektum ebben a parkban RCT1 összekapcsolást igényel a megfelelő megjelenítéshez. Tartalékképek lesznek használva. +STR_6515 :{BLACK}Nincs összekapcsolódás az RollerCoaster Tycoon 1-el - tartalékképek lesznek használva. +STR_6516 :Egy vagy több hozzáadott objektum RollerCoaster Tycoon 1 összekapcsolást igényel a megfelelő megjelenítéshez. Tartalékképek lesznek használva. +STR_6517 :Egy vagy több objektum ebben a parkban RollerCoaster Tycoon 1 összekapcsolást igényel a megfelelő megjelenítéshez. Tartalékképek lesznek használva. STR_6518 :{BLACK}Vidd az egeret egy pálya fölé a leírás és a cél megtekintéséhez. Kattints rá a játék elindításához. STR_6519 :Extrák +STR_6520 :Asset csomagok +STR_6521 :Alacsony prioritás +STR_6522 :Magas prioritás +STR_6523 :A kiválasztott asset csomag prioritásának csökkentése. +STR_6524 :A kiválasztott asset csomag prioritásának növelése. +STR_6525 :A játék összes assetjének újratöltése az engedélyezett asset csomagokkal. +STR_6526 :(alap grafika, zene és hangeffektek) +STR_6527 :Versenyek +STR_6528 :Érvénytelen pályaparaméterek! +STR_6529 :Érvénytelen színséma-paraméter! +STR_6531 :Az időgép +STR_6532 :Katy álomvilága +STR_6533 :{WINDOW_COLOUR_2}Izgalmi faktor: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Intenzitási faktor: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Émelygési faktor: {BLACK}-{COMMA16}% ############# # Scenarios # @@ -3632,8 +3663,8 @@ STR_PARK :Hármas-sziget STR_DTLS :Egy frissen nyílt park, amelyet több sziget alkot -STR_SCNR :Kati Álomvilága -STR_PARK :Kati Álomvilága +STR_SCNR :Katie Álomvilága +STR_PARK :Katie Álomvilága STR_DTLS :Egy kis méretű vidámpark, pár játékkal és hellyel a terjeszkedéshez - A célod, hogy megduplázd a park értékét @@ -3853,8 +3884,8 @@ STR_PARK :Városi Park STR_DTLS :Egy apró park egyezséget kötött a közeli várossal, amelynek értelmében magán a városon keresztül terjeszkedhet -STR_SCNR :Gotfrid Kertek -STR_PARK :Gotfrid Kertek +STR_SCNR :Gotfrid Kert +STR_PARK :Gotfrid Kert STR_DTLS :Egy nagy kertnek arra van szüksége, hogy sikeres vidámpark legyen belőle @@ -3972,7 +4003,7 @@ STR_DTLS :Ez a néhány okosan tervezett hullámvasúttal rendelkező sivatag STR_SCNR :Törpe Tornyok STR_PARK :Törpe Tornyok -STR_DTLS : Öt meglévő hullámvasutat kell befejezned ebben a kis parkban +STR_DTLS :Öt meglévő hullámvasutat kell befejezned ebben a kis parkban STR_SCNR :Sohamár Park @@ -4038,44 +4069,144 @@ STR_DTLS : ########### ## Start OpenRCT2 Official + [TTPIRF05] STR_NAME :Tető -[TTRFWD01] -STR_NAME :Tető - -[TTRFWD02] -STR_NAME :Tető - -[TTRFWD03] -STR_NAME :Tető - -[TTRFWD04] -STR_NAME :Tető - -[TTRFWD05] -STR_NAME :Tető - -[TTRFWD06] -STR_NAME :Tető - -[TTRFWD07] -STR_NAME :Tető - -[TTRFWD08] -STR_NAME :Tető - -[ACWW33] -STR_NAME :Fa sánckerítés - -[ACWWF32] -STR_NAME :Fa sánckerítés - ## End OpenRCT2 Official ############################################################################### ## RCT2 Scenarios ############################################################################### + +STR_SCNR :Alpesi Kalandok +STR_PARK :Alpesi Kalandok +STR_DTLS :Alakíts át egy kis hegyi síközpontot havas témájú vidámparkká + + +STR_SCNR :Barátság Repülőtér +STR_PARK :Barátság Repülőtér +STR_DTLS :Építs egy repülés témájú vidámparkot ezen az elhagyatott repülőtéren + + +STR_SCNR :Botanikus Hullámok +STR_PARK :Botanikus Hullámok +STR_DTLS :A kihívásod az, hogy építs egy igazán nyereséges parkot ezen a paradicsomi szigeten... + + +STR_SCNR :Építsd meg a saját Six Flags Belgiumodat +STR_PARK :Six Flags Belgium +STR_DTLS :Építsd meg a saját változatodat ebből európai Six Flags parkból! + + +STR_SCNR :Építsd meg a saját Six Flags Great Adventure-ödet +STR_PARK :Six Flags Great Adventure +STR_DTLS :Használd a tervezői képességeidet, hogy újraalkosd ezt a Six Flags parkot + + +STR_SCNR :Építsd meg a saját Six Flags Hollandodat +STR_PARK :Six Flags Holland +STR_DTLS :Építsd meg ezt az európai Six Flags parkot úgy, ahogyan szeretnéd + + +STR_SCNR :Építsd meg a saján Six Flags Magic Mountain-edet +STR_PARK :Six Flags Magic Mountain +STR_DTLS :Készítsd el a saját verziódat ebből a hatalmas Six Flags parkból! + + +STR_SCNR :Építsd meg a saját Six Flags over Texasodat +STR_PARK :Six Flags over Texas +STR_DTLS :A semmiből kiindulva, építsd meg ebben a Six Flags parkban a hullámvasutakat! + + +STR_SCNR :Építsd meg a saját Six Flags parkodat +STR_PARK :Six Flags +STR_DTLS :Építsd meg a saját Six Flags parkodat - vagy építs más Six Flags parkokból származó játékokat, vagy tervezz és építs saját játékokat. + + +STR_SCNR :Bumfordi Bazár +STR_PARK :Bumfordi Bazár +STR_DTLS :Egy kis piaci bazárral indulva, a kihívásod a boltok és bódék nyereségének növelése azzal, hogy több vendéget vonzol be játékok és hullámvasutak építésével + + +STR_SCNR :Őrült Kastély +STR_PARK :Őrült Kastély +STR_DTLS :Örököltél egy nagy kastélyt. Az a feladatod, hogy átalakítsd egy kis vidámparkká. + + +STR_SCNR :Poros Golfpálya +STR_PARK :Poros Golfpálya +STR_DTLS :A sivatagban, egy autópálya-csomópont közelében található Poros Golfpálya lehetőséget kínál egy kis golfközpont virágzó vidámparkká fejlesztésére + + +STR_SCNR :Elektromos Mezők +STR_PARK :Elektromos Mezők +STR_DTLS :Örököltél egy kis farmot, és a kihívásod az, hogy építs egy kis vidámparkot a mezők és a farmépületek között + + +STR_SCNR :Extrém Magaslatok +STR_PARK :Extrém Magaslatok +STR_DTLS :Pénzügyi korlátoktól mentesen, a kihívásod ennek a sivatagi parkonak a bővítése úgy, hogy magához vonzza a maximális izgalmakat kereső embereket + + +STR_SCNR :Gyári Móka +STR_PARK :Gyári Móka +STR_DTLS :Egy elhagyatott gyárkomplexum lehetőség egy mechanikus témájú vidámpark építésére + + +STR_SCNR :Gombaerdő +STR_PARK :Gombaerdő +STR_DTLS :Kizárólag régebbi stílusú, fából készült hullámvasutakra korlátozva, a kihívásod az, hogy egy virágzó vidámparkot építs Gombaerdőben + + +STR_SCNR :Szellemváros +STR_PARK :Szellemváros +STR_DTLS :Egy nagy vidámparklánc arra bérelt fel, hogy egy elhagyatott bányászváros köré építs egy óriási hullámvasútparkot + + +STR_SCNR :Gravitációs Kert +STR_PARK :Gravitációs Kert +STR_DTLS :A kihívásod az, hogy építs egy hullámvasútparkot a gyönyörű Gravitációs Kertben. Semmi más játékot, csak hullámvasutakat! + + +STR_SCNR :Pokoli Kilátások +STR_PARK :Pokoli Kilátások +STR_DTLS :A park bizonytalanul fészkel a magmafolyamokkal övezett lávaköveken + + +STR_SCNR :Szerencsés-tó +STR_PARK :Szerencsés-tó +STR_DTLS :Korlátlan pénzzel, de egy kihívást jelentő tavi helyszínen, ezt a parkot igazi próbatétel lesz bővíteni és igazgatni + + +STR_SCNR :Szivárvány Csúcs +STR_PARK :Szivárvány Csúcs +STR_DTLS :A domboldalon épült parkban tilos bármi magasat építeni. Sikerül bővítened a parkot és sikeressé tenni? + + +STR_SCNR :Six Flags Belgium +STR_PARK :Six Flags Belgium +STR_DTLS :Próbáld ki magad ennek a Six Flags parknak vezetésében és fejlesztésében + + +STR_SCNR :Six Flags Great Adventure +STR_PARK :Six Flags Great Adventure +STR_DTLS :Építsd meg a hiányzó Six Flags játékokat, vagy készíts saját terveket a park fejlesztésére! De ne feledkezz meg a végső célodról: több vendéget vonzani a parkba! + + +STR_SCNR :Six Flags Holland +STR_PARK :Six Flags Holland +STR_DTLS :Próbáld ki magad ennek a Six Flags parknak a vezetésében és fejlesztésében + + +STR_SCNR :Six Flags Magic Mountain +STR_PARK :Six Flags Magic Mountain +STR_DTLS :Építsd meg a hiányzó Six Flags játékokat, vagy készíts saját terveket a park fejlesztésére! De ne feledkezz meg a végső célodról: több vendéget vonzani a parkba! + + +STR_SCNR :Six Flags over Texas +STR_PARK :Six Flags over Texas +STR_DTLS :Építsd meg a hiányzó Six Flags játékokat, vagy készíts saját terveket a park fejlesztésére! De ne feledkezz meg a végső célodról: több vendéget vonzani a parkba! ############################################################################### ## Wacky Worlds Scenarios @@ -4092,3 +4223,101 @@ STR_NAME :Fa sánckerítés STR_SCNR :Panda Világ STR_PARK :Panda Világ STR_DTLS :Szerezz be további játékokat, hogy több ember látogasson el ebbe a panda-témájú parkba + +### + +STR_SCNR :Temető-gerinc +STR_PARK :Temető-gerinc +STR_DTLS :Itt van halloween, UCES halloween, tök lámpás ami gyertyát rejt! Ez a temető bajban van, és rajtad múlik a megmentése, miközben arra is ügyelned kell, hogy a halottak békében nyugodjanak! Képes vagy a szellemeket a sírjukban tartani és frászt hozni a vendégeidre?{NEWLINE}Szerző: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :Alexandriai világítótorony +STR_PARK :Alexandriai világítótorony +STR_DTLS :Sándor építette a várost; a görögök, rómaiak, egyiptomiak rányomták bélyegüket. De a legnagyobb megtiszteltetés az ókori világ egy csodája - a világítótorony. Látogass el és hozz létre egy parkot!{NEWLINE}Szerző: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :Amilyen a megnyitó napján volt - 1905. május 18-án.{NEWLINE}Szerző: Aetherwave + + +STR_SCNR :Vezúv +STR_PARK :Vezúv +STR_DTLS :Pompejit és Herculaneumot a Vezúv temette maga alá Kr.u. 79-ben. Látogass el az ásatásokra és építs egy parkot!{NEWLINE}{NEWLINE}Szerző: Katatude + + +STR_SCNR :A Homokozó +STR_PARK :A Homokozó +STR_DTLS :Amit mindenki akar - egy homokozó! Szóval ragadjátok meg a kis vödrötöket és lapátotokat és építsetek egy parkot!{NEWLINE}Szerző: Katatude + + +STR_SCNR :Niagara-vízesés és szurdok +STR_PARK :Niagara-vízesés +STR_DTLS :Amerikai-zuhatag, Menyasszonyi fátyol-zuhatag és a kanadai Patkó-zuhatag a Niagara határon, 1850.{NEWLINE}Szerző: Katatude + + +STR_SCNR :Sziklás-hegyi bányászok +STR_PARK :Sziklás-hegyi bányászok +STR_DTLS :Egy sziklaomlás megrongálta a vasutadat. A munkásaid elmentek kutatni. Van arany a hullámvasutakban?{NEWLINE}Szerzők: Squid, Buckone, Fossil + + +STR_SCNR :Az Időgép +STR_PARK :Az Időgép +STR_DTLS :Az időgép. Építsd meg, hogy mehess - amikor akarsz, ahová akarsz. Az örökkévalóság vár. Minden relatív.{NEWLINE}Szerző: Katatude + + +STR_SCNR :Bábel tornya +STR_PARK :Bábel tornya +STR_DTLS :Hűű! Nézd csak, hova vitt minket az időgép! Hová tűnt mindenki?{NEWLINE}Szerző: Fossil + + +STR_SCNR :Átalakítás +STR_PARK :Átalakítás +STR_DTLS :Vártunk téged…{NEWLINE}Szerző: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :A rómaiak belefáradtak az unalmas gladiátorharcokba. Adj nekik valami izgalmasabbat, változtass egy római várost minden idők legnagyobb vidámparkjává!{NEWLINE}Szerző: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :A karácsonyfa alatt +STR_PARK :Téli Csodaország +STR_DTLS :Anyu építette ezt a jelenetet a fánk alá. Most azt akarja, hogy parkot csináljunk bele! Tudsz segíteni?{NEWLINE}Szerző: Katatude + + +STR_SCNR :Robbanás Bigrockban +STR_PARK :Robbanás Bigrockban +STR_DTLS :Miután robbanás történt a Bigrock Mining Co. vállalatnál, Bigrock lakosainak egy vidámparkot kell építeniük, hogy életben tartsák városukat.{NEWLINE}Szerzők: rbarclay & buckone + + +STR_SCNR :Feketerigó Tábor +STR_PARK :Feketerigó Tábor +STR_DTLS :Csak $500/hét ez a nyári tábor! Törd fel a malacperselyed, aztán szórakozz és építs egy parkot.{NEWLINE}Szerző: Katatude + + +STR_SCNR :Sihuhu Város +STR_PARK :Sihuhu Város +STR_DTLS :Anyu! Apu! Sihuhu városba akarok menni!{NEWLINE}Szerző: Fossil + + +STR_SCNR :Sárkány-szigetek +STR_PARK :Sárkány-szigetek +STR_DTLS :Sárkány-szigetek? Nem biztos, hogy oda akarok menni...{NEWLINE}Szerző: Fossil + + +STR_SCNR :Kölyökkarnevál II +STR_PARK :Kölyökkarnevál +STR_DTLS :Hé, gyerekek! Érezzük jól magunkat!{NEWLINE}Szerzők: Piehead & Fossil + + +STR_SCNR :Homokdűne +STR_PARK :Homokdűne +STR_DTLS :Egy kis park tulajdonosaként vásároltál egy nagy darab földet a tengerparton, hogy bővíts és még több vendéget vonzz a gyönyörű homokdűnékre, de vigyázz: nem bolygathatod az ökológiailag érzékeny homokdűnéket.{NEWLINE}Szerző: rbarclay diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index 71b0d3abaf..95df200b5b 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -180,7 +180,7 @@ STR_0602 :I treni dell’ottovolante sono spinti fuori dalla stazione tramite STR_0603 :Un ottovolante in legno con i binari in acciaio, in grado di avere ripide discese e inversioni. STR_0604 :I visitatori viaggiano lungo un sottile tracciato da monorotaia, attraverso strette inversioni e cambi di direzione. STR_0605 :I visitatori scendono lungo una rotaia piena di curve, frenando per controllare la velocità del loro vagone -STR_0606 :Un ottovolante di legno vecchio stile con un percorso veloce e turbolento, con molto air-time, G laterali, progettata per farti sentire 'fuori controllo' +STR_0606 :Un ottovolante di legno vecchio stile con un percorso veloce e turbolento, con molto air-time, G laterali, progettato per farti sentire “fuori controllo” STR_0767 :Visitatore {INT32} STR_0768 :Tuttofare {INT32} STR_0769 :Meccanico {INT32} @@ -755,7 +755,7 @@ STR_1363 :Troppo in alto per i supporti! STR_1364 :I supporti del tracciato non possono essere ulteriormente estesi! STR_1365 :Curva in-linea (Sx) STR_1366 :Curva in-linea (Dx) -STR_1367 :Mezzo giro morte Piccolo +STR_1367 :Mezzo giro della morte piccolo STR_1368 :Mezzo avvitamento (Sx) STR_1369 :Mezzo avvitamento (Dx) STR_1370 :Avvitamento (Sx) @@ -2585,17 +2585,17 @@ STR_5278 :Modalità sandbox STR_5279 :Disattiva modalità sandbox STR_5280 :Permetti la modifica delle impostazioni del terreno tramite la finestra Mappa e altre opzioni che sono solitamente non disponibili nella modifica Scenario STR_5281 :Feature -STR_5282 :RCT1 Ride Open/Close Lights -STR_5283 :RCT1 Park Open/Close Lights -STR_5284 :RCT1 Selezione Font Scenario -STR_5287 :L’attrazione è già partita -STR_5288 :Corsa chiusa -STR_5289 :Nessun guasto per questa attrazione +STR_5282 :Semaforo apertura attrazione di RCT1 +STR_5283 :Semaforo apertura parco di RCT1 +STR_5284 :Font di RCT1 nella selezione scenario +STR_5287 :L’attrazione è già guasta +STR_5288 :Attrazione chiusa +STR_5289 :Nessun guasto disponibile per questa attrazione STR_5290 :Ripara corsa -STR_5291 :non puoi forzare un guasto +STR_5291 :Non è possibile forzare un guasto STR_5292 :Forza un guasto STR_5293 :Chiudi attrazione -STR_5294 :Testa attrazione +STR_5294 :Prova attrazione STR_5295 :Apri attrazione STR_5296 :Chiudi parco STR_5297 :Apri parco @@ -2716,8 +2716,6 @@ STR_5503 :Inserisci hostname o indirizzo IP: STR_5504 :Show multiplayer status STR_5505 :Impossibile connettersi al server. STR_5506 :I visitatori ignorano l’intensità -STR_5508 :Permetti caricamento file con checksum errato -STR_5509 :Permetti il caricamento di scenari e salvataggi{NEWLINE}che hanno un codice di controllo errato,{NEWLINE}come ad esempio gli scenari della demo{NEWLINE}o i salvataggi danneggiati. STR_5510 :Scheda audio predefinita STR_5511 :(UNKNOWN) STR_5512 :Salva partita con nome… @@ -2992,8 +2990,8 @@ STR_5824 :Disattiva l’effetto fulmine{NEWLINE}durante i temporali STR_5825 :Mantiene il cursorse del mouse all’interno della finestra STR_5826 :Inverte la direzione di scorrimento{NEWLINE}quando si mantiene premuto il tasto destro. STR_5827 :Imposta lo schema colore dell’interfaccia -STR_5828 :Cambia quale formato di misurazione è usato per le distanze, la velocità… -STR_5829 :Cambia la moneta in uso. Soltanto visuale, non effettua una vera conversione +STR_5828 :Cambia l’unità di misura usata per le distanze, la velocità… +STR_5829 :Cambia la moneta in uso. Ha soltanto un effetto visuale, non effettua una vera conversione STR_5830 :Cambia la lingua utilizzata STR_5831 :Cambia il formato della{NEWLINE}temperatura visualizzata STR_5832 :Mostra l’altezza in unità generiche invece del formato impostato in “Distanze e velocità” @@ -3602,9 +3600,7 @@ STR_6487 :Mostra/nascondi personale STR_6488 :{RED}I visitatori si lamentano per la lunghezza delle code nel tuo parco.{NEWLINE}Prendi in considerazione di accorciare quelle problematiche o di aumentare il flusso di visitatori delle attrazioni. STR_6489 :Errore: versione parco non compatibile STR_6490 :Avviso: versione parco semi-compatibile -STR_6491 :Questo parco è stato salvato in una versione più recente di OpenRCT2. Il parco è v{INT32} e richiede almeno v{INT32}. STR_6492 :Questo parco è stato salvato in una versione più vecchia di OpenRCT2 e non può essere aperto con questa versione. Il parco è v{INT32}. -STR_6493 :Questo parco è stato salvato in una versione più recente di OpenRCT2, alcuni dati potrebbero essere persi. Il parco è v{INT32} e richiede almeno v{INT32}. STR_6494 :Raggruppa per tipo attrazione STR_6495 :Raggruppa le attrazioni in base al loro tipo anziché mostrare ogni veicolo separatamente. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3626,6 +3622,12 @@ STR_6511 :Zero G Roll (Dx) STR_6512 :Zero G Roll Grande (Sx) STR_6513 :Zero G Roll Grande (Dx) STR_6514 :Altezza non valida! +STR_6515 :{BLACK}RCT1 non collegato - saranno usate immagini di ripiego. +STR_6516 :Uno o più oggetti aggiunti necessitano che RCT1 sia collegato per una corretta visualizzazione. Saranno usate immagini di ripiego. +STR_6517 :Uno o più oggetti di questo parco necessitano che RCT1 sia collegato per una corretta visualizzazione. Saranno usate immagini di ripiego. +STR_6518 :{BLACK}Passa il cursore sopra a uno scenario per visualizzare la sua descrizione e il suo obiettivo. Fai clic per iniziare a giocare. +STR_6519 :Extra + ############# # Scenarios # @@ -4076,37 +4078,6 @@ STR_DTLS : ## Start OpenRCT2 Official [TTPIRF05] STR_NAME :Tetto - -[TTRFWD01] -STR_NAME :Tetto - -[TTRFWD02] -STR_NAME :Tetto - -[TTRFWD03] -STR_NAME :Tetto - -[TTRFWD04] -STR_NAME :Tetto - -[TTRFWD05] -STR_NAME :Tetto - -[TTRFWD06] -STR_NAME :Tetto - -[TTRFWD07] -STR_NAME :Tetto - -[TTRFWD08] -STR_NAME :Tetto - -[ACWW33] -STR_NAME :Muro di pali di legno - -[ACWWF32] -STR_NAME :Muro di pali di legno - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/ja-JP.txt b/data/language/ja-JP.txt index bf84412d3c..d2f71dd630 100644 --- a/data/language/ja-JP.txt +++ b/data/language/ja-JP.txt @@ -2702,8 +2702,6 @@ STR_5503 :ホスト名またはIPアドレスを入力してください: STR_5504 :マルチプレイのステイタスの表示 STR_5505 :サーバに接続できない STR_5506 :Guests ignore intensities -STR_5508 :Allow loading files with incorrect checksums -STR_5509 :Allows loading scenarios and saves{NEWLINE}that have an incorrect checksum,{NEWLINE}like the scenarios from the demo{NEWLINE}or damaged saves. STR_5510 :デフォルトのサウンドデバイス STR_5511 :(未知) STR_5512 :名前を保存 @@ -3913,37 +3911,6 @@ STR_DTLS : ## Start OpenRCT2 Official [TTPIRF05] STR_NAME :屋根 - -[TTRFWD01] -STR_NAME :屋根 - -[TTRFWD02] -STR_NAME :屋根 - -[TTRFWD03] -STR_NAME :屋根 - -[TTRFWD04] -STR_NAME :屋根 - -[TTRFWD05] -STR_NAME :屋根 - -[TTRFWD06] -STR_NAME :屋根 - -[TTRFWD07] -STR_NAME :屋根 - -[TTRFWD08] -STR_NAME :屋根 - -[ACWW33] -STR_NAME :木製のポスト壁 - -[ACWWF32] -STR_NAME :木製のポスト壁 - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index a8c4f03590..788a98719b 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -2714,8 +2714,6 @@ STR_5503 :호스트네임이나 IP 주소를 입력하세요: STR_5504 :접속자 목록 창을 엽니다 STR_5505 :서버에 접속할 수 없습니다 STR_5506 :손님이 격렬도를 무시하고 탐 -STR_5508 :올바르지 않은 검사 합을 가진 파일 불러오기 허용 -STR_5509 :데모에서 저장한 시나리오나 손상된 저장 파일과 같이 올바르지 않은 검사 합을 가진 시나리오나 저장 파일을 불러오는 것을 허용합니다. STR_5510 :기본 사운드 장치 STR_5511 :(알 수 없음) STR_5512 :다른 이름으로 저장 @@ -2998,7 +2996,7 @@ STR_5832 :높이를 “거리 및 속력”에 설정된 거리 단위 대신 STR_5833 :사용할 날짜 형식을 설정합니다. STR_5834 :OpenRCT2가 사용할 오디오 장치를 선택합니다. STR_5835 :게임 밖으로 커서가 나가면 게임에서 소리가 나지 않도록 만듭니다. -STR_5836 :첫 화면에서 사용할 음악을 선택합니다.{NEWLINE}RCT1 테마를 선택할 경우, RCT1 게임 폴더의 ‘data/css17.dat’ 파일을 복사해서 RCT2 폴더에 ‘data/css50.dat’라는 이름으로 저장해두거나, 기타 탭에서 RCT1의 경로를 지정해야 합니다. +STR_5836 :첫 화면에서 사용할 음악을 선택합니다.{NEWLINE}RCT1 테마를 선택하려면 고급 탭에서 RCT1의 경로를 지정해야 합니다. STR_5837 :사용자 UI 테마를 생성하고 관리합니다. STR_5838 :메인 메뉴에 재정 창을 위한 별도의 버튼을 표시합니다. STR_5839 :메인 매뉴에 연구 및 개발 창을 위한 별도의 버튼을 표시합니다. @@ -3431,7 +3429,7 @@ STR_6318 :네트워크 비동기화가 감지되었습니다.{NEWLINE}로그 STR_6319 :블록 브레이크 닫기 STR_6320 :파괴 불가 STR_6321 :기물 부서짐 -STR_6322 :{WINDOW_COLOUR_2}스프라이트 ID: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}엔티티 ID: {BLACK}{INT32} STR_6323 :가상 운행 중 STR_6324 :가상 운행 STR_6325 :놀이기구 가상으로 운행합니다 @@ -3598,9 +3596,7 @@ STR_6487 :직원를 감추거나 보여줍니다 STR_6488 :{RED}손님들이 공원 대기줄 길이에 대해 불평하고 있습니다{NEWLINE}문제가 있는 대기줄을 줄이거나 놀이기구의 순환율을 높이세요 STR_6489 :오류: 호환 불가능한 공원 버전 STR_6490 :경고: 일부만 호환 가능한 공원 버전 -STR_6491 :이 공원은 더 최신 버전의 OpenRCT2에서 저장되었습니다. 이 공원은 v{INT32} 버전이고 v{INT32} 버전 이상이 필요합니다. STR_6492 :이 공원은 오래된 버전의 OpenRCT2에서 저장되었고 현재 OpenRCT2 버전에서 열 수 없습니다. 이 공원의 버전은 v{INT32} 입니다. -STR_6493 :이 공원은 더 최신 버전의 OpenRCT2에서 저장되었고, 일부 데이터가 손실될 수 있습니다. 이 공원은 v{INT32} 버전이고 v{INT32} 버전 이상이 필요합니다. STR_6494 :놀이기구 종류 별로 묶기 STR_6495 :놀이기구를 각 차량 별로 보여주는 대신 놀이기구 종류 별로 묶어서 보여줍니다 STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3622,11 +3618,27 @@ STR_6511 :제로 G 롤 (오른쪽) STR_6512 :대형 제로 G 롤 (왼쪽) STR_6513 :대형 제로 G 롤 (오른쪽) STR_6514 :잘못된 높이입니다! -STR_6515 :{BLACK}RCT1이 연결되지 않았습니다 - 대체 이미지가 사용됩니다. -STR_6516 :하나 이상의 오브젝트에서 RCT1 연결을 필요로 합니다. 대체 이미지가 사용될 것입니다. -STR_6517 :이 공원에서 사용된 하나 이상의 오브젝트가 RCT1 연결을 필요로 합니다. 대체 이미지가 사용될 것입니다. +STR_6515 :{BLACK}RollerCoaster Tycoon 1이 연결되지 않았습니다 - 대체 이미지가 사용됩니다. +STR_6516 :하나 이상의 오브젝트에서 RollerCoaster Tycoon 1 연결을 필요로 합니다. 대체 이미지가 사용될 것입니다. +STR_6517 :이 공원에서 사용된 하나 이상의 오브젝트가 RollerCoaster Tycoon 1 연결을 필요로 합니다. 대체 이미지가 사용될 것입니다. STR_6518 :{BLACK}시나리오의 설명과 목표를 보려면 시나리오에 마우스를 올리세요. 플레이를 시작하려면 클릭하세요. STR_6519 :기타 +STR_6520 :에셋 팩 +STR_6521 :우선순위 낮추기 +STR_6522 :우선순위 높이기 +STR_6523 :선택한 에셋 팩의 우선순위를 낮춥니다. +STR_6524 :선택한 에셋 팩의 우선순위를 높입니다. +STR_6525 :게임에서 활성화된 모든 에셋 팩을 다시 불러옵니다. +STR_6526 :(기본 그래픽, 음악, 효과음) +STR_6527 :경쟁 +STR_6528 :잘못된 트랙 값입니다! +STR_6529 :잘못된 색상 값입니다! +STR_6530 :유저 제작 확장팩(UCES) +STR_6531 :타임머신 +STR_6532 :케이티의 드림월드 +STR_6533 :{WINDOW_COLOUR_2}흥미도 인수: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}격렬도 인수: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}멀미도 인수: {BLACK}-{COMMA16}% ############# # Scenarios # @@ -4076,36 +4088,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :지붕 -[TTRFWD01] -STR_NAME :지붕 - -[TTRFWD02] -STR_NAME :지붕 - -[TTRFWD03] -STR_NAME :지붕 - -[TTRFWD04] -STR_NAME :지붕 - -[TTRFWD05] -STR_NAME :지붕 - -[TTRFWD06] -STR_NAME :지붕 - -[TTRFWD07] -STR_NAME :지붕 - -[TTRFWD08] -STR_NAME :지붕 - -[ACWW33] -STR_NAME :나무 기둥 벽 - -[ACWWF32] -STR_NAME :나무 기둥 벽 - ## End OpenRCT2 Official ############################################################################### @@ -4409,3 +4391,102 @@ STR_DTLS :이 오래된 놀이공원은 더 나은 미래를 기대하고 있 STR_SCNR :판다 월드 STR_PARK :판다 월드 STR_DTLS :이 판다 테마의 공원에 놀이기구를 더 지어서 손님들을 더 끌어모으세요. + + +### + +STR_SCNR :Cemetery Ridge +STR_PARK :묘지 언덕 +STR_DTLS :핼러원, UCES의 핼러윈, 호박이 비명을 지르는 죽음의 밤! 죽은 자들을 편히 쉬게 하는 동시에 어려운 처지에 놓여있는 이 묘지를 구하는 것은 당신의 몫입니다! 유령을 무덤에 가둬놓고 손님들에게 오들오들함을 선사할 수 있나요?{NEWLINE}제작자: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :The Lighthouse of Alexandria +STR_PARK :알렉산드리아의 등대 +STR_DTLS :알렉산더 대왕은 도시를 건설했습니다. 그리스인, 로마인, 이집트인들이 흔적을 남겼죠. 하지만 가장 큰 영예는 고대의 불가사의인 등대였습니다. 이 곳을 공원으로 만들어보세요!{NEWLINE}제작자: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :루나 파크 +STR_DTLS :공원 개장일이었떤 1905년 5월 18일처럼.{NEWLINE}제작자: Aetherwave + + +STR_SCNR :Mount Vesuvius +STR_PARK :베수비오 산 +STR_DTLS :폼페이와 헤르쿨라네움은 서기 79년에 베수비오 화산 폭발로 묻혀버렸습니다. 이 발굴지를 공원으로 만들어보세요!{NEWLINE}제작자: Katatude + + +STR_SCNR :The Sandbox +STR_PARK :모래 상자 +STR_DTLS :모두가 원하는 모래 상자! 이제 양동이와 삽을 들고 원하는 공원을 만드세요!{NEWLINE}제작자: Katatude + + +STR_SCNR :Niagara Falls & Gorge +STR_PARK :나이아가라 폭포 +STR_DTLS :1850년 나이아가라 폭포의 아메리카 폭포, 브라이들 폭포, 캐나다 폭포{NEWLINE}제작자: Katatude + + +STR_SCNR :Rocky Mountain Miners +STR_PARK :록키 산맥 광부 +STR_DTLS :산사태로 철도가 손상되었습니다. 직원들이 탐사에 나섰습니다. 롤러코스터에 금이 있을까요?{NEWLINE}제작자: Squid, Buckone, Fossil + + +STR_SCNR :The Time Machine +STR_PARK :타임 머신 +STR_DTLS :원하는 때, 원하는 곳으로 갈 수 있도록 타임 머신을 만드세요. 영원이 당신을 기다립니다. 모든 것은 상대적이니 말이죠.{NEWLINE}제작자: Katatude + + +STR_SCNR :Tower of Babel +STR_PARK :바벨 탑 +STR_DTLS :우와, 타임머신이 우릴 어디로 대려왔는지 보세요! 근데 다들 어디갔죠?{NEWLINE}제작자: Fossil + + +STR_SCNR :Transformation +STR_PARK :트랜스포메이션 +STR_DTLS :널 기다리고 있었어…{NEWLINE}제작자: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :알 수 없는 도시 +STR_DTLS :로마인들은 글래디에이터의 전투가 이제 질렸다고 합니다. 그들에게 더 많은 스릴을 선사해서 이 로마 도시를 전 시대를 통틀어 가장 거대한 놀이 공원으로 바꿔보세요!{NEWLINE}제작자: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Beneath the Christmas Tree +STR_PARK :겨울 원더 랜드 +STR_DTLS :엄마가 우리 나무 아래를 이렇게 만들었어요. 이제 공원을 만들고 싶으시대요. 도와주실 수 있나요?{NEWLINE}제작자: Katatude + + +STR_SCNR :Bigrock Blast +STR_PARK :빅록 폭발 +STR_DTLS :빅록 채광 주식회사에서 폭발 사건이 일어난 이후, 빅록의 사람들은 마을을 유지하기 위해 놀이공원을 지어야만 한다고 합니다.{NEWLINE}제작자: rbarclay & buckone + + +STR_SCNR :Camp Mockingbird +STR_PARK :앵무새 캠프 +STR_DTLS :이번 여름 캠프가 일주일에 단돈 $500! 은행 금고를 열고 공원을 만들면서 놀아보세요.{NEWLINE}제작자: Katatude + + +STR_SCNR :Choo-Choo Town +STR_PARK :칙칙폭폭 마을 +STR_DTLS :엄마! 아빠! 나 칙칙폭폭 마을에 가고 싶어요!{NEWLINE}제작자: Fossil + + +STR_SCNR :Dragon Islands +STR_PARK :용의 섬 +STR_DTLS :용의 섬이라고? 거기 가고 싶은지 확신이 안 서는 걸…{NEWLINE}제작자: Fossil + + +STR_SCNR :Kiddie Karnival II +STR_PARK :어린이 카니발 +STR_DTLS :어린이 여러분! 같이 신나게 놀아봐요!{NEWLINE}제작자: Piehead & Fossil + + +STR_SCNR :Sand Dune +STR_PARK :모래 언덕 +STR_DTLS :이 작은 공원의 소유자로써, 아름다운 모래 언덕을 방문하여 더 많은 목표를 유치하고 확장하기 위해 해변을 따라 큰 땅을 샀지만 조심하세요! 생태학적으로 소중한 이 모래 언덕을 건드릴 수는 없습니다.{NEWLINE}제작자: rbarclay diff --git a/data/language/nb-NO.txt b/data/language/nb-NO.txt index 1e5be919ca..71d5b67e0f 100644 --- a/data/language/nb-NO.txt +++ b/data/language/nb-NO.txt @@ -2719,8 +2719,6 @@ STR_5503 :Enter hostname or IP address: STR_5504 :Show multiplayer status STR_5505 :Unable to connect to server. STR_5506 :Guests ignore intensities -STR_5508 :Allow loading files with incorrect checksums -STR_5509 :Allows loading scenarios and saves{NEWLINE}that have an incorrect checksum,{NEWLINE}like the scenarios from the demo{NEWLINE}or damaged saves. STR_5510 :Default sound device STR_5511 :(UNKNOWN) STR_5512 :Save Game As @@ -3607,9 +3605,7 @@ STR_6487 :Skru av/på usynlige ansatte STR_6488 :{RED}Gjestene klager på lange køer i parken.{NEWLINE}Prøv å gjøre køer kortere, eller øk kapasiteten til påvirkede attraksjoner. STR_6489 :Feil: Inkompatibel parkversjon STR_6490 :Advarsel delvis inkompatibel parkversjon -STR_6491 :Denne parken ble lagret i en nyere versjon av OpenRCT2. Parken er lagret med v{INT32} og krever minst v{INT32} for å lastes inn. STR_6492 :Denne parken ble lagret i en eldre versjon av OpenRCT2 og kan ikke åpnes i denne versjonen av OpenRCT2. Parken er lagret med v{INT32}. -STR_6493 :Denne parken ble lagret i en nyere versjon av OpenRCT2. Noe data kan mangle ved innlasting. Parken er lagret med v{INT32} og krever minst v{INT32} for å lastes inn. STR_6494 :Grupper etter attraksjonstype STR_6495 :Grupper attraksjoner etter type heller enn å vise hver vogn separat STR_6496 :{WINDOW_COLOUR_2}{STRINGID} diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 621760b845..801bfbcb4a 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -2711,8 +2711,6 @@ STR_5503 :Hostnaam of IP-adres invoeren: STR_5504 :Status multiplayer tonen STR_5505 :Kan niet met de server verbinden. STR_5506 :Bezoekers negeren intensiteit -STR_5508 :Bestanden met incorrecte checksum toch laden -STR_5509 :Maakt het mogelijk om scenario’s en opgeslagen spellen met een incorrecte checksum te laden, zoals scenario’s uit de demo of beschadigde opgeslagen parken. STR_5510 :Standaard geluidsapparaat STR_5511 :(ONBEKEND) STR_5512 :Spel opslaan als… @@ -2994,7 +2992,7 @@ STR_5832 :Toon hoogtes in eenheden in plaats van echte maten. STR_5833 :Stelt de datumindeling in. STR_5834 :Stelt in welk audioapparaat OpenRCT2 zal gebruiken. STR_5835 :Dempt het geluid als het venster de focus kwijtraakt. -STR_5836 :Selecteert welke muziek er wordt gebruikt tijdens de titelpresentatie.{NEWLINE}Om de muziek van RCT1 te gebruiken moet je het bestand ‘data/css17.dat’ uit je RCT1-map kopiëren naar ‘data/css50.dat’ in je RCT2-map, of een pad naar je RCT1-bestanden instellen onder het tabblad ‘Overige instellingen’. +STR_5836 :Selecteert welke muziek er wordt gebruikt tijdens de titelpresentatie.{NEWLINE}Om de muziek van RCT1 te gebruiken moet je een pad naar je RCT1-bestanden instellen onder het tabblad ‘Geavanceerd’. STR_5837 :Eigen thema’s voor de GUI aanmaken en beheren. STR_5838 :Toont een knop voor financiën in de werkbalk. STR_5839 :Toont een knop voor onderzoek en ontwikkeling in de werkbalk. @@ -3427,7 +3425,7 @@ STR_6318 :Netwerkdesynchronisatie gedetecteerd.{NEWLINE}Logbestand: {STRING} STR_6319 :Blokrem is gesloten STR_6320 :Mag niet worden verwijderd STR_6321 :Straatmeubel is kapot -STR_6322 :{WINDOW_COLOUR_2}Sprite-id: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}Entiteit-ID: {BLACK}{INT32} STR_6323 :Simulatie STR_6324 :Simuleren STR_6325 :Testrit simuleren @@ -3594,9 +3592,9 @@ STR_6487 :Zichtbaarheid werknemers wisselen STR_6488 :{RED}De bezoekers klagen over de lange wachttijden in je park.{NEWLINE}Overweeg het verkorten van wachtgebieden of het verlagen van doorlooptijden. STR_6489 :Fout: parkversie niet compatibel STR_6490 :Waarschuwing: Park-versie is deels compatibel -STR_6491 :Dit park is opgeslagen in een latere versie van OpenRCT2. Parkversie is v{INT32} en vereist minimaal v{INT32}. +STR_6491 :Dit park is opgeslagen in een latere versie van OpenRCT2. Het park is opgeslagen in v{INT32} en vereist minimaal v{INT32}. Je huidige versie is v{INT32}. STR_6492 :Dit park is opgeslagen in een vorige versie van OpenRCT2 en kan niet worden geopend met deze versie van OpenRCT2. Parkversie is v{INT32}. -STR_6493 :Dit park is opgeslagen in een latere versie van OpenRCT2, sommige gegevens kunnen verloren gaan. Parkversie is v{INT32} en vereist minimaal v{INT32}. +STR_6493 :Dit park is opgeslagen in een latere versie van OpenRCT2, sommige gegevens kunnen verloren gaan. Parkversie is v{INT32}, je huidige versie is v{INT32}. STR_6494 :Groeperen op baantype STR_6495 :Groepeert attracties per baantype. Schakel dit uit om elk voertuig apart te tonen. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3618,11 +3616,28 @@ STR_6511 :0 g-rol (rechts) STR_6512 :Grote 0 g-rol (links) STR_6513 :Grote 0 g-rol (rechts) STR_6514 :Ongeldige hoogte! -STR_6515 :{BLACK}RCT1 is niet gekoppeld, OpenRCT2 zal terugvallen op alternatieve afbeeldingen. -STR_6516 :Eén of meer toegevoegde objecten vereist een koppeling met RCT1 voor een juiste weergave. OpenRCT2 zal terugvallen op alternatieve afbeeldingen. -STR_6517 :Eén of meer objecten in dit park vereist een koppeling met RCT1 voor een juiste weergave. OpenRCT2 zal terugvallen op alternatieve afbeeldingen. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 is niet gekoppeld, OpenRCT2 zal terugvallen op alternatieve afbeeldingen. +STR_6516 :Eén of meer toegevoegde objecten vereist een koppeling met RollerCoaster Tycoon 1 voor een juiste weergave. OpenRCT2 zal terugvallen op alternatieve afbeeldingen. +STR_6517 :Eén of meer objecten in dit park vereist een koppeling met RollerCoaster Tycoon 1 voor een juiste weergave. OpenRCT2 zal terugvallen op alternatieve afbeeldingen. STR_6518 :{BLACK}Beweeg de aanwijzer over een scenario om de beschrijving en doelstelling weer te geven. Klik erop om een spel te starten. STR_6519 :Extra’s +STR_6520 :Assetpacks +STR_6521 :Lage prioriteit +STR_6522 :Hoge prioriteit +STR_6523 :Prioriteit van het geselecteerde assetpack verlagen. +STR_6524 :Prioriteit van het geselecteerde assetpack verhogen. +STR_6525 :Assets in het spel opnieuw laden, op basis van de geselecteerde assetpacks. +STR_6526 :(basisgraphics, -muziek en -geluidseffecten) +STR_6527 :Wedstrijden +STR_6528 :Ongeldige baanparameters! +STR_6529 :Ongeldige parameter voor kleurenschema! +STR_6530 :User Created Expansion Set +STR_6531 :The Time Machine +STR_6532 :Katy’s Dreamworld +STR_6533 :{WINDOW_COLOUR_2}Plezierfactor: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Intensiteitsfactor: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Misselijkheidsfactor: {BLACK}-{COMMA16}% +STR_6536 :Dit park is opgeslagen in een latere versie van OpenRCT2. Het park is opgeslagen in v{INT32}, je huidige versie is v{INT32}. ############# # Scenarios # @@ -4360,6 +4375,104 @@ STR_SCNR :Panda World STR_PARK :Panda World STR_DTLS :Voeg meer attracties toe aan dit park met pandathema, en trek meer bezoekers aan. +### + +STR_SCNR :Cemetery Ridge +STR_PARK :Cemetery Ridge +STR_DTLS :Het is Allerheiligenavond bij UCES en de pompoenen komen tot leven! Deze begraafplaats is in de problemen gekomen en het is jouw taak om deze op te lossen, zonder de doden te storen! Gaat het je lukken om de geesten in de graven te houden en je bezoekers koude rillingen te bezorgen?{NEWLINE}Gemaakt door: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :De vuurtoren van Alexandrië +STR_PARK :De vuurtoren van Alexandrië +STR_DTLS :Alexander bouwde deze stad. De Grieken, Romeinen en Egyptenaren drukten er hun stempel op. Maar het pronkstuk was dit wereldwonder: de vuurtoren. Kom langs en bouw een park!{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :Zoals het eruitzag op de openingsdag, 18 mei 1905.{NEWLINE}Gemaakt door: Aetherwave + + +STR_SCNR :Vesuvius +STR_PARK :Vesuvius +STR_DTLS :Pompeii en Herculaneum werden in 79 n.Chr. door de Vesuvius bedolven onder de as. Bezoek de opgravingen en bouw een park!{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :De zandbak +STR_PARK :De zandbak +STR_DTLS :Iedereen wil toch wel eens in de zandbak spelen? Pak je emmertje en je schepje en bouw een park!{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :Niagara Falls +STR_PARK :Niagara Falls +STR_DTLS :American Falls, Bridal Falls en Canadian Horseshoe Falls op de grens bij de Niagara, 1850.{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :Rocky Mountain Miners +STR_PARK :Rocky Mountain Miners +STR_DTLS :Door een aardverschuiving is je spoorweg bedolven onder het puin. Je werknemers zijn het gebied gaan verkennen. Zijn achtbanen misschien de gouden bergen waar je naar op zoek was?{NEWLINE}Gemaakt door: Squid, Buckone, Fossil + + +STR_SCNR :De tijdmachine +STR_PARK :The Time Machine +STR_DTLS :De tijdmachine, die je overal heen brengt waar en wanneer je maar wilt. De eeuwigheid wacht op je. Maar alles is relatief.{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :De toren van Babel +STR_PARK :Babel +STR_DTLS :Waar zijn we nu weer beland? Waar is iedereen?{NEWLINE}Gemaakt door: Fossil + + +STR_SCNR :Transformation +STR_PARK :Transformation +STR_DTLS :We hadden je al verwacht…{NEWLINE}Gemaakt door: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :De Romeinen hebben zo onderhand wel genoeg van al die gladiatorengevechten. Zorg voor nieuwe vormen van vermaak door een Romeins stadje om te toveren in het beste attractiepark aller tijden!{NEWLINE}Gemaakt door: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Beneath the Christmas Tree +STR_PARK :Winter Wonderland +STR_DTLS :Je moeder heeft dit tafereel onder de kerstboom gebouwd. Nu is het jouw beurt om er een park van te maken!{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :Bigrock Blast +STR_PARK :Bigrock Blast +STR_DTLS :Na een explosie bij de Bigrock Mining Co. moeten de inwoners van Bigrock hun stad in leven zien te houden. Ze hebben jou ingehuurd om deze klus te klaren.{NEWLINE}Gemaakt door: rbarclay & buckone + + +STR_SCNR :Camp Mockingbird +STR_PARK :Camp Mockingbird +STR_DTLS :Dit zomerkamp kost maar 500 euro per week! Plunder je spaarrekening en kom bouwen!{NEWLINE}Gemaakt door: Katatude + + +STR_SCNR :Choo-Choo Town +STR_PARK :Choo-Choo Town +STR_DTLS :Mam! Pap! Ik wil naarChoo-Choo Town!{NEWLINE}Gemaakt door: Fossil + + +STR_SCNR :Dragon Islands +STR_PARK :Dragon Islands +STR_DTLS :Dragon Islands? Dat klinkt niet erg veilig…{NEWLINE}Gemaakt door: Fossil + + +STR_SCNR :Kiddie Karnival II +STR_PARK :Kiddie Karnival +STR_DTLS :Tijd om de kleintjes te vermaken!{NEWLINE}Gemaakt door: Piehead & Fossil + + +STR_SCNR :Sand Dune +STR_PARK :Sand Dune +STR_DTLS :Je bezit al een klein park en hebt besloten om een groot stuk land bij het strand erbij te kopen, om meer bezoekers naar deze prachtige duinen te trekken. Maar let op: de duinen zijn een gevoelig ecosysteem dat je niet mag verstoren.{NEWLINE}Gemaakt door: rbarclay + ################################## # Rides/attractions / Attracties # ################################## @@ -4439,38 +4552,6 @@ STR_NAME :Dak [TTPRF11] STR_NAME :Dak - -# TT wooden (Mine) roofs -[TTRFWD01] -STR_NAME :Dak - -[TTRFWD02] -STR_NAME :Dak - -[TTRFWD03] -STR_NAME :Dak - -[TTRFWD04] -STR_NAME :Dak - -[TTRFWD05] -STR_NAME :Dak - -[TTRFWD06] -STR_NAME :Dak - -[TTRFWD07] -STR_NAME :Dak - -[TTRFWD08] -STR_NAME :Dak - -[ACWW33] -STR_NAME :Muur van houten palen - -[ACWWF32] -STR_NAME :Hek van houten palen - ## End CC diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index bcca09c437..1bed6a7e0c 100644 --- a/data/language/pl-PL.txt +++ b/data/language/pl-PL.txt @@ -2708,8 +2708,6 @@ STR_5503 :Wprowadź IP lub hostname: STR_5504 :Pokaż status gry wieloosobowej STR_5505 :Nie można połączyć z serwerem. STR_5506 :Goście ignorują intensywność -STR_5508 :Zezwól na pliki ze złymi sumami kontrolnymi -STR_5509 :Zezwól na ładowanie scenariuszy i zapisanych gier z błędną sumą kontrolą, takich jak scenariusz z wersji demo czy z uszkodzonym zapisem gry. STR_5510 :Domyślne urządzenie audio STR_5511 :(UNKNOWN) STR_5512 :Zapisz grę jako @@ -3593,9 +3591,7 @@ STR_6487 :Przełącznik przezroczystości pracowników STR_6488 :{RED}Goście skarżą się na dłogość kolejek w Twoim parku.{NEWLINE}Rozważ skrócenie problematycznych kolejek lub zwiększenie przepustowości przejażdżek. STR_6489 :Błąd: Niekompatybilna wersja parku STR_6490 :Ostrzeżenie: Częściowo kompatybilna wersja parku -STR_6491 :Ten park został zapisany w późniejszej wersji OpenRCT2. Park jest v{INT32} i wymaga co najmniej v{INT32}. STR_6492 :Ten park został zapisany w starej wersji OpenRCT2 i nie można go otworzyć za pomocą tej wersji programu OpenRCT2. Park ma jest w v{INT32}. -STR_6493 :Ten park został zapisany w późniejszej wersji OpenRCT2, niektóre dane mogą zostać utracone. Park jest w v{INT32} i wymaga co najmniej v{INT32}. STR_6494 :Grupuj po typie atrakcji STR_6495 :Grupuj po typie atrakcji zamiast wyświetlić każdą osobno. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -4068,36 +4064,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Roof -[TTRFWD01] -STR_NAME :Roof - -[TTRFWD02] -STR_NAME :Roof - -[TTRFWD03] -STR_NAME :Roof - -[TTRFWD04] -STR_NAME :Roof - -[TTRFWD05] -STR_NAME :Roof - -[TTRFWD06] -STR_NAME :Roof - -[TTRFWD07] -STR_NAME :Roof - -[TTRFWD08] -STR_NAME :Roof - -[ACWW33] -STR_NAME :Wooden Post Wall - -[ACWWF32] -STR_NAME :Wooden Post Wall - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index e3fa460952..ed9af485c6 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -2710,8 +2710,6 @@ STR_5503 :Digite o nome do servidor ou o endereço de IP: STR_5504 :Exibir o estado do multijogador STR_5505 :Impossível se conectar ao servidor. STR_5506 :Visitantes ignoram intensidades -STR_5508 :Carregamento de arquivos com checksum incorreto -STR_5509 :Permite carregar cenários e jogos salvos{NEWLINE}que possuam checksum incorreto, como os cenários do demo{NEWLINE}ou jogos salvos danificados. STR_5510 :Dispositivo de som padrão STR_5511 :(DESCONHECIDO) STR_5512 :Salvar Jogo Como @@ -2995,7 +2993,7 @@ STR_5832 :Mostra altura como unidade genérica ao invés de formato de medida STR_5833 :Muda qual formato de data é usado STR_5834 :Seleciona qual dispositivo de áudio o OpenRCT2 irá usar STR_5835 :Deixa o jogo mudo se a janela perder foco -STR_5836 :Seleciona música que será usada no menu principal.{NEWLINE}Selecionar o tema do RCT1 requer que você copie ‘data/css17.dat’ da pasta do seu RCT1 para ‘data/css50.dat’ da pasta do seu RCT2, ou definir o caminho para o RCT1 na aba Variados. +STR_5836 :Selecione a música que será usada no menu principal.{NEWLINE}Selecionar o tema do RCT1 requer que você defina o caminho para o RCT1 na aba Avançado. STR_5837 :Cria e gerencia temas de interface de usuário personalizadas STR_5838 :Mostra um botão separado para janela de finanças na barra de ferramentas STR_5839 :Mostra um botão separado para janela de pesquisa e desenvolvimento na barra de ferramentas @@ -3428,7 +3426,7 @@ STR_6318 :Assincronia de rede detectada.{NEWLINE}Arquivo de registro: {STRING STR_6319 :Freios Bloqueadores Fechados STR_6320 :Indestrutível STR_6321 :Adição quebrada -STR_6322 :{WINDOW_COLOUR_2}Id da Sprite: {BLACK}{INT32} +STR_6322 :{WINDOW_COLOUR_2}ID da entidade: {BLACK}{INT32} STR_6323 :Simulando STR_6324 :Simular STR_6325 :Simular brinquedo/atração @@ -3595,9 +3593,9 @@ STR_6487 :Alternar visibilidade dos funcionários STR_6488 :{RED}Os visitantes estão reclamando do tamanho das filas no seu parque.{NEWLINE}Considere encurtar filas problemáticas, ou aumentar a vazão das atrações. STR_6489 :Erro: Versão de Park Incompatível STR_6490 :Aviso: Versão de Park Semi-compatível -STR_6491 :Esse park foi salvo em uma versão posterior do OpenRCT2. O Park é v{INT32} e requer ao menos v{INT32}. +STR_6491 :Esse park foi salvo em uma versão posterior do OpenRCT2. O Park foi salvo na v{INT32} e requer ao menos v{INT32}. Você atualmente está na v{INT32}. STR_6492 :Esse park foi salvo em uma versão antiga do OpenRCT2, e não pode ser aberto com essa versão do OpenRCT2. O Park é v{INT32}. -STR_6493 :Esse park foi salvo em uma versão posterior do OpenRCT2, algumas informações podem ser perdidas. O Park é v{INT32} e requer ao menos v{INT32}. +STR_6493 :Esse park foi salvo em uma versão posterior do OpenRCT2, algumas informações podem ser perdidas. O Park foi salvo na v{INT32}. Você atualmente está na v{INT32}. STR_6494 :Agrupar por tipo de veículo STR_6495 :Agrupar atrações por tipo de veículo em vez de mostrar cada veículo separadamente. STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3619,11 +3617,28 @@ STR_6511 :Giro de Gravidade Zero (direita) STR_6512 :Giro de Gravidade Zero Grande (esquerda) STR_6513 :Giro de Gravidade Zero Grande (direita) STR_6514 :Altura inválida! -STR_6515 :{BLACK}RCT1 não associado - imagens de reserva serão usadas. -STR_6516 :Um ou mais objetos adicionados requerem o RCT1 associado para exibição correta. Imagens de reserva serão usadas. -STR_6517 :Um ou mais objetos nesse parque requerem o RCT1 associado para exibição correta. Imagens de reserva serão usadas. +STR_6515 :{BLACK}RollerCoaster Tycoon 1 não associado - imagens de reserva serão usadas. +STR_6516 :Um ou mais objetos adicionados requerem o RollerCoaster Tycoon 1 associado para exibição correta. Imagens de reserva serão usadas. +STR_6517 :Um ou mais objetos nesse parque requerem o RollerCoaster Tycoon 1 associado para exibição correta. Imagens de reserva serão usadas. STR_6518 :{BLACK}Coloque o mouse sobre um cenário para ver sua descrição e objetivo. Clique para começar a jogar. STR_6519 :Extras +STR_6520 :Conjuntos de Recursos +STR_6521 :Baixa Prioridade +STR_6522 :Alta Prioridade +STR_6523 :Diminuir a prioridade do conjunto de recursos selecionado. +STR_6524 :Aumentar a prioridade do conjunto de recursos selecionado. +STR_6525 :Recarregar todos os recursos do jogo com os conjuntos de recursos selecionados. +STR_6526 :(gráficos, músicas e efeitos sonoros base) +STR_6527 :Competições +STR_6528 :Parâmetros de pista inválidos! +STR_6529 :Parâmetro de esquema de cor inválido! +STR_6530 :User Created Expansion Set +STR_6531 :A Máquina do Tempo +STR_6532 :O Mundo Fantástico de Katy +STR_6533 :{WINDOW_COLOUR_2}Fator de emoção: {BLACK}-{COMMA16}% +STR_6534 :{WINDOW_COLOUR_2}Fator de intensidade: {BLACK}-{COMMA16}% +STR_6535 :{WINDOW_COLOUR_2}Fator de Náusea: {BLACK}-{COMMA16}% +STR_6536 :Esse park foi salvo em uma versão posterior do OpenRCT2. O Park foi salvo na v{INT32}. Você atualmente está na v{INT32}. ############# # Scenarios # @@ -4074,37 +4089,6 @@ STR_DTLS : ## Start OpenRCT2 Official [TTPIRF05] STR_NAME :Telhado - -[TTRFWD01] -STR_NAME :Telhado - -[TTRFWD02] -STR_NAME :Telhado - -[TTRFWD03] -STR_NAME :Telhado - -[TTRFWD04] -STR_NAME :Telhado - -[TTRFWD05] -STR_NAME :Telhado - -[TTRFWD06] -STR_NAME :Telhado - -[TTRFWD07] -STR_NAME :Telhado - -[TTRFWD08] -STR_NAME :Telhado - -[ACWW33] -STR_NAME :Parede de Poste de Madeira - -[ACWWF32] -STR_NAME :Parede de Poste de Madeira - ## End OpenRCT2 Official ############################################################################### @@ -4408,3 +4392,101 @@ STR_DTLS :Este parque temático envelhecido já viu dias melhores. Ajude o do STR_SCNR :Mundo Panda STR_PARK :Mundo Panda STR_DTLS :Adicione mais atrações e atraia mais pessoas a esse parque com temática panda + +### + +STR_SCNR :Cemetery Ridge +STR_PARK :Cemetery Ridge +STR_DTLS :É Halloween, Halloween do UCES, abóboras gritam na calada da noite! Esse cemitério está em apuros e cabe a você salvá-lo enquanto deixa os mortos descansarem em paz! Você consegue manter os fantasmas em seus túmulos e dar calafrios aos seus clientes?{NEWLINE}Autor: Squid + +############################################################################### +## UCES: The Time Machine (2003) +############################################################################### + +STR_SCNR :O Farol de Alexandria +STR_PARK :O Farol de Alexandria +STR_DTLS :Alexandre construiu a cidade; Gregos, romanos, egípcios deixaram suas marcas. Mas a maior honra foi um monumento do mundo antigo - o farol. Visite e faça um parque!{NEWLINE}Autor: Katatude + + +STR_SCNR :Luna Park, Cleveland +STR_PARK :Luna Park +STR_DTLS :Como estava no seu dia de inauguração - 18 de maio de 1905.{NEWLINE}Autor: Aetherwave + + +STR_SCNR :Monte Vesúvio +STR_PARK :Monte Vesúvio +STR_DTLS :Pompeia e Herculano foram soterradas pelo Monte Vesúvio em 79 d.C. Visite as escavações e construa um parque!{NEWLINE}Autor: Katatude + + +STR_SCNR :A Caixa de Areia +STR_PARK :A Caixa de Areia +STR_DTLS :O que todos querem: uma caixa de areia! Então pegue seu baldinho e sua pá e construa um parque!{NEWLINE}Autor: Katatude + + +STR_SCNR :Cataratas e Desfiladeiro do Niágara +STR_PARK :Cataratas do Niágara +STR_DTLS :Cataratas Americanas, Cataratas “Véu da Noiva” & Cataratas “Ferradura” na fronteira Niágara, 1850.{NEWLINE}Autor: Katatude + + +STR_SCNR :Mineradores da Montanha Rochosa +STR_PARK :Mineradores da Montanha Rochosa +STR_DTLS :Um deslizamento de pedras danificou sua linha de trem. Seus trabalhadores saíram para explorar. Há ouro em montanhas-russas?{NEWLINE}Autores: Squid, Buckone, Fossil + + +STR_SCNR :A Máquina do Tempo +STR_PARK :A Máquina do Tempo +STR_DTLS :A Máquina do Tempo. Construa para ir: quando quiser, aonde quiser. A eternidade espera. É tudo relativo.{NEWLINE}Autor: Katatude + + +STR_SCNR :Torre de Babel +STR_PARK :Torre de Babel +STR_DTLS :Eita! Olha aonde a máquina do tempo nos trouxe agora! Aonde foram todos?{NEWLINE}Autor: Fossil + + +STR_SCNR :Transformação +STR_PARK :Transformação +STR_DTLS :Estávamos te esperando…{NEWLINE}Autor: Fossil + + +STR_SCNR :Urbis Incognitus +STR_PARK :Urbis Incognitus +STR_DTLS :Os romanos estão cansados de lutas entediantes de gladiadores. Dê a eles algo mais emocionante, transforme uma cidade romana no maior parque de diversões de todos os tempos!{NEWLINE}Autor: Kaffe + +############################################################################### +## UCES: Katy’s Dreamworld (2003) +############################################################################### + + +STR_SCNR :Debaixo da Árvore de Natal +STR_PARK :Inverno das Maravilhas +STR_DTLS :Mamãe construiu esse cenário debaixo de nossa árvore. Agora ela quer um parque feito nele! Você pode ajudar?{NEWLINE}Autor: Katatude + + +STR_SCNR :Explosão de Pedragrande +STR_PARK :Explosão de Pedragrande +STR_DTLS :Após uma explosão na Companhia de Mineração de Pedragrande, as pessoa de Pedragrande tem de construir um parque de diversões para manter sua cidade viva.{NEWLINE}Autores: rbarclay & buckone + + +STR_SCNR :Acampamento Sabiá +STR_PARK :Acampamento Sabiá +STR_DTLS :Apenas R$500/semana para esse acampamento de verão! Abra sua carteira e se divirta construindo um parque.{NEWLINE}Autor: Katatude + + +STR_SCNR :Cidade do Piuí +STR_PARK :Cidade do Piuí +STR_DTLS :Mamãe! Papai! Quero ir pra Cidade do Piuí!{NEWLINE}Autor: Fossil + + +STR_SCNR :Ilhas do Dragão +STR_PARK :Ilhas do Dragão +STR_DTLS :Ilhas do Dragão? Não tenho certeza se quero ir lá…{NEWLINE}Autor: Fossil + + +STR_SCNR :Kiddie Karnival II +STR_PARK :Kiddie Karnival +STR_DTLS :Ei crianças! Vamos nos divertir!{NEWLINE}Autores: Piehead & Fossil + + +STR_SCNR :Duna de Areia +STR_PARK :Duna de Areia +STR_DTLS :Como o dono de um pequeno parque, você comprou um grande terreno ao longo da praia para expandir e atrair mais visitantes para visitar as lindas dunas de areia, mas cuidado: você não pode perturbar essas dunas de areia frágeis ecologicamente.{NEWLINE}Autor: rbarclay diff --git a/data/language/sv-SE.txt b/data/language/sv-SE.txt index 004a2675c5..d9c07b4a2b 100644 --- a/data/language/sv-SE.txt +++ b/data/language/sv-SE.txt @@ -2711,8 +2711,6 @@ STR_5503 :Skriv in värdsnamn eller IP-adress: STR_5504 :Visa online-status STR_5505 :Kunde inte ansluta till servern. STR_5506 :Besökarna ignorerar intensitetsnivån -STR_5508 :Tillåt filer med inkorrekta kontrollsummor att laddas -STR_5509 :Tillåter spelet att ladda scenarion och sparfiler{NEWLINE}som har inkorrekta kontrollsummor,{NEWLINE}som scenarion från demon och skadade sparfiler. STR_5510 :Standardljudenhet STR_5511 :(OKÄND) STR_5512 :Spara spelet som @@ -3597,9 +3595,7 @@ STR_6487 :Växla genomskinlig personal STR_6488 :{RED}Gästerna klagar på kölängderna i din park. {NEWLINE}Överväg att förkorta problematiska köer, eller öka åkturernas genomströmning. STR_6489 :Fel: Inkompatibel parkversion STR_6490 :Varning: Halvkompatibel parkversion -STR_6491 :Denna park sparades i en nyare version av OpenRCT2. Parken är v{INT32} och kräver åtminstone v{INT32}. STR_6492 :Denna park sparades i en äldre version av OpenRCT2, och kan inte öppnas med denna version av OpenRCT2. Parken är v{INT32}. -STR_6493 :Denna park sparades i en nyare version av OpenRCT2, viss data kan gå förlorad. Parken är v{INT32} och kräver åtminstone v{INT32}. ############# # Scenarion # @@ -4052,36 +4048,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Tak -[TTRFWD01] -STR_NAME :Tak - -[TTRFWD02] -STR_NAME :Tak - -[TTRFWD03] -STR_NAME :Tak - -[TTRFWD04] -STR_NAME :Tak - -[TTRFWD05] -STR_NAME :Tak - -[TTRFWD06] -STR_NAME :Tak - -[TTRFWD07] -STR_NAME :Tak - -[TTRFWD08] -STR_NAME :Tak - -[ACWW33] -STR_NAME :Träpalissad - -[ACWWF32] -STR_NAME :Träpalissadvägg - ## End OpenRCT2 Official diff --git a/data/language/tr-TR.txt b/data/language/tr-TR.txt index 6234b728c5..f2f66f31ff 100644 --- a/data/language/tr-TR.txt +++ b/data/language/tr-TR.txt @@ -94,6 +94,7 @@ STR_0089 :Mini Tren STR_0090 :Küçük Maden Treni STR_0091 :Bilinmeyen Alet (59) STR_0092 :LIM Tren +STR_0096 :Klasik Tahta Tren STR_0512 :Sardal şeklinde tırmanma zinciri rayı ile yükseğe çıkabilen çelik yapılı bir tren STR_0513 :Yolcuların ayakda durdukları koltuksuz tren STR_0514 :Trenin vagonları salıncak gibi yukarıdan aşağı asılı. Virajlarda vagonlar sağa veya sola doğru sallanıyor @@ -173,6 +174,7 @@ STR_0598 :Vidaya benzeyen rayları ile 90 derece havaya fırlatılan ve aynı STR_0599 :Tekli vagonları ve hafif düşüşleri ile ölçülü bir tren STR_0600 :Maden vagonlarından oluşan bu tren ölçülü virajlardan ve düşüşlerden gitmekde STR_0602 :Lineer Indüksiyon Motoru ile 90 derece dikine fırlatılan tren, aynı şekilde 90 derece düşüş ile başlangıca dönüyor +STR_0606 :Hızlı ve zor bir sürüşe sahip, açık havanın tadını çıkarabileceğiniz, bir miktar G kuvveti bulunan, ‘kontrolden-çıkmış’ gibi hissettirmek için tasarlanmış ahşap bir tren. STR_0767 :Müşteri {INT32} STR_0768 :Temizlikci {INT32} STR_0769 :Mühendis {INT32} @@ -743,10 +745,10 @@ STR_1360 :{WINDOW_COLOUR_2}Bekleme süresi: {BLACK}{COMMA16} dakika STR_1361 :Hız değiştirilemiyor… STR_1362 :Başlangıç hızı değiştirilemiyor… STR_1363 :Direkler için çok yüksek! -STR_1364 :Direkler üstedki yol için daha fazla yükseltilemiyor! +STR_1364 :Direkler üsteki yol için daha fazla yükseltilemiyor! STR_1365 :Yuvarlama (sol) STR_1366 :Yuvarlama (sağ) -STR_1367 :Yarı döngü +STR_1367 :Küçük yarı döngü STR_1368 :Yarı kıvrılma (sol) STR_1369 :Yarı kıvrılma (sağ) STR_1370 :Kıvrık yuvarlama (sol) @@ -2702,8 +2704,6 @@ STR_5503 :Host ismini veya IP-Adresini giriniz: STR_5504 :Multiplayer durumunu göster STR_5505 :Server’e bağlanamadı. STR_5506 :Müşteriler şiddet oranını aldırmasın -STR_5508 :Checksum’ı yanlış olan dosyaların yüklenmesine izin ver -STR_5509 :Bu ayar ile bozuk veya arızalı senrayolar ve oyun kayıdları yüklenebiliyor STR_5510 :Varasayılan aygıt STR_5511 :(BILINMIYOR) STR_5512 :Farklı kaydet @@ -2986,7 +2986,7 @@ STR_5832 :Yükseklik birimin “Mesafe ve Hız” bölümünde seçdiğiniz g STR_5833 :Kullanmak istediğiniz tarih formatını seçiniz STR_5834 :Kullanmak istediğiniz ses aygıtını seçiniz STR_5835 :Oyun penceresi simge durumuna getirildiğinde oyununu sesini kıs -STR_5836 :Ana ekran müziğini.{NEWLINE}RCT1 seçildiğinde ya RCT 1’in ‘data’ adlı klasöründen ‘css17.dat’ dosyasını RCT2’nin ‘data’ adlı klasörüne ‘css50.dat’ olarak kopyalamanız yada ‘Diğer Ayarlar’ penceresinden RCT1 klasörünü belirlemeniz gereklidir +STR_5836 :Ana ekran müziğini.{NEWLINE}RCT1 temasını seçmek için ‘Diğer Ayarlar’ penceresinden RCT1 klasörünü belirlemeniz gereklidir. STR_5837 :Arayüzü temları değiştiriniz veya oluşturunuz STR_5838 :Üst araç çubuğunda ‘Finansal Bakış’ simgesini göster/gizle STR_5839 :Üst araç çubuğunda ‘Araştırma’ simgesini göster/gizle @@ -3377,6 +3377,24 @@ STR_6267 :Zemin deneticisini aç STR_6268 :Bir sonraki tick’e atla STR_6269 :Geçersiz hava ID’si STR_6360 :{BLACK}{COMMA32} +STR_6502 :{COMMA16} ve {COMMA16} arasında değer giriniz. +STR_6503 :En az bir istasyon nesnesi seçilmelidir +STR_6504 :En az bir arazi yüzeyi seçilmelidir +STR_6505 :En az bir arazi kenarı seçilmelidir +STR_6514 :Geçersiz yükseklik! +STR_6515 :{BLACK}RCT1 bağlı değil - yedek görüntüler kullanılacak. +STR_6516 :Eklenen bir veya daha fazla nesne, uygun görüntüleme için RCT1'in bağlanmasını gerektirir. Yedek görüntüler kullanılacak. +STR_6517 :Bu parktaki bir veya daha fazla nesne, düzgün görüntüleme için RCT1'in bağlanmasını gerektirir. Yedek görüntüler kullanılacak. +STR_6518 :{BLACK}Açıklamasını ve amacını görüntülemek için bir senaryonun üzerine gelin. Oynamaya başlamak için tıklayın. +STR_6519 :Ekstralar +STR_6520 :Varlık paketleri +STR_6521 :Düşük öncelik +STR_6522 :Yüksek öncelik +STR_6523 :Seçili varlık paketinin önceliğini düşür. +STR_6524 :Seçili varlık paketinin önceliğini yükselt. +STR_6525 :Etkinleştirilmiş varlık paketleri ile beraber oyundaki tüm varlıkları yeniden yükleyin. +STR_6526 :(ana grafikler, müzik ve ses efektleri) +STR_6527 :Yarışmalar ############# # Scenarios # @@ -3827,37 +3845,6 @@ STR_DTLS : ## Start OpenRCT2 Official [TTPIRF05] STR_NAME :Çatı - -[TTRFWD01] -STR_NAME :Çatı - -[TTRFWD02] -STR_NAME :Çatı - -[TTRFWD03] -STR_NAME :Çatı - -[TTRFWD04] -STR_NAME :Çatı - -[TTRFWD05] -STR_NAME :Çatı - -[TTRFWD06] -STR_NAME :Çatı - -[TTRFWD07] -STR_NAME :Çatı - -[TTRFWD08] -STR_NAME :Çatı - -[ACWW33] -STR_NAME :Direkli ahşap duvar - -[ACWWF32] -STR_NAME :Direkli ahşap duvar - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/vi-VN.txt b/data/language/vi-VN.txt index 24924042dc..9b4e8df41d 100644 --- a/data/language/vi-VN.txt +++ b/data/language/vi-VN.txt @@ -2708,8 +2708,6 @@ STR_5503 :Enter hostname or IP address: STR_5504 :Show multiplayer status STR_5505 :Unable to connect to server. STR_5506 :Guests ignore intensities -STR_5508 :Allow loading files with incorrect checksums -STR_5509 :Allows loading scenarios and saves{NEWLINE}that have an incorrect checksum,{NEWLINE}like the scenarios from the demo{NEWLINE}or damaged saves. STR_5510 :Default sound device STR_5511 :(UNKNOWN) STR_5512 :Save Game As @@ -3989,36 +3987,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :Roof -[TTRFWD01] -STR_NAME :Roof - -[TTRFWD02] -STR_NAME :Roof - -[TTRFWD03] -STR_NAME :Roof - -[TTRFWD04] -STR_NAME :Roof - -[TTRFWD05] -STR_NAME :Roof - -[TTRFWD06] -STR_NAME :Roof - -[TTRFWD07] -STR_NAME :Roof - -[TTRFWD08] -STR_NAME :Roof - -[ACWW33] -STR_NAME :Wooden Post Wall - -[ACWWF32] -STR_NAME :Wooden Post Wall - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/zh-CN.txt b/data/language/zh-CN.txt index 0227761ef7..26c02f6b63 100644 --- a/data/language/zh-CN.txt +++ b/data/language/zh-CN.txt @@ -2710,8 +2710,6 @@ STR_5503 :请输入主机名称或IP地址: STR_5504 :显示多人联机状态 STR_5505 :无法连接至服务器. STR_5506 :游客忽略强烈程度 -STR_5508 :允许读取校验失败的文件 -STR_5509 :允许读取校验失败的剧情和存档文件,{NEWLINE}例如试玩版的剧情或损坏的存档. STR_5510 :默认音频设备 STR_5511 :(UNKNOWN) STR_5512 :另存游戏 @@ -2994,8 +2992,8 @@ STR_5831 :修改温度显示的单位 STR_5832 :高度用通用单位替换“距离和速度单位”中设置的单位 STR_5833 :修改日期格式 STR_5834 :选择OpenRCT2使用的音频设备 -STR_5835 :游戏窗口失焦时静音 -STR_5836 :选择主菜单使用的音乐.{NEWLINE}选择过山车大亨1的主题音乐时需要手动将过山车大亨1游戏目录下的‘data/css17.dat’拷贝并重命名为过山车大亨2游戏目录下的‘data/css50.dat’,或者在杂项窗口中设定过山车大亨1的路径. +STR_5835 :当游戏窗口失去焦点时静音 +STR_5836 :选择主菜单使用的音乐.{NEWLINE}若选择过山车大亨1的主题,则需要在杂项选项卡中设定过山车大亨1的路径. STR_5837 :创建并管理自定义游戏界面配色主题 STR_5838 :在工具栏上为财务窗口显示一个单独的按钮 STR_5839 :在工具栏上为研发窗口显示一个单独的按钮 @@ -3595,9 +3593,7 @@ STR_6487 :隐藏雇员切换 STR_6488 :{RED}游客在抱怨排队区的长度.{NEWLINE}请考虑减少造成问题的队列长度或增加设施的游客接待量(试试增加列车数?) STR_6489 :错误: 不兼容的公园版本 STR_6490 :警告: 半兼容的公园版本 -STR_6491 :这个公园是较新版本的OpenRCT2保存的,版本号: v{INT32} 至少需要将游戏更新至 v{INT32} 才可以运行. STR_6492 :这个公园是较早版本的OpenRCT2保存的,无法在此版本的OpenRCT2中打开,版本号: v{INT32} . -STR_6493 :这个公园是较新版本的OpenRCT2保存的,一些数据或许已经丢失,版本号: v{INT32} 至少需要 v{INT32} 才可以运行. STR_6494 :按设施类型分类 STR_6495 :按设施的类型分类显示而不是直接显示各个载具 STR_6496 :{WINDOW_COLOUR_2}{STRINGID} @@ -3619,6 +3615,19 @@ STR_6511 :零重力滚动(向右转) STR_6512 :大型零重力滚动(向左转) STR_6513 :大型零重力滚动(向右转) STR_6514 :无效的高度! +STR_6515 :{BLACK}未链接过山车大亨1——将使用备用图像 +STR_6516 :一个或多个项目附加需要链接过山车大亨1才能正常显示。将使用备用图像显示。 +STR_6517 :在此乐园中的一个或多个项目需要链接过山车大亨1才能正常显示。将使用备用图像显示。 +STR_6518 :{BLACK}将鼠标悬停在剧本上可查看其说明和目标。单击它开始游玩。 +STR_6519 :额外内容 +STR_6520 :资产包 +STR_6521 :低优先级 +STR_6522 :高优先级 +STR_6523 :降低所选资产包的优先级 +STR_6524 :增加所选资产包的优先级 +STR_6525 :使用已启用的资产包重新加载在游戏中的所有资产 +STR_6526 :(基础图形、音乐及音效) +STR_6527 :竞赛 ############# # Scenarios # @@ -4070,37 +4079,6 @@ STR_DTLS : [TTPIRF05] STR_NAME :屋顶 - -[TTRFWD01] -STR_NAME :屋顶 - -[TTRFWD02] -STR_NAME :屋顶 - -[TTRFWD03] -STR_NAME :屋顶 - -[TTRFWD04] -STR_NAME :屋顶 - -[TTRFWD05] -STR_NAME :屋顶 - -[TTRFWD06] -STR_NAME :屋顶 - -[TTRFWD07] -STR_NAME :屋顶 - -[TTRFWD08] -STR_NAME :屋顶 - -[ACWW33] -STR_NAME :木柱墙 - -[ACWWF32] -STR_NAME :木柱墙 - ## End OpenRCT2 Official ############################################################################### diff --git a/data/language/zh-TW.txt b/data/language/zh-TW.txt index ee9e01ffa6..a280e71b9a 100644 --- a/data/language/zh-TW.txt +++ b/data/language/zh-TW.txt @@ -2712,8 +2712,6 @@ STR_5503 :請輸入主機名稱或IP地址: STR_5504 :顯示多人連線狀態 STR_5505 :無法連接至伺服器. STR_5506 :遊客無視設施的刺激度 -STR_5508 :允許載入校驗失敗的檔案 -STR_5509 :允許載入校驗失敗的劇情及存檔, 例如試玩版的劇情或已損壞的存檔. STR_5510 :預設音效裝置 STR_5511 :(未知) STR_5512 :另存遊戲 @@ -3599,9 +3597,7 @@ STR_6487 :開關‘略過員工’選項 STR_6488 :{RED}遊客都在投訴樂園裡的輪侯區長度過長{NEWLINE}請檢查樂園的輪侯區道路設計是否需要改善, 或增加遊樂設施的載客量. STR_6489 :錯誤: 不兼容的樂園文件版本 STR_6490 :警告: 部份兼容的樂園文件版本 -STR_6491 :此樂園從較新的OpenRCT2中儲存. 樂園文件版本為v{INT32}及需要至少v{INT32}. STR_6492 :此樂園從較舊的OpenRCT2中儲存, 而且不能於此版本中開啟. 樂園文件版本為v{INT32}. -STR_6493 :此樂園從較新的OpenRCT2中儲存, 部份資料可能會被遺失. 樂園文件版本為v{INT32}及需要至少v{INT32}. ############# # Scenarios # diff --git a/debian/compat b/debian/compat index ec635144f6..b1bd38b62a 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +13 diff --git a/debian/rules b/debian/rules index 3c39c25d50..60ea49a7b1 100755 --- a/debian/rules +++ b/debian/rules @@ -2,5 +2,19 @@ BUILDDIR=build_dir +# Ignore false warnings with GCC: +# +# stringop-overflow false positive in GCC < 11.3 +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 +# +# maybe-uninitialized false positive in GCC < 12.3 (note 12.3 is currently unreleased) +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937 +# +# Reference OpenRCT2 bug reports: +# https://github.com/OpenRCT2/OpenRCT2/issues/16691 (-Wno-stringop-overflow) +# https://github.com/OpenRCT2/OpenRCT2/issues/17371 (-Wno-maybe-uninitialized -Wno-error=null-dereference) +export DEB_CFLAGS_MAINT_APPEND = -Wno-stringop-overflow -Wno-maybe-uninitialized -Wno-error=null-dereference +export DEB_CXXFLAGS_MAINT_APPEND = -Wno-stringop-overflow -Wno-maybe-uninitialized -Wno-error=null-dereference + %: dh $@ diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 174706643b..82667c54a0 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,3 +1,67 @@ +0.4.3 (in development) +------------------------------------------------------------------------ +- Feature: [#17782] The Flying Coaster now has access to boosters and can draw outside loops. +- Feature: [#17997] The Log Flume can now draw steep pieces down (if vehicle allows it). +- Feature: [#18312, objects#220, OpenSFX#13] New sound effects for the Hybrid and Single Rail roller coasters. +- Feature: [#18675] [Plugin] Plugins can refer to g2 image icons by name. +- Feature: [objects#173] Add alpine coaster vehicle. +- Feature: [objects#221] Add two extra jungle walls. +- Feature: [objects#225] Add log cabin roofs. +- Feature: [OpenMusic#14, OpenMusic#15, OpenMusic#18] Added Galaxy, Acid and Dodgems ride music styles. +- Improved: [#18013, #18016, #18018, #18019, #18514, objects#224] Added colour presets to Spiral Slide, Dodgems, Boat Hire, Flying Saucers, and Car Ride. +- Improved: [#18024] Clearer error messages when loading incompatible .park files. +- Improved: [#18192] Tycoon Park has been added to the Extras tab. +- Improved: [#18214] Competition scenarios have received their own section. +- Improved: [#18250] Added modern style file and folder pickers on Windows. +- Improved: [#18332] Allow Inverted Roller Coaster to draw boosters. +- Improved: [#18350] Changed ride vehicle list to have less padding. +- Improved: [#18422] Allow adding images to music objects. +- Improved: [#18428] [Plugin] Add widget description interfaces to documentation. +- Improved: [#18487] Mini Helicopters track can now draw spinning tunnels. +- Improved: [#18591] Order RollerCoaster Tycoon 2 scenarios by difficulty. +- Improved: [#18607] A new tab for all UCES Scenarios, if it’s installed. +- Improved: [#18621] OpenGL performance. +- Change: [#17677] Open campaign window from finished campaign news. +- Change: [#17998] Show cursor when using inverted mouse dragging. +- Change: [#18230] Make the large flat to steep pieces available on the corkscrew roller coaster without cheats. +- Change: [#18381] Convert custom invisible paths to the built-in ones. +- Change: [OpenSFX#11, OpenMusic#19] First implementation of official replacement asset packs for sound effects & music. +- Fix: [#1491] Clearance of the Cash Machine is too low (original bug). +- Fix: [#1519] “See-through rides” doesn't affect all rides (original bug). +- Fix: [#6341] “Unlock vehicle limits” does not allow setting fewer vehicles than the vehicle type requires. +- Fix: [#14312] Research ride type message incorrect. +- Fix: [#14425] Ride ratings do not skip unallocated ride ids. +- Fix: [#15969] Guests heading for ride use vanilla behaviour +- Fix: [#17067] Random Staff Patrol Area clicks. +- Fix: [#17316] Sides of River Rapids’ corners overlay other parts of the track. +- Fix: [#17657] When switching from buying land rights to buying construction rights, grid disables and won't re-enable afterwards. +- Fix: [#17763] Missing validation on invalid characters in file name. +- Fix: [#17853] Invention name tears while being dragged. +- Fix: [#18064] Unable to dismiss notification messages. +- Fix: [#18070] Underground entrance/exit shows through terrain walls (original bug). +- Fix: [#18094] Underground shops & facilities don't show when adjacent to non-underground path (original bug). +- Fix: [#18122] Ghosts count towards “Great scenery!” guest thought. +- Fix: [#18134] Underground on-ride photo section partially clips through adjacent terrain edge. +- Fix: [#18244] Invention DragWindow's starting position is inconsistent. +- Fix: [#18245] Guests stopping dead in their tracks at railway crossings. +- Fix: [#18257] Guests ‘waiting’ on extended railway crossings. +- Fix: [#18354] Overwrite alert does not show when save name has different casing on Windows. +- Fix: [#18379] Tunnel entrances for underground Mini Golf Hole E are not rendered correctly. +- Fix: [#18442] About window background is clickable. +- Fix: [#18449] [Plugin] Change type of listview widgets from 'scroll_view' to 'listview'. +- Fix: [#18453] Slow walking guests don't get across level crossings in time. +- Fix: [#18469] Land rights window buttons incorrectly disabled and markers remain visible indefinitely. +- Fix: [#18459] ‘Highlight path issues’ hides fences for paths with additions. +- Fix: [#18552] Trains clipping through helixes. +- Fix: [#18576] Cannot open parks with certain types of corrupt tile elements. +- Fix: [#18606] JSON objects do not take priority over the DAT files they supersede. +- Fix: [#18620] [Plugin] Crash when reading widget properties from windows that have both static and tab widgets. +- Fix: [#18653] Negative ratings multipliers do not appear in Vehicle tab. +- Fix: [#18696] Construction rights cannot be viewed after all are purchased. +- Fix: [#18720] Upwards helix is enabled for the Alpine Coaster, even when cheats are off. +- Fix: [#18755] Ferris Wheel and Circus ghosts not coloured correctly. +- Fix: [#18802] Game could crash when determining if a mechanic is heading to fix the ride blocking the path. + 0.4.2 (2022-10-05) ------------------------------------------------------------------------ - Feature: [#6326] Ability to load .SV6 files from RCT Classic that have more than 9601 guests. @@ -11,12 +75,12 @@ - Feature: [#17821] [Plugin] Add API for track subpositions and vehicle subposition. - Feature: [#17877] Add three real-life flying roller coaster colour schemes. - Feature: [#17900] Add “Classic Wooden Coaster” with shallow banked turns. +- Feature: [#18050] Add asset pack manager and asset packs. - Feature: [#18057] Staff members now wait for passing or stalled vehicles before crossing railway tracks. - Feature: [#18168] Add additional track pieces to the LIM Launched Coaster and the Looping Coaster. - Feature: [objects#198] Add additional pirate roofs. - Feature: [objects#205] Add additional glass roofs. - Feature: [objects#209] Add the Steel Roller Coaster train and 2-across Inverted Train from RollerCoaster Tycoon 1. -- Feature: [#18050] Add asset pack manager and asset packs. - Improved: [#15358] Park and scenario names can now contain up to 128 characters. - Improved: [#15589] Numpad Enter can now be used to close text input. - Improved: [#16819] Don’t prompt to “Save game as” when saving a loaded saved game (excepting autosaves). @@ -66,21 +130,21 @@ - Fix: [#17776] “Other Parks” tab uses separate lists for SC4/SC6 and .park scenarios. - Fix: [#17784] Colour preset RNG is biased (original bug). - Fix: [#17788] Guests could leave queue if another guest rejoins it from the entrance building. -- Fix: [#17834] Finance window becomes blank after 4096 years. - Fix: [#17816] Option to pause game when Steam Overlay is active is not greyed out when using the OpenGL renderer. +- Fix: [#17834] Finance window becomes blank after 4096 years. +- Fix: [#17865] With difficult guest generation, tested but unopened rides still contribute to the guest cap. +- Fix: [#17866] [Plugin] Wrong Soft Guest Cap at start of new game. +- Fix: [#17889] Peeps don’t stop at level railway crossings if approached from downhill. - Fix: [#17897] Guest can get stuck on tiles with construction rights outside the park. - Fix: [#17904] Trees are removed at no cost to make way for ride entrance/exits. - Fix: [#17905] The chain button in the map window is enabled for rectangular maps when (re)opened. - Fix: [#17931] The in-game command ‘count_objects’ crashes the game. -- Fix: [#17865] With difficult guest generation, tested but unopened rides still contribute to the guest cap. -- Fix: [#17866] [Plugin] Wrong Soft Guest Cap at start of new game. -- Fix: [#17889] Peeps don’t stop at level railway crossings if approached from downhill. -- Fix: [#17980] Queue lines of track designs mess up existing queue lines if dragged through them. - Fix: [#17959] Areas marked for dirty drawing are too large. - Fix: [#17963] Some marketing campaigns can’t be started after Finances window tab has been on Research. - Fix: [#17964] Sprites don’t show up on two sides of the view-clip selection. - Fix: [#17966] Reversed steel trains do not properly import from S4. - Fix: [#17973] Bins and lamps overlay parts of the land (original bug). +- Fix: [#17980] Queue lines of track designs mess up existing queue lines if dragged through them. - Fix: [#18008] Steeplechase S-bends has multiple gaps visible in the tracks (original bug). - Fix: [#18009] Visual glitch with litter at edge of sloped path. - Fix: [#18025] Fix land ownership in Six Holland, Six Flags Magic Mountain, North America - Grand Canyon and Asia - Great Wall of China Tourism Enhancement scenarios. diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 7267693765..0c68e395a7 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2021 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -230,6 +230,12 @@ declare global { */ getTrackSegment(type: number): TrackSegment | null; + /** + * Gets the image number for the given icon. + * @param iconName The name of the icon. + */ + getIcon(iconName: IconName): number; + /** * Gets a random integer within the specified range using the game's pseudo- * random number generator. This is part of the game state and shared across @@ -1915,7 +1921,7 @@ declare global { * The type of park message, including icon and behaviour. */ type ParkMessageType = - "attraction" | "peep_on_attraction" | "peep" | "money" | "blank" | "research" | "guests" | "award" | "chart"; + "attraction" | "peep_on_attraction" | "peep" | "money" | "blank" | "research" | "guests" | "award" | "chart" | "campaign"; interface ParkMessage { /** @@ -2407,7 +2413,7 @@ declare global { */ interface ScenarioFile { id: number; - category: "beginner" | "challenging" | "expert" | "real" | "other" | "dlc" | "build_your_own"; + category: "beginner" | "challenging" | "expert" | "real" | "other" | "dlc" | "build_your_own" | "competitions"; sourceGame: "rct1" | "rct1_aa" | "rct1_ll" | "rct2" | "rct2_ww" | "rct2_tt" | "real" | "extras" | "other"; path: string; internalName: string; @@ -2537,18 +2543,38 @@ declare global { type Widget = ButtonWidget | CheckboxWidget | ColourPickerWidget | CustomWidget | DropdownWidget | GroupBoxWidget | LabelWidget | ListViewWidget | SpinnerWidget | TextBoxWidget | ViewportWidget; + + type IconName = "arrow_down" | "arrow_up" | "chat" | "cheats" | "copy" | "empty" | "eyedropper" | + "fast_forward" | "game_speed_indicator" | "game_speed_indicator_double" | "glassy_recolourable" | + "hide_full" | "hide_partial" | "hide_scenery" | "hide_supports" | "hide_vegetation" | "hide_vehicles" | + "large_scenery" | "legacy_paths" | "link_chain" | "logo" | "logo_text" | "map_east" | + "map_east_pressed" | "map_gen_land" | "map_gen_noise" | "map_gen_trees" | "map_north" | + "map_north_pressed" | "map_south" | "map_south_pressed" | "map_west" | "map_west_pressed" | + "mountain_tool_even" | "mountain_tool_odd" | "multiplayer" | "multiplayer_desync" | "multiplayer_sync" | + "multiplayer_toolbar" | "multiplayer_toolbar_pressed" | "mute" | "mute_pressed" | "news_messages" | + "normal_selection_6x6" | "paste" | "path_railings" | "path_surfaces" | "paths" | "placeholder" | + "rct1_close_off" | "rct1_close_off_pressed" | "rct1_close_on" | "rct1_close_on_pressed"| "rct1_open_off" | + "rct1_open_off_pressed" | "rct1_open_on" | "rct1_open_on_pressed" | "rct1_simulate_off" | + "rct1_simulate_off_pressed" | "rct1_simulate_on" | "rct1_simulate_on_pressed" | "rct1_test_off" | + "rct1_test_off_pressed" | "rct1_test_on" | "rct1_test_on_pressed" | "reload" | "ride_stations" | + "scenery_scatter_high" | "scenery_scatter_low" | "scenery_scatter_medium" | "search" | + "selection_edge_ne" | "selection_edge_nw" | "selection_edge_se" | "selection_edge_sw" | + "server_password" | "sideways_tab" | "sideways_tab_active" | "simulate" | "small_scenery" | "sort" | + "terrain_edges" | "title_play" | "title_restart" | "title_skip" | "title_stop" | "unmute" | + "unmute_pressed" | "view" | "zoom_in" | "zoom_in_background" | "zoom_out" | "zoom_out_background"; + interface WidgetBase { - readonly window?: Window; - type: WidgetType; + readonly window: Window; + readonly type: WidgetType; x: number; y: number; width: number; height: number; - name?: string; - tooltip?: string; - isDisabled?: boolean; - isVisible?: boolean; + name: string; + tooltip: string; + isDisabled: boolean; + isVisible: boolean; } interface ButtonWidget extends WidgetBase { @@ -2557,73 +2583,63 @@ declare global { * Whether the button has a 3D border. * By default, text buttons have borders and image buttons do not but it can be overridden. */ - border?: boolean; - image?: number; - isPressed?: boolean; - text?: string; - onClick?: () => void; + border: boolean; + image: number | IconName; + isPressed: boolean; + text: string; } interface CheckboxWidget extends WidgetBase { type: "checkbox"; - text?: string; - isChecked?: boolean; - onChange?: (isChecked: boolean) => void; + text: string; + isChecked: boolean; } interface ColourPickerWidget extends WidgetBase { type: "colourpicker"; - colour?: number; - onChange?: (colour: number) => void; + colour: number; } interface CustomWidget extends WidgetBase { type: "custom"; - onDraw?: (this: CustomWidget, g: GraphicsContext) => void; } interface DropdownWidget extends WidgetBase { type: "dropdown"; - items?: string[]; - selectedIndex?: number; - onChange?: (index: number) => void; + items: string[]; + selectedIndex: number; + text: string; } interface GroupBoxWidget extends WidgetBase { type: "groupbox"; - text?: string; - } - - interface LabelWidget extends WidgetBase { - type: "label"; - text?: string; - textAlign?: TextAlignment; + text: string; } type TextAlignment = "left" | "centred"; + interface LabelWidget extends WidgetBase { + type: "label"; + text: string; + textAlign: TextAlignment; + } + + type SortOrder = "none" | "ascending" | "descending"; type ScrollbarType = "none" | "horizontal" | "vertical" | "both"; interface ListViewColumn { - canSort?: boolean; - sortOrder?: SortOrder; - header?: string; - headerTooltip?: string; - width?: number; - ratioWidth?: number; - minWidth?: number; - maxWidth?: number; + canSort: boolean; + sortOrder: SortOrder; + header: string; + headerTooltip: string; + width: number; + ratioWidth: number; + minWidth: number; + maxWidth: number; } - interface ListViewItemSeperator { - type: "seperator"; - text?: string; - } - - type ListViewItem = ListViewItemSeperator | string[]; - interface RowColumn { row: number; column: number; @@ -2631,38 +2647,30 @@ declare global { interface ListViewWidget extends WidgetBase { type: "listview"; - scrollbars?: ScrollbarType; - isStriped?: boolean; - showColumnHeaders?: boolean; - columns?: ListViewColumn[]; - items?: string[] | ListViewItem[]; - selectedCell?: RowColumn; - readonly highlightedCell?: RowColumn; - canSelect?: boolean; - - onHighlight?: (item: number, column: number) => void; - onClick?: (item: number, column: number) => void; + scrollbars: ScrollbarType; + isStriped: boolean; + showColumnHeaders: boolean; + columns: ListViewColumn[]; + items: string[]; + selectedCell: RowColumn; + readonly highlightedCell: RowColumn; + canSelect: boolean; } interface SpinnerWidget extends WidgetBase { type: "spinner"; - text?: string; - - onDecrement?: () => void; - onIncrement?: () => void; - onClick?: () => void; + text: string; } interface TextBoxWidget extends WidgetBase { type: "textbox"; - text?: string; - maxLength?: number; - onChange?: (text: string) => void; + text: string; + maxLength: number; } interface ViewportWidget extends WidgetBase { type: "viewport"; - viewport?: Viewport; + readonly viewport: Viewport; } interface Window { @@ -2673,10 +2681,10 @@ declare global { /** * The window is resizable (by the user) if and only if minWidth !== maxWidth or minHeight !== maxHeight. * In that case, the window displays a small widget in the lower right corner that the user can use to resize the window by clicking and dragging. - * + * * When writing to width (or height), if the window is resizable, the new value will be clamped to fit the corresponding min/max values. * Otherwise, if the window is not resizable, both the width (or height) and the corresponding min/max values are set to the new value. - * + * * For the default min/max values, see {@link WindowDesc}. */ width: number; @@ -2696,6 +2704,115 @@ declare global { findWidget(name: string): T; } + type WidgetDesc = + ButtonDesc | CheckboxDesc | ColourPickerDesc | CustomDesc | DropdownDesc | GroupBoxDesc | + LabelDesc | ListViewDesc | SpinnerDesc | TextBoxDesc | ViewportDesc; + + interface WidgetBaseDesc { + type: WidgetType; + x: number; + y: number; + width: number; + height: number; + name?: string; + tooltip?: string; + isDisabled?: boolean; + isVisible?: boolean; + } + + interface ButtonDesc extends WidgetBaseDesc { + type: "button"; + /** + * Whether the button has a 3D border. + * By default, text buttons have borders and image buttons do not but it can be overridden. + */ + border?: boolean; + image?: number; + isPressed?: boolean; + text?: string; + onClick?: () => void; + } + + interface CheckboxDesc extends WidgetBaseDesc { + type: "checkbox"; + text?: string; + isChecked?: boolean; + onChange?: (isChecked: boolean) => void; + } + + interface ColourPickerDesc extends WidgetBaseDesc { + type: "colourpicker"; + colour?: number; + onChange?: (colour: number) => void; + } + + interface CustomDesc extends WidgetBaseDesc { + type: "custom"; + onDraw?: (this: CustomWidget, g: GraphicsContext) => void; + } + + interface DropdownDesc extends WidgetBaseDesc { + type: "dropdown"; + items?: string[]; + selectedIndex?: number; + onChange?: (index: number) => void; + } + + interface GroupBoxDesc extends WidgetBaseDesc { + type: "groupbox"; + text?: string; + } + + interface LabelDesc extends WidgetBaseDesc { + type: "label"; + text?: string; + textAlign?: TextAlignment; + } + + interface ListViewItemSeperator { + type: "seperator"; + text?: string; + } + + type ListViewItem = ListViewItemSeperator | string[]; + + interface RowColumn { + row: number; + column: number; + } + + interface ListViewDesc extends WidgetBaseDesc { + type: "listview"; + scrollbars?: ScrollbarType; + isStriped?: boolean; + showColumnHeaders?: boolean; + columns?: Partial[]; + items?: string[] | ListViewItem[]; + selectedCell?: RowColumn; + canSelect?: boolean; + onHighlight?: (item: number, column: number) => void; + onClick?: (item: number, column: number) => void; + } + + interface SpinnerDesc extends WidgetBaseDesc { + type: "spinner"; + text?: string; + onDecrement?: () => void; + onIncrement?: () => void; + onClick?: () => void; + } + + interface TextBoxDesc extends WidgetBaseDesc { + type: "textbox"; + text?: string; + maxLength?: number; + onChange?: (text: string) => void; + } + + interface ViewportDesc extends WidgetBaseDesc { + type: "viewport"; + } + interface WindowDesc { classification: string; x?: number; @@ -2706,7 +2823,7 @@ declare global { id?: number; /** * See {@link Window} for information about the behaviour of min/max width/height after window creation. - * + * * Behaviour during window creation: * If at least one of the parameters min/max width/height is present, the window is considered to be resizable. * In that case, the min values default to zero (if unspecified) and the max values default to 0xFFFF (if unspecified). @@ -2716,7 +2833,7 @@ declare global { minHeight?: number; maxWidth?: number; maxHeight?: number; - widgets?: Widget[]; + widgets?: WidgetDesc[]; colours?: number[]; tabs?: WindowTabDesc[]; tabIndex?: number; @@ -2734,8 +2851,8 @@ declare global { } interface WindowTabDesc { - image: number | ImageAnimation; - widgets?: Widget[]; + image: number | ImageAnimation | IconName; + widgets?: WidgetDesc[]; } interface Viewport { diff --git a/openrct2.common.props b/openrct2.common.props index fd137d0d7f..6afb7deebf 100644 --- a/openrct2.common.props +++ b/openrct2.common.props @@ -10,7 +10,7 @@ $(DefaultPlatformToolset) 10.0.17763.0 - MultiByte + Unicode $(SolutionDir)bin\ $(SolutionDir)obj\$(ProjectName)\$(Configuration)_$(Platform)\ diff --git a/openrct2.proj b/openrct2.proj index 5bdd85d425..87bae6926c 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -45,10 +45,14 @@ f3a03c2e7b610fefa28d6962da10144f6324078d https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.0/title-sequences.zip 4ab0065e5a4d9f9c77d94718bbdfcfcd5a389da0 - https://github.com/OpenRCT2/objects/releases/download/v1.3.5/objects.zip - 58bddc5f845d8c7eb5d9fd25e52ab1fed24c85db - https://github.com/OpenRCT2/replays/releases/download/v0.0.69/replays.zip - 3EC20AA2C90FDEEB08C26B6DA6D111C9C5C9B694 + https://github.com/OpenRCT2/objects/releases/download/v1.3.7/objects.zip + 82930d549e0b3c3bce29718d5390c5cd474d0f28 + https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.1/opensound.zip + 8f04aea33f8034131c3069f6accacce0d94f80c1 + https://github.com/OpenRCT2/OpenMusic/releases/download/v1.0.1/openmusic.zip + 8ff94490180e2fbfdd13a4130eb300da726ca406 + https://github.com/OpenRCT2/replays/releases/download/v0.0.70/replays.zip + 09B339E86AAE81580C5AC3E23AC4BC9E030DA076 @@ -128,6 +132,24 @@ OutputDirectory="$(TargetDir)data\object" /> + + + + + + + + + + = 1.0) + - libpng (>= 1.2) + - speexdsp (only for UI client) + - curl (only if building with http support) + - nlohmann-json (>= 3.6.0) + - openssl (>= 1.0; only if building with multiplayer support) + - icu (>= 59.0) + - zlib + - gl (commonly provided by Mesa or GPU vendors; only for UI client, can be disabled) + - cmake + - benchmark (optional) + - innoextract (optional runtime dependency; used for GOG installer extraction during setup) + - libogg + - libvorbis + - flac + +See the wiki for [the actual package names used in pacman](https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-MSYS2-MinGW). ### macOS: - Xcode Command Line Tools - [Homebrew](https://brew.sh) - CMake (available through Homebrew) - ### Linux: +- gcc (>= 7.1) or clang (>= 8.0.0) (for C++17 support) - sdl2 (only for UI client) - freetype (can be disabled) - fontconfig (can be disabled) @@ -148,21 +168,19 @@ msbuild openrct2.proj /t:PublishPortable ### macOS: #### CMake: -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: +CMake can build either a self-contained application bundle, which includes 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 dependencies 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 +cmake -S . -B build +cmake --build build --target 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 + +cmake -S . -B build -DMACOS_BUNDLE=off +cmake --build build +cmake --build build --target install ln -s ../data data ``` Then you can run the game by running `./openrct2`. @@ -174,17 +192,23 @@ Detailed instructions can be found on [Building OpenRCT2 on macOS using CMake](h ### Linux: The standard CMake build procedure is to install the [required libraries](https://github.com/OpenRCT2/OpenRCT2#linux), then: ``` -mkdir build -cd build -cmake ../ # set your standard cmake options, e.g. build type here - For example, -DCMAKE_BUILD_TYPE=RelWithDebInfo -make # you can parallelise your build job with e.g. -j8 or consider using ninja -DESTDIR=. make install # the install target creates all the necessary files in places we expect them +cmake -S . -B build -DCMAKE_INSTALL_PREFIX=. # set your standard cmake options, e.g. build type here - For example, -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake --build build # you can parallelise your build job with e.g. -j 8 or consider using ninja +cmake --build build --target install # the install target creates all the necessary files in places we expect them ``` -You can also use Ninja in place of Make, if you prefer, see Wiki for details. +You can also use Ninja in place of Make using `-G Ninja` in the first command, if you prefer, see Wiki for details. Detailed instructions can be found on [Building OpenRCT2 on Linux](https://github.com/OpenRCT2/OpenRCT2/wiki/Building-OpenRCT2-on-Linux). +Note: the `cmake -S . -B build` syntax is available for CMake >= 3.14. For older versions use: +``` +mkdir build +cd build +cmake .. -DCMAKE_INSTALL_PREFIX=. # set your standard cmake options, e.g. build type here - For example, -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake --build . --target install +``` + --- # 4. Contributing diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index a04f68bb3a..6e5a160a26 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -1,4 +1,10 @@ [ + { + "path": "empty.png" + }, + { + "path": "placeholder.png" + }, { "path": "logo.png" }, @@ -17,9 +23,6 @@ { "path": "icons/map_gen_land.png" }, - { - "path": "placeholder.png" - }, { "path": "icons/zoom_in.png" }, @@ -98,78 +101,6 @@ { "path": "icons/cheats.png" }, - { - "path": "track/junior/flat_to_steep_1.png" - }, - { - "path": "track/junior/flat_to_steep_2_1.png" - }, - { - "path": "track/junior/flat_to_steep_3_1.png" - }, - { - "path": "track/junior/flat_to_steep_4.png" - }, - { - "path": "track/junior/flat_to_steep_2_2.png" - }, - { - "path": "track/junior/flat_to_steep_3_2.png" - }, - { - "path": "track/junior/steep_to_flat_1.png" - }, - { - "path": "track/junior/steep_to_flat_2_1.png" - }, - { - "path": "track/junior/steep_to_flat_3_1.png" - }, - { - "path": "track/junior/steep_to_flat_4.png" - }, - { - "path": "track/junior/steep_to_flat_2_2.png" - }, - { - "path": "track/junior/steep_to_flat_3_2.png" - }, - { - "path": "track/junior/flat_to_steep_lift_1.png" - }, - { - "path": "track/junior/flat_to_steep_lift_2_1.png" - }, - { - "path": "track/junior/flat_to_steep_lift_3_1.png" - }, - { - "path": "track/junior/flat_to_steep_lift_4.png" - }, - { - "path": "track/junior/flat_to_steep_lift_2_2.png" - }, - { - "path": "track/junior/flat_to_steep_lift_3_2.png" - }, - { - "path": "track/junior/steep_to_flat_lift_1.png" - }, - { - "path": "track/junior/steep_to_flat_lift_2_1.png" - }, - { - "path": "track/junior/steep_to_flat_lift_3_1.png" - }, - { - "path": "track/junior/steep_to_flat_lift_4.png" - }, - { - "path": "track/junior/steep_to_flat_lift_2_2.png" - }, - { - "path": "track/junior/steep_to_flat_lift_3_2.png" - }, { "path": "icons/news_messages.png" }, @@ -179,54 +110,6 @@ { "path": "icons/multiplayer.png" }, - { - "path": "track/junior/flat_to_steep_diagonal_1.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_2.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_3.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_4.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_1.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_2.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_3.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_4.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_lift_1.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_lift_2.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_lift_3.png" - }, - { - "path": "track/junior/flat_to_steep_diagonal_lift_4.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_lift_1.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_lift_2.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_lift_3.png" - }, - { - "path": "track/junior/steep_to_flat_diagonal_lift_4.png" - }, { "path": "icons/sort.png" }, @@ -236,28 +119,6 @@ { "path": "icons/paste.png" }, - { - "path": "track/intamin/booster_1.png" - }, - { - "path": "track/intamin/booster_2.png" - }, - { - "path": "track/bm/booster_1.png" - }, - { - "path": "track/bm/booster_2.png" - }, - { - "path": "track/junior/booster_1.png", - "x_offset": -21, - "y_offset": 0 - }, - { - "path": "track/junior/booster_2.png", - "x_offset": -22, - "y_offset": 1 - }, { "path": "icons/mute.png" }, @@ -270,114 +131,9 @@ { "path": "icons/unmute_pressed.png" }, - { - "path": "track/mini/booster_1.png" - }, - { - "path": "track/mini/booster_2.png" - }, - { - "path": "track/railway/quarter_turn_3_tiles_sw_se_part_3.png", - "x_offset": -8, - "y_offset": 1 - }, - { - "path": "track/railway/gravel_sw_ne.png", - "x_offset": -33, - "y_offset": -2 - }, - { - "path": "track/railway/gravel_nw_se.png", - "x_offset": -21, - "y_offset": -2 - }, - { - "path": "track/railway/grooved_sw_ne.png", - "x_offset": -28, - "y_offset": -1 - }, - { - "path": "track/railway/grooved_nw_se.png", - "x_offset": -14, - "y_offset": -2 - }, - { - "path": "track/railway/grooved_sw_ne_trans.png", - "x_offset": -28, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/railway/grooved_nw_se_trans.png", - "x_offset": -14, - "y_offset": -2, - "palette": "keep" - }, - { - "path": "track/railway/grooved_end_ne_trans.png", - "x_offset": -28, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/railway/grooved_end_se_trans.png", - "x_offset": -14, - "y_offset": -2, - "palette": "keep" - }, - { - "path": "track/railway/grooved_end_nw_trans.png", - "x_offset": -14, - "y_offset": -2, - "palette": "keep" - }, - { - "path": "track/railway/grooved_end_sw_trans.png", - "x_offset": -26, - "y_offset": -2, - "palette": "keep" - }, - { - "path": "track/railway/grooved_end_sw_ne_trans.png", - "x_offset": -28, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/railway/grooved_end_nw_se_trans.png", - "x_offset": -14, - "y_offset": -2, - "palette": "keep" - }, { "path": "icons/search.png" }, - { - "path": "surface/glassy_recolourable.png", - "x_offset": -32, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "surface/selection_edge_nw.png", - "x_offset": -32, - "y_offset": -1 - }, - { - "path": "surface/selection_edge_ne.png", - "x_offset": 0, - "y_offset": -1 - }, - { - "path": "surface/selection_edge_sw.png", - "x_offset": -32, - "y_offset": 15 - }, - { - "path": "surface/selection_edge_se.png", - "x_offset": 0, - "y_offset": 15 - }, { "path": "icons/eyedropper.png", "x_offset": 5, @@ -465,16 +221,6 @@ { "path": "tool/scenery_scatter_high.png" }, - { - "path": "track/wooden/booster_1.png", - "x_offset": -34, - "y_offset": -15 - }, - { - "path": "track/wooden/booster_2.png", - "x_offset": -30, - "y_offset": -15 - }, { "path": "icons/view.png" }, @@ -555,6 +301,32 @@ "x_offset": 2, "y_offset": 2 }, + { + "path": "surface/glassy_recolourable.png", + "x_offset": -32, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "surface/selection_edge_nw.png", + "x_offset": -32, + "y_offset": -1 + }, + { + "path": "surface/selection_edge_ne.png", + "x_offset": 0, + "y_offset": -1 + }, + { + "path": "surface/selection_edge_sw.png", + "x_offset": -32, + "y_offset": 15 + }, + { + "path": "surface/selection_edge_se.png", + "x_offset": 0, + "y_offset": 15 + }, { "path": "font/latin/ae-uc-small.png", "y_offset": 0, @@ -2376,6 +2148,2376 @@ "palette": "keep", "forceBmp": true }, + { + "path": "track/junior/flat_to_steep_1.png" + }, + { + "path": "track/junior/flat_to_steep_2_1.png" + }, + { + "path": "track/junior/flat_to_steep_3_1.png" + }, + { + "path": "track/junior/flat_to_steep_4.png" + }, + { + "path": "track/junior/flat_to_steep_2_2.png" + }, + { + "path": "track/junior/flat_to_steep_3_2.png" + }, + { + "path": "track/junior/steep_to_flat_1.png" + }, + { + "path": "track/junior/steep_to_flat_2_1.png" + }, + { + "path": "track/junior/steep_to_flat_3_1.png" + }, + { + "path": "track/junior/steep_to_flat_4.png" + }, + { + "path": "track/junior/steep_to_flat_2_2.png" + }, + { + "path": "track/junior/steep_to_flat_3_2.png" + }, + { + "path": "track/junior/flat_to_steep_lift_1.png" + }, + { + "path": "track/junior/flat_to_steep_lift_2_1.png" + }, + { + "path": "track/junior/flat_to_steep_lift_3_1.png" + }, + { + "path": "track/junior/flat_to_steep_lift_4.png" + }, + { + "path": "track/junior/flat_to_steep_lift_2_2.png" + }, + { + "path": "track/junior/flat_to_steep_lift_3_2.png" + }, + { + "path": "track/junior/steep_to_flat_lift_1.png" + }, + { + "path": "track/junior/steep_to_flat_lift_2_1.png" + }, + { + "path": "track/junior/steep_to_flat_lift_3_1.png" + }, + { + "path": "track/junior/steep_to_flat_lift_4.png" + }, + { + "path": "track/junior/steep_to_flat_lift_2_2.png" + }, + { + "path": "track/junior/steep_to_flat_lift_3_2.png" + }, + { + "path": "track/junior/booster_1.png", + "x_offset": -21, + "y_offset": 0 + }, + { + "path": "track/junior/booster_2.png", + "x_offset": -22, + "y_offset": 1 + }, + { + "path": "track/intamin/booster_1.png" + }, + { + "path": "track/intamin/booster_2.png" + }, + { + "path": "track/bm/booster_1.png" + }, + { + "path": "track/bm/booster_2.png" + }, + { + "path": "track/mini/booster_1.png" + }, + { + "path": "track/mini/booster_2.png" + }, + { + "path": "track/railway/quarter_turn_3_tiles_sw_se_part_3.png", + "x_offset": -8, + "y_offset": 1 + }, + { + "path": "track/railway/gravel_sw_ne.png", + "x_offset": -33, + "y_offset": -2 + }, + { + "path": "track/railway/gravel_nw_se.png", + "x_offset": -21, + "y_offset": -2 + }, + { + "path": "track/railway/grooved_sw_ne.png", + "x_offset": -28, + "y_offset": -1 + }, + { + "path": "track/railway/grooved_nw_se.png", + "x_offset": -14, + "y_offset": -2 + }, + { + "path": "track/railway/grooved_sw_ne_trans.png", + "x_offset": -28, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/railway/grooved_nw_se_trans.png", + "x_offset": -14, + "y_offset": -2, + "palette": "keep" + }, + { + "path": "track/railway/grooved_end_ne_trans.png", + "x_offset": -28, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/railway/grooved_end_se_trans.png", + "x_offset": -14, + "y_offset": -2, + "palette": "keep" + }, + { + "path": "track/railway/grooved_end_nw_trans.png", + "x_offset": -14, + "y_offset": -2, + "palette": "keep" + }, + { + "path": "track/railway/grooved_end_sw_trans.png", + "x_offset": -26, + "y_offset": -2, + "palette": "keep" + }, + { + "path": "track/railway/grooved_end_sw_ne_trans.png", + "x_offset": -28, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/railway/grooved_end_nw_se_trans.png", + "x_offset": -14, + "y_offset": -2, + "palette": "keep" + }, + { + "path": "track/wooden/booster_1.png", + "x_offset": -34, + "y_offset": -15 + }, + { + "path": "track/wooden/booster_2.png", + "x_offset": -30, + "y_offset": -15 + }, + { + "path": "track/wooden/station_block_brake_open_sw_ne.png", + "x_offset": -34, + "y_offset": -8 + }, + { + "path": "track/wooden/station_block_brake_open_nw_se.png", + "x_offset": -30, + "y_offset": -8 + }, + { + "path": "track/wooden/station_block_brake_closed_sw_ne.png", + "x_offset": -34, + "y_offset": -8 + }, + { + "path": "track/wooden/station_block_brake_closed_nw_se.png", + "x_offset": -30, + "y_offset": -8 + }, + { + "path": "track/wooden/classic_wooden_preview_track.png", + "x_offset": 1, + "y_offset": 1 + }, + { + "path": "track/wooden/classic_wooden_preview_supports.png", + "x_offset": 2, + "y_offset": 1 + }, + { + "path": "track/bm_invert/booster_1.png", + "x_offset": -25, + "y_offset": -5 + }, + { + "path": "track/bm_invert/booster_2.png", + "x_offset": -25, + "y_offset": -5 + }, + { + "path": "track/lim/barrel_roll_left_1_1.png", + "x_offset": -22, + "y_offset": 9, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_1_2.png", + "x_offset": -11, + "y_offset": 7, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_1_3.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_1_4.png", + "x_offset": -22, + "y_offset": -16, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_1_5.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_1_6.png", + "x_offset": -12, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_2_1.png", + "x_offset": -19, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_2_2.png", + "x_offset": -22, + "y_offset": 6, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_2_3.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_2_4.png", + "x_offset": -28, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_2_5.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_2_6.png", + "x_offset": -32, + "y_offset": -18, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_3_1.png", + "x_offset": -29, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_3_2.png", + "x_offset": -2, + "y_offset": 6, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_3_3.png", + "x_offset": -25, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_3_4.png", + "x_offset": -27, + "y_offset": -12, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_3_5.png", + "x_offset": 2, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_3_6.png", + "x_offset": -22, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_4_1.png", + "x_offset": -15, + "y_offset": -12, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_4_2.png", + "x_offset": 1, + "y_offset": 18, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_4_3.png", + "x_offset": -12, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_4_4.png", + "x_offset": -10, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_4_5.png", + "x_offset": 11, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_left_4_6.png", + "x_offset": -22, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_1_1.png", + "x_offset": -23, + "y_offset": -12, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_1_2.png", + "x_offset": -11, + "y_offset": 16, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_1_3.png", + "x_offset": -28, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_1_4.png", + "x_offset": -23, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_1_5.png", + "x_offset": -21, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_1_6.png", + "x_offset": -23, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_2_1.png", + "x_offset": -22, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_2_2.png", + "x_offset": -22, + "y_offset": 7, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_2_3.png", + "x_offset": -10, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_2_4.png", + "x_offset": 3, + "y_offset": -12, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_2_5.png", + "x_offset": -7, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_2_6.png", + "x_offset": -6, + "y_offset": -18, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_3_1.png", + "x_offset": -1, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_3_2.png", + "x_offset": -4, + "y_offset": 6, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_3_3.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_3_4.png", + "x_offset": 0, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_3_5.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_3_6.png", + "x_offset": -22, + "y_offset": -18, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_4_1.png", + "x_offset": -9, + "y_offset": 9, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_4_2.png", + "x_offset": -20, + "y_offset": 7, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_4_3.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_4_4.png", + "x_offset": -28, + "y_offset": -16, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_4_5.png", + "x_offset": 0, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/barrel_roll_right_4_6.png", + "x_offset": -23, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_1_1.png", + "x_offset": -28, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_1_2.png", + "x_offset": -22, + "y_offset": -40, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_1_3.png", + "x_offset": -15, + "y_offset": -82, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_1_4.png", + "x_offset": -22, + "y_offset": 24, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_2_1.png", + "x_offset": -16, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_2_2.png", + "x_offset": 1, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_2_3.png", + "x_offset": -38, + "y_offset": -114, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_2_4.png", + "x_offset": -22, + "y_offset": 12, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_3_1.png", + "x_offset": -25, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_3_2.png", + "x_offset": -27, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_3_3.png", + "x_offset": -1, + "y_offset": -121, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_3_4.png", + "x_offset": -24, + "y_offset": 4, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_4_1.png", + "x_offset": -14, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_4_2.png", + "x_offset": -16, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_4_3.png", + "x_offset": 5, + "y_offset": -91, + "palette": "keep" + }, + { + "path": "track/lim/half_loop_4_4.png", + "x_offset": 6, + "y_offset": 16, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_1_1.png", + "x_offset": -22, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_1_2.png", + "x_offset": -22, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_1_3.png", + "x_offset": -21, + "y_offset": -27, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_1_4.png", + "x_offset": -23, + "y_offset": -46, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_2_1.png", + "x_offset": -22, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_2_2.png", + "x_offset": -25, + "y_offset": -5, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_2_3.png", + "x_offset": -25, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_2_4.png", + "x_offset": -20, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_3_1.png", + "x_offset": -23, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_3_2.png", + "x_offset": -24, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_3_3.png", + "x_offset": -23, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_3_4.png", + "x_offset": -23, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_4_1.png", + "x_offset": -21, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_4_2.png", + "x_offset": -23, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_4_3.png", + "x_offset": -23, + "y_offset": -27, + "palette": "keep" + }, + { + "path": "track/lim/flat_to_steep_up_4_4.png", + "x_offset": -22, + "y_offset": -46, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_1_1.png", + "x_offset": -24, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_1_2.png", + "x_offset": -24, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_1_3.png", + "x_offset": -24, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_1_4.png", + "x_offset": -23, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_2_1.png", + "x_offset": -24, + "y_offset": -26, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_2_2.png", + "x_offset": -19, + "y_offset": -14, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_2_3.png", + "x_offset": -12, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_2_4.png", + "x_offset": -15, + "y_offset": -2, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_3_1.png", + "x_offset": -14, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_3_2.png", + "x_offset": -13, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_3_3.png", + "x_offset": -18, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_3_4.png", + "x_offset": -22, + "y_offset": -5, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_4_1.png", + "x_offset": -21, + "y_offset": -41, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_4_2.png", + "x_offset": -20, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_4_3.png", + "x_offset": -19, + "y_offset": -18, + "palette": "keep" + }, + { + "path": "track/lim/steep_to_flat_up_4_4.png", + "x_offset": -22, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_1_1.png", + "x_offset": -22, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_1_2.png", + "x_offset": -21, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_1_3.png", + "x_offset": -29, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_1_4.png", + "x_offset": -22, + "y_offset": -44, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_1_5.png", + "x_offset": -22, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_2_1.png", + "x_offset": -22, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_2_2.png", + "x_offset": -32, + "y_offset": -10, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_2_3.png", + "x_offset": -23, + "y_offset": -46, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_2_4.png", + "x_offset": -19, + "y_offset": -52, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_2_5.png", + "x_offset": -15, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_3_1.png", + "x_offset": -16, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_3_2.png", + "x_offset": -13, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_3_3.png", + "x_offset": 17, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_3_4.png", + "x_offset": -8, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_3_5.png", + "x_offset": -16, + "y_offset": -24, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_4_1.png", + "x_offset": -24, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_4_2.png", + "x_offset": -24, + "y_offset": -23, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_4_3.png", + "x_offset": -14, + "y_offset": -9, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_4_4.png", + "x_offset": -14, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_left_4_5.png", + "x_offset": -22, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_1_1.png", + "x_offset": -22, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_1_2.png", + "x_offset": -23, + "y_offset": -24, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_1_3.png", + "x_offset": -21, + "y_offset": -9, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_1_4.png", + "x_offset": -30, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_1_5.png", + "x_offset": -32, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_2_1.png", + "x_offset": -22, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_2_2.png", + "x_offset": -16, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_2_3.png", + "x_offset": -24, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_2_4.png", + "x_offset": -16, + "y_offset": -31, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_2_5.png", + "x_offset": -22, + "y_offset": -23, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_3_1.png", + "x_offset": -18, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_3_2.png", + "x_offset": -16, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_3_3.png", + "x_offset": -26, + "y_offset": -47, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_3_4.png", + "x_offset": -29, + "y_offset": -53, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_3_5.png", + "x_offset": -23, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_4_1.png", + "x_offset": -22, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_4_2.png", + "x_offset": -10, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_4_3.png", + "x_offset": 17, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_4_4.png", + "x_offset": -11, + "y_offset": -44, + "palette": "keep" + }, + { + "path": "track/lim/large_corkscrew_right_4_5.png", + "x_offset": -18, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_1_1.png", + "x_offset": -26, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_1_2.png", + "x_offset": -18, + "y_offset": -10, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_2_1.png", + "x_offset": 37, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_2_2.png", + "x_offset": -16, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_2_3.png", + "x_offset": -38, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_3_1.png", + "x_offset": -19, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_3_2.png", + "x_offset": -6, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_4_1.png", + "x_offset": -26, + "y_offset": -9, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_left_bank_to_gentle_up_4_2.png", + "x_offset": -29, + "y_offset": 4, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_1_1.png", + "x_offset": -28, + "y_offset": -10, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_1_2.png", + "x_offset": -26, + "y_offset": 4, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_2_1.png", + "x_offset": -14, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_2_2.png", + "x_offset": -29, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_3_1.png", + "x_offset": -38, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_3_2.png", + "x_offset": -38, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_3_3.png", + "x_offset": -17, + "y_offset": -10, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_4_1.png", + "x_offset": -7, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/small_turn_right_bank_to_gentle_up_4_2.png", + "x_offset": -19, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_1_1.png", + "x_offset": -23, + "y_offset": -29, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_1_2.png", + "x_offset": -23, + "y_offset": -46, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_1_3.png", + "x_offset": -30, + "y_offset": -80, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_1_4.png", + "x_offset": 0, + "y_offset": -114, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_1_5.png", + "x_offset": -22, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_2_1.png", + "x_offset": -22, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_2_2.png", + "x_offset": 0, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_2_3.png", + "x_offset": 0, + "y_offset": -82, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_2_4.png", + "x_offset": -31, + "y_offset": -143, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_2_5.png", + "x_offset": -23, + "y_offset": -36, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_3_1.png", + "x_offset": -17, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_3_2.png", + "x_offset": 0, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_3_3.png", + "x_offset": -2, + "y_offset": -52, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_3_4.png", + "x_offset": -32, + "y_offset": -148, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_3_5.png", + "x_offset": -16, + "y_offset": -36, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_4_1.png", + "x_offset": -22, + "y_offset": -14, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_4_2.png", + "x_offset": -24, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_4_3.png", + "x_offset": -30, + "y_offset": -26, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_4_4.png", + "x_offset": -9, + "y_offset": -118, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_left_4_5.png", + "x_offset": -23, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_1_1.png", + "x_offset": -22, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_1_2.png", + "x_offset": -20, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_1_3.png", + "x_offset": -18, + "y_offset": -27, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_1_4.png", + "x_offset": -15, + "y_offset": -118, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_1_5.png", + "x_offset": -23, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_2_1.png", + "x_offset": -22, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_2_2.png", + "x_offset": -32, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_2_3.png", + "x_offset": -32, + "y_offset": -52, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_2_4.png", + "x_offset": -25, + "y_offset": -148, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_2_5.png", + "x_offset": -22, + "y_offset": -36, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_3_1.png", + "x_offset": -32, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_3_2.png", + "x_offset": -32, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_3_3.png", + "x_offset": -32, + "y_offset": -82, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_3_4.png", + "x_offset": -9, + "y_offset": -143, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_3_5.png", + "x_offset": -12, + "y_offset": -35, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_4_1.png", + "x_offset": -22, + "y_offset": -29, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_4_2.png", + "x_offset": -16, + "y_offset": -46, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_4_3.png", + "x_offset": -2, + "y_offset": -80, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_4_4.png", + "x_offset": -32, + "y_offset": -115, + "palette": "keep" + }, + { + "path": "track/lim/medium_half_loop_right_4_5.png", + "x_offset": -32, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_1.png", + "x_offset": -23, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_2.png", + "x_offset": -20, + "y_offset": -38, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_3.png", + "x_offset": -20, + "y_offset": -65, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_4.png", + "x_offset": -24, + "y_offset": -80, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_5.png", + "x_offset": -15, + "y_offset": -64, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_6.png", + "x_offset": -9, + "y_offset": -171, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_1_7.png", + "x_offset": -21, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_1.png", + "x_offset": -22, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_2.png", + "x_offset": -6, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_3.png", + "x_offset": -9, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_4.png", + "x_offset": -8, + "y_offset": -90, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_5.png", + "x_offset": -32, + "y_offset": -126, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_6.png", + "x_offset": -26, + "y_offset": -192, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_2_7.png", + "x_offset": -23, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_1.png", + "x_offset": -24, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_2.png", + "x_offset": -29, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_3.png", + "x_offset": -24, + "y_offset": -33, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_4.png", + "x_offset": -5, + "y_offset": -56, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_5.png", + "x_offset": -6, + "y_offset": -112, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_6.png", + "x_offset": -21, + "y_offset": -192, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_3_7.png", + "x_offset": -26, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_1.png", + "x_offset": -23, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_2.png", + "x_offset": -29, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_3.png", + "x_offset": -32, + "y_offset": -48, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_4.png", + "x_offset": -32, + "y_offset": -79, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_5.png", + "x_offset": 17, + "y_offset": -57, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_6.png", + "x_offset": -14, + "y_offset": -176, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_left_4_7.png", + "x_offset": -19, + "y_offset": -10, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_1.png", + "x_offset": -22, + "y_offset": -14, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_2.png", + "x_offset": -19, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_3.png", + "x_offset": -14, + "y_offset": -49, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_4.png", + "x_offset": 0, + "y_offset": -79, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_5.png", + "x_offset": -32, + "y_offset": -57, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_6.png", + "x_offset": -19, + "y_offset": -175, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_1_7.png", + "x_offset": -23, + "y_offset": -10, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_1.png", + "x_offset": -22, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_2.png", + "x_offset": -10, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_3.png", + "x_offset": -6, + "y_offset": -33, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_4.png", + "x_offset": -16, + "y_offset": -56, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_5.png", + "x_offset": -24, + "y_offset": -112, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_6.png", + "x_offset": -17, + "y_offset": -192, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_2_7.png", + "x_offset": -22, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_1.png", + "x_offset": -26, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_2.png", + "x_offset": -26, + "y_offset": -4, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_3.png", + "x_offset": -28, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_4.png", + "x_offset": -32, + "y_offset": -89, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_5.png", + "x_offset": 17, + "y_offset": -125, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_6.png", + "x_offset": 0, + "y_offset": -192, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_3_7.png", + "x_offset": -17, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_1.png", + "x_offset": -23, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_2.png", + "x_offset": -24, + "y_offset": -38, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_3.png", + "x_offset": -21, + "y_offset": -65, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_4.png", + "x_offset": -4, + "y_offset": -80, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_5.png", + "x_offset": -6, + "y_offset": -64, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_6.png", + "x_offset": -28, + "y_offset": -172, + "palette": "keep" + }, + { + "path": "track/lim/large_half_loop_right_4_7.png", + "x_offset": -27, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_1_1.png", + "x_offset": -22, + "y_offset": -6, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_1_2.png", + "x_offset": -12, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_1_3.png", + "x_offset": -11, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_1_4.png", + "x_offset": -20, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_2_1.png", + "x_offset": -16, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_2_2.png", + "x_offset": -22, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_2_3.png", + "x_offset": -23, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_2_4.png", + "x_offset": -21, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_3_1.png", + "x_offset": -20, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_3_2.png", + "x_offset": -21, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_3_3.png", + "x_offset": -1, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_3_4.png", + "x_offset": -23, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_4_1.png", + "x_offset": -16, + "y_offset": -24, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_4_2.png", + "x_offset": -11, + "y_offset": -33, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_4_3.png", + "x_offset": 16, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_left_4_4.png", + "x_offset": -21, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_1_1.png", + "x_offset": -22, + "y_offset": -24, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_1_2.png", + "x_offset": -28, + "y_offset": -33, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_1_3.png", + "x_offset": -21, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_1_4.png", + "x_offset": -24, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_2_1.png", + "x_offset": -22, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_2_2.png", + "x_offset": -16, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_2_3.png", + "x_offset": -13, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_2_4.png", + "x_offset": -11, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_3_1.png", + "x_offset": 3, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_3_2.png", + "x_offset": -9, + "y_offset": -1, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_3_3.png", + "x_offset": -11, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_3_4.png", + "x_offset": -21, + "y_offset": -15, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_4_1.png", + "x_offset": -16, + "y_offset": -6, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_4_2.png", + "x_offset": -27, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_4_3.png", + "x_offset": -24, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/zero_g_roll_right_4_4.png", + "x_offset": -23, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_1_1.png", + "x_offset": -24, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_1_2.png", + "x_offset": -24, + "y_offset": 2, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_1_3.png", + "x_offset": -18, + "y_offset": -47, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_1_4.png", + "x_offset": -14, + "y_offset": -36, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_1_5.png", + "x_offset": -18, + "y_offset": -19, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_2_1.png", + "x_offset": -24, + "y_offset": -39, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_2_2.png", + "x_offset": -27, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_2_3.png", + "x_offset": -32, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_2_4.png", + "x_offset": -29, + "y_offset": -14, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_3_1.png", + "x_offset": -8, + "y_offset": -29, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_3_2.png", + "x_offset": -11, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_3_3.png", + "x_offset": -28, + "y_offset": -36, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_3_4.png", + "x_offset": -24, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_3_5.png", + "x_offset": 3, + "y_offset": -6, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_3_6.png", + "x_offset": -23, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_4_1.png", + "x_offset": -15, + "y_offset": -46, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_4_2.png", + "x_offset": -14, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_4_3.png", + "x_offset": -6, + "y_offset": -25, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_4_4.png", + "x_offset": -9, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_left_4_5.png", + "x_offset": -22, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_1_1.png", + "x_offset": -24, + "y_offset": -48, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_1_2.png", + "x_offset": -32, + "y_offset": -43, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_1_3.png", + "x_offset": -30, + "y_offset": -24, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_1_4.png", + "x_offset": -31, + "y_offset": -32, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_1_5.png", + "x_offset": -26, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_2_1.png", + "x_offset": 5, + "y_offset": -30, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_2_2.png", + "x_offset": -24, + "y_offset": -29, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_2_3.png", + "x_offset": -25, + "y_offset": -37, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_2_4.png", + "x_offset": -17, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_2_5.png", + "x_offset": -8, + "y_offset": -7, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_2_6.png", + "x_offset": -8, + "y_offset": -13, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_3_1.png", + "x_offset": -16, + "y_offset": -39, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_3_2.png", + "x_offset": -12, + "y_offset": -28, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_3_3.png", + "x_offset": -5, + "y_offset": -21, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_3_4.png", + "x_offset": -22, + "y_offset": -14, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_4_1.png", + "x_offset": -16, + "y_offset": -42, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_4_2.png", + "x_offset": 5, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_4_3.png", + "x_offset": -29, + "y_offset": -47, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_4_4.png", + "x_offset": -27, + "y_offset": -36, + "palette": "keep" + }, + { + "path": "track/lim/large_zero_g_roll_right_4_5.png", + "x_offset": -23, + "y_offset": -20, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_1.png", + "x_offset": -22, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_2_1.png", + "x_offset": -19, + "y_offset": 1, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_2_2.png", + "x_offset": -22, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_3_1.png", + "x_offset": -3, + "y_offset": 0, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_3_2.png", + "x_offset": -23, + "y_offset": -8, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_4.png", + "x_offset": -22, + "y_offset": -22, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_1.png", + "x_offset": -24, + "y_offset": -24, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_2_1.png", + "x_offset": -10, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_2_2.png", + "x_offset": -24, + "y_offset": -6, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_3_1.png", + "x_offset": -22, + "y_offset": -11, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_3_2.png", + "x_offset": -11, + "y_offset": -6, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_4.png", + "x_offset": -22, + "y_offset": -23, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_diag_1.png", + "x_offset": -32, + "y_offset": -18, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_diag_2.png", + "x_offset": -10, + "y_offset": -5, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_diag_3.png", + "x_offset": -32, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/small_flat_to_steep_up_diag_4.png", + "x_offset": -10, + "y_offset": -29, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_diag_1.png", + "x_offset": -32, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_diag_2.png", + "x_offset": -10, + "y_offset": -9, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_diag_3.png", + "x_offset": -32, + "y_offset": -17, + "palette": "keep" + }, + { + "path": "track/lim/small_steep_to_flat_up_diag_4.png", + "x_offset": -10, + "y_offset": -29, + "palette": "keep" + }, + { + "path": "track/flume/25-60-down-nesw.png", + "x_offset": -26, + "y_offset": -39, + "palette" : "keep" + }, + { + "path": "track/flume/25-60-down-nwse.png", + "x_offset": -28, + "y_offset": -39, + "palette" : "keep" + }, + { + "path": "track/flume/25-60-down-nesw-back-water.png", + "y_offset": -23, + "palette" : "keep" + }, + { + "path": "track/flume/25-60-down-nesw-back.png", + "x_offset": -26, + "y_offset": -12, + "palette" : "keep" + }, + { + "path": "track/flume/25-60-down-nwse-back-water.png", + "x_offset": -25, + "y_offset": -22, + "palette" : "keep" + }, + { + "path": "track/flume/25-60-down-nwse-back.png", + "x_offset": -10, + "y_offset": -12, + "palette" : "keep" + }, + { + "path": "track/flume/60-down-nesw.png", + "x_offset": -27, + "y_offset": -71, + "palette" : "keep" + }, + { + "path": "track/flume/60-down-nwse.png", + "x_offset": -28, + "y_offset": -70, + "palette" : "keep" + }, + { + "path": "track/flume/60-down-nesw-back.png", + "x_offset": -26, + "y_offset": -53, + "palette" : "keep" + }, + { + "path": "track/flume/60-down-nwse-back.png", + "x_offset": -27, + "y_offset": -55, + "palette" : "keep" + }, + { + "path": "track/flume/60-25-down-nesw.png", + "x_offset": -27, + "y_offset": -39, + "palette" : "keep" + }, + { + "path": "track/flume/60-25-down-nwse.png", + "x_offset": -28, + "y_offset": -39, + "palette" : "keep" + }, + { + "path": "track/flume/60-25-down-nesw-back-water.png", + "x_offset": -20, + "y_offset": -6, + "palette" : "keep" + }, + { + "path": "track/flume/60-25-down-nesw-back.png", + "x_offset": -27, + "y_offset": -22, + "palette" : "keep" + }, + { + "path": "track/flume/60-25-down-nwse-back-water.png", + "x_offset": 2, + "y_offset": -6, + "palette" : "keep" + }, + { + "path": "track/flume/60-25-down-nwse-back.png", + "x_offset": -26, + "y_offset": -22, + "palette" : "keep" + }, { "path": "support/flat_to_steep_1_1.png", "x_offset": -32, @@ -15909,2090 +18051,5 @@ "x_offset": -5, "y_offset": -20, "palette": "keep" - }, - { - "path": "track/wooden/station_block_brake_open_sw_ne.png", - "x_offset": -34, - "y_offset": -8 - }, - { - "path": "track/wooden/station_block_brake_open_nw_se.png", - "x_offset": -30, - "y_offset": -8 - }, - { - "path": "track/wooden/station_block_brake_closed_sw_ne.png", - "x_offset": -34, - "y_offset": -8 - }, - { - "path": "track/wooden/station_block_brake_closed_nw_se.png", - "x_offset": -30, - "y_offset": -8 - }, - { - "path": "empty.png" - }, - { - "path": "track/wooden/classic_wooden_preview_track.png", - "x_offset": 1, - "y_offset": 1 - }, - { - "path": "track/wooden/classic_wooden_preview_supports.png", - "x_offset": 2, - "y_offset": 1 - }, - { - "path": "track/lim/barrel_roll_left_1_1.png", - "x_offset": -22, - "y_offset": 9, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_1_2.png", - "x_offset": -11, - "y_offset": 7, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_1_3.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_1_4.png", - "x_offset": -22, - "y_offset": -16, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_1_5.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_1_6.png", - "x_offset": -12, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_2_1.png", - "x_offset": -19, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_2_2.png", - "x_offset": -22, - "y_offset": 6, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_2_3.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_2_4.png", - "x_offset": -28, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_2_5.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_2_6.png", - "x_offset": -32, - "y_offset": -18, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_3_1.png", - "x_offset": -29, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_3_2.png", - "x_offset": -2, - "y_offset": 6, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_3_3.png", - "x_offset": -25, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_3_4.png", - "x_offset": -27, - "y_offset": -12, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_3_5.png", - "x_offset": 2, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_3_6.png", - "x_offset": -22, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -12, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_4_2.png", - "x_offset": 1, - "y_offset": 18, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_4_3.png", - "x_offset": -12, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_4_4.png", - "x_offset": -10, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_4_5.png", - "x_offset": 11, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_left_4_6.png", - "x_offset": -22, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_1_1.png", - "x_offset": -23, - "y_offset": -12, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_1_2.png", - "x_offset": -11, - "y_offset": 16, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_1_3.png", - "x_offset": -28, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_1_4.png", - "x_offset": -23, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_1_5.png", - "x_offset": -21, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_1_6.png", - "x_offset": -23, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_2_1.png", - "x_offset": -22, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_2_2.png", - "x_offset": -22, - "y_offset": 7, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_2_3.png", - "x_offset": -10, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_2_4.png", - "x_offset": 3, - "y_offset": -12, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_2_5.png", - "x_offset": -7, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_2_6.png", - "x_offset": -6, - "y_offset": -18, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_3_1.png", - "x_offset": -1, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_3_2.png", - "x_offset": -4, - "y_offset": 6, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_3_3.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_3_4.png", - "x_offset": 0, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_3_5.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_3_6.png", - "x_offset": -22, - "y_offset": -18, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_4_1.png", - "x_offset": -9, - "y_offset": 9, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_4_2.png", - "x_offset": -20, - "y_offset": 7, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_4_3.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_4_4.png", - "x_offset": -28, - "y_offset": -16, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_4_5.png", - "x_offset": 0, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/barrel_roll_right_4_6.png", - "x_offset": -23, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_1_1.png", - "x_offset": -28, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_1_2.png", - "x_offset": -22, - "y_offset": -40, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_1_3.png", - "x_offset": -15, - "y_offset": -82, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_1_4.png", - "x_offset": -22, - "y_offset": 24, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_2_1.png", - "x_offset": -16, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_2_2.png", - "x_offset": 1, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_2_3.png", - "x_offset": -38, - "y_offset": -114, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_2_4.png", - "x_offset": -22, - "y_offset": 12, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_3_1.png", - "x_offset": -25, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_3_2.png", - "x_offset": -27, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_3_3.png", - "x_offset": -1, - "y_offset": -121, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_3_4.png", - "x_offset": -24, - "y_offset": 4, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_4_1.png", - "x_offset": -14, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_4_2.png", - "x_offset": -16, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_4_3.png", - "x_offset": 5, - "y_offset": -91, - "palette": "keep" - }, - { - "path": "track/lim/half_loop_4_4.png", - "x_offset": 6, - "y_offset": 16, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_1_1.png", - "x_offset": -22, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_1_2.png", - "x_offset": -22, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_1_3.png", - "x_offset": -21, - "y_offset": -27, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_1_4.png", - "x_offset": -23, - "y_offset": -46, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_2_1.png", - "x_offset": -22, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_2_2.png", - "x_offset": -25, - "y_offset": -5, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_2_3.png", - "x_offset": -25, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_2_4.png", - "x_offset": -20, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_3_1.png", - "x_offset": -23, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_3_2.png", - "x_offset": -24, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_3_3.png", - "x_offset": -23, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_3_4.png", - "x_offset": -23, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_4_1.png", - "x_offset": -21, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_4_2.png", - "x_offset": -23, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_4_3.png", - "x_offset": -23, - "y_offset": -27, - "palette": "keep" - }, - { - "path": "track/lim/flat_to_steep_up_4_4.png", - "x_offset": -22, - "y_offset": -46, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_1_1.png", - "x_offset": -24, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_1_2.png", - "x_offset": -24, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_1_3.png", - "x_offset": -24, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_1_4.png", - "x_offset": -23, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_2_1.png", - "x_offset": -24, - "y_offset": -26, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_2_2.png", - "x_offset": -19, - "y_offset": -14, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_2_3.png", - "x_offset": -12, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_2_4.png", - "x_offset": -15, - "y_offset": -2, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_3_1.png", - "x_offset": -14, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_3_2.png", - "x_offset": -13, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_3_3.png", - "x_offset": -18, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_3_4.png", - "x_offset": -22, - "y_offset": -5, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_4_1.png", - "x_offset": -21, - "y_offset": -41, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_4_2.png", - "x_offset": -20, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_4_3.png", - "x_offset": -19, - "y_offset": -18, - "palette": "keep" - }, - { - "path": "track/lim/steep_to_flat_up_4_4.png", - "x_offset": -22, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_1_1.png", - "x_offset": -22, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_1_2.png", - "x_offset": -21, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_1_3.png", - "x_offset": -29, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_1_4.png", - "x_offset": -22, - "y_offset": -44, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_1_5.png", - "x_offset": -22, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_2_1.png", - "x_offset": -22, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_2_2.png", - "x_offset": -32, - "y_offset": -10, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_2_3.png", - "x_offset": -23, - "y_offset": -46, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_2_4.png", - "x_offset": -19, - "y_offset": -52, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_2_5.png", - "x_offset": -15, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_3_1.png", - "x_offset": -16, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_3_2.png", - "x_offset": -13, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_3_3.png", - "x_offset": 17, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_3_4.png", - "x_offset": -8, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_3_5.png", - "x_offset": -16, - "y_offset": -24, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_4_1.png", - "x_offset": -24, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_4_2.png", - "x_offset": -24, - "y_offset": -23, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_4_3.png", - "x_offset": -14, - "y_offset": -9, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_4_4.png", - "x_offset": -14, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_left_4_5.png", - "x_offset": -22, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_1_1.png", - "x_offset": -22, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_1_2.png", - "x_offset": -23, - "y_offset": -24, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_1_3.png", - "x_offset": -21, - "y_offset": -9, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_1_4.png", - "x_offset": -30, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_1_5.png", - "x_offset": -32, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_2_1.png", - "x_offset": -22, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_2_2.png", - "x_offset": -16, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_2_3.png", - "x_offset": -24, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_2_4.png", - "x_offset": -16, - "y_offset": -31, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_2_5.png", - "x_offset": -22, - "y_offset": -23, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_3_1.png", - "x_offset": -18, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_3_2.png", - "x_offset": -16, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_3_3.png", - "x_offset": -26, - "y_offset": -47, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_3_4.png", - "x_offset": -29, - "y_offset": -53, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_3_5.png", - "x_offset": -23, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_4_1.png", - "x_offset": -22, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_4_2.png", - "x_offset": -10, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_4_3.png", - "x_offset": 17, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_4_4.png", - "x_offset": -11, - "y_offset": -44, - "palette": "keep" - }, - { - "path": "track/lim/large_corkscrew_right_4_5.png", - "x_offset": -18, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_1_1.png", - "x_offset": -26, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_1_2.png", - "x_offset": -18, - "y_offset": -10, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_2_1.png", - "x_offset": 37, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_2_2.png", - "x_offset": -16, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_2_3.png", - "x_offset": -38, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_3_1.png", - "x_offset": -19, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_3_2.png", - "x_offset": -6, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -9, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_left_bank_to_gentle_up_4_2.png", - "x_offset": -29, - "y_offset": 4, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_1_1.png", - "x_offset": -28, - "y_offset": -10, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": 4, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_2_1.png", - "x_offset": -14, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_2_2.png", - "x_offset": -29, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_3_2.png", - "x_offset": -38, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_3_3.png", - "x_offset": -17, - "y_offset": -10, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_4_1.png", - "x_offset": -7, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/small_turn_right_bank_to_gentle_up_4_2.png", - "x_offset": -19, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_1_1.png", - "x_offset": -23, - "y_offset": -29, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_1_2.png", - "x_offset": -23, - "y_offset": -46, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_1_3.png", - "x_offset": -30, - "y_offset": -80, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_1_4.png", - "x_offset": 0, - "y_offset": -114, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_1_5.png", - "x_offset": -22, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_2_1.png", - "x_offset": -22, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_2_2.png", - "x_offset": 0, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_2_3.png", - "x_offset": 0, - "y_offset": -82, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_2_4.png", - "x_offset": -31, - "y_offset": -143, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_2_5.png", - "x_offset": -23, - "y_offset": -36, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_3_1.png", - "x_offset": -17, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_3_2.png", - "x_offset": 0, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_3_3.png", - "x_offset": -2, - "y_offset": -52, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_3_4.png", - "x_offset": -32, - "y_offset": -148, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_3_5.png", - "x_offset": -16, - "y_offset": -36, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_4_1.png", - "x_offset": -22, - "y_offset": -14, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_4_2.png", - "x_offset": -24, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_4_3.png", - "x_offset": -30, - "y_offset": -26, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_4_4.png", - "x_offset": -9, - "y_offset": -118, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_left_4_5.png", - "x_offset": -23, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_1_1.png", - "x_offset": -22, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_1_2.png", - "x_offset": -20, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_1_3.png", - "x_offset": -18, - "y_offset": -27, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_1_4.png", - "x_offset": -15, - "y_offset": -118, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_1_5.png", - "x_offset": -23, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_2_1.png", - "x_offset": -22, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_2_2.png", - "x_offset": -32, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_2_3.png", - "x_offset": -32, - "y_offset": -52, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_2_4.png", - "x_offset": -25, - "y_offset": -148, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_2_5.png", - "x_offset": -22, - "y_offset": -36, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_3_1.png", - "x_offset": -32, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_3_2.png", - "x_offset": -32, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_3_3.png", - "x_offset": -32, - "y_offset": -82, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_3_4.png", - "x_offset": -9, - "y_offset": -143, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_3_5.png", - "x_offset": -12, - "y_offset": -35, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_4_1.png", - "x_offset": -22, - "y_offset": -29, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_4_2.png", - "x_offset": -16, - "y_offset": -46, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_4_3.png", - "x_offset": -2, - "y_offset": -80, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_4_4.png", - "x_offset": -32, - "y_offset": -115, - "palette": "keep" - }, - { - "path": "track/lim/medium_half_loop_right_4_5.png", - "x_offset": -32, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_1.png", - "x_offset": -23, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_2.png", - "x_offset": -20, - "y_offset": -38, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_3.png", - "x_offset": -20, - "y_offset": -65, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_4.png", - "x_offset": -24, - "y_offset": -80, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_5.png", - "x_offset": -15, - "y_offset": -64, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_6.png", - "x_offset": -9, - "y_offset": -171, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_1_7.png", - "x_offset": -21, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_1.png", - "x_offset": -22, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_2.png", - "x_offset": -6, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_3.png", - "x_offset": -9, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_4.png", - "x_offset": -8, - "y_offset": -90, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_5.png", - "x_offset": -32, - "y_offset": -126, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_6.png", - "x_offset": -26, - "y_offset": -192, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_2_7.png", - "x_offset": -23, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_1.png", - "x_offset": -24, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_2.png", - "x_offset": -29, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_3.png", - "x_offset": -24, - "y_offset": -33, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_4.png", - "x_offset": -5, - "y_offset": -56, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_5.png", - "x_offset": -6, - "y_offset": -112, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_6.png", - "x_offset": -21, - "y_offset": -192, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_3_7.png", - "x_offset": -26, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_1.png", - "x_offset": -23, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_2.png", - "x_offset": -29, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_3.png", - "x_offset": -32, - "y_offset": -48, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_4.png", - "x_offset": -32, - "y_offset": -79, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_5.png", - "x_offset": 17, - "y_offset": -57, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_6.png", - "x_offset": -14, - "y_offset": -176, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_left_4_7.png", - "x_offset": -19, - "y_offset": -10, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_1.png", - "x_offset": -22, - "y_offset": -14, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_2.png", - "x_offset": -19, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_3.png", - "x_offset": -14, - "y_offset": -49, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_4.png", - "x_offset": 0, - "y_offset": -79, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_5.png", - "x_offset": -32, - "y_offset": -57, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_6.png", - "x_offset": -19, - "y_offset": -175, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_1_7.png", - "x_offset": -23, - "y_offset": -10, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_1.png", - "x_offset": -22, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_2.png", - "x_offset": -10, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_3.png", - "x_offset": -6, - "y_offset": -33, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_4.png", - "x_offset": -16, - "y_offset": -56, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_5.png", - "x_offset": -24, - "y_offset": -112, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_6.png", - "x_offset": -17, - "y_offset": -192, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_2_7.png", - "x_offset": -22, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_1.png", - "x_offset": -26, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_2.png", - "x_offset": -26, - "y_offset": -4, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_3.png", - "x_offset": -28, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_4.png", - "x_offset": -32, - "y_offset": -89, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_5.png", - "x_offset": 17, - "y_offset": -125, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_6.png", - "x_offset": 0, - "y_offset": -192, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_3_7.png", - "x_offset": -17, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_1.png", - "x_offset": -23, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_2.png", - "x_offset": -24, - "y_offset": -38, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_3.png", - "x_offset": -21, - "y_offset": -65, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_4.png", - "x_offset": -4, - "y_offset": -80, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_5.png", - "x_offset": -6, - "y_offset": -64, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_6.png", - "x_offset": -28, - "y_offset": -172, - "palette": "keep" - }, - { - "path": "track/lim/large_half_loop_right_4_7.png", - "x_offset": -27, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_1_1.png", - "x_offset": -22, - "y_offset": -6, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_1_2.png", - "x_offset": -12, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_1_3.png", - "x_offset": -11, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_1_4.png", - "x_offset": -20, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_2_1.png", - "x_offset": -16, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_2_2.png", - "x_offset": -22, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_2_3.png", - "x_offset": -23, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_2_4.png", - "x_offset": -21, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_3_1.png", - "x_offset": -20, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_3_2.png", - "x_offset": -21, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_3_3.png", - "x_offset": -1, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_3_4.png", - "x_offset": -23, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_4_1.png", - "x_offset": -16, - "y_offset": -24, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_4_2.png", - "x_offset": -11, - "y_offset": -33, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_4_3.png", - "x_offset": 16, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_left_4_4.png", - "x_offset": -21, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_1_1.png", - "x_offset": -22, - "y_offset": -24, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_1_2.png", - "x_offset": -28, - "y_offset": -33, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_1_3.png", - "x_offset": -21, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_1_4.png", - "x_offset": -24, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_2_1.png", - "x_offset": -22, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_2_2.png", - "x_offset": -16, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_2_3.png", - "x_offset": -13, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_2_4.png", - "x_offset": -11, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_3_1.png", - "x_offset": 3, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_3_2.png", - "x_offset": -9, - "y_offset": -1, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_3_3.png", - "x_offset": -11, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_3_4.png", - "x_offset": -21, - "y_offset": -15, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_4_1.png", - "x_offset": -16, - "y_offset": -6, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_4_2.png", - "x_offset": -27, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_4_3.png", - "x_offset": -24, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/zero_g_roll_right_4_4.png", - "x_offset": -23, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_1_1.png", - "x_offset": -24, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_1_2.png", - "x_offset": -24, - "y_offset": 2, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_1_3.png", - "x_offset": -18, - "y_offset": -47, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_1_4.png", - "x_offset": -14, - "y_offset": -36, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_1_5.png", - "x_offset": -18, - "y_offset": -19, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_2_1.png", - "x_offset": -24, - "y_offset": -39, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_2_2.png", - "x_offset": -27, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_2_3.png", - "x_offset": -32, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_2_4.png", - "x_offset": -29, - "y_offset": -14, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_3_1.png", - "x_offset": -8, - "y_offset": -29, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_3_2.png", - "x_offset": -11, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_3_3.png", - "x_offset": -28, - "y_offset": -36, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_3_4.png", - "x_offset": -24, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_3_5.png", - "x_offset": 3, - "y_offset": -6, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_3_6.png", - "x_offset": -23, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -46, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_4_2.png", - "x_offset": -14, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_4_3.png", - "x_offset": -6, - "y_offset": -25, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_4_4.png", - "x_offset": -9, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_left_4_5.png", - "x_offset": -22, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_1_1.png", - "x_offset": -24, - "y_offset": -48, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_1_2.png", - "x_offset": -32, - "y_offset": -43, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_1_3.png", - "x_offset": -30, - "y_offset": -24, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_1_4.png", - "x_offset": -31, - "y_offset": -32, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_1_5.png", - "x_offset": -26, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_2_1.png", - "x_offset": 5, - "y_offset": -30, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_2_2.png", - "x_offset": -24, - "y_offset": -29, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_2_3.png", - "x_offset": -25, - "y_offset": -37, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_2_4.png", - "x_offset": -17, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_2_5.png", - "x_offset": -8, - "y_offset": -7, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_2_6.png", - "x_offset": -8, - "y_offset": -13, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_3_1.png", - "x_offset": -16, - "y_offset": -39, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_3_2.png", - "x_offset": -12, - "y_offset": -28, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_3_3.png", - "x_offset": -5, - "y_offset": -21, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_3_4.png", - "x_offset": -22, - "y_offset": -14, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_4_1.png", - "x_offset": -16, - "y_offset": -42, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_4_2.png", - "x_offset": 5, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_4_3.png", - "x_offset": -29, - "y_offset": -47, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_4_4.png", - "x_offset": -27, - "y_offset": -36, - "palette": "keep" - }, - { - "path": "track/lim/large_zero_g_roll_right_4_5.png", - "x_offset": -23, - "y_offset": -20, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_1.png", - "x_offset": -22, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_2_1.png", - "x_offset": -19, - "y_offset": 1, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_2_2.png", - "x_offset": -22, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_3_1.png", - "x_offset": -3, - "y_offset": 0, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_3_2.png", - "x_offset": -23, - "y_offset": -8, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_4.png", - "x_offset": -22, - "y_offset": -22, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_1.png", - "x_offset": -24, - "y_offset": -24, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_2_1.png", - "x_offset": -10, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_2_2.png", - "x_offset": -24, - "y_offset": -6, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_3_1.png", - "x_offset": -22, - "y_offset": -11, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_3_2.png", - "x_offset": -11, - "y_offset": -6, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_4.png", - "x_offset": -22, - "y_offset": -23, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_diag_1.png", - "x_offset": -32, - "y_offset": -18, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_diag_2.png", - "x_offset": -10, - "y_offset": -5, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_diag_3.png", - "x_offset": -32, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/small_flat_to_steep_up_diag_4.png", - "x_offset": -10, - "y_offset": -29, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_diag_1.png", - "x_offset": -32, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_diag_2.png", - "x_offset": -10, - "y_offset": -9, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_diag_3.png", - "x_offset": -32, - "y_offset": -17, - "palette": "keep" - }, - { - "path": "track/lim/small_steep_to_flat_up_diag_4.png", - "x_offset": -10, - "y_offset": -29, - "palette": "keep" } ] diff --git a/resources/g2/track/bm_invert/booster_1.png b/resources/g2/track/bm_invert/booster_1.png new file mode 100644 index 0000000000..ef4f789cd9 Binary files /dev/null and b/resources/g2/track/bm_invert/booster_1.png differ diff --git a/resources/g2/track/bm_invert/booster_2.png b/resources/g2/track/bm_invert/booster_2.png new file mode 100644 index 0000000000..0ea90d1a58 Binary files /dev/null and b/resources/g2/track/bm_invert/booster_2.png differ diff --git a/resources/g2/track/flume/25-60-down-nesw-back-water.png b/resources/g2/track/flume/25-60-down-nesw-back-water.png new file mode 100644 index 0000000000..938913f6d5 Binary files /dev/null and b/resources/g2/track/flume/25-60-down-nesw-back-water.png differ diff --git a/resources/g2/track/flume/25-60-down-nesw-back.png b/resources/g2/track/flume/25-60-down-nesw-back.png new file mode 100644 index 0000000000..13a1fe6ff4 Binary files /dev/null and b/resources/g2/track/flume/25-60-down-nesw-back.png differ diff --git a/resources/g2/track/flume/25-60-down-nesw.png b/resources/g2/track/flume/25-60-down-nesw.png new file mode 100644 index 0000000000..dfc1b9009b Binary files /dev/null and b/resources/g2/track/flume/25-60-down-nesw.png differ diff --git a/resources/g2/track/flume/25-60-down-nwse-back-water.png b/resources/g2/track/flume/25-60-down-nwse-back-water.png new file mode 100644 index 0000000000..742268c3da Binary files /dev/null and b/resources/g2/track/flume/25-60-down-nwse-back-water.png differ diff --git a/resources/g2/track/flume/25-60-down-nwse-back.png b/resources/g2/track/flume/25-60-down-nwse-back.png new file mode 100644 index 0000000000..c6b79d8213 Binary files /dev/null and b/resources/g2/track/flume/25-60-down-nwse-back.png differ diff --git a/resources/g2/track/flume/25-60-down-nwse.png b/resources/g2/track/flume/25-60-down-nwse.png new file mode 100644 index 0000000000..2a3d8b064a Binary files /dev/null and b/resources/g2/track/flume/25-60-down-nwse.png differ diff --git a/resources/g2/track/flume/60-25-down-nesw-back-water.png b/resources/g2/track/flume/60-25-down-nesw-back-water.png new file mode 100644 index 0000000000..8a0301fd98 Binary files /dev/null and b/resources/g2/track/flume/60-25-down-nesw-back-water.png differ diff --git a/resources/g2/track/flume/60-25-down-nesw-back.png b/resources/g2/track/flume/60-25-down-nesw-back.png new file mode 100644 index 0000000000..a7d0ac1539 Binary files /dev/null and b/resources/g2/track/flume/60-25-down-nesw-back.png differ diff --git a/resources/g2/track/flume/60-25-down-nesw.png b/resources/g2/track/flume/60-25-down-nesw.png new file mode 100644 index 0000000000..b2169787ad Binary files /dev/null and b/resources/g2/track/flume/60-25-down-nesw.png differ diff --git a/resources/g2/track/flume/60-25-down-nwse-back-water.png b/resources/g2/track/flume/60-25-down-nwse-back-water.png new file mode 100644 index 0000000000..0d6e834b36 Binary files /dev/null and b/resources/g2/track/flume/60-25-down-nwse-back-water.png differ diff --git a/resources/g2/track/flume/60-25-down-nwse-back.png b/resources/g2/track/flume/60-25-down-nwse-back.png new file mode 100644 index 0000000000..abf4641253 Binary files /dev/null and b/resources/g2/track/flume/60-25-down-nwse-back.png differ diff --git a/resources/g2/track/flume/60-25-down-nwse.png b/resources/g2/track/flume/60-25-down-nwse.png new file mode 100644 index 0000000000..26107a321f Binary files /dev/null and b/resources/g2/track/flume/60-25-down-nwse.png differ diff --git a/resources/g2/track/flume/60-down-nesw-back.png b/resources/g2/track/flume/60-down-nesw-back.png new file mode 100644 index 0000000000..3d283de7b7 Binary files /dev/null and b/resources/g2/track/flume/60-down-nesw-back.png differ diff --git a/resources/g2/track/flume/60-down-nesw.png b/resources/g2/track/flume/60-down-nesw.png new file mode 100644 index 0000000000..39e6654008 Binary files /dev/null and b/resources/g2/track/flume/60-down-nesw.png differ diff --git a/resources/g2/track/flume/60-down-nwse-back.png b/resources/g2/track/flume/60-down-nwse-back.png new file mode 100644 index 0000000000..7f89f0d80e Binary files /dev/null and b/resources/g2/track/flume/60-down-nwse-back.png differ diff --git a/resources/g2/track/flume/60-down-nwse.png b/resources/g2/track/flume/60-down-nwse.png new file mode 100644 index 0000000000..3c9f615810 Binary files /dev/null and b/resources/g2/track/flume/60-down-nwse.png differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_1.png b/resources/g2/track/junior/flat_to_steep_diagonal_1.png deleted file mode 100644 index 1e6b999209..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_1.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_2.png b/resources/g2/track/junior/flat_to_steep_diagonal_2.png deleted file mode 100644 index 95e1c35c8d..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_2.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_3.png b/resources/g2/track/junior/flat_to_steep_diagonal_3.png deleted file mode 100644 index 08346c46e4..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_3.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_4.png b/resources/g2/track/junior/flat_to_steep_diagonal_4.png deleted file mode 100644 index 0db6b59516..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_4.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_lift_1.png b/resources/g2/track/junior/flat_to_steep_diagonal_lift_1.png deleted file mode 100644 index b03d1e3bac..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_lift_1.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_lift_2.png b/resources/g2/track/junior/flat_to_steep_diagonal_lift_2.png deleted file mode 100644 index d41e3cfdeb..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_lift_2.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_lift_3.png b/resources/g2/track/junior/flat_to_steep_diagonal_lift_3.png deleted file mode 100644 index 347c8f3c4a..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_lift_3.png and /dev/null differ diff --git a/resources/g2/track/junior/flat_to_steep_diagonal_lift_4.png b/resources/g2/track/junior/flat_to_steep_diagonal_lift_4.png deleted file mode 100644 index b2cd5dc98b..0000000000 Binary files a/resources/g2/track/junior/flat_to_steep_diagonal_lift_4.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_1.png b/resources/g2/track/junior/steep_to_flat_diagonal_1.png deleted file mode 100644 index b856b344c4..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_1.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_2.png b/resources/g2/track/junior/steep_to_flat_diagonal_2.png deleted file mode 100644 index 481b65c1ee..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_2.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_3.png b/resources/g2/track/junior/steep_to_flat_diagonal_3.png deleted file mode 100644 index b17eae0ad2..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_3.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_4.png b/resources/g2/track/junior/steep_to_flat_diagonal_4.png deleted file mode 100644 index 3887906cb5..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_4.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_lift_1.png b/resources/g2/track/junior/steep_to_flat_diagonal_lift_1.png deleted file mode 100644 index 64579a3a4a..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_lift_1.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_lift_2.png b/resources/g2/track/junior/steep_to_flat_diagonal_lift_2.png deleted file mode 100644 index 9dee6ef127..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_lift_2.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_lift_3.png b/resources/g2/track/junior/steep_to_flat_diagonal_lift_3.png deleted file mode 100644 index ba2f7bbb70..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_lift_3.png and /dev/null differ diff --git a/resources/g2/track/junior/steep_to_flat_diagonal_lift_4.png b/resources/g2/track/junior/steep_to_flat_diagonal_lift_4.png deleted file mode 100644 index 1a5c6f6ef7..0000000000 Binary files a/resources/g2/track/junior/steep_to_flat_diagonal_lift_4.png and /dev/null differ diff --git a/shell.nix b/shell.nix index f0d377ce61..c74d360ca6 100644 --- a/shell.nix +++ b/shell.nix @@ -15,8 +15,8 @@ let objects-src = pkgs.fetchFromGitHub { owner = "OpenRCT2"; repo = "objects"; - rev = "v1.3.5"; - sha256 = "4859b7a443d0969cb1c639202fe70f40ac4c2625830657c72645d987912258ff"; + rev = "v1.3.7"; + sha256 = "d6be9743c68f233674f5549204637b1f0304d7567a816d18e3f1576500a51d38"; }; title-sequences-src = pkgs.fetchFromGitHub { diff --git a/src/openrct2-ui/CMakeLists.txt b/src/openrct2-ui/CMakeLists.txt index 4cafef4458..82cd535937 100644 --- a/src/openrct2-ui/CMakeLists.txt +++ b/src/openrct2-ui/CMakeLists.txt @@ -232,7 +232,21 @@ if(MACOS_BUNDLE) ZIP_URL ${TITLE_SEQUENCE_URL} SHA1 ${TITLE_SEQUENCE_SHA1} ) - + + # download opensfx and openmsx + download_openrct2_zip( + ZIP_VERSION ${OPENSFX_VERSION} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR} + ZIP_URL ${OPENSFX_URL} + SHA1 ${OPENSFX_SHA1} + ) + download_openrct2_zip( + ZIP_VERSION ${OPENMSX_VERSION} + DOWNLOAD_DIR ${CMAKE_BINARY_DIR} + ZIP_URL ${OPENMSX_URL} + SHA1 ${OPENMSX_SHA1} + ) + file(COPY ${OBJECTS_DIR} DESTINATION "${BUNDLE_RESOURCE_DIR}") file(COPY ${TITLE_SEQUENCE_DIR} DESTINATION "${BUNDLE_RESOURCE_DIR}") diff --git a/src/openrct2-ui/CursorRepository.cpp b/src/openrct2-ui/CursorRepository.cpp index 57a9dcbc51..201a5f253a 100644 --- a/src/openrct2-ui/CursorRepository.cpp +++ b/src/openrct2-ui/CursorRepository.cpp @@ -27,7 +27,7 @@ CursorRepository::~CursorRepository() void CursorRepository::LoadCursors() { - SetCursorScale(static_cast(round(gConfigGeneral.window_scale))); + SetCursorScale(static_cast(round(gConfigGeneral.WindowScale))); SetCurrentCursor(CursorID::Arrow); } diff --git a/src/openrct2-ui/TextComposition.cpp b/src/openrct2-ui/TextComposition.cpp index 4685441a5a..0811a31bad 100644 --- a/src/openrct2-ui/TextComposition.cpp +++ b/src/openrct2-ui/TextComposition.cpp @@ -178,7 +178,7 @@ void TextComposition::HandleMessage(const SDL_Event* e) if ((modifier & KEYBOARD_PRIMARY_MODIFIER) && _session.Length) { SDL_SetClipboardText(_session.Buffer); - context_show_error(STR_COPY_INPUT_TO_CLIPBOARD, STR_NONE, {}); + ContextShowError(STR_COPY_INPUT_TO_CLIPBOARD, STR_NONE, {}); } break; case SDLK_v: diff --git a/src/openrct2-ui/UiContext.Win32.cpp b/src/openrct2-ui/UiContext.Win32.cpp index 14e7d70cda..0738961ba3 100644 --- a/src/openrct2-ui/UiContext.Win32.cpp +++ b/src/openrct2-ui/UiContext.Win32.cpp @@ -13,7 +13,6 @@ // clang-format off # include # include -# include // clang-format on # undef CreateWindow @@ -27,30 +26,38 @@ # include # include # include -# include -# include +# include +# include // Native resource IDs # include "../../resources/resource.h" -static std::wstring SHGetPathFromIDListLongPath(LPCITEMIDLIST pidl) +using namespace Microsoft::WRL; + +class CCoInitialize { - // Limit path length to 32K - std::wstring pszPath(std::numeric_limits().max(), 0); - auto result = SHGetPathFromIDListEx(pidl, pszPath.data(), static_cast(pszPath.size()), GPFIDL_DEFAULT); - if (result) +public: + CCoInitialize(DWORD dwCoInit) + : m_hr(CoInitializeEx(nullptr, dwCoInit)) { - // Truncate at first null terminator - auto length = pszPath.find(L'\0'); - if (length != std::wstring::npos) - { - pszPath.resize(length); - pszPath.shrink_to_fit(); - } - return pszPath; } - return std::wstring(); -} + + ~CCoInitialize() + { + if (SUCCEEDED(m_hr)) + { + CoUninitialize(); + } + } + + operator bool() const + { + return SUCCEEDED(m_hr); + } + +private: + HRESULT m_hr; +}; namespace OpenRCT2::Ui { @@ -62,20 +69,20 @@ namespace OpenRCT2::Ui public: Win32Context() { - _win32module = GetModuleHandleA(nullptr); + _win32module = GetModuleHandle(nullptr); } void SetWindowIcon(SDL_Window* window) override { if (_win32module != nullptr) { - HICON icon = LoadIconA(_win32module, MAKEINTRESOURCEA(IDI_ICON)); + HICON icon = LoadIcon(_win32module, MAKEINTRESOURCE(IDI_ICON)); if (icon != nullptr) { HWND hwnd = GetHWND(window); if (hwnd != nullptr) { - SendMessageA(hwnd, WM_SETICON, ICON_SMALL, reinterpret_cast(icon)); + SendMessage(hwnd, WM_SETICON, ICON_SMALL, reinterpret_cast(icon)); } } } @@ -83,7 +90,7 @@ namespace OpenRCT2::Ui bool IsSteamOverlayAttached() override { - return (GetModuleHandleA("GameOverlayRenderer.dll") != nullptr); + return (GetModuleHandleW(L"GameOverlayRenderer.dll") != nullptr); } void ShowMessageBox(SDL_Window* window, const std::string& message) override @@ -116,94 +123,87 @@ namespace OpenRCT2::Ui ShellExecuteW(NULL, L"open", urlW.c_str(), NULL, NULL, SW_SHOWNORMAL); } - std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) override + std::string ShowFileDialogInternal(SDL_Window* window, const FileDialogDesc& desc, bool isFolder) { - std::wstring wcFilename = String::ToWideChar(desc.DefaultFilename); - wcFilename.resize(std::max(wcFilename.size(), MAX_PATH)); - - std::wstring wcTitle = String::ToWideChar(desc.Title); - std::wstring wcInitialDirectory = String::ToWideChar(desc.InitialDirectory); - std::wstring wcFilters = GetFilterString(desc.Filters); - - // Set open file name options - OPENFILENAMEW openFileName = {}; - openFileName.lStructSize = sizeof(OPENFILENAMEW); - openFileName.lpstrTitle = wcTitle.c_str(); - openFileName.lpstrInitialDir = wcInitialDirectory.c_str(); - openFileName.lpstrFilter = wcFilters.c_str(); - openFileName.lpstrFile = &wcFilename[0]; - openFileName.nMaxFile = static_cast(wcFilename.size()); - - // Open dialog - BOOL dialogResult = FALSE; - DWORD commonFlags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; - if (desc.Type == FileDialogType::Open) - { - openFileName.Flags = commonFlags | OFN_NONETWORKBUTTON | OFN_FILEMUSTEXIST; - dialogResult = GetOpenFileNameW(&openFileName); - } - else if (desc.Type == FileDialogType::Save) - { - openFileName.Flags = commonFlags | OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT; - dialogResult = GetSaveFileNameW(&openFileName); - } - std::string resultFilename; - if (dialogResult) + + CCoInitialize coInitialize(COINIT_APARTMENTTHREADED); + if (coInitialize) { - resultFilename = String::ToUtf8(openFileName.lpstrFile); - - // If there is no extension, append the pattern - std::string resultExtension = Path::GetExtension(resultFilename); - if (resultExtension.empty()) + CLSID dialogId = CLSID_FileOpenDialog; + DWORD flagsToSet = FOS_FORCEFILESYSTEM; + if (desc.Type == FileDialogType::Save) { - int32_t filterIndex = openFileName.nFilterIndex - 1; + dialogId = CLSID_FileSaveDialog; + flagsToSet |= FOS_OVERWRITEPROMPT | FOS_CREATEPROMPT | FOS_STRICTFILETYPES; + } + if (isFolder) + { + flagsToSet |= FOS_PICKFOLDERS; + } - assert(filterIndex >= 0); - assert(filterIndex < static_cast(desc.Filters.size())); - - std::string pattern = desc.Filters[filterIndex].Pattern; - std::string patternExtension = Path::GetExtension(pattern); - if (!patternExtension.empty()) + ComPtr fileDialog; + if (SUCCEEDED( + CoCreateInstance(dialogId, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(fileDialog.GetAddressOf())))) + { + DWORD flags; + if (SUCCEEDED(fileDialog->GetOptions(&flags)) && SUCCEEDED(fileDialog->SetOptions(flags | flagsToSet))) { - resultFilename += patternExtension; + fileDialog->SetTitle(String::ToWideChar(desc.Title).c_str()); + fileDialog->SetFileName(String::ToWideChar(Path::GetFileName(desc.DefaultFilename)).c_str()); + + // Set default directory (optional, don't fail the operation if it fails to set) + ComPtr defaultDirectory; + if (SUCCEEDED(SHCreateItemFromParsingName( + String::ToWideChar(desc.InitialDirectory).c_str(), nullptr, + IID_PPV_ARGS(defaultDirectory.GetAddressOf())))) + { + fileDialog->SetFolder(defaultDirectory.Get()); + } + + // Opt-in to automatic extensions, this will ensure extension of the selected file matches the filter + // Setting it to an empty string so "All Files" does not get anything appended + fileDialog->SetDefaultExtension(L""); + + // Filters need an "auxillary" storage for wide strings + std::vector filtersStorage; + auto filters = GetFilters(desc.Filters, filtersStorage); + + bool filtersSet = true; + if (!filters.empty()) + { + filtersSet = SUCCEEDED(fileDialog->SetFileTypes(static_cast(filters.size()), filters.data())); + } + + if (filtersSet && SUCCEEDED(fileDialog->Show(nullptr))) + { + ComPtr resultItem; + if (SUCCEEDED(fileDialog->GetResult(resultItem.GetAddressOf()))) + { + PWSTR filePath = nullptr; + if (SUCCEEDED(resultItem->GetDisplayName(SIGDN_FILESYSPATH, &filePath))) + { + resultFilename = String::ToUtf8(filePath); + CoTaskMemFree(filePath); + } + } + } } } } return resultFilename; } + std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) override + { + return ShowFileDialogInternal(window, desc, false); + } + std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) override { - std::string result; - - // Initialize COM - if (SUCCEEDED(CoInitializeEx(0, COINIT_APARTMENTTHREADED))) - { - std::wstring titleW = String::ToWideChar(title); - BROWSEINFOW bi = {}; - bi.lpszTitle = titleW.c_str(); - bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_NONEWFOLDERBUTTON; - - LPITEMIDLIST pidl = SHBrowseForFolderW(&bi); - if (pidl != nullptr) - { - result = String::ToUtf8(SHGetPathFromIDListLongPath(pidl)); - } - CoTaskMemFree(pidl); - - CoUninitialize(); - } - else - { - log_error("Error opening directory browse window"); - } - - // SHBrowseForFolderW might minimize the main window, - // so make sure that it's visible again. - ShowWindow(GetHWND(window), SW_RESTORE); - - return result; + FileDialogDesc desc; + desc.Title = title; + return ShowFileDialogInternal(window, desc, true); } bool HasFilePicker() const override @@ -230,14 +230,24 @@ namespace OpenRCT2::Ui return result; } - static std::wstring GetFilterString(const std::vector& filters) + static std::vector GetFilters( + const std::vector& filters, std::vector& outFiltersStorage) { - std::wstringstream filtersb; + std::vector result; for (const auto& filter : filters) { - filtersb << String::ToWideChar(filter.Name) << '\0' << String::ToWideChar(filter.Pattern) << '\0'; + outFiltersStorage.emplace_back(String::ToWideChar(filter.Name)); + outFiltersStorage.emplace_back(String::ToWideChar(filter.Pattern)); } - return filtersb.str(); + + for (auto it = outFiltersStorage.begin(); it != outFiltersStorage.end();) + { + const wchar_t* Name = (*it++).c_str(); + const wchar_t* Pattern = (*it++).c_str(); + result.push_back({ Name, Pattern }); + } + + return result; } }; diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index f5f4a73f6b..cbdf6f57c0 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -186,12 +186,12 @@ public: // Set window size UpdateFullscreenResolutions(); - Resolution resolution = GetClosestResolution(gConfigGeneral.fullscreen_width, gConfigGeneral.fullscreen_height); + Resolution resolution = GetClosestResolution(gConfigGeneral.FullscreenWidth, gConfigGeneral.FullscreenHeight); SDL_SetWindowSize(_window, resolution.Width, resolution.Height); } else if (mode == FULLSCREEN_MODE::WINDOWED) { - SDL_SetWindowSize(_window, gConfigGeneral.window_width, gConfigGeneral.window_height); + SDL_SetWindowSize(_window, gConfigGeneral.WindowWidth, gConfigGeneral.WindowHeight); } if (SDL_SetWindowFullscreen(_window, windowFlags)) @@ -334,7 +334,7 @@ public: switch (e.type) { case SDL_QUIT: - context_quit(); + ContextQuit(); break; case SDL_WINDOWEVENT: if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) @@ -351,10 +351,10 @@ public: { // Update default display index int32_t displayIndex = SDL_GetWindowDisplayIndex(_window); - if (displayIndex != gConfigGeneral.default_display) + if (displayIndex != gConfigGeneral.DefaultDisplay) { - gConfigGeneral.default_display = displayIndex; - config_save_default(); + gConfigGeneral.DefaultDisplay = displayIndex; + ConfigSaveDefault(); } break; } @@ -373,8 +373,8 @@ public: } break; case SDL_MOUSEMOTION: - _cursorState.position = { static_cast(e.motion.x / gConfigGeneral.window_scale), - static_cast(e.motion.y / gConfigGeneral.window_scale) }; + _cursorState.position = { static_cast(e.motion.x / gConfigGeneral.WindowScale), + static_cast(e.motion.y / gConfigGeneral.WindowScale) }; break; case SDL_MOUSEWHEEL: if (_inGameConsole.IsOpen()) @@ -390,8 +390,8 @@ public: { break; } - ScreenCoordsXY mousePos = { static_cast(e.button.x / gConfigGeneral.window_scale), - static_cast(e.button.y / gConfigGeneral.window_scale) }; + ScreenCoordsXY mousePos = { static_cast(e.button.x / gConfigGeneral.WindowScale), + static_cast(e.button.y / gConfigGeneral.WindowScale) }; switch (e.button.button) { case SDL_BUTTON_LEFT: @@ -426,8 +426,8 @@ public: { break; } - ScreenCoordsXY mousePos = { static_cast(e.button.x / gConfigGeneral.window_scale), - static_cast(e.button.y / gConfigGeneral.window_scale) }; + ScreenCoordsXY mousePos = { static_cast(e.button.x / gConfigGeneral.WindowScale), + static_cast(e.button.y / gConfigGeneral.WindowScale) }; switch (e.button.button) { case SDL_BUTTON_LEFT: @@ -581,7 +581,7 @@ public: { char scaleQualityBuffer[4]; _scaleQuality = ScaleQuality::SmoothNearestNeighbour; - if (gConfigGeneral.window_scale == std::floor(gConfigGeneral.window_scale)) + if (gConfigGeneral.WindowScale == std::floor(gConfigGeneral.WindowScale)) { _scaleQuality = ScaleQuality::NearestNeighbour; } @@ -601,10 +601,10 @@ public: void CreateWindow() override { - SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, gConfigGeneral.minimize_fullscreen_focus_loss ? "1" : "0"); + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, gConfigGeneral.MinimizeFullscreenFocusLoss ? "1" : "0"); // Set window position to default display - int32_t defaultDisplay = std::clamp(gConfigGeneral.default_display, 0, 0xFFFF); + int32_t defaultDisplay = std::clamp(gConfigGeneral.DefaultDisplay, 0, 0xFFFF); auto windowPos = ScreenCoordsXY{ static_cast(SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay)), static_cast(SDL_WINDOWPOS_UNDEFINED_DISPLAY(defaultDisplay)) }; @@ -731,8 +731,8 @@ private: void CreateWindow(const ScreenCoordsXY& windowPos) { // Get saved window size - int32_t width = gConfigGeneral.window_width; - int32_t height = gConfigGeneral.window_height; + int32_t width = gConfigGeneral.WindowWidth; + int32_t height = gConfigGeneral.WindowHeight; if (width <= 0) width = 640; if (height <= 0) @@ -740,7 +740,7 @@ private: // Create window in window first rather than fullscreen so we have the display the window is on first uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI; - if (gConfigGeneral.drawing_engine == DrawingEngine::OpenGL) + if (gConfigGeneral.DrawingEngine == DrawingEngine::OpenGL) { flags |= SDL_WINDOW_OPENGL; } @@ -754,7 +754,7 @@ private: ApplyScreenSaverLockSetting(); SDL_SetWindowMinimumSize(_window, 720, 480); - SetCursorTrap(gConfigGeneral.trap_cursor); + SetCursorTrap(gConfigGeneral.TrapCursor); _platformUiContext->SetWindowIcon(_window); // Initialise the surface, palette and draw buffer @@ -765,9 +765,9 @@ private: // Fix #4022: Force Mac to windowed to avoid cursor offset on launch issue #ifdef __MACOSX__ - gConfigGeneral.fullscreen_mode = static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::WINDOWED); + gConfigGeneral.FullscreenMode = static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::WINDOWED); #else - SetFullscreenMode(static_cast(gConfigGeneral.fullscreen_mode)); + SetFullscreenMode(static_cast(gConfigGeneral.FullscreenMode)); #endif TriggerResize(); } @@ -775,8 +775,8 @@ private: void OnResize(int32_t width, int32_t height) { // Scale the native window size to the game's canvas size - _width = static_cast(width / gConfigGeneral.window_scale); - _height = static_cast(height / gConfigGeneral.window_scale); + _width = static_cast(width / gConfigGeneral.WindowScale); + _height = static_cast(height / gConfigGeneral.WindowScale); drawing_engine_resize(); @@ -798,11 +798,11 @@ private: if (!(flags & nonWindowFlags)) { - if (width != gConfigGeneral.window_width || height != gConfigGeneral.window_height) + if (width != gConfigGeneral.WindowWidth || height != gConfigGeneral.WindowHeight) { - gConfigGeneral.window_width = width; - gConfigGeneral.window_height = height; - config_save_default(); + gConfigGeneral.WindowWidth = width; + gConfigGeneral.WindowHeight = height; + ConfigSaveDefault(); } } } @@ -847,10 +847,10 @@ private: resolutions.erase(last, resolutions.end()); // Update config fullscreen resolution if not set - if (!resolutions.empty() && (gConfigGeneral.fullscreen_width == -1 || gConfigGeneral.fullscreen_height == -1)) + if (!resolutions.empty() && (gConfigGeneral.FullscreenWidth == -1 || gConfigGeneral.FullscreenHeight == -1)) { - gConfigGeneral.fullscreen_width = resolutions.back().Width; - gConfigGeneral.fullscreen_height = resolutions.back().Height; + gConfigGeneral.FullscreenWidth = resolutions.back().Width; + gConfigGeneral.FullscreenHeight = resolutions.back().Height; } _fsResolutions = resolutions; diff --git a/src/openrct2-ui/UiContext.macOS.mm b/src/openrct2-ui/UiContext.macOS.mm index c42b9d66b0..193a556bc0 100644 --- a/src/openrct2-ui/UiContext.macOS.mm +++ b/src/openrct2-ui/UiContext.macOS.mm @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 22b02b54de..3fcb5f44e8 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -159,7 +159,7 @@ public: case WV_FINANCES_RESEARCH: return WindowFinancesResearchOpen(); case WV_RIDE_RESEARCH: - if (gConfigInterface.toolbar_show_research) + if (gConfigInterface.ToolbarShowResearch) { return this->OpenWindow(WindowClass::Research); } @@ -174,6 +174,8 @@ public: return WindowChangelogOpen(WV_CHANGELOG); case WV_NEW_VERSION_INFO: return WindowChangelogOpen(WV_NEW_VERSION_INFO); + case WV_FINANCE_MARKETING: + return WindowFinancesMarketingOpen(); default: return nullptr; } @@ -252,7 +254,7 @@ public: { std::string message = intent->GetStringExtra(INTENT_EXTRA_MESSAGE); close_callback callback = intent->GetCloseCallbackExtra(INTENT_EXTRA_CALLBACK); - return WindowNetworkStatusOpen(message.c_str(), callback); + return WindowNetworkStatusOpen(message, callback); } case WindowClass::ObjectLoadError: { diff --git a/src/openrct2-ui/audio/AudioMixer.cpp b/src/openrct2-ui/audio/AudioMixer.cpp index 22c8096a66..7d84f30f62 100644 --- a/src/openrct2-ui/audio/AudioMixer.cpp +++ b/src/openrct2-ui/audio/AudioMixer.cpp @@ -146,8 +146,8 @@ void AudioMixer::GetNextAudioChunk(uint8_t* dst, size_t length) else { auto group = channel->GetGroup(); - if ((group != MixerGroup::Sound || gConfigSound.sound_enabled) && gConfigSound.master_sound_enabled - && gConfigSound.master_volume != 0) + if ((group != MixerGroup::Sound || gConfigSound.SoundEnabled) && gConfigSound.MasterSoundEnabled + && gConfigSound.MasterVolume != 0) { MixChannel(channel.get(), dst, length); } @@ -159,14 +159,14 @@ void AudioMixer::GetNextAudioChunk(uint8_t* dst, size_t length) void AudioMixer::UpdateAdjustedSound() { // Did the volume level get changed? Recalculate level in this case. - if (_settingSoundVolume != gConfigSound.sound_volume) + if (_settingSoundVolume != gConfigSound.SoundVolume) { - _settingSoundVolume = gConfigSound.sound_volume; + _settingSoundVolume = gConfigSound.SoundVolume; _adjustSoundVolume = powf(static_cast(_settingSoundVolume) / 100.f, 10.f / 6.f); } - if (_settingMusicVolume != gConfigSound.ride_music_volume) + if (_settingMusicVolume != gConfigSound.AudioFocus) { - _settingMusicVolume = gConfigSound.ride_music_volume; + _settingMusicVolume = gConfigSound.AudioFocus; _adjustMusicVolume = powf(static_cast(_settingMusicVolume) / 100.f, 10.f / 6.f); } } @@ -297,7 +297,7 @@ void AudioMixer::ApplyPan(const IAudioChannel* channel, void* buffer, size_t len int32_t AudioMixer::ApplyVolume(const IAudioChannel* channel, void* buffer, size_t len) { float volumeAdjust = _volume; - volumeAdjust *= gConfigSound.master_sound_enabled ? (static_cast(gConfigSound.master_volume) / 100.0f) : 0.0f; + volumeAdjust *= gConfigSound.MasterSoundEnabled ? (static_cast(gConfigSound.MasterVolume) / 100.0f) : 0.0f; switch (channel->GetGroup()) { diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index 1e97b6bc12..dad0a413d4 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -138,7 +138,7 @@ public: _screenTexture = SDL_CreateTexture(_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_STREAMING, width, height); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer); - uint32_t scale = std::ceil(gConfigGeneral.window_scale); + uint32_t scale = std::ceil(gConfigGeneral.WindowScale); _scaledScreenTexture = SDL_CreateTexture( _sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET, width * scale, height * scale); } @@ -163,7 +163,7 @@ public: _paletteHWMapped[i] = SDL_MapRGB(_screenTextureFormat, palette[i].Red, palette[i].Green, palette[i].Blue); } - if (gConfigGeneral.enable_light_fx) + if (gConfigGeneral.EnableLightFx) { auto& lightPalette = lightfx_get_palette(); for (int32_t i = 0; i < 256; i++) @@ -204,7 +204,7 @@ protected: private: void Display() { - if (gConfigGeneral.enable_light_fx) + if (gConfigGeneral.EnableLightFx) { void* pixels; int32_t pitch; @@ -238,14 +238,14 @@ private: } bool isSteamOverlayActive = GetContext()->GetUiContext()->IsSteamOverlayActive(); - if (isSteamOverlayActive && gConfigGeneral.steam_overlay_pause) + if (isSteamOverlayActive && gConfigGeneral.SteamOverlayPause) { OverlayPreRenderCheck(); } SDL_RenderPresent(_sdlRenderer); - if (isSteamOverlayActive && gConfigGeneral.steam_overlay_pause) + if (isSteamOverlayActive && gConfigGeneral.SteamOverlayPause) { OverlayPostRenderCheck(); } @@ -337,8 +337,8 @@ private: void RenderDirtyVisuals() { - float scaleX = gConfigGeneral.window_scale; - float scaleY = gConfigGeneral.window_scale; + float scaleX = gConfigGeneral.WindowScale; + float scaleY = gConfigGeneral.WindowScale; SDL_SetRenderDrawBlendMode(_sdlRenderer, SDL_BLENDMODE_BLEND); for (uint32_t y = 0; y < _dirtyGrid.BlockRows; y++) diff --git a/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp index f7464922c0..ed21018663 100644 --- a/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/SoftwareDrawingEngine.cpp @@ -122,7 +122,7 @@ private: } // Copy the surface to the window - if (gConfigGeneral.window_scale == 1 || gConfigGeneral.window_scale <= 0) + if (gConfigGeneral.WindowScale == 1 || gConfigGeneral.WindowScale <= 0) { SDL_Surface* windowSurface = SDL_GetWindowSurface(_window); if (SDL_BlitSurface(_surface, nullptr, windowSurface, nullptr)) diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h b/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h index ff9de74545..f31588f57d 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h +++ b/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h @@ -115,9 +115,9 @@ struct DrawRectCommand enum { - FLAG_NO_TEXTURE = (1U << 2U), - FLAG_MASK = (1U << 3U), - FLAG_CROSS_HATCH = (1U << 4U), + FLAG_NO_TEXTURE = (1u << 2u), + FLAG_MASK = (1u << 3u), + FLAG_CROSS_HATCH = (1u << 4u), }; }; diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp index 449de04ed8..3fc0f6836a 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp @@ -27,8 +27,11 @@ constexpr VDStruct VertexData[4] = { { 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f }, }; +constexpr const size_t InitialInstancesBufferSize = 32768; + DrawRectShader::DrawRectShader() : OpenGLShaderProgram("drawrect") + , _maxInstancesBufferSize(InitialInstancesBufferSize) { GetLocations(); @@ -52,6 +55,8 @@ DrawRectShader::DrawRectShader() glVertexAttribPointer(vVertVec, 2, GL_FLOAT, GL_FALSE, sizeof(VDStruct), reinterpret_cast(offsetof(VDStruct, vec))); glBindBuffer(GL_ARRAY_BUFFER, _vboInstances); + glBufferData(GL_ARRAY_BUFFER, sizeof(DrawRectCommand) * InitialInstancesBufferSize, NULL, GL_STREAM_DRAW); + glVertexAttribIPointer(vClip, 4, GL_INT, sizeof(DrawRectCommand), reinterpret_cast(offsetof(DrawRectCommand, clip))); glVertexAttribIPointer( vTexColourAtlas, 1, GL_INT, sizeof(DrawRectCommand), @@ -163,7 +168,16 @@ void DrawRectShader::SetInstances(const RectCommandBatch& instances) glBindVertexArray(_vao); glBindBuffer(GL_ARRAY_BUFFER, _vboInstances); - glBufferData(GL_ARRAY_BUFFER, sizeof(DrawRectCommand) * instances.size(), instances.data(), GL_STREAM_DRAW); + + if (instances.size() > _maxInstancesBufferSize) + { + glBufferData(GL_ARRAY_BUFFER, sizeof(DrawRectCommand) * instances.size(), instances.data(), GL_STREAM_DRAW); + _maxInstancesBufferSize = instances.size(); + } + else + { + glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(DrawRectCommand) * instances.size(), instances.data()); + } _instanceCount = static_cast(instances.size()); } diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h index 9b57ec5110..8e187b804c 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h +++ b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h @@ -44,6 +44,7 @@ private: GLuint _vao; GLsizei _instanceCount = 0; + size_t _maxInstancesBufferSize; public: DrawRectShader(); diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPIProc.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPIProc.h index b64492148f..867a18a489 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPIProc.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPIProc.h @@ -45,6 +45,7 @@ OPENGL_PROC(PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer) OPENGL_PROC(PFNGLBINDVERTEXARRAYPROC, glBindVertexArray) OPENGL_PROC(PFNGLBLITFRAMEBUFFERPROC, glBlitFramebuffer) OPENGL_PROC(PFNGLBUFFERDATAPROC, glBufferData) +OPENGL_PROC(PFNGLBUFFERSUBDATAPROC, glBufferSubData) OPENGL_PROC(PFNGLCLEARBUFFERFVPROC, glClearBufferfv) OPENGL_PROC(PFNGLCLEARBUFFERUIVPROC, glClearBufferuiv) OPENGL_PROC(PFNGLCOMPILESHADERPROC, glCompileShader) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 24c15299db..8638dbe276 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -104,13 +104,13 @@ public: 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, const ImageId& imageId, int32_t x, int32_t y) override; + void DrawSprite(rct_drawpixelinfo* dpi, const ImageId imageId, int32_t x, int32_t y) override; void DrawSpriteRawMasked( - rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId& maskImage, const ImageId& colourImage) override; - void DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId& 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; + rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) override; + void DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) override; + void DrawGlyph(rct_drawpixelinfo* dpi, const ImageId 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, + rct_drawpixelinfo* dpi, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) override; void FlushCommandBuffers(); @@ -451,7 +451,7 @@ private: } if (GetContext()->GetUiContext()->GetScaleQuality() == ScaleQuality::SmoothNearestNeighbour) { - uint32_t scale = std::ceil(gConfigGeneral.window_scale); + uint32_t scale = std::ceil(gConfigGeneral.WindowScale); _smoothScaleFramebuffer = std::make_unique(_width * scale, _height * scale, false, false); } } @@ -587,7 +587,7 @@ void OpenGLDrawingContext::DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, con command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId& imageId, int32_t x, int32_t y) +void OpenGLDrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId imageId, int32_t x, int32_t y) { CalculcateClipping(dpi); @@ -738,7 +738,7 @@ void OpenGLDrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId& ima } void OpenGLDrawingContext::DrawSpriteRawMasked( - rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId& maskImage, const ImageId& colourImage) + rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) { CalculcateClipping(dpi); @@ -800,7 +800,7 @@ void OpenGLDrawingContext::DrawSpriteRawMasked( command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId& image, int32_t x, int32_t y, uint8_t colour) +void OpenGLDrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) { CalculcateClipping(dpi); @@ -852,17 +852,18 @@ void OpenGLDrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawGlyph(rct_drawpixelinfo* dpi, uint32_t image, int32_t x, int32_t y, const PaletteMap& palette) +void OpenGLDrawingContext::DrawGlyph( + rct_drawpixelinfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) { CalculcateClipping(dpi); - auto g1Element = gfx_get_g1_element(image & 0x7FFFF); + auto g1Element = gfx_get_g1_element(image); if (g1Element == nullptr) { return; } - const auto texture = _textureCache->GetOrLoadGlyphTexture(ImageId::FromUInt32(image), palette); + const auto texture = _textureCache->GetOrLoadGlyphTexture(image, palette); int32_t left = x + g1Element->x_offset; int32_t top = y + g1Element->y_offset; @@ -908,7 +909,7 @@ void OpenGLDrawingContext::DrawGlyph(rct_drawpixelinfo* dpi, uint32_t image, int } void OpenGLDrawingContext::DrawBitmap( - rct_drawpixelinfo* dpi, uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) + rct_drawpixelinfo* dpi, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) { CalculcateClipping(dpi); diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index 02e0a718f7..7c5d19be7c 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -64,7 +64,7 @@ void TextureCache::InvalidateImage(ImageIndex image) } // Note: for performance reasons, this returns a BasicTextureInfo over an AtlasTextureInfo (also to not expose the cache) -BasicTextureInfo TextureCache::GetOrLoadImageTexture(const ImageId& imageId) +BasicTextureInfo TextureCache::GetOrLoadImageTexture(const ImageId imageId) { uint32_t index; @@ -96,7 +96,7 @@ BasicTextureInfo TextureCache::GetOrLoadImageTexture(const ImageId& imageId) return info; } -BasicTextureInfo TextureCache::GetOrLoadGlyphTexture(const ImageId& imageId, const PaletteMap& paletteMap) +BasicTextureInfo TextureCache::GetOrLoadGlyphTexture(const ImageId imageId, const PaletteMap& paletteMap) { GlyphId glyphId{}; glyphId.Image = imageId.GetIndex(); @@ -247,7 +247,7 @@ void TextureCache::EnlargeAtlasesTexture(GLuint newEntries) } // Initial capacity will be 12 which covers most cases of a fully visible park. - _atlasesTextureCapacity = (_atlasesTextureCapacity + 6) << 1UL; + _atlasesTextureCapacity = (_atlasesTextureCapacity + 6) << 1uL; glBindTexture(GL_TEXTURE_2D_ARRAY, _atlasesTexture); glTexImage3D( @@ -266,7 +266,7 @@ void TextureCache::EnlargeAtlasesTexture(GLuint newEntries) _atlasesTextureIndices = newIndices; } -AtlasTextureInfo TextureCache::LoadImageTexture(const ImageId& imageId) +AtlasTextureInfo TextureCache::LoadImageTexture(const ImageId imageId) { rct_drawpixelinfo dpi = GetImageAsDPI(ImageId(imageId.GetIndex())); @@ -283,7 +283,7 @@ AtlasTextureInfo TextureCache::LoadImageTexture(const ImageId& imageId) return cacheInfo; } -AtlasTextureInfo TextureCache::LoadGlyphTexture(const ImageId& imageId, const PaletteMap& paletteMap) +AtlasTextureInfo TextureCache::LoadGlyphTexture(const ImageId imageId, const PaletteMap& paletteMap) { rct_drawpixelinfo dpi = GetGlyphAsDPI(imageId, paletteMap); @@ -347,7 +347,7 @@ AtlasTextureInfo TextureCache::AllocateImage(int32_t imageWidth, int32_t imageHe return _atlases.back().Allocate(imageWidth, imageHeight); } -rct_drawpixelinfo TextureCache::GetImageAsDPI(const ImageId& imageId) +rct_drawpixelinfo TextureCache::GetImageAsDPI(const ImageId imageId) { auto g1Element = gfx_get_g1_element(imageId); int32_t width = g1Element->width; @@ -358,7 +358,7 @@ rct_drawpixelinfo TextureCache::GetImageAsDPI(const ImageId& imageId) return dpi; } -rct_drawpixelinfo TextureCache::GetGlyphAsDPI(const ImageId& imageId, const PaletteMap& palette) +rct_drawpixelinfo TextureCache::GetGlyphAsDPI(const ImageId imageId, const PaletteMap& palette) { auto g1Element = gfx_get_g1_element(imageId); int32_t width = g1Element->width; diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index db27cd828a..6504a36194 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -40,7 +40,7 @@ struct GlyphId { size_t hash = k.Image * 7; hash += (k.Palette & 0xFFFFFFFFUL) * 13; - hash += (k.Palette >> 32UL) * 23; + hash += (k.Palette >> 32uL) * 23; return hash; } }; @@ -221,8 +221,8 @@ public: TextureCache(); ~TextureCache(); void InvalidateImage(ImageIndex image); - BasicTextureInfo GetOrLoadImageTexture(const ImageId& imageId); - BasicTextureInfo GetOrLoadGlyphTexture(const ImageId& imageId, const PaletteMap& paletteMap); + BasicTextureInfo GetOrLoadImageTexture(const ImageId imageId); + BasicTextureInfo GetOrLoadGlyphTexture(const ImageId imageId, const PaletteMap& paletteMap); BasicTextureInfo GetOrLoadBitmapTexture(ImageIndex image, const void* pixels, size_t width, size_t height); GLuint GetAtlasesTexture(); @@ -233,12 +233,12 @@ private: void CreateTextures(); void GeneratePaletteTexture(); void EnlargeAtlasesTexture(GLuint newEntries); - AtlasTextureInfo LoadImageTexture(const ImageId& image); - AtlasTextureInfo LoadGlyphTexture(const ImageId& image, const PaletteMap& paletteMap); + AtlasTextureInfo LoadImageTexture(const ImageId image); + AtlasTextureInfo LoadGlyphTexture(const ImageId image, const PaletteMap& paletteMap); AtlasTextureInfo AllocateImage(int32_t imageWidth, int32_t imageHeight); AtlasTextureInfo LoadBitmapTexture(ImageIndex image, const void* pixels, size_t width, size_t height); - static rct_drawpixelinfo GetImageAsDPI(const ImageId& imageId); - static rct_drawpixelinfo GetGlyphAsDPI(const ImageId& imageId, const PaletteMap& paletteMap); + static rct_drawpixelinfo GetImageAsDPI(const ImageId imageId); + static rct_drawpixelinfo GetGlyphAsDPI(const ImageId imageId, const PaletteMap& paletteMap); void FreeTextures(); static rct_drawpixelinfo CreateDPI(int32_t width, int32_t height); diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 75a176c0c7..8a07a6af9d 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -120,7 +120,7 @@ void InputManager::HandleViewScrolling() InputScrollViewport(_viewScroll); // Mouse edge scrolling - if (gConfigGeneral.edge_scrolling) + if (gConfigGeneral.EdgeScrolling) { if (input_get_state() != InputState::Normal) return; @@ -155,12 +155,12 @@ void InputManager::HandleModifiers() } #endif - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { if (gInputPlaceObjectModifier & (PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z)) - virtual_floor_enable(); + VirtualFloorEnable(); else - virtual_floor_disable(); + VirtualFloorDisable(); } } diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 6dca4b40c2..17863f5595 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -120,8 +120,8 @@ void GameHandleInput() } else { - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); screenCoords.x = std::clamp(screenCoords.x, 0, screenWidth - 1); screenCoords.y = std::clamp(screenCoords.y, 0, screenHeight - 1); @@ -140,7 +140,7 @@ static MouseState GameGetNextInput(ScreenCoordsXY& screenCoords) RCTMouseData* input = GetMouseInput(); if (input == nullptr) { - const CursorState* cursorState = context_get_cursor_state(); + const CursorState* cursorState = ContextGetCursorState(); screenCoords = cursorState->position; return MouseState::Released; } @@ -181,7 +181,7 @@ static void InputScrollDragBegin(const ScreenCoordsXY& screenCoords, rct_window* _ticksSinceDragStart = 0; _dragScrollIndex = window_get_scroll_data_index(*w, widgetIndex); - context_hide_cursor(); + ContextHideCursor(); } /** @@ -219,10 +219,10 @@ static void InputScrollDragContinue(const ScreenCoordsXY& screenCoords, rct_wind WidgetScrollUpdateThumbs(*w, widgetIndex); window_invalidate_by_number(w->classification, w->number); - ScreenCoordsXY fixedCursorPosition = { static_cast(std::ceil(gInputDragLast.x * gConfigGeneral.window_scale)), - static_cast(std::ceil(gInputDragLast.y * gConfigGeneral.window_scale)) }; + ScreenCoordsXY fixedCursorPosition = { static_cast(std::ceil(gInputDragLast.x * gConfigGeneral.WindowScale)), + static_cast(std::ceil(gInputDragLast.y * gConfigGeneral.WindowScale)) }; - context_set_cursor_position(fixedCursorPosition); + ContextSetCursorPosition(fixedCursorPosition); } /** @@ -234,7 +234,7 @@ static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState stat rct_window* w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); if (w == nullptr) { - context_show_cursor(); + ContextShowCursor(); _inputState = InputState::Reset; return; } @@ -251,7 +251,7 @@ static void InputScrollRight(const ScreenCoordsXY& screenCoords, MouseState stat break; case MouseState::RightRelease: _inputState = InputState::Reset; - context_show_cursor(); + ContextShowCursor(); break; case MouseState::LeftPress: case MouseState::LeftRelease: @@ -375,6 +375,9 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState break; } + if (!input_test_flag(INPUT_FLAG_4)) + break; + if (w->classification != _dragWidget.window_classification || w->number != _dragWidget.window_number || !(_inputFlags & INPUT_FLAG_TOOL_ACTIVE)) { @@ -471,7 +474,7 @@ static void InputWindowPositionContinue( { int32_t snapProximity; - snapProximity = (w.flags & WF_NO_SNAPPING) ? 0 : gConfigGeneral.window_snap_proximity; + snapProximity = (w.flags & WF_NO_SNAPPING) ? 0 : gConfigGeneral.WindowSnapProximity; window_move_and_snap(w, newScreenCoords - lastScreenCoords, snapProximity); } @@ -496,7 +499,7 @@ static void InputWindowResizeBegin(rct_window& w, WidgetIndex widgetIndex, const static void InputWindowResizeContinue(rct_window& w, const ScreenCoordsXY& screenCoords) { - if (screenCoords.y < static_cast(context_get_height()) - 2) + if (screenCoords.y < static_cast(ContextGetHeight()) - 2) { auto differentialCoords = screenCoords - gInputDragLast; int32_t targetWidth = _originalWindowWidth + differentialCoords.x - w.width; @@ -524,9 +527,12 @@ static void InputViewportDragBegin(rct_window& w) _dragWidget.window_classification = w.classification; _dragWidget.window_number = w.number; _ticksSinceDragStart = 0; - auto cursorPosition = context_get_cursor_position(); + auto cursorPosition = ContextGetCursorPosition(); gInputDragLast = cursorPosition; - context_hide_cursor(); + if (!gConfigGeneral.InvertViewportDrag) + { + ContextHideCursor(); + } window_unfollow_sprite(w); // gInputFlags |= INPUT_FLAG_5; @@ -537,8 +543,8 @@ static void InputViewportDragContinue() rct_window* w; rct_viewport* viewport; - auto newDragCoords = context_get_cursor_position(); - const CursorState* cursorState = context_get_cursor_state(); + auto newDragCoords = ContextGetCursorPosition(); + const CursorState* cursorState = ContextGetCursorState(); auto differentialCoords = newDragCoords - gInputDragLast; w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number); @@ -555,7 +561,7 @@ static void InputViewportDragContinue() _ticksSinceDragStart += gCurrentDeltaTime; if (viewport == nullptr) { - context_show_cursor(); + ContextShowCursor(); _inputState = InputState::Reset; } else if (differentialCoords.x != 0 || differentialCoords.y != 0) @@ -570,7 +576,7 @@ static void InputViewportDragContinue() differentialCoords.x = (viewport->zoom + 1).ApplyTo(differentialCoords.x); differentialCoords.y = (viewport->zoom + 1).ApplyTo(differentialCoords.y); - if (gConfigGeneral.invert_viewport_drag) + if (gConfigGeneral.InvertViewportDrag) { w->savedViewPos -= differentialCoords; } @@ -581,20 +587,20 @@ static void InputViewportDragContinue() } } - if (cursorState->touch) + if (cursorState->touch || gConfigGeneral.InvertViewportDrag) { gInputDragLast = newDragCoords; } else { - context_set_cursor_position(gInputDragLast); + ContextSetCursorPosition(gInputDragLast); } } static void InputViewportDragEnd() { _inputState = InputState::Reset; - context_show_cursor(); + ContextShowCursor(); } #pragma endregion @@ -618,7 +624,7 @@ static void InputScrollBegin(rct_window& w, WidgetIndex widgetIndex, const Scree _currentScrollArea = scroll_area; _currentScrollIndex = scroll_id; - window_event_unknown_15_call(&w, scroll_id, scroll_area); + window_event_scroll_select_call(&w, scroll_id, scroll_area); if (scroll_area == SCROLL_PART_VIEW) { window_event_scroll_mousedown_call(&w, scroll_id, scrollCoords); @@ -1040,8 +1046,8 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W w = window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) { + input_set_flag(INPUT_FLAG_4, true); window_event_tool_down_call(w, gCurrentToolWidget.widget_index, screenCoords); - _inputFlags |= INPUT_FLAG_4; } } break; @@ -1491,7 +1497,7 @@ static void InputUpdateTooltip(rct_window* w, WidgetIndex widgetIndex, const Scr */ int32_t GetNextKey() { - uint8_t* keysPressed = const_cast(context_get_keys_pressed()); + uint8_t* keysPressed = const_cast(ContextGetKeysPressed()); for (int32_t i = 0; i < 221; i++) { if (keysPressed[i]) @@ -1517,7 +1523,7 @@ void SetCursor(CursorID cursor_id) { cursor_id = CursorID::DiagonalArrows; } - context_setcurrentcursor(cursor_id); + ContextSetCurrentCursor(cursor_id); } /** @@ -1567,23 +1573,23 @@ void GameHandleEdgeScroll() return; if (mainWindow->viewport == nullptr) return; - if (!context_has_focus()) + if (!ContextHasFocus()) return; scrollX = 0; scrollY = 0; // Scroll left / right - const CursorState* cursorState = context_get_cursor_state(); + const CursorState* cursorState = ContextGetCursorState(); if (cursorState->position.x == 0) scrollX = -1; - else if (cursorState->position.x >= context_get_width() - 1) + else if (cursorState->position.x >= ContextGetWidth() - 1) scrollX = 1; // Scroll up / down if (cursorState->position.y == 0) scrollY = -1; - else if (cursorState->position.y >= context_get_height() - 1) + else if (cursorState->position.y >= ContextGetHeight() - 1) scrollY = 1; InputScrollViewport(ScreenCoordsXY(scrollX, scrollY)); @@ -1599,7 +1605,7 @@ void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords) rct_window* mainWindow = window_get_main(); rct_viewport* viewport = mainWindow->viewport; - const int32_t speed = gConfigGeneral.edge_scrolling_speed; + const int32_t speed = gConfigGeneral.EdgeScrollingSpeed; int32_t multiplier = viewport->zoom.ApplyTo(speed); int32_t dx = scrollScreenCoords.x * multiplier; diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 76936fbcd5..d66fd32273 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -49,7 +49,7 @@ static void OpenWindow(WindowClass wc) { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - context_open_window(wc); + ContextOpenWindow(wc); } } @@ -171,13 +171,13 @@ static void ShortcutRemoveTopBottomToolbarToggle() { if (gScreenFlags == 0) { - context_open_window(WindowClass::TopToolbar); - context_open_window(WindowClass::BottomToolbar); + ContextOpenWindow(WindowClass::TopToolbar); + ContextOpenWindow(WindowClass::BottomToolbar); } else { - context_open_window(WindowClass::TopToolbar); - context_open_window_view(WV_EDITOR_BOTTOM_TOOLBAR); + ContextOpenWindow(WindowClass::TopToolbar); + ContextOpenWindowView(WV_EDITOR_BOTTOM_TOOLBAR); } } } @@ -269,7 +269,7 @@ static void ShortcutBuildNewRide() { if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { - context_open_window(WindowClass::ConstructRide); + ContextOpenWindow(WindowClass::ConstructRide); } } } @@ -281,7 +281,7 @@ static void ShortcutShowFinancialInformation() if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) - context_open_window(WindowClass::Finances); + ContextOpenWindow(WindowClass::Finances); } static void ShortcutShowResearchInformation() @@ -291,7 +291,7 @@ static void ShortcutShowResearchInformation() if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { - context_open_window_view(WV_RIDE_RESEARCH); + ContextOpenWindowView(WV_RIDE_RESEARCH); } } @@ -302,7 +302,7 @@ static void ShortcutShowRidesList() if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { - context_open_window(WindowClass::RideList); + ContextOpenWindow(WindowClass::RideList); } } @@ -313,7 +313,7 @@ static void ShortcutShowParkInformation() if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { - context_open_window(WindowClass::ParkInformation); + ContextOpenWindow(WindowClass::ParkInformation); } } @@ -324,7 +324,7 @@ static void ShortcutShowGuestList() if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { - context_open_window(WindowClass::GuestList); + ContextOpenWindow(WindowClass::GuestList); } } @@ -335,7 +335,7 @@ static void ShortcutShowStaffList() if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { - context_open_window(WindowClass::StaffList); + ContextOpenWindow(WindowClass::StaffList); } } @@ -345,7 +345,7 @@ static void ShortcutShowRecentMessages() return; if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) - context_open_window(WindowClass::RecentNews); + ContextOpenWindow(WindowClass::RecentNews); } static void ShortcutShowMap() @@ -355,7 +355,7 @@ static void ShortcutShowMap() if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gEditorStep == EditorStep::LandscapeEditor) if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) - context_open_window(WindowClass::Map); + ContextOpenWindow(WindowClass::Map); } static void ShortcutReduceGameSpeed() @@ -388,7 +388,7 @@ static void ShortcutOpenCheatWindow() window_close(*window); return; } - context_open_window(WindowClass::Cheats); + ContextOpenWindow(WindowClass::Cheats); } static void ShortcutOpenTransparencyWindow() @@ -396,7 +396,7 @@ static void ShortcutOpenTransparencyWindow() if (gScreenFlags != SCREEN_FLAGS_PLAYING) return; - context_open_window(WindowClass::Transparency); + ContextOpenWindow(WindowClass::Transparency); } static void ShortcutClearScenery() @@ -431,7 +431,7 @@ static void ShortcutQuickSaveGame() auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } @@ -473,21 +473,21 @@ static void ShortcutOpenSceneryPicker() static void ShortcutScaleUp() { - gConfigGeneral.window_scale += 0.25f; - config_save_default(); + gConfigGeneral.WindowScale += 0.25f; + ConfigSaveDefault(); gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); + ContextTriggerResize(); + ContextUpdateCursorScale(); } static void ShortcutScaleDown() { - gConfigGeneral.window_scale -= 0.25f; - gConfigGeneral.window_scale = std::max(0.5f, gConfigGeneral.window_scale); - config_save_default(); + gConfigGeneral.WindowScale -= 0.25f; + gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale); + ConfigSaveDefault(); gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); + ContextTriggerResize(); + ContextUpdateCursorScale(); } // Tile inspector shortcuts @@ -520,7 +520,7 @@ static void ShortcutToggleVisibility() return; extern TileCoordsXY windowTileInspectorTile; - TileElement* tileElement = map_get_nth_element_at(windowTileInspectorTile.ToCoordsXY(), windowTileInspectorSelectedIndex); + TileElement* tileElement = MapGetNthElementAt(windowTileInspectorTile.ToCoordsXY(), windowTileInspectorSelectedIndex); if (tileElement != nullptr) { tileElement->SetInvisible(!tileElement->IsInvisible()); @@ -623,7 +623,7 @@ static void ShortcutToggleConsole() { console.Toggle(); } - else if (gConfigGeneral.debugging_tools && !context_is_input_active()) + else if (gConfigGeneral.DebuggingTools && !ContextIsInputActive()) { window_cancel_textbox(); console.Toggle(); @@ -730,8 +730,8 @@ static void ShortcutToggleTransparentWater() if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) return; - gConfigGeneral.transparent_water ^= 1; - config_save_default(); + gConfigGeneral.TransparentWater ^= 1; + ConfigSaveDefault(); gfx_invalidate_screen(); } @@ -808,7 +808,7 @@ void ShortcutManager::RegisterDefaultShortcuts() }); RegisterShortcut(ShortcutId::InterfaceSceneryPicker, STR_SHORTCUT_OPEN_SCENERY_PICKER, []() { ShortcutOpenSceneryPicker(); }); - RegisterShortcut(ShortcutId::InterfaceShowOptions, STR_SHORTCUT_SHOW_OPTIONS, []() { context_open_window(WindowClass::Options); }); + RegisterShortcut(ShortcutId::InterfaceShowOptions, STR_SHORTCUT_SHOW_OPTIONS, []() { ContextOpenWindow(WindowClass::Options); }); RegisterShortcut(ShortcutId::InterfaceOpenTransparencyOptions, STR_SHORTCUT_OPEN_TRANSPARENCY_OPTIONS, "CTRL+T", []() { ShortcutOpenTransparencyWindow(); }); RegisterShortcut(ShortcutId::InterfaceOpenCheats, STR_SHORTCUT_OPEN_CHEATS_WINDOW, "CTRL+ALT+C", []() { ShortcutOpenCheatWindow(); }); RegisterShortcut(ShortcutId::InterfaceOpenMap, STR_SHORTCUT_SHOW_MAP, "TAB", []() { ShortcutShowMap(); }); @@ -832,7 +832,7 @@ void ShortcutManager::RegisterDefaultShortcuts() } }); RegisterShortcut(ShortcutId::InterfaceOpenTileInspector, STR_SHORTCUT_OPEN_TILE_INSPECTOR, []() { - if (gConfigInterface.toolbar_show_cheats) + if (gConfigInterface.ToolbarShowCheats) { OpenWindow(WindowClass::TileInspector); } @@ -913,7 +913,7 @@ void ShortcutManager::RegisterDefaultShortcuts() } else { - context_open_window(WindowClass::DebugPaint); + ContextOpenWindow(WindowClass::DebugPaint); } } }); diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index 444bab88c9..4a19f7975b 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -56,6 +56,7 @@ void WindowDropdownShowColour(rct_window* w, rct_widget* widget, uint8_t dropdow void WindowDropdownShowColourAvailable( rct_window* w, rct_widget* widget, uint8_t dropdownColour, uint8_t selectedColour, uint32_t availableColours); uint32_t DropdownGetAppropriateImageDropdownItemsPerRow(uint32_t numItems); +bool WindowDropDownHasMultipleColumns(size_t numItems); namespace Dropdown { diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index b3aeba5d69..d8939d6a43 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -30,7 +30,7 @@ namespace Graph ft.Add(DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]); DrawTextBasic( dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, - { FontSpriteBase::SMALL, TextAlignment::CENTRE }); + { FontStyle::Small, TextAlignment::CENTRE }); // Draw month mark gfx_fill_rect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10); @@ -167,7 +167,7 @@ namespace Graph ft.Add(DateGameShortMonthNames[date_get_month((yearOver32 / 4) + MONTH_COUNT)]); DrawTextBasic( dpi, screenCoords - ScreenCoordsXY{ 0, 10 }, STR_GRAPH_LABEL, ft, - { FontSpriteBase::SMALL, TextAlignment::CENTRE }); + { FontStyle::Small, TextAlignment::CENTRE }); // Draw month mark gfx_fill_rect(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_10); @@ -239,7 +239,7 @@ namespace Graph 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(); + const auto cursorPosition = ContextGetCursorPositionScaled(); const ScreenRect chartFrame{ screenCoords, screenCoords + ScreenCoordsXY{ ChartMaxWidth, ChartMaxHeight } }; if (!chartFrame.Contains(cursorPosition)) diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index c7f28d462f..1412a8b8b8 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -26,14 +26,14 @@ using namespace OpenRCT2::Ui; static InGameConsole _inGameConsole; -static FontSpriteBase InGameConsoleGetFontSpriteBase() +static FontStyle InGameConsoleGetFontStyle() { - return (gConfigInterface.console_small_font ? FontSpriteBase::SMALL : FontSpriteBase::MEDIUM); + return (gConfigInterface.ConsoleSmallFont ? FontStyle::Small : FontStyle::Medium); } static int32_t InGameConsoleGetLineHeight() { - return font_get_line_height(InGameConsoleGetFontSpriteBase()); + return font_get_line_height(InGameConsoleGetFontStyle()); } InGameConsole::InGameConsole() @@ -119,7 +119,7 @@ void InGameConsole::ClearInput() _consoleCurrentLine[0] = 0; if (_isOpen) { - context_start_text_input(_consoleCurrentLine, sizeof(_consoleCurrentLine)); + ContextStartTextInput(_consoleCurrentLine, sizeof(_consoleCurrentLine)); } } @@ -150,7 +150,7 @@ void InGameConsole::RefreshCaret(size_t position) _selectionStart = position; char tempString[TEXT_INPUT_SIZE] = { 0 }; std::memcpy(tempString, &_consoleCurrentLine, _selectionStart); - _caretScreenPosX = gfx_get_string_width_no_formatting(tempString, InGameConsoleGetFontSpriteBase()); + _caretScreenPosX = gfx_get_string_width_no_formatting(tempString, InGameConsoleGetFontStyle()); } void InGameConsole::Scroll(int32_t linesToScroll) @@ -181,7 +181,7 @@ void InGameConsole::Open() _isOpen = true; ScrollToEnd(); RefreshCaret(); - _consoleTextInputSession = context_start_text_input(_consoleCurrentLine, sizeof(_consoleCurrentLine)); + _consoleTextInputSession = ContextStartTextInput(_consoleCurrentLine, sizeof(_consoleCurrentLine)); } void InGameConsole::Close() @@ -189,7 +189,7 @@ void InGameConsole::Close() _consoleTextInputSession = nullptr; _isOpen = false; Invalidate(); - context_stop_text_input(); + ContextStopTextInput(); } void InGameConsole::Hide() @@ -243,7 +243,7 @@ void InGameConsole::Invalidate() const void InGameConsole::Update() { _consoleTopLeft = { 0, 0 }; - _consoleBottomRight = { context_get_width(), 322 }; + _consoleBottomRight = { ContextGetWidth(), 322 }; if (_isOpen) { @@ -318,7 +318,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const { const size_t index = i + _consoleScrollPos; lineBuffer = _colourFormatStr + _consoleLines[index]; - gfx_draw_string(dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontSpriteBase() }); + gfx_draw_string(dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() }); screenCoords.y += lineHeight; } @@ -326,7 +326,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const // Draw current line lineBuffer = _colourFormatStr + _consoleCurrentLine; - gfx_draw_string_no_formatting(dpi, screenCoords, lineBuffer.c_str(), { TEXT_COLOUR_255, InGameConsoleGetFontSpriteBase() }); + gfx_draw_string_no_formatting(dpi, screenCoords, lineBuffer.c_str(), { TEXT_COLOUR_255, InGameConsoleGetFontStyle() }); // Draw caret if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD) diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 872cfdbdfe..e4696f0994 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -617,9 +617,9 @@ namespace ThemeManager ActiveAvailableThemeIndex = 1; bool configValid = false; - if (!String::IsNullOrEmpty(gConfigInterface.current_theme_preset)) + if (!String::IsNullOrEmpty(gConfigInterface.CurrentThemePreset)) { - if (LoadThemeByConfigName(gConfigInterface.current_theme_preset)) + if (LoadThemeByConfigName(gConfigInterface.CurrentThemePreset)) { configValid = true; } @@ -627,7 +627,7 @@ namespace ThemeManager if (!configValid) { - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(1)); } } @@ -709,7 +709,7 @@ void ThemeManagerSetActiveAvailableTheme(size_t index) } } ThemeManager::ActiveAvailableThemeIndex = index; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(index)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(index)); ColourSchemeUpdateAll(); } @@ -805,7 +805,7 @@ void ThemeRename(const utf8* name) if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path)) { ThemeManager::ActiveAvailableThemeIndex = i; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(1)); break; } } @@ -830,7 +830,7 @@ void ThemeDuplicate(const utf8* name) if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path)) { ThemeManager::ActiveAvailableThemeIndex = i; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(i)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(i)); break; } } @@ -841,7 +841,7 @@ void ThemeDelete() File::Delete(ThemeManager::CurrentThemePath); ThemeManager::LoadTheme(const_cast(&PredefinedThemeRCT2)); ThemeManager::ActiveAvailableThemeIndex = 1; - String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1)); + String::DiscardDuplicate(&gConfigInterface.CurrentThemePreset, ThemeManagerGetAvailableThemeConfigName(1)); } void ThemeManagerInitialise() diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index d1f3e271ba..e0683f44ae 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -186,7 +186,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords) { auto intent = Intent(WD_VEHICLE); intent.putExtra(INTENT_EXTRA_VEHICLE, entity); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case EntityType::Guest: @@ -194,7 +194,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords) { auto intent = Intent(WindowClass::Peep); intent.putExtra(INTENT_EXTRA_PEEP, entity); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case EntityType::Balloon: @@ -227,11 +227,11 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords) { auto intent = Intent(WD_TRACK); intent.putExtra(INTENT_EXTRA_TILE_ELEMENT, info.Element); - context_open_intent(&intent); + ContextOpenIntent(&intent); return true; } case ViewportInteractionItem::ParkEntrance: - context_open_window(WindowClass::ParkInformation); + ContextOpenWindow(WindowClass::ParkInformation); return true; default: return false; @@ -356,7 +356,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor else { // FIXME: Why does it *2 the value? - if (!gCheatsSandboxMode && !map_is_location_owned({ info.Loc, tileElement->GetBaseZ() * 2 })) + if (!gCheatsSandboxMode && !MapIsLocationOwned({ info.Loc, tileElement->GetBaseZ() * 2 })) { info.SpriteType = ViewportInteractionItem::None; return info; @@ -428,7 +428,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor auto banner = tileElement->AsBanner()->GetBanner(); if (banner != nullptr) { - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); auto ft = Formatter(); ft.Add(STR_MAP_TOOLTIP_BANNER_STRINGID_STRINGID); @@ -587,7 +587,7 @@ bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords) ViewportInteractionRemoveLargeScenery(info.Element, info.Loc); break; case ViewportInteractionItem::Banner: - context_open_detail_window(WD_BANNER, info.Element->AsBanner()->GetIndex().ToUnderlying()); + ContextOpenDetailWindow(WD_BANNER, info.Element->AsBanner()->GetIndex().ToUnderlying()); break; } @@ -620,9 +620,9 @@ static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const Co w = window_find_by_class(WindowClass::Footpath); if (w != nullptr) - footpath_provisional_update(); + FootpathProvisionalUpdate(); - tileElement2 = map_get_first_element_at(mapCoords); + tileElement2 = MapGetFirstElementAt(mapCoords); if (tileElement2 == nullptr) return; do @@ -675,7 +675,7 @@ static void ViewportInteractionRemoveParkWall(TileElement* tileElement, const Co auto* wallEntry = tileElement->AsWall()->GetEntry(); if (wallEntry->scrolling_mode != SCROLLING_MODE_NONE) { - context_open_detail_window(WD_SIGN_SMALL, tileElement->AsWall()->GetBannerIndex().ToUnderlying()); + ContextOpenDetailWindow(WD_SIGN_SMALL, tileElement->AsWall()->GetBannerIndex().ToUnderlying()); } else { @@ -696,7 +696,7 @@ static void ViewportInteractionRemoveLargeScenery(TileElement* tileElement, cons if (sceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) { auto bannerIndex = tileElement->AsLargeScenery()->GetBannerIndex(); - context_open_detail_window(WD_SIGN, bannerIndex.ToUnderlying()); + ContextOpenDetailWindow(WD_SIGN, bannerIndex.ToUnderlying()); } else { @@ -793,7 +793,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo int16_t z = waterHeight; if (info.SpriteType != ViewportInteractionItem::Water) { - z = tile_element_height(mapPos); + z = TileElementHeight(mapPos); } mapPos = viewport_coord_to_map_coord(initialVPPos, z); mapPos.x = std::clamp(mapPos.x, initialPos.x, initialPos.x + 31); diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 3c6c154d97..0df6a1ddf1 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -490,7 +490,7 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde auto ft = Formatter(); ft.Add(buffer); DrawTextBasic(dpi, { l, t }, STR_STRING, ft, { colour }); - textRight = l + gfx_get_string_width(buffer, FontSpriteBase::MEDIUM) + 1; + textRight = l + gfx_get_string_width(buffer, FontStyle::Medium) + 1; } // Border @@ -1078,11 +1078,11 @@ void WidgetSetDisabled(rct_window& w, WidgetIndex widgetIndex, bool value) SafeSetWidgetFlag(w, widgetIndex, WIDGET_FLAGS::IS_DISABLED, value); if (value) { - w.disabled_widgets |= (1ULL << widgetIndex); + w.disabled_widgets |= (1uLL << widgetIndex); } else { - w.disabled_widgets &= ~(1ULL << widgetIndex); + w.disabled_widgets &= ~(1uLL << widgetIndex); } } @@ -1091,11 +1091,11 @@ void WidgetSetHoldable(rct_window& w, WidgetIndex widgetIndex, bool value) SafeSetWidgetFlag(w, widgetIndex, WIDGET_FLAGS::IS_HOLDABLE, value); if (value) { - w.hold_down_widgets |= (1ULL << widgetIndex); + w.hold_down_widgets |= (1uLL << widgetIndex); } else { - w.hold_down_widgets &= ~(1ULL << widgetIndex); + w.hold_down_widgets &= ~(1uLL << widgetIndex); } } @@ -1108,9 +1108,9 @@ void WidgetSetPressed(rct_window& w, WidgetIndex widgetIndex, bool value) { SafeSetWidgetFlag(w, widgetIndex, WIDGET_FLAGS::IS_PRESSED, value); if (value) - w.pressed_widgets |= (1ULL << widgetIndex); + w.pressed_widgets |= (1uLL << widgetIndex); else - w.pressed_widgets &= ~(1ULL << widgetIndex); + w.pressed_widgets &= ~(1uLL << widgetIndex); } void WidgetSetCheckboxValue(rct_window& w, WidgetIndex widgetIndex, bool value) @@ -1147,9 +1147,9 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex if (widget.text != 0) { safe_strcpy(wrapped_string, widget.string, 512); - gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5, FontSpriteBase::MEDIUM, &no_lines); + gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5, FontStyle::Medium, &no_lines); gfx_draw_string_no_formatting( - dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontSpriteBase::MEDIUM }); + dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontStyle::Medium }); } return; } @@ -1158,16 +1158,16 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex // String length needs to add 12 either side of box // +13 for cursor when max length. - gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5 - 6, FontSpriteBase::MEDIUM, &no_lines); + gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5 - 6, FontStyle::Medium, &no_lines); - gfx_draw_string_no_formatting(dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontSpriteBase::MEDIUM }); + gfx_draw_string_no_formatting(dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontStyle::Medium }); size_t string_length = get_string_size(wrapped_string) - 1; // Make a copy of the string for measuring the width. char temp_string[TEXT_INPUT_SIZE] = { 0 }; std::memcpy(temp_string, wrapped_string, std::min(string_length, gTextInput->SelectionStart)); - int32_t cur_x = topLeft.x + gfx_get_string_width_no_formatting(temp_string, FontSpriteBase::MEDIUM) + 3; + int32_t cur_x = topLeft.x + gfx_get_string_width_no_formatting(temp_string, FontStyle::Medium) + 3; int32_t width = 6; if (static_cast(gTextInput->SelectionStart) < strlen(gTextBoxInput)) @@ -1176,7 +1176,7 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex // of the character that the cursor is under. temp_string[1] = '\0'; temp_string[0] = gTextBoxInput[gTextInput->SelectionStart]; - width = std::max(gfx_get_string_width_no_formatting(temp_string, FontSpriteBase::MEDIUM) - 2, 4); + width = std::max(gfx_get_string_width_no_formatting(temp_string, FontStyle::Medium) - 2, 4); } if (gTextBoxFrameNo <= 15) @@ -1187,7 +1187,7 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex } } -uint32_t GetColourButtonImage(colour_t colour) +ImageId GetColourButtonImage(colour_t colour) { - return SPRITE_ID_PALETTE_COLOUR_1(colour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; + return ImageId(SPR_PALETTE_BTN, colour).WithBlended(true); } diff --git a/src/openrct2-ui/interface/Widget.h b/src/openrct2-ui/interface/Widget.h index b1968f1920..ec5b1fc7bb 100644 --- a/src/openrct2-ui/interface/Widget.h +++ b/src/openrct2-ui/interface/Widget.h @@ -9,7 +9,8 @@ #pragma once +#include #include -uint32_t GetColourButtonImage(colour_t colour); +ImageId GetColourButtonImage(colour_t colour); rct_widget* GetWidgetByIndex(const rct_window& w, WidgetIndex widgetIndex); diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 95b215ca6c..fdc4ab02e0 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -61,17 +61,17 @@ static bool WindowFitsWithinSpace(const ScreenCoordsXY& loc, int32_t width, int3 return false; if (loc.y <= TOP_TOOLBAR_HEIGHT && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) return false; - if (loc.x + width > context_get_width()) + if (loc.x + width > ContextGetWidth()) return false; - if (loc.y + height > context_get_height()) + if (loc.y + height > ContextGetHeight()) return false; return WindowFitsBetweenOthers(loc, width, height); } static bool WindowFitsOnScreen(const ScreenCoordsXY& loc, int32_t width, int32_t height) { - uint16_t screenWidth = context_get_width(); - uint16_t screenHeight = context_get_height(); + uint16_t screenWidth = ContextGetWidth(); + uint16_t screenHeight = ContextGetHeight(); int32_t unk; unk = -(width / 4); @@ -217,7 +217,7 @@ rct_window* WindowCreate( // Check if there are any window slots left // include WINDOW_LIMIT_RESERVED for items such as the main viewport and toolbars to not appear to be counted. - if (g_window_list.size() >= static_cast(gConfigGeneral.window_limit + WINDOW_LIMIT_RESERVED)) + if (g_window_list.size() >= static_cast(gConfigGeneral.WindowLimit + WINDOW_LIMIT_RESERVED)) { // Close least recently used window for (auto& w : g_window_list) @@ -511,7 +511,7 @@ static bool WindowOtherWheelInput(rct_window& w, WidgetIndex widgetIndex, int32_ void WindowAllWheelInput() { // Get wheel value - auto cursorState = context_get_cursor_state(); + auto cursorState = ContextGetCursorState(); int32_t absolute_wheel = cursorState->wheel; int32_t relative_wheel = absolute_wheel - _previousAbsoluteWheel; int32_t pixel_scroll = relative_wheel * WindowScrollPixels; @@ -566,7 +566,7 @@ void WindowAllWheelInput() void ApplyScreenSaverLockSetting() { - gConfigGeneral.disable_screensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver(); + gConfigGeneral.DisableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver(); } /** diff --git a/src/openrct2-ui/scripting/CustomListView.cpp b/src/openrct2-ui/scripting/CustomListView.cpp index 44f43e9fe2..6acb41247a 100644 --- a/src/openrct2-ui/scripting/CustomListView.cpp +++ b/src/openrct2-ui/scripting/CustomListView.cpp @@ -715,7 +715,7 @@ void CustomListView::PaintSeperator( // Get string dimensions format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data()); - int32_t categoryStringHalfWidth = (gfx_get_string_width(gCommonStringFormatBuffer, FontSpriteBase::MEDIUM) / 2) + 4; + int32_t categoryStringHalfWidth = (gfx_get_string_width(gCommonStringFormatBuffer, FontStyle::Medium) / 2) + 4; int32_t strLeft = centreX - categoryStringHalfWidth; int32_t strRight = centreX + categoryStringHalfWidth; diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index b95d2eea3b..3351f5d79b 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -199,7 +199,7 @@ namespace OpenRCT2::Scripting else if (info.Element != nullptr) { int32_t index = 0; - auto el = map_get_first_element_at(info.Loc); + auto el = MapGetFirstElementAt(info.Loc); if (el != nullptr) { do diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index af081b8420..0542ec968c 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -107,10 +107,9 @@ namespace OpenRCT2::Ui::Windows if (result.Type == "button") { auto dukImage = desc["image"]; - if (dukImage.type() == DukValue::Type::NUMBER) + if (dukImage.type() == DukValue::Type::STRING || dukImage.type() == DukValue::Type::NUMBER) { - auto img = dukImage.as_uint(); - result.Image = ImageId::FromUInt32(img); + result.Image = ImageId::FromUInt32(ImageFromDuk(dukImage)); result.HasBorder = false; } else @@ -210,9 +209,9 @@ namespace OpenRCT2::Ui::Windows { CustomTabDesc result; auto dukImage = desc["image"]; - if (dukImage.type() == DukValue::Type::NUMBER) + if (dukImage.type() == DukValue::Type::STRING || dukImage.type() == DukValue::Type::NUMBER) { - result.imageFrameBase = ImageId::FromUInt32(static_cast(dukImage.as_int())); + result.imageFrameBase = ImageId::FromUInt32(ImageFromDuk(dukImage)); result.imageFrameCount = 0; result.imageFrameDuration = 0; } @@ -365,7 +364,7 @@ namespace OpenRCT2::Ui::Windows auto tabWidgetIndex = widgetDescIndex - Desc.Widgets.size(); if (tabWidgetIndex < widgets.size()) { - return &widgets[widgetDescIndex]; + return &widgets[tabWidgetIndex]; } } } @@ -1003,7 +1002,7 @@ namespace OpenRCT2::Ui::Windows else if (desc.Type == "colourpicker") { widget.type = WindowWidgetType::ColourBtn; - widget.image = GetColourButtonImage(desc.Colour); + widget.image = GetColourButtonImage(desc.Colour).ToUInt32(); widgetList.push_back(widget); } else if (desc.Type == "custom") @@ -1238,7 +1237,7 @@ namespace OpenRCT2::Ui::Windows if (lastColour != colour && colour < COLOUR_COUNT) { customWidgetInfo->Colour = colour; - widget.image = GetColourButtonImage(colour); + widget.image = GetColourButtonImage(colour).ToUInt32(); widget_invalidate(*w, widgetIndex); std::vector args; diff --git a/src/openrct2-ui/scripting/ScGraphicsContext.hpp b/src/openrct2-ui/scripting/ScGraphicsContext.hpp index 2be85832ec..a8bb99c7c6 100644 --- a/src/openrct2-ui/scripting/ScGraphicsContext.hpp +++ b/src/openrct2-ui/scripting/ScGraphicsContext.hpp @@ -156,8 +156,8 @@ namespace OpenRCT2::Scripting DukValue measureText(const std::string& text) { - auto width = gfx_get_string_width(text, FontSpriteBase::MEDIUM); - auto height = string_get_height_raw(text.c_str(), FontSpriteBase::MEDIUM); + auto width = gfx_get_string_width(text, FontStyle::Medium); + auto height = string_get_height_raw(text.c_str(), FontStyle::Medium); return ToDuk(_ctx, { width, height }); } diff --git a/src/openrct2-ui/scripting/ScTileSelection.hpp b/src/openrct2-ui/scripting/ScTileSelection.hpp index 625d44c65b..526f7ca389 100644 --- a/src/openrct2-ui/scripting/ScTileSelection.hpp +++ b/src/openrct2-ui/scripting/ScTileSelection.hpp @@ -52,7 +52,7 @@ namespace OpenRCT2::Scripting void range_set(DukValue value) { - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (value.type() == DukValue::Type::OBJECT) { auto range = GetMapRange(value); @@ -70,7 +70,7 @@ namespace OpenRCT2::Scripting { gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } DukValue tiles_get() const @@ -95,7 +95,7 @@ namespace OpenRCT2::Scripting void tiles_set(DukValue value) { - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectionTiles.clear(); if (value.is_array()) { @@ -125,7 +125,7 @@ namespace OpenRCT2::Scripting { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; } - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); } static void Register(duk_context* ctx) diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 29a498b287..8f1feb143a 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -48,6 +48,7 @@ namespace OpenRCT2::Scripting { "other", SCENARIO_CATEGORY_OTHER }, { "dlc", SCENARIO_CATEGORY_DLC }, { "build_your_own", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, + { "competitions", SCENARIO_CATEGORY_COMPETITIONS }, }); static const DukEnumMap ScenarioSourceMap({ @@ -64,12 +65,18 @@ namespace OpenRCT2::Scripting template<> inline DukValue ToDuk(duk_context* ctx, const SCENARIO_CATEGORY& value) { - return ToDuk(ctx, ScenarioCategoryMap[value]); + const auto& entry = ScenarioCategoryMap.find(value); + if (entry != ScenarioCategoryMap.end()) + return ToDuk(ctx, entry->first); + return ToDuk(ctx, ScenarioCategoryMap[SCENARIO_CATEGORY_OTHER]); } template<> inline DukValue ToDuk(duk_context* ctx, const ScenarioSource& value) { - return ToDuk(ctx, ScenarioSourceMap[value]); + const auto& entry = ScenarioSourceMap.find(value); + if (entry != ScenarioSourceMap.end()) + return ToDuk(ctx, entry->first); + return ToDuk(ctx, ScenarioSourceMap[ScenarioSource::Other]); } class ScTool @@ -121,11 +128,11 @@ namespace OpenRCT2::Scripting private: int32_t width_get() const { - return context_get_width(); + return ContextGetWidth(); } int32_t height_get() const { - return context_get_height(); + return ContextGetHeight(); } int32_t windows_get() const { diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 8b9cba0759..09e913c5c6 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -203,7 +203,7 @@ namespace OpenRCT2::Scripting auto coords = GetCoordsFromObject(position); if (coords) { - auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), *coords); + auto screenCoords = Translate3DTo2DWithZ(get_current_rotation(), *coords); auto left = screenCoords.x - (viewport->view_width / 2); auto top = screenCoords.y - (viewport->view_height / 2); SetViewLeftTop(left, top); @@ -294,7 +294,7 @@ namespace OpenRCT2::Scripting return CoordsXYZ(x, y, dukZ.as_int()); } - auto z = tile_element_height(CoordsXY(x, y)); + auto z = TileElementHeight(CoordsXY(x, y)); return CoordsXYZ(x, y, z); } } diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 40d8d93202..30f18109d7 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -21,6 +21,7 @@ # include # include # include +# include # include namespace OpenRCT2::Scripting @@ -102,7 +103,7 @@ namespace OpenRCT2::Scripting case WindowWidgetType::Caption: return "caption"; case WindowWidgetType::Scroll: - return "scroll_view"; + return "listview"; case WindowWidgetType::Checkbox: return "checkbox"; case WindowWidgetType::TextBox: @@ -448,6 +449,9 @@ namespace OpenRCT2::Scripting dukglue_register_property(ctx, &ScButtonWidget::border_get, &ScButtonWidget::border_set, "border"); dukglue_register_property(ctx, &ScButtonWidget::isPressed_get, &ScButtonWidget::isPressed_set, "isPressed"); dukglue_register_property(ctx, &ScButtonWidget::image_get, &ScButtonWidget::image_set, "image"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScButtonWidget::text_get, &ScButtonWidget::text_set, "text"); } private: @@ -497,16 +501,21 @@ namespace OpenRCT2::Scripting auto widget = GetWidget(); if (widget != nullptr && widget->type == WindowWidgetType::FlatBtn) { + if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) + { + return LegacyIconIndex(widget->image); + } return widget->image; } return 0; } - void image_set(uint32_t value) + + void image_set(DukValue value) { auto widget = GetWidget(); if (widget != nullptr && widget->type == WindowWidgetType::FlatBtn) { - widget->image = value; + widget->image = ImageFromDuk(value); Invalidate(); } } @@ -524,6 +533,9 @@ namespace OpenRCT2::Scripting { dukglue_set_base_class(ctx); dukglue_register_property(ctx, &ScCheckBoxWidget::isChecked_get, &ScCheckBoxWidget::isChecked_set, "isChecked"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScCheckBoxWidget::text_get, &ScCheckBoxWidget::text_set, "text"); } private: @@ -596,6 +608,9 @@ namespace OpenRCT2::Scripting dukglue_register_property(ctx, &ScDropdownWidget::items_get, &ScDropdownWidget::items_set, "items"); dukglue_register_property( ctx, &ScDropdownWidget::selectedIndex_get, &ScDropdownWidget::selectedIndex_set, "selectedIndex"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScDropdownWidget::text_get, &ScDropdownWidget::text_set, "text"); } private: @@ -648,7 +663,9 @@ namespace OpenRCT2::Scripting static void Register(duk_context* ctx) { dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScGroupBoxWidget::text_get, &ScGroupBoxWidget::text_set, "text"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScGroupBoxWidget::text_get, &ScGroupBoxWidget::text_set, "text"); } }; @@ -663,7 +680,9 @@ namespace OpenRCT2::Scripting static void Register(duk_context* ctx) { dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScLabelWidget::text_get, &ScLabelWidget::text_set, "text"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScLabelWidget::text_get, &ScLabelWidget::text_set, "text"); dukglue_register_property(ctx, &ScLabelWidget::textAlign_get, &ScLabelWidget::textAlign_set, "textAlign"); } @@ -896,7 +915,9 @@ namespace OpenRCT2::Scripting static void Register(duk_context* ctx) { dukglue_set_base_class(ctx); - dukglue_register_property(ctx, &ScSpinnerWidget::text_get, &ScSpinnerWidget::text_set, "text"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScSpinnerWidget::text_get, &ScSpinnerWidget::text_set, "text"); } }; @@ -912,6 +933,9 @@ namespace OpenRCT2::Scripting { dukglue_set_base_class(ctx); dukglue_register_property(ctx, &ScTextBoxWidget::maxLength_get, &ScTextBoxWidget::maxLength_set, "maxLength"); + // Explicit template due to text being a base method + dukglue_register_property( + ctx, &ScTextBoxWidget::text_get, &ScTextBoxWidget::text_set, "text"); } private: diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index 7978d069d4..fc1421c8a2 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -289,7 +289,7 @@ namespace OpenRCT2::Title { gLoadKeepWindowsOpen = true; CloseParkSpecificWindows(); - context_load_park_from_file(path); + GetContext()->LoadParkFromFile(path); } else { @@ -326,7 +326,7 @@ namespace OpenRCT2::Title { gLoadKeepWindowsOpen = true; CloseParkSpecificWindows(); - context_load_park_from_stream(stream); + ContextLoadParkFromStream(stream); } else { @@ -381,8 +381,8 @@ namespace OpenRCT2::Title ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - context_broadcast_intent(&intent); - scenery_set_default_placement_configuration(); + ContextBroadcastIntent(&intent); + ScenerySetDefaultPlacementConfiguration(); News::InitQueue(); load_palette(); gScreenAge = 0; diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 58027ca718..3109c53c91 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -57,7 +57,7 @@ enum WindowAboutWidgetIdx { #define WIDGETS_MAIN \ WINDOW_SHIM(WINDOW_TITLE, WW, WH), \ - MakeWidget ({ 0, TABHEIGHT}, {WW, WH - TABHEIGHT}, WindowWidgetType::ImgBtn, WindowColour::Secondary ), /* page background */ \ + MakeWidget ({ 0, TABHEIGHT}, {WW, WH - TABHEIGHT}, WindowWidgetType::Frame, WindowColour::Secondary ), /* page background */ \ MakeRemapWidget({ 3, 17}, {91, TABHEIGHT - 16}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB_LARGE), /* about OpenRCT2 button */ \ MakeRemapWidget({94, 17}, {91, TABHEIGHT - 16}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_TAB_LARGE) /* about RCT2 button */ @@ -113,10 +113,10 @@ public: OpenRCT2::GetContext()->GetUiContext()->OpenURL("https://discord.gg/ZXZd8D8"); break; case WIDX_CHANGELOG: - context_open_window(WindowClass::Changelog); + ContextOpenWindow(WindowClass::Changelog); break; case WIDX_NEW_VERSION: - context_open_window_view(WV_NEW_VERSION_INFO); + ContextOpenWindowView(WV_NEW_VERSION_INFO); break; case WIDX_COPY_BUILD_INFO: SDL_SetClipboardText(gVersionInfoFull); @@ -170,7 +170,7 @@ private: pressed_widgets = 0; widgets = _windowAboutPageWidgets[p]; - pressed_widgets |= (p == WINDOW_ABOUT_PAGE_RCT2) ? (1ULL << WIDX_TAB_ABOUT_RCT2) : (1ULL << WIDX_TAB_ABOUT_OPENRCT2); + pressed_widgets |= (p == WINDOW_ABOUT_PAGE_RCT2) ? (1uLL << WIDX_TAB_ABOUT_RCT2) : (1uLL << WIDX_TAB_ABOUT_OPENRCT2); WindowInitScrollWidgets(*this); Invalidate(); } @@ -194,7 +194,7 @@ private: auto const& versionPlaceholder = widgets[WIDX_VERSION]; auto versionPlaceHolderWidth = versionPlaceholder.right - versionPlaceholder.left; auto centreX = versionPlaceholder.left + versionPlaceHolderWidth / 2; - auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - font_get_line_height(FontSpriteBase::MEDIUM)) / 2; + auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - font_get_line_height(FontStyle::Medium)) / 2; auto centrePos = windowPos + ScreenCoordsXY(centreX, centreY); DrawTextWrapped(&dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); @@ -215,7 +215,7 @@ private: auto screenCoords = ScreenCoordsXY{ windowPos.x + 200, yPage + 5 }; - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + int32_t lineHeight = font_get_line_height(FontStyle::Medium); // Credits DrawTextBasic(&dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE }); diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index 92c35818ab..f16a3c2b8a 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -42,8 +42,8 @@ static rct_widget WindowAssetPacksWidgets[] = { MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_HIGH_PRIORITY), MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::LabelCentred, WindowColour::Secondary, STR_LOW_PRIORITY), - MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_ARROW_UP, STR_DECREASE_PRIOTITY_TIP), - MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_ARROW_DOWN, STR_INCREASE_PRIOTITY_TIP), + MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_ARROW_UP, STR_INCREASE_PRIOTITY_TIP), + MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_ARROW_DOWN, STR_DECREASE_PRIOTITY_TIP), MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_RELOAD, STR_RELOAD_ASSET_PACKS_TIP), WIDGETS_END, }; @@ -148,11 +148,7 @@ public: void OnPrepareDraw() override { - 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; + ResizeFrame(); auto& list = widgets[WIDX_LIST]; list.left = 6; @@ -181,7 +177,7 @@ public: toolstripY += 24; } - SetWidgetDisabled(WIDX_MOVE_UP, !_selectedIndex || _selectedIndex == 0U); + SetWidgetDisabled(WIDX_MOVE_UP, !_selectedIndex || _selectedIndex == 0u); SetWidgetDisabled(WIDX_MOVE_DOWN, !_selectedIndex || _selectedIndex >= GetNumAssetPacks() - 1); widgets[WIDX_APPLY].bottom = widgets[WIDX_LIST].bottom; diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 86e219dcf3..c88425ae82 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -40,20 +40,20 @@ enum WindowBannerWidgetIdx { }; static constexpr const StringId BannerColouredTextFormats[] = { - STR_TEXT_COLOR_BLACK, - STR_TEXT_COLOR_GREY, - STR_TEXT_COLOR_WHITE, - STR_TEXT_COLOR_RED, - STR_TEXT_COLOR_GREEN, - STR_TEXT_COLOR_YELLOW, - STR_TEXT_COLOR_TOPAZ, - STR_TEXT_COLOR_CELADON, - STR_TEXT_COLOR_BABYBLUE, - STR_TEXT_COLOR_PALELAVENDER, - STR_TEXT_COLOR_PALEGOLD, - STR_TEXT_COLOR_LIGHTPINK, - STR_TEXT_COLOR_PEARLAQUA, - STR_TEXT_COLOR_PALESILVER, + STR_TEXT_COLOUR_BLACK, + STR_TEXT_COLOUR_GREY, + STR_TEXT_COLOUR_WHITE, + STR_TEXT_COLOUR_RED, + STR_TEXT_COLOUR_GREEN, + STR_TEXT_COLOUR_YELLOW, + STR_TEXT_COLOUR_TOPAZ, + STR_TEXT_COLOUR_CELADON, + STR_TEXT_COLOUR_BABYBLUE, + STR_TEXT_COLOUR_PALELAVENDER, + STR_TEXT_COLOUR_PALEGOLD, + STR_TEXT_COLOUR_LIGHTPINK, + STR_TEXT_COLOUR_PEARLAQUA, + STR_TEXT_COLOUR_PALESILVER, }; static rct_widget window_banner_widgets[] = { @@ -83,7 +83,7 @@ private: (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, Focus(_bannerViewPos)); if (viewport != nullptr) - viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); } @@ -100,7 +100,7 @@ private: return nullptr; } - TileElement* tileElement = map_get_first_element_at(banner->position); + TileElement* tileElement = MapGetFirstElementAt(banner->position); if (tileElement == nullptr) { return nullptr; @@ -274,21 +274,21 @@ public: rct_widget* colourBtn = &window_banner_widgets[WIDX_MAIN_COLOUR]; colourBtn->type = WindowWidgetType::Empty; - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry != nullptr && (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)) { colourBtn->type = WindowWidgetType::ColourBtn; } - pressed_widgets &= ~(1ULL << WIDX_BANNER_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)); + (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON)); if (banner->flags & BANNER_FLAG_NO_ENTRY) { - pressed_widgets |= (1ULL << WIDX_BANNER_NO_ENTRY); - disabled_widgets |= (1ULL << WIDX_BANNER_TEXT) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN) - | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON); + 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 = GetColourButtonImage(banner->colour).ToUInt32(); rct_widget* dropDownWidget = &window_banner_widgets[WIDX_TEXT_COLOUR_DROPDOWN]; dropDownWidget->text = BannerColouredTextFormats[banner->text_colour]; } diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index b20e594eef..e6db56da45 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -120,8 +120,8 @@ public: void OnResize() override { - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); max_width = (screenWidth * 4) / 5; max_height = (screenHeight * 4) / 5; @@ -147,13 +147,7 @@ public: void OnPrepareDraw() override { - 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; + ResizeFrameWithPage(); widgets[WIDX_SCROLL].right = width - 3; widgets[WIDX_SCROLL].bottom = height - 22; widgets[WIDX_OPEN_URL].bottom = height - 5; @@ -182,7 +176,7 @@ public: void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override { - const int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + const int32_t lineHeight = font_get_line_height(FontStyle::Medium); ScreenCoordsXY screenCoords(3, 3 - lineHeight); for (const auto& line : _changelogLines) @@ -199,7 +193,7 @@ public: { return ScreenSize( _changelogLongestLineWidth + 4, - static_cast(_changelogLines.size()) * font_get_line_height(FontSpriteBase::MEDIUM)); + static_cast(_changelogLines.size()) * font_get_line_height(FontStyle::Medium)); } // TODO: This probably should be a utility function defined elsewhere for reusability @@ -301,7 +295,7 @@ private: _changelogLongestLineWidth = 0; for (const auto& line : _changelogLines) { - int32_t linewidth = gfx_get_string_width(line.c_str(), FontSpriteBase::MEDIUM); + int32_t linewidth = gfx_get_string_width(line.c_str(), FontStyle::Medium); _changelogLongestLineWidth = std::max(linewidth, _changelogLongestLineWidth); } } @@ -313,8 +307,8 @@ rct_window* WindowChangelogOpen(int personality) if (window == nullptr) { // Create a new centred window - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); int32_t width = (screenWidth * 4) / 5; int32_t height = (screenHeight * 4) / 5; diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index bcf1246b78..8b243bde16 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -320,20 +320,20 @@ static rct_widget *window_cheats_page_widgets[] = }; static uint64_t window_cheats_page_hold_down_widgets[] = { - (1ULL << WIDX_MONEY_SPINNER_INCREMENT) | - (1ULL << WIDX_MONEY_SPINNER_DECREMENT) | - (1ULL << WIDX_ADD_MONEY) | - (1ULL << WIDX_YEAR_UP) | - (1ULL << WIDX_YEAR_DOWN) | - (1ULL << WIDX_MONTH_UP) | - (1ULL << WIDX_MONTH_DOWN) | - (1ULL << WIDX_DAY_UP) | - (1ULL << WIDX_DAY_DOWN), + (1uLL << WIDX_MONEY_SPINNER_INCREMENT) | + (1uLL << WIDX_MONEY_SPINNER_DECREMENT) | + (1uLL << WIDX_ADD_MONEY) | + (1uLL << WIDX_YEAR_UP) | + (1uLL << WIDX_YEAR_DOWN) | + (1uLL << WIDX_MONTH_UP) | + (1uLL << WIDX_MONTH_DOWN) | + (1uLL << WIDX_DAY_UP) | + (1uLL << WIDX_DAY_DOWN), 0, - (1ULL << WIDX_INCREASE_PARK_RATING) | - (1ULL << WIDX_DECREASE_PARK_RATING), + (1uLL << WIDX_INCREASE_PARK_RATING) | + (1uLL << WIDX_DECREASE_PARK_RATING), 0, }; @@ -361,7 +361,7 @@ public: void OnOpen() override { SetPage(WINDOW_CHEATS_PAGE_MONEY); - _parkRatingSpinnerValue = get_forced_park_rating() >= 0 ? get_forced_park_rating() : 999; + _parkRatingSpinnerValue = ParkGetForcedRating() >= 0 ? ParkGetForcedRating() : 999; } void OnUpdate() override @@ -471,7 +471,7 @@ public: case WINDOW_CHEATS_PAGE_MISC: widgets[WIDX_OPEN_CLOSE_PARK].text = (gParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK : STR_CHEAT_OPEN_PARK; - SetCheckboxValue(WIDX_FORCE_PARK_RATING, get_forced_park_rating() >= 0); + SetCheckboxValue(WIDX_FORCE_PARK_RATING, ParkGetForcedRating() >= 0); SetCheckboxValue(WIDX_FREEZE_WEATHER, gCheatsFreezeWeather); SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gCheatsNeverendingMarketing); SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gCheatsDisablePlantAging); @@ -789,7 +789,7 @@ private: case WIDX_INCREASE_PARK_RATING: _parkRatingSpinnerValue = std::min(999, 10 * (_parkRatingSpinnerValue / 10 + 1)); InvalidateWidget(WIDX_PARK_RATING_SPINNER); - if (get_forced_park_rating() >= 0) + if (ParkGetForcedRating() >= 0) { auto setCheatAction = SetCheatAction(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); GameActions::Execute(&setCheatAction); @@ -798,7 +798,7 @@ private: case WIDX_DECREASE_PARK_RATING: _parkRatingSpinnerValue = std::max(0, 10 * (_parkRatingSpinnerValue / 10 - 1)); InvalidateWidget(WIDX_PARK_RATING_SPINNER); - if (get_forced_park_rating() >= 0) + if (ParkGetForcedRating() >= 0) { CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); } @@ -887,7 +887,7 @@ private: CheatsSet(CheatType::NeverEndingMarketing, !gCheatsNeverendingMarketing); break; case WIDX_FORCE_PARK_RATING: - if (get_forced_park_rating() >= 0) + if (ParkGetForcedRating() >= 0) { CheatsSet(CheatType::SetForcedParkRating, -1); } @@ -1044,7 +1044,7 @@ private: { if (!gCheatsShowAllOperatingModes) { - context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } CheatsSet(CheatType::ShowAllOperatingModes, !gCheatsShowAllOperatingModes); } @@ -1053,7 +1053,7 @@ private: { if (!gCheatsShowVehiclesFromOtherTrackTypes) { - context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gCheatsShowVehiclesFromOtherTrackTypes); } @@ -1062,7 +1062,7 @@ private: { if (!gCheatsDisableTrainLengthLimit) { - context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } CheatsSet(CheatType::DisableTrainLengthLimit, !gCheatsDisableTrainLengthLimit); } @@ -1074,7 +1074,7 @@ private: { if (!gCheatsAllowArbitraryRideTypeChanges) { - context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gCheatsAllowArbitraryRideTypeChanges); } @@ -1092,7 +1092,7 @@ private: { if (!gCheatsAllowTrackPlaceInvalidHeights) { - context_show_error(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gCheatsAllowTrackPlaceInvalidHeights); } diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 677dfc2f63..5da7d472bd 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -64,7 +64,7 @@ public: void OnOpen() override { widgets = window_clear_scenery_widgets; - hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); window_push_others_below(*this); @@ -164,8 +164,8 @@ public: 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); + 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); @@ -204,7 +204,7 @@ rct_window* WindowClearSceneryOpen() if (w != nullptr) return w; - w = WindowCreate(WindowClass::ClearScenery, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); + w = WindowCreate(WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); if (w != nullptr) return w; diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 089da24945..4ebe20a4ca 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -52,7 +52,7 @@ public: void OnOpen() override { widgets = window_custom_currency_widgets; - hold_down_widgets = (1ULL << WIDX_RATE_UP) | (1ULL << WIDX_RATE_DOWN); + hold_down_widgets = (1uLL << WIDX_RATE_UP) | (1uLL << WIDX_RATE_DOWN); WindowInitScrollWidgets(*this); colours[0] = COLOUR_LIGHT_BROWN; colours[1] = COLOUR_LIGHT_BROWN; @@ -70,16 +70,16 @@ public: break; case WIDX_RATE_UP: CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1; - gConfigGeneral.custom_currency_rate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; - config_save_default(); + gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + ConfigSaveDefault(); window_invalidate_all(); break; case WIDX_RATE_DOWN: if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1) { CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1; - gConfigGeneral.custom_currency_rate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; - config_save_default(); + gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + ConfigSaveDefault(); window_invalidate_all(); } break; @@ -143,8 +143,8 @@ public: CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Suffix; } - gConfigGeneral.custom_currency_affix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode; - config_save_default(); + gConfigGeneral.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode; + ConfigSaveDefault(); window_invalidate_all(); } @@ -165,10 +165,10 @@ public: CURRENCY_SYMBOL_MAX_SIZE); safe_strcpy( - gConfigGeneral.custom_currency_symbol, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, + gConfigGeneral.CustomCurrencySymbol, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, CURRENCY_SYMBOL_MAX_SIZE); - config_save_default(); + ConfigSaveDefault(); window_invalidate_all(); break; @@ -178,8 +178,8 @@ public: { rate = res.value(); CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate; - gConfigGeneral.custom_currency_rate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; - config_save_default(); + gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + ConfigSaveDefault(); window_invalidate_all(); } break; diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 4ffc933358..3ae7a9fb02 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -110,7 +110,7 @@ public: const auto& stringIdx = widgets[widgetIndex].text; auto string = ls.GetString(stringIdx); Guard::ArgumentNotNull(string); - const auto strWidth = gfx_get_string_width(string, FontSpriteBase::MEDIUM); + const auto strWidth = gfx_get_string_width(string, FontStyle::Medium); newWidth = std::max(strWidth, newWidth); } @@ -146,7 +146,7 @@ public: rct_window* WindowDebugPaintOpen() { auto* window = WindowFocusOrCreate( - WindowClass::DebugPaint, { 16, context_get_height() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, + WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, WF_STICK_TO_FRONT | WF_TRANSPARENT); return window; diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 4d504b3ef6..c5f628644f 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -315,8 +315,8 @@ private: const auto ddWidth = ItemWidth * NumColumns + 3; const auto ddHeight = ItemHeight * NumRows + 3; - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); auto boundedScreenPos = screenPos; if (screenPos.x + ddWidth > screenWidth) boundedScreenPos.x = std::max(0, screenWidth - ddWidth); @@ -354,7 +354,7 @@ void WindowDropdownShowText(const ScreenCoordsXY& screenPos, int32_t extray, uin for (size_t i = 0; i < num_items; i++) { format_string(buffer, 256, gDropdownItems[i].Format, static_cast(&gDropdownItems[i].Args)); - string_width = gfx_get_string_width(buffer, FontSpriteBase::MEDIUM); + string_width = gfx_get_string_width(buffer, FontStyle::Medium); max_string_width = std::max(string_width, max_string_width); } @@ -456,7 +456,7 @@ void WindowDropdownShowColour(rct_window* w, rct_widget* widget, uint8_t dropdow defaultIndex = i; gDropdownItems[i].Format = Dropdown::FormatColourPicker; - gDropdownItems[i].Args = (i << 32) | (SPRITE_ID_PALETTE_COLOUR_1(i) | SPR_PALETTE_BTN); + gDropdownItems[i].Args = (i << 32) | ImageId(SPR_PALETTE_BTN, i).ToUInt32(); } // Show dropdown @@ -473,3 +473,8 @@ uint32_t DropdownGetAppropriateImageDropdownItemsPerRow(uint32_t numItems) { return numItems < std::size(_appropriateImageDropdownItemsPerRow) ? _appropriateImageDropdownItemsPerRow[numItems] : 8; } + +bool WindowDropDownHasMultipleColumns(size_t numItems) +{ + return numItems > DROPDOWN_TEXT_MAX_ROWS; +} diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 7379f34422..2948dd2b21 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -71,7 +71,7 @@ public: (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowClass::EditorScenarioBottomToolbar : WindowClass::EditorTrackBottomToolbar); - uint16_t screenWidth = context_get_width(); + uint16_t screenWidth = ContextGetWidth(); widgets[WIDX_NEXT_IMAGE].left = screenWidth - 200; widgets[WIDX_NEXT_IMAGE].right = screenWidth - 1; widgets[WIDX_NEXT_STEP_BUTTON].left = screenWidth - 198; @@ -157,16 +157,16 @@ private: { window_close_all(); set_all_scenery_items_invented(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); gEditorStep = EditorStep::LandscapeEditor; - context_open_window(WindowClass::Map); + ContextOpenWindow(WindowClass::Map); gfx_invalidate_screen(); } void JumpBackToInventionListSetUp() const { window_close_all(); - context_open_window(WindowClass::EditorInventionList); + ContextOpenWindow(WindowClass::EditorInventionList); gEditorStep = EditorStep::InventionsListSetUp; gfx_invalidate_screen(); } @@ -174,7 +174,7 @@ private: void JumpBackToOptionsSelection() const { window_close_all(); - context_open_window(WindowClass::EditorScenarioOptions); + ContextOpenWindow(WindowClass::EditorScenarioOptions); gEditorStep = EditorStep::OptionsSelection; gfx_invalidate_screen(); } @@ -190,7 +190,7 @@ private: return true; } - context_show_error(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); + ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); w = window_find_by_class(WindowClass::EditorObjectSelection); if (w != nullptr) { @@ -208,11 +208,11 @@ private: finish_object_selection(); if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) { - context_open_window(WindowClass::ConstructRide); + ContextOpenWindow(WindowClass::ConstructRide); } else { - context_open_window(WindowClass::Map); + ContextOpenWindow(WindowClass::Map); } } @@ -222,12 +222,12 @@ private: if (checksPassed) { window_close_all(); - context_open_window(WindowClass::EditorInventionList); + ContextOpenWindow(WindowClass::EditorInventionList); gEditorStep = EditorStep::InventionsListSetUp; } else { - context_show_error(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, errorString, {}); + ContextShowError(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, errorString, {}); } gfx_invalidate_screen(); @@ -236,7 +236,7 @@ private: void JumpForwardToOptionsSelection() const { window_close_all(); - context_open_window(WindowClass::EditorScenarioOptions); + ContextOpenWindow(WindowClass::EditorScenarioOptions); gEditorStep = EditorStep::OptionsSelection; gfx_invalidate_screen(); } @@ -244,7 +244,7 @@ private: void JumpForwardToObjectiveSelection() const { window_close_all(); - context_open_window(WindowClass::EditorObjectiveOptions); + ContextOpenWindow(WindowClass::EditorObjectiveOptions); gEditorStep = EditorStep::ObjectiveSelection; gfx_invalidate_screen(); } @@ -254,7 +254,7 @@ private: const auto savePrepareResult = scenario_prepare_for_save(); if (!savePrepareResult.Successful) { - context_show_error(STR_UNABLE_TO_SAVE_SCENARIO_FILE, savePrepareResult.Message, {}); + ContextShowError(STR_UNABLE_TO_SAVE_SCENARIO_FILE, savePrepareResult.Message, {}); gfx_invalidate_screen(); return; } @@ -263,7 +263,7 @@ private: auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); - context_open_intent(&intent); + ContextOpenIntent(&intent); } void HidePreviousStepButton() @@ -393,7 +393,7 @@ private: rct_window* WindowEditorBottomToolbarOpen() { auto* window = WindowCreate( - WindowClass::BottomToolbar, ScreenCoordsXY(0, context_get_height() - 32), context_get_width(), 32, + WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); return window; diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index f404ad571e..a384a69b44 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -67,7 +67,8 @@ static rct_widget _inventionListDragWidgets[] = { #pragma endregion -static void WindowEditorInventionsListDragOpen(ResearchItem* researchItem); +static void WindowEditorInventionsListDragOpen( + ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth); static const ResearchItem* WindowEditorInventionsListDragGetItem(); /** @@ -94,27 +95,36 @@ static void ResearchRidesSetup() } } -static std::pair WindowEditorInventionsListPrepareName(const ResearchItem& researchItem, bool withGap) +static void DrawResearchItem( + rct_drawpixelinfo& dpi, const ResearchItem& researchItem, const int16_t& width, const ScreenCoordsXY& screenCoords, + StringId format, TextPaint textPaint) { - StringId drawString; - StringId stringId = researchItem.GetName(); - auto ft = Formatter(); + const StringId itemNameId = researchItem.GetName(); + int16_t columnSplitOffset = width / 2; if (researchItem.type == Research::EntryType::Ride && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { - drawString = withGap ? STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME_DRAG : STR_WINDOW_COLOUR_2_STRINGID_STRINGID; - StringId rideTypeName = get_ride_naming(researchItem.baseRideType, get_ride_entry(researchItem.entryIndex)).Name; + const StringId rideTypeName = get_ride_naming(researchItem.baseRideType, get_ride_entry(researchItem.entryIndex)).Name; + + // Draw group name + auto ft = Formatter(); ft.Add(rideTypeName); - ft.Add(stringId); + DrawTextEllipsised(&dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint); + + // Draw vehicle name + ft = Formatter(); + ft.Add(itemNameId); + DrawTextEllipsised( + &dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint); } else { - drawString = STR_WINDOW_COLOUR_2_STRINGID; - ft.Add(stringId); + // Scenery group, flat ride or shopdis + auto ft = Formatter(); + ft.Add(itemNameId); + DrawTextEllipsised(&dpi, screenCoords, width, format, ft, textPaint); } - - return std::make_pair(drawString, ft); } #pragma region Invention List Window @@ -248,7 +258,8 @@ public: return; Invalidate(); - WindowEditorInventionsListDragOpen(researchItem); + + WindowEditorInventionsListDragOpen(researchItem, windowPos, widgets[WIDX_PRE_RESEARCHED_SCROLL].right); } void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override @@ -258,7 +269,6 @@ public: gfx_clear(&dpi, paletteIndex); int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width(); - int16_t columnSplitOffset = boxWidth / 2; int32_t itemY = -SCROLLABLE_ROW_HEIGHT; auto* dragItem = WindowEditorInventionsListDragGetItem(); @@ -294,46 +304,19 @@ public: // TODO: this parameter by itself produces very light text. // It needs a {BLACK} token in the string to work properly. colour_t colour = COLOUR_BLACK; - FontSpriteBase fontSpriteBase = FontSpriteBase::MEDIUM; + FontStyle fontStyle = FontStyle::Medium; + auto darkness = TextDarkness::Regular; if (researchItem.IsAlwaysResearched()) { if (_selectedResearchItem == &researchItem && dragItem == nullptr) - fontSpriteBase = FontSpriteBase::MEDIUM_EXTRA_DARK; + darkness = TextDarkness::ExtraDark; else - fontSpriteBase = FontSpriteBase::MEDIUM_DARK; + darkness = TextDarkness::Dark; colour = colours[1] | COLOUR_FLAG_INSET; } - const StringId itemNameId = researchItem.GetName(); - - if (researchItem.type == Research::EntryType::Ride - && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - const auto rideEntry = get_ride_entry(researchItem.entryIndex); - const StringId rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name; - - // Draw group name - auto ft = Formatter(); - ft.Add(rideTypeName); - DrawTextEllipsised( - &dpi, { 1, itemY }, columnSplitOffset - 11, STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME, ft, - { colour, fontSpriteBase }); - - // Draw vehicle name - ft = Formatter(); - ft.Add(itemNameId); - DrawTextEllipsised( - &dpi, { columnSplitOffset + 1, itemY }, columnSplitOffset - 11, STR_BLACK_STRING, ft, - { colour, fontSpriteBase }); - } - else - { - // Scenery group, flat ride or shop - auto ft = Formatter(); - ft.Add(itemNameId); - DrawTextEllipsised(&dpi, { 1, itemY }, boxWidth, STR_BLACK_STRING, ft, { colour, fontSpriteBase }); - } + DrawResearchItem(dpi, researchItem, boxWidth, { 1, itemY }, STR_BLACK_STRING, { colour, fontStyle, darkness }); } } @@ -422,7 +405,23 @@ public: screenPos = windowPos + ScreenCoordsXY{ bkWidget.midX() + 1, bkWidget.bottom + 3 }; const auto itemWidth = width - widgets[WIDX_RESEARCH_ORDER_SCROLL].right - 6; - auto [drawString, ft] = WindowEditorInventionsListPrepareName(*researchItem, false); + StringId drawString = STR_WINDOW_COLOUR_2_STRINGID; + StringId stringId = researchItem->GetName(); + auto ft = Formatter(); + + if (researchItem->type == Research::EntryType::Ride + && !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + drawString = STR_WINDOW_COLOUR_2_STRINGID_STRINGID; + StringId rideTypeName = get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex)).Name; + ft.Add(rideTypeName); + ft.Add(stringId); + } + else + { + ft.Add(stringId); + } + DrawTextEllipsised(&dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE }); screenPos.y += 15; @@ -435,19 +434,13 @@ public: void OnPrepareDraw() override { - pressed_widgets |= 1ULL << WIDX_PREVIEW; - pressed_widgets |= 1ULL << WIDX_TAB_1; + pressed_widgets |= 1uLL << WIDX_PREVIEW; + pressed_widgets |= 1uLL << WIDX_TAB_1; widgets[WIDX_CLOSE].type = gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR ? WindowWidgetType::Empty : WindowWidgetType::CloseBox; - 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_RESIZE].right = width - 1; - widgets[WIDX_RESIZE].bottom = height - 1; + ResizeFrameWithPage(); int16_t scrollListHeight = (height - 88) / 2; @@ -520,6 +513,13 @@ public: _selectedResearchItem = nullptr; Invalidate(); + uint32_t beforeItemRawValue = 0; + if (beforeItem != nullptr) + beforeItemRawValue = beforeItem->rawValue; + + if (item.rawValue == beforeItemRawValue) + return; + ResearchRemove(item); auto& researchList = isInvented ? gResearchItemsInvented : gResearchItemsUninvented; @@ -527,7 +527,7 @@ public: { for (size_t i = 0; i < researchList.size(); i++) { - if (researchList[i] == *beforeItem) + if (researchList[i].rawValue == beforeItemRawValue) { researchList.insert((researchList.begin() + i), item); return; @@ -640,36 +640,18 @@ public: { auto screenCoords = windowPos + ScreenCoordsXY{ 0, 2 }; - auto [drawString, ft] = WindowEditorInventionsListPrepareName(_draggedItem, true); - DrawTextBasic(&dpi, screenCoords, drawString, ft, { COLOUR_BLACK | COLOUR_FLAG_OUTLINE }); + DrawResearchItem( + dpi, _draggedItem, width, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, { COLOUR_BLACK | COLOUR_FLAG_OUTLINE }); } - void Init(ResearchItem& researchItem) + void Init(ResearchItem& researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) { _draggedItem = researchItem; - StringId stringId = researchItem.GetName(); - char buffer[256] = {}; - if (researchItem.type == Research::EntryType::Ride - && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - const auto rideEntry = get_ride_entry(researchItem.entryIndex); - const StringId rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name; - Formatter ft; - ft.Add(stringId); - ft.Add(rideTypeName); - format_string(buffer, 256, STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME, &ft); - } - else - { - format_string(buffer, 256, stringId, nullptr); - } - - auto stringWidth = gfx_get_string_width(buffer, FontSpriteBase::MEDIUM); - widgets[0].right = stringWidth; + widgets[0].right = objectSelectionScrollWidth; Invalidate(); - windowPos = gTooltipCursor - ScreenCoordsXY{ stringWidth / 2, 7 }; - width = stringWidth; + windowPos = ScreenCoordsXY{ editorPos.x, gTooltipCursor.y - 7 }; + width = objectSelectionScrollWidth; Invalidate(); InputWindowPositionBegin(*this, 0, gTooltipCursor); @@ -681,14 +663,15 @@ public: } }; -static void WindowEditorInventionsListDragOpen(ResearchItem* researchItem) +static void WindowEditorInventionsListDragOpen( + ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) { window_close_by_class(WindowClass::EditorInventionListDrag); auto* wnd = WindowCreate( WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); if (wnd != nullptr) { - wnd->Init(*researchItem); + wnd->Init(*researchItem, editorPos, objectSelectionScrollWidth); } } diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index ca57501f8b..1f37bc4ee1 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -269,7 +269,7 @@ public: widgets[WIDX_FILTER_TEXT_BOX].string = _filter_string; - _filter_flags = gConfigInterface.object_selection_filter_flags; + _filter_flags = gConfigInterface.ObjectSelectionFilterFlags; std::fill_n(_filter_string, sizeof(_filter_string), 0x00); WindowInitScrollWidgets(*this); @@ -314,12 +314,12 @@ public: } auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); VisibleListDispose(); intent = Intent(INTENT_ACTION_REFRESH_SCENERY); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } void OnUpdate() override @@ -367,8 +367,8 @@ public: break; case WIDX_FILTER_RIDE_TAB_ALL: _filter_flags |= FILTER_RIDES; - gConfigInterface.object_selection_filter_flags = _filter_flags; - config_save_default(); + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; + ConfigSaveDefault(); FilterUpdateCounts(); VisibleListRefresh(); @@ -385,8 +385,8 @@ public: case WIDX_FILTER_RIDE_TAB_STALL: _filter_flags &= ~FILTER_RIDES; _filter_flags |= (1 << (widgetIndex - WIDX_FILTER_RIDE_TAB_TRANSPORT + _numSourceGameItems)); - gConfigInterface.object_selection_filter_flags = _filter_flags; - config_save_default(); + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; + ConfigSaveDefault(); FilterUpdateCounts(); VisibleListRefresh(); @@ -412,7 +412,7 @@ public: auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case WIDX_FILTER_TEXT_BOX: @@ -546,8 +546,8 @@ public: { _filter_flags ^= (1 << dropdownIndex); } - gConfigInterface.object_selection_filter_flags = _filter_flags; - config_save_default(); + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; + ConfigSaveDefault(); FilterUpdateCounts(); scrolls->v_top = 0; @@ -589,7 +589,7 @@ public: Invalidate(); - const CursorState* state = context_get_cursor_state(); + const CursorState* state = ContextGetCursorState(); OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, state->position.x); if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) @@ -620,7 +620,7 @@ public: StringId error_title = (inputFlags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT : STR_UNABLE_TO_DE_SELECT_THIS_OBJECT; - context_show_error(error_title, objectSelectResult.Message, {}); + ContextShowError(error_title, objectSelectResult.Message, {}); return; } @@ -636,12 +636,12 @@ public: const auto errorMessage = _gSceneryGroupPartialSelectError.value(); if (errorMessage == STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED) { - context_show_error( + ContextShowError( STR_WARNING_TOO_MANY_OBJECTS_SELECTED, STR_NOT_ALL_OBJECTS_IN_THIS_SCENERY_GROUP_COULD_BE_SELECTED, {}); } else { - context_show_error( + ContextShowError( errorMessage, STR_NOT_ALL_OBJECTS_IN_THIS_SCENERY_GROUP_COULD_BE_SELECTED, Formatter::Common()); } } @@ -721,15 +721,14 @@ public: if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && (*listItem.flags & ObjectSelectionFlags::Selected)) { screenCoords.x = 2; - FontSpriteBase fontSpriteBase = highlighted ? FontSpriteBase::MEDIUM_EXTRA_DARK - : FontSpriteBase::MEDIUM_DARK; + auto darkness = highlighted ? TextDarkness::ExtraDark : TextDarkness::Dark; colour_t colour2 = NOT_TRANSLUCENT(colours[1]); if (*listItem.flags & (ObjectSelectionFlags::InUse | ObjectSelectionFlags::AlwaysRequired)) colour2 |= COLOUR_FLAG_INSET; gfx_draw_string( &dpi, screenCoords, static_cast(CheckBoxMarkString), - { static_cast(colour2), fontSpriteBase }); + { static_cast(colour2), FontStyle::Medium, darkness }); } screenCoords.x = gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER ? 0 : 15; @@ -738,11 +737,11 @@ public: auto buffer = strchr(bufferWithColour, '\0'); colour_t colour = COLOUR_BLACK; - FontSpriteBase fontSpriteBase = FontSpriteBase::MEDIUM; + auto darkness = TextDarkness::Regular; if (*listItem.flags & ObjectSelectionFlags::Flag6) { colour = colours[1] & 0x7F; - fontSpriteBase = FontSpriteBase::MEDIUM_DARK; + darkness = TextDarkness::Dark; } int32_t width_limit = widgets[WIDX_LIST].width() - screenCoords.x; @@ -755,7 +754,8 @@ public: safe_strcpy(buffer, language_get_string(rideTypeStringId), 256 - (buffer - bufferWithColour)); auto ft = Formatter(); ft.Add(gCommonStringFormatBuffer); - DrawTextEllipsised(&dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, fontSpriteBase }); + DrawTextEllipsised( + &dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); screenCoords.x = widgets[WIDX_LIST_SORT_RIDE].left - widgets[WIDX_LIST].left; } @@ -770,7 +770,7 @@ public: } auto ft = Formatter(); ft.Add(gCommonStringFormatBuffer); - DrawTextEllipsised(&dpi, screenCoords, width_limit, STR_STRING, ft, { colour, fontSpriteBase }); + DrawTextEllipsised(&dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); } screenCoords.y += SCROLLABLE_ROW_HEIGHT; } @@ -815,13 +815,7 @@ public: void OnPrepareDraw() override { // Resize widgets - 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_TAB_CONTENT_PANEL].right = width - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = height - 1; + ResizeFrameWithPage(); widgets[WIDX_ADVANCED].left = width - 130; widgets[WIDX_ADVANCED].right = width - 9; widgets[WIDX_LIST].right = width - 309; @@ -834,12 +828,12 @@ public: widgets[WIDX_FILTER_DROPDOWN].right = width - 137; // Set pressed widgets - pressed_widgets |= 1ULL << WIDX_PREVIEW; + pressed_widgets |= 1uLL << WIDX_PREVIEW; SetPressedTab(); if (list_information_type & 1) - pressed_widgets |= (1ULL << WIDX_ADVANCED); + pressed_widgets |= (1uLL << WIDX_ADVANCED); else - pressed_widgets &= ~(1ULL << WIDX_ADVANCED); + pressed_widgets &= ~(1uLL << WIDX_ADVANCED); // Set window title and buttons auto ft = Formatter::Common(); @@ -915,17 +909,17 @@ public: if (ridePage) { - for (int32_t i = 0; i < 7; i++) - pressed_widgets &= ~(1 << (WIDX_FILTER_RIDE_TAB_ALL + i)); + for (int32_t i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) + pressed_widgets &= ~(1 << i); if ((_filter_flags & FILTER_RIDES) == FILTER_RIDES) - pressed_widgets |= (1ULL << WIDX_FILTER_RIDE_TAB_ALL); + pressed_widgets |= (1uLL << WIDX_FILTER_RIDE_TAB_ALL); else { for (int32_t i = 0; i < 6; i++) { if (_filter_flags & (1 << (_numSourceGameItems + i))) - pressed_widgets |= 1ULL << (WIDX_FILTER_RIDE_TAB_TRANSPORT + i); + pressed_widgets |= 1uLL << (WIDX_FILTER_RIDE_TAB_TRANSPORT + i); } } @@ -1508,12 +1502,12 @@ private: ; rct_ride_entry* ride_entry = get_ride_entry(entry_index); - auto rideType = ride_entry_get_first_non_null_ride_type(ride_entry); + auto rideType = ride_entry->GetFirstNonNullRideType(); auto intent = Intent(WindowClass::TrackDesignList); intent.putExtra(INTENT_EXTRA_RIDE_TYPE, rideType); intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, entry_index); - context_open_intent(&intent); + ContextOpenIntent(&intent); } }; @@ -1589,7 +1583,7 @@ void EditorLoadSelectedObjects() if (objectType == ObjectType::Ride) { rct_ride_entry* rideEntry = get_ride_entry(entryIndex); - auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); + auto rideType = rideEntry->GetFirstNonNullRideType(); ResearchCategory category = static_cast(GetRideTypeDescriptor(rideType).Category); research_insert_ride_entry(rideType, entryIndex, category, true); } @@ -1611,5 +1605,5 @@ void EditorLoadSelectedObjects() load_palette(); } if (showFallbackWarning) - context_show_error(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); + ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); } diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 3e98b9ace4..4092b4b6f8 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -177,10 +177,10 @@ static WindowEventList *window_editor_objective_options_page_events[] = { #pragma region Enabled widgets static uint64_t window_editor_objective_options_page_hold_down_widgets[] = { - (1ULL << WIDX_OBJECTIVE_ARG_1_INCREASE) | - (1ULL << WIDX_OBJECTIVE_ARG_1_DECREASE) | - (1ULL << WIDX_OBJECTIVE_ARG_2_INCREASE) | - (1ULL << WIDX_OBJECTIVE_ARG_2_DECREASE), + (1uLL << WIDX_OBJECTIVE_ARG_1_INCREASE) | + (1uLL << WIDX_OBJECTIVE_ARG_1_DECREASE) | + (1uLL << WIDX_OBJECTIVE_ARG_2_INCREASE) | + (1uLL << WIDX_OBJECTIVE_ARG_2_DECREASE), 0, }; @@ -218,20 +218,14 @@ rct_window* WindowEditorObjectiveOptionsOpen() static void WindowEditorObjectiveOptionsSetPressedTab(rct_window* w) { int32_t i; - for (i = 0; i < 2; i++) - w->pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + for (i = WIDX_TAB_1; i <= WIDX_TAB_2; i++) + w->pressed_widgets &= ~(1 << i); w->pressed_widgets |= 1LL << (WIDX_TAB_1 + w->page); } static void WindowEditorObjectiveOptionsAnchorBorderWidgets(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; + w->ResizeFrameWithPage(); } static void WindowEditorObjectiveOptionsDrawTabImages(rct_window* w, rct_drawpixelinfo* dpi) @@ -391,7 +385,7 @@ static void WindowEditorObjectiveOptionsShowObjectiveDropdown(rct_window* w) const bool objectiveAllowedByMoneyUsage = !(parkFlags & PARK_FLAGS_NO_MONEY) || !ObjectiveNeedsMoney(i); // This objective can only work if the player can ask money for rides. - const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME) || park_ride_prices_unlocked(); + const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME) || ParkRidePricesUnlocked(); if (objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings) { gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; @@ -442,7 +436,7 @@ static void WindowEditorObjectiveOptionsArg1Increase(rct_window* w) case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: if (gScenarioObjective.Currency >= 2000000.00_GBP) { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } else { @@ -453,7 +447,7 @@ static void WindowEditorObjectiveOptionsArg1Increase(rct_window* w) case OBJECTIVE_MONTHLY_FOOD_INCOME: if (gScenarioObjective.Currency >= 2000000.00_GBP) { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } else { @@ -464,7 +458,7 @@ static void WindowEditorObjectiveOptionsArg1Increase(rct_window* w) case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: if (gScenarioObjective.MinimumLength >= 5000) { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } else { @@ -475,7 +469,7 @@ static void WindowEditorObjectiveOptionsArg1Increase(rct_window* w) case OBJECTIVE_FINISH_5_ROLLERCOASTERS: if (gScenarioObjective.MinimumExcitement >= FIXED_2DP(9, 90)) { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } else { @@ -486,7 +480,7 @@ static void WindowEditorObjectiveOptionsArg1Increase(rct_window* w) default: if (gScenarioObjective.NumGuests >= 5000) { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } else { @@ -506,7 +500,7 @@ static void WindowEditorObjectiveOptionsArg1Decrease(rct_window* w) case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: if (gScenarioObjective.Currency <= 1000.00_GBP) { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } else { @@ -517,7 +511,7 @@ static void WindowEditorObjectiveOptionsArg1Decrease(rct_window* w) case OBJECTIVE_MONTHLY_FOOD_INCOME: if (gScenarioObjective.Currency <= 1000.00_GBP) { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } else { @@ -528,7 +522,7 @@ static void WindowEditorObjectiveOptionsArg1Decrease(rct_window* w) case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: if (gScenarioObjective.MinimumLength <= 1000) { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } else { @@ -539,7 +533,7 @@ static void WindowEditorObjectiveOptionsArg1Decrease(rct_window* w) case OBJECTIVE_FINISH_5_ROLLERCOASTERS: if (gScenarioObjective.MinimumExcitement <= FIXED_2DP(4, 00)) { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } else { @@ -550,7 +544,7 @@ static void WindowEditorObjectiveOptionsArg1Decrease(rct_window* w) default: if (gScenarioObjective.NumGuests <= 250) { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } else { @@ -565,7 +559,7 @@ static void WindowEditorObjectiveOptionsArg2Increase(rct_window* w) { if (gScenarioObjective.Year >= 25) { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } else { @@ -578,7 +572,7 @@ static void WindowEditorObjectiveOptionsArg2Decrease(rct_window* w) { if (gScenarioObjective.Year <= 1) { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } else { @@ -664,8 +658,7 @@ static void WindowEditorObjectiveOptionsMainUpdate(rct_window* w) // Check if objective is allowed by money and pay-per-ride settings. const bool objectiveAllowedByMoneyUsage = !(parkFlags & PARK_FLAGS_NO_MONEY) || !ObjectiveNeedsMoney(objectiveType); // This objective can only work if the player can ask money for rides. - const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME) - || park_ride_prices_unlocked(); + const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME) || ParkRidePricesUnlocked(); if (!objectiveAllowedByMoneyUsage || !objectiveAllowedByPaymentSettings) { // Reset objective @@ -1085,11 +1078,10 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_draw { if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) { - FontSpriteBase fontSpriteBase = stringId == STR_WINDOW_COLOUR_2_STRINGID ? FontSpriteBase::MEDIUM_EXTRA_DARK - : FontSpriteBase::MEDIUM_DARK; + auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark; gfx_draw_string( dpi, { 2, y }, static_cast(CheckBoxMarkString), - { static_cast(w->colours[1] & 0x7F), fontSpriteBase }); + { static_cast(w->colours[1] & 0x7F), FontStyle::Medium, darkness }); } // Ride name @@ -1111,10 +1103,10 @@ static void WindowEditorObjectiveOptionsUpdateDisabledWidgets(rct_window* w) const auto& rideManager = GetRideManager(); if (std::any_of(rideManager.begin(), rideManager.end(), [](const Ride& ride) { return ride.IsRide(); })) { - w->disabled_widgets &= ~(1ULL << WIDX_TAB_2); + w->disabled_widgets &= ~(1uLL << WIDX_TAB_2); } else { - w->disabled_widgets |= (1ULL << WIDX_TAB_2); + w->disabled_widgets |= (1uLL << WIDX_TAB_2); } } diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 725fe4fb50..3b62c41e72 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -180,28 +180,28 @@ static rct_widget *window_editor_scenario_options_widgets[] = { #pragma region Enabled widgets static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = { - (1ULL << WIDX_INITIAL_CASH_INCREASE) | - (1ULL << WIDX_INITIAL_CASH_DECREASE) | - (1ULL << WIDX_INITIAL_LOAN_INCREASE) | - (1ULL << WIDX_INITIAL_LOAN_DECREASE) | - (1ULL << WIDX_MAXIMUM_LOAN_INCREASE) | - (1ULL << WIDX_MAXIMUM_LOAN_DECREASE) | - (1ULL << WIDX_INTEREST_RATE_INCREASE) | - (1ULL << WIDX_INTEREST_RATE_DECREASE), - (1ULL << WIDX_CASH_PER_GUEST_INCREASE) | - (1ULL << WIDX_CASH_PER_GUEST_DECREASE) | - (1ULL << WIDX_GUEST_INITIAL_HAPPINESS_INCREASE) | - (1ULL << WIDX_GUEST_INITIAL_HAPPINESS_DECREASE) | - (1ULL << WIDX_GUEST_INITIAL_HUNGER_INCREASE) | - (1ULL << WIDX_GUEST_INITIAL_HUNGER_DECREASE) | - (1ULL << WIDX_GUEST_INITIAL_THIRST_INCREASE) | - (1ULL << WIDX_GUEST_INITIAL_THIRST_DECREASE), - (1ULL << WIDX_LAND_COST_INCREASE) | - (1ULL << WIDX_LAND_COST_DECREASE) | - (1ULL << WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE) | - (1ULL << WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE) | - (1ULL << WIDX_ENTRY_PRICE_INCREASE) | - (1ULL << WIDX_ENTRY_PRICE_DECREASE), + (1uLL << WIDX_INITIAL_CASH_INCREASE) | + (1uLL << WIDX_INITIAL_CASH_DECREASE) | + (1uLL << WIDX_INITIAL_LOAN_INCREASE) | + (1uLL << WIDX_INITIAL_LOAN_DECREASE) | + (1uLL << WIDX_MAXIMUM_LOAN_INCREASE) | + (1uLL << WIDX_MAXIMUM_LOAN_DECREASE) | + (1uLL << WIDX_INTEREST_RATE_INCREASE) | + (1uLL << WIDX_INTEREST_RATE_DECREASE), + (1uLL << WIDX_CASH_PER_GUEST_INCREASE) | + (1uLL << WIDX_CASH_PER_GUEST_DECREASE) | + (1uLL << WIDX_GUEST_INITIAL_HAPPINESS_INCREASE) | + (1uLL << WIDX_GUEST_INITIAL_HAPPINESS_DECREASE) | + (1uLL << WIDX_GUEST_INITIAL_HUNGER_INCREASE) | + (1uLL << WIDX_GUEST_INITIAL_HUNGER_DECREASE) | + (1uLL << WIDX_GUEST_INITIAL_THIRST_INCREASE) | + (1uLL << WIDX_GUEST_INITIAL_THIRST_DECREASE), + (1uLL << WIDX_LAND_COST_INCREASE) | + (1uLL << WIDX_LAND_COST_DECREASE) | + (1uLL << WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE) | + (1uLL << WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE) | + (1uLL << WIDX_ENTRY_PRICE_INCREASE) | + (1uLL << WIDX_ENTRY_PRICE_DECREASE), }; // clang-format on @@ -317,13 +317,7 @@ private: void AnchorBorderWidgets() { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); } void DrawTabImages(rct_drawpixelinfo& dpi) @@ -438,7 +432,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_CASH, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_CASH, STR_NONE, {}); } Invalidate(); break; @@ -451,7 +445,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_CASH, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_CASH, STR_NONE, {}); } Invalidate(); break; @@ -464,7 +458,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_INIT_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_INIT_LOAN, STR_NONE, {}); } Invalidate(); break; @@ -477,7 +471,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_INIT_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_INIT_LOAN, STR_NONE, {}); } Invalidate(); break; @@ -490,7 +484,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_MAX_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_MAX_LOAN, STR_NONE, {}); } Invalidate(); break; @@ -503,7 +497,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_MAX_LOAN, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_MAX_LOAN, STR_NONE, {}); } Invalidate(); break; @@ -516,7 +510,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE, {}); } Invalidate(); break; @@ -529,7 +523,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE, {}); } Invalidate(); break; @@ -702,7 +696,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -715,7 +709,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -728,7 +722,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -741,7 +735,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -754,7 +748,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -767,7 +761,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -780,7 +774,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -793,7 +787,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -976,7 +970,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -989,7 +983,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -1002,7 +996,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -1015,7 +1009,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -1028,7 +1022,7 @@ private: } else { - context_show_error(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -1041,7 +1035,7 @@ private: } else { - context_show_error(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); } Invalidate(); break; @@ -1133,7 +1127,7 @@ private: widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type = WindowWidgetType::DropdownMenu; widgets[WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN].type = WindowWidgetType::Button; - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) { widgets[WIDX_ENTRY_PRICE].type = WindowWidgetType::Empty; widgets[WIDX_ENTRY_PRICE_INCREASE].type = WindowWidgetType::Empty; diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index ea8516621b..81d41c14bb 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -27,42 +27,91 @@ static rct_widget window_error_widgets[] = { MakeWidget({0, 0}, {200, 42}, WindowWidgetType::ImgBtn, WindowColour::Primary), WIDGETS_END, }; - -static void WindowErrorUnknown5(rct_window *w); -static void WindowErrorPaint(rct_window *w, rct_drawpixelinfo *dpi); - -static WindowEventList window_error_events([](auto& events) -{ - events.unknown_05 = &WindowErrorUnknown5; - events.paint = &WindowErrorPaint; -}); // clang-format on -static std::string _window_error_text; -static uint16_t _window_error_num_lines; - -/** - * - * rct2: 0x0066792F - * - * bx: title - * dx: message - */ -rct_window* WindowErrorOpen(StringId title, StringId message, const Formatter& args) +class ErrorWindow final : public Window { - auto titlez = format_string(title, args.Data()); - auto messagez = format_string(message, args.Data()); - return WindowErrorOpen(titlez, messagez); -} +private: + std::string _text; + uint16_t _numLines; + +public: + ErrorWindow(std::string text, uint16_t numLines) + : _text(text) + , _numLines(numLines) + { + } + + void OnOpen() override + { + window_error_widgets[WIDX_BACKGROUND].right = width; + window_error_widgets[WIDX_BACKGROUND].bottom = height; + + widgets = window_error_widgets; + error.var_480 = 0; + if (!gDisableErrorWindowSound) + { + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, windowPos.x + (width / 2)); + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + ScreenCoordsXY leftTop{ windowPos }; + ScreenCoordsXY rightBottom{ windowPos + ScreenCoordsXY{ width - 1, height - 1 } }; + ScreenCoordsXY leftBottom{ leftTop.x, rightBottom.y }; + ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y }; + + gfx_filter_rect( + &dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, + FilterPaletteID::Palette45); + gfx_filter_rect(&dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed); + + gfx_filter_rect( + &dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } }, + FilterPaletteID::PaletteDarken3); + gfx_filter_rect( + &dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } }, + FilterPaletteID::PaletteDarken3); + gfx_filter_rect( + &dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } }, + FilterPaletteID::PaletteDarken3); + gfx_filter_rect( + &dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } }, + FilterPaletteID::PaletteDarken3); + + gfx_filter_rect( + &dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } }, + FilterPaletteID::PaletteDarken3); + gfx_filter_rect( + &dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } }, + FilterPaletteID::PaletteDarken3); + gfx_filter_rect( + &dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } }, + FilterPaletteID::PaletteDarken3); + gfx_filter_rect( + &dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, + FilterPaletteID::PaletteDarken3); + + draw_string_centred_raw( + &dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium); + } + + void OnUnknown5() override + { + error.var_480++; + if (error.var_480 >= 8) + { + Close(); + } + } +}; rct_window* WindowErrorOpen(std::string_view title, std::string_view message) { - int32_t numLines, width, height, maxY; - rct_window* w; - window_close_by_class(WindowClass::Error); - auto& buffer = _window_error_text; - buffer.assign("{BLACK}"); + + std::string buffer = "{BLACK}"; buffer.append(title); // Format the message @@ -82,98 +131,39 @@ rct_window* WindowErrorOpen(std::string_view title, std::string_view message) // Check if there is any text to display if (buffer.size() <= 1) + { return nullptr; + } - width = gfx_get_string_width_new_lined(buffer.data(), FontSpriteBase::MEDIUM); + int32_t width = gfx_get_string_width_new_lined(buffer.data(), FontStyle::Medium); width = std::clamp(width, 64, 196); - gfx_wrap_string(buffer.data(), width + 1, FontSpriteBase::MEDIUM, &numLines); + int32_t numLines{}; + gfx_wrap_string(buffer.data(), width + 1, FontStyle::Medium, &numLines); - _window_error_num_lines = numLines; width = width + 3; - height = (numLines + 1) * font_get_line_height(FontSpriteBase::MEDIUM) + 4; - - window_error_widgets[WIDX_BACKGROUND].right = width; - window_error_widgets[WIDX_BACKGROUND].bottom = height; - - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); - const CursorState* state = context_get_cursor_state(); + int32_t height = (numLines + 1) * font_get_line_height(FontStyle::Medium) + 4; + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + const CursorState* state = ContextGetCursorState(); ScreenCoordsXY windowPosition = state->position - ScreenCoordsXY(width / 2, -26); windowPosition.x = std::clamp(windowPosition.x, 0, screenWidth); windowPosition.y = std::max(22, windowPosition.y); - maxY = screenHeight - height; + int32_t maxY = screenHeight - height; if (windowPosition.y > maxY) { windowPosition.y = std::min(windowPosition.y - height - 40, maxY); } - w = WindowCreate( - windowPosition, width, height, &window_error_events, WindowClass::Error, + auto errorWindow = std::make_unique(buffer, numLines); + return WindowCreate( + std::move(errorWindow), WindowClass::Error, windowPosition, width, height, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_RESIZABLE); - w->widgets = window_error_widgets; - w->error.var_480 = 0; - if (!gDisableErrorWindowSound) - { - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, w->windowPos.x + (w->width / 2)); - } - - return w; } -/** - * - * rct2: 0x00667BFE - */ -static void WindowErrorUnknown5(rct_window* w) +rct_window* WindowErrorOpen(StringId title, StringId message, const Formatter& args) { - w->error.var_480++; - if (w->error.var_480 >= 8) - window_close(*w); -} - -/** - * - * rct2: 0x00667AA3 - */ -static void WindowErrorPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - ScreenCoordsXY leftTop{ w->windowPos }; - ScreenCoordsXY rightBottom{ w->windowPos + ScreenCoordsXY{ w->width - 1, w->height - 1 } }; - ScreenCoordsXY leftBottom{ leftTop.x, rightBottom.y }; - ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y }; - - gfx_filter_rect( - dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, FilterPaletteID::Palette45); - gfx_filter_rect(dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed); - - gfx_filter_rect( - dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } }, - FilterPaletteID::PaletteDarken3); - gfx_filter_rect( - dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } }, - FilterPaletteID::PaletteDarken3); - gfx_filter_rect( - dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } }, - FilterPaletteID::PaletteDarken3); - gfx_filter_rect( - dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } }, - FilterPaletteID::PaletteDarken3); - - gfx_filter_rect( - dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } }, - FilterPaletteID::PaletteDarken3); - gfx_filter_rect( - dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } }, - FilterPaletteID::PaletteDarken3); - gfx_filter_rect( - dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } }, - FilterPaletteID::PaletteDarken3); - gfx_filter_rect( - dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, - FilterPaletteID::PaletteDarken3); - - draw_string_centred_raw( - dpi, { leftTop + ScreenCoordsXY{ (w->width + 1) / 2 - 1, 1 } }, _window_error_num_lines, _window_error_text.data(), - FontSpriteBase::MEDIUM); + auto titlez = format_string(title, args.Data()); + auto messagez = format_string(message, args.Data()); + return WindowErrorOpen(titlez, messagez); } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 126abe5521..988383a7d2 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -209,7 +209,7 @@ static_assert(std::size(_windowFinancesTabAnimationFrames) == WINDOW_FINANCES_PA static constexpr const int32_t EXPENDITURE_COLUMN_WIDTH = 80; static constexpr const uint32_t _windowFinancesPageHoldDownWidgets[] = { - (1ULL << WIDX_LOAN_INCREASE) | (1ULL << WIDX_LOAN_DECREASE), // WINDOW_FINANCES_PAGE_SUMMARY + (1uLL << WIDX_LOAN_INCREASE) | (1uLL << WIDX_LOAN_DECREASE), // WINDOW_FINANCES_PAGE_SUMMARY 0, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH 0, // WINDOW_FINANCES_PAGE_VALUE_GRAPH @@ -632,7 +632,7 @@ public: ft.Add(axisValue); DrawTextBasic( &dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, - { FontSpriteBase::SMALL, TextAlignment::RIGHT }); + { FontStyle::Small, TextAlignment::RIGHT }); gfx_fill_rect_inset( &dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -689,7 +689,7 @@ public: ft.Add(axisValue); DrawTextBasic( &dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, - { FontSpriteBase::SMALL, TextAlignment::RIGHT }); + { FontStyle::Small, TextAlignment::RIGHT }); gfx_fill_rect_inset( &dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -748,7 +748,7 @@ public: ft.Add(axisValue); DrawTextBasic( &dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, - { FontSpriteBase::SMALL, TextAlignment::RIGHT }); + { FontStyle::Small, TextAlignment::RIGHT }); gfx_fill_rect_inset( &dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -768,7 +768,7 @@ public: { if (widgetIndex >= WIDX_CAMPAIGN_1 && widgetIndex <= WIDX_CAMPAIGN_6) { - context_open_detail_window(WD_NEW_CAMPAIGN, widgetIndex - WIDX_CAMPAIGN_1); + ContextOpenDetailWindow(WD_NEW_CAMPAIGN, widgetIndex - WIDX_CAMPAIGN_1); } } @@ -890,7 +890,7 @@ public: if (widgetIndex >= WIDX_TRANSPORT_RIDES && widgetIndex <= WIDX_SCENERY_AND_THEMING) { auto activeResearchTypes = gResearchPriorities; - activeResearchTypes ^= 1ULL << (widgetIndex - WIDX_TRANSPORT_RIDES); + activeResearchTypes ^= 1uLL << (widgetIndex - WIDX_TRANSPORT_RIDES); auto gameAction = ParkSetResearchFundingAction(activeResearchTypes, gResearchFundingLevel); GameActions::Execute(&gameAction); @@ -904,7 +904,7 @@ public: rct_widget* dropdownWidget = &widgets[widgetIndex - 1]; - for (int32_t i = 0; i < 4; i++) + for (std::size_t i = 0; i < std::size(ResearchFundingLevelNames); i++) { gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[i].Args = ResearchFundingLevelNames[i]; @@ -950,7 +950,7 @@ public: for (int32_t i = 0; i < 7; i++) { int32_t mask = 1 << i; - int32_t widgetMask = 1ULL << (i + WIDX_TRANSPORT_RIDES); + int32_t widgetMask = 1uLL << (i + WIDX_TRANSPORT_RIDES); // Set checkbox disabled if research type is complete if (uncompletedResearchTypes & mask) @@ -1014,6 +1014,16 @@ public: } }; +static FinancesWindow* FinancesWindowOpen(uint8_t page) +{ + auto* window = WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); + + if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY) + window->SetPage(page); + + return window; +} + rct_window* WindowFinancesOpen() { return WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); @@ -1021,10 +1031,10 @@ rct_window* WindowFinancesOpen() rct_window* WindowFinancesResearchOpen() { - auto* window = WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); - - if (window != nullptr) - window->SetPage(WINDOW_FINANCES_PAGE_RESEARCH); - - return window; + return FinancesWindowOpen(WINDOW_FINANCES_PAGE_RESEARCH); +} + +rct_window* WindowFinancesMarketingOpen() +{ + return FinancesWindowOpen(WINDOW_FINANCES_PAGE_MARKETING); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 60794afa62..a99315e12b 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include @@ -32,18 +33,7 @@ #include #include -static constexpr const StringId WINDOW_TITLE = STR_FOOTPATHS; -static constexpr const int32_t WH = 421; -static constexpr const int32_t WW = 106; -static constexpr const uint16_t ARROW_PULSE_DURATION = 200; - -static uint8_t _footpathConstructDirection; -static uint8_t _footpathConstructValidDirections; -static uint8_t _footpathConstructionMode; - -static std::vector> _dropdownEntries; - -static PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type); +using namespace OpenRCT2::Ui; // clang-format off enum @@ -53,6 +43,16 @@ enum PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL }; +#pragma region Measurements + +static constexpr const StringId WINDOW_TITLE = STR_FOOTPATHS; +static constexpr const int32_t WH_WINDOW = 421; +static constexpr const int32_t WW_WINDOW = 106; + +#pragma endregion + +#pragma region Widgets + enum WindowFootpathWidgetIdx { WIDX_BACKGROUND, @@ -83,7 +83,7 @@ enum WindowFootpathWidgetIdx }; static rct_widget window_footpath_widgets[] = { - WINDOW_SHIM(WINDOW_TITLE, WW, WH), + WINDOW_SHIM(WINDOW_TITLE, WW_WINDOW, WH_WINDOW), // Type group MakeWidget({ 3, 17}, {100, 95}, WindowWidgetType::Groupbox, WindowColour::Primary , STR_TYPE ), @@ -113,38 +113,7 @@ static rct_widget window_footpath_widgets[] = { WIDGETS_END, }; -static void WindowFootpathClose(rct_window * w); -static void WindowFootpathMouseup(rct_window * w, WidgetIndex widgetIndex); -static void WindowFootpathMousedown(rct_window * w, WidgetIndex widgetIndex, rct_widget * widget); -static void WindowFootpathDropdown(rct_window * w, WidgetIndex widgetIndex, int32_t dropdownIndex); -static void WindowFootpathUpdate(rct_window * w); -static void WindowFootpathToolupdate(rct_window * w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -static void WindowFootpathTooldown(rct_window * w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -static void WindowFootpathTooldrag(rct_window * w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -static void WindowFootpathToolup(rct_window * w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -static void WindowFootpathInvalidate(rct_window * w); -static void WindowFootpathPaint(rct_window * w, rct_drawpixelinfo * dpi); - -static WindowEventList window_footpath_events([](auto& events) -{ - events.close = &WindowFootpathClose; - events.mouse_up = &WindowFootpathMouseup; - events.mouse_down = &WindowFootpathMousedown; - events.dropdown = &WindowFootpathDropdown; - events.update = &WindowFootpathUpdate; - events.tool_update = &WindowFootpathToolupdate; - events.tool_down = &WindowFootpathTooldown; - events.tool_drag = &WindowFootpathTooldrag; - events.tool_up = &WindowFootpathToolup; - events.invalidate = &WindowFootpathInvalidate; - events.paint = &WindowFootpathPaint; -}); -// clang-format on - -static money32 _window_footpath_cost; -static uint32_t _footpathConstructionNextArrowPulse = 0; -static uint8_t _lastUpdatedCameraRotation = UINT8_MAX; -static bool _footpathErrorOccured; +#pragma endregion /** rct2: 0x0098D8B4 */ static constexpr const uint8_t DefaultPathSlope[] = { @@ -172,19 +141,1258 @@ static constexpr const uint8_t ConstructionPreviewImages[][4] = { { 16, 17, 18, 19 }, // Upwards { 18, 19, 16, 17 }, // Downwards }; +// clang-format on -static void WindowFootpathMousedownDirection(int32_t direction); -static void WindowFootpathMousedownSlope(int32_t slope); -static void WindowFootpathShowFootpathTypesDialog(rct_window* w, rct_widget* widget, bool showQueues); -static void WindowFootpathShowRailingsTypesDialog(rct_window* w, rct_widget* widget); -static void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords); -static void WindowFootpathSetSelectionStartBridgeAtPoint(const ScreenCoordsXY& screenCoords); -static void WindowFootpathPlacePathAtPoint(const ScreenCoordsXY& screenCoords); -static void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords); -static void WindowFootpathConstruct(); -static void WindowFootpathRemove(); -static void WindowFootpathSetEnabledAndPressedWidgets(); -static void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope); +class FootpathWindow final : public Window +{ +private: + const uint16_t ARROW_PULSE_DURATION = 200; + + uint8_t _footpathConstructDirection; + uint8_t _footpathConstructValidDirections; + uint8_t _footpathConstructionMode; + + std::vector> _dropdownEntries; + + money32 _windowFootpathCost; + uint32_t _footpathConstructionNextArrowPulse = 0; + uint8_t _lastUpdatedCameraRotation = UINT8_MAX; + bool _footpathErrorOccured = false; + +public: +#pragma region Window Override Events + + void OnOpen() override + { + widgets = window_footpath_widgets; + + WindowInitScrollWidgets(*this); + window_push_others_right(*this); + show_gridlines(); + + tool_cancel(); + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; + tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); + input_set_flag(INPUT_FLAG_6, true); + _footpathErrorOccured = false; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + void OnClose() override + { + FootpathProvisionalUpdate(); + viewport_set_visibility(0); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + window_invalidate_by_class(WindowClass::TopToolbar); + hide_gridlines(); + } + + void OnUpdate() override + { + widget_invalidate(*this, WIDX_CONSTRUCT); + WindowFootpathUpdateProvisionalPathForBridgeMode(); + + // #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed + uint8_t currentRotation = get_current_rotation(); + if (_lastUpdatedCameraRotation != currentRotation) + { + _lastUpdatedCameraRotation = currentRotation; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + // Check tool + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) + { + if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) + { + Close(); + } + else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) + { + Close(); + } + else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_ON_LAND) + { + Close(); + } + } + else if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) + { + if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) + { + Close(); + } + else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) + { + Close(); + } + else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) + { + Close(); + } + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_FOOTPATH_TYPE: + WindowFootpathShowFootpathTypesDialog(&window_footpath_widgets[widgetIndex], false); + break; + case WIDX_QUEUELINE_TYPE: + WindowFootpathShowFootpathTypesDialog(&window_footpath_widgets[widgetIndex], true); + break; + case WIDX_RAILINGS_TYPE: + WindowFootpathShowRailingsTypesDialog(&window_footpath_widgets[widgetIndex]); + break; + case WIDX_DIRECTION_NW: + WindowFootpathMousedownDirection(0); + break; + case WIDX_DIRECTION_NE: + WindowFootpathMousedownDirection(1); + break; + case WIDX_DIRECTION_SW: + WindowFootpathMousedownDirection(2); + break; + case WIDX_DIRECTION_SE: + WindowFootpathMousedownDirection(3); + break; + case WIDX_SLOPEDOWN: + WindowFootpathMousedownSlope(6); + break; + case WIDX_LEVEL: + WindowFootpathMousedownSlope(0); + break; + case WIDX_SLOPEUP: + WindowFootpathMousedownSlope(2); + break; + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_CONSTRUCT: + WindowFootpathConstruct(); + break; + case WIDX_REMOVE: + WindowFootpathRemove(); + break; + case WIDX_CONSTRUCT_ON_LAND: + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) + { + break; + } + + _windowFootpathCost = MONEY32_UNDEFINED; + tool_cancel(); + FootpathProvisionalUpdate(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; + tool_set(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); + input_set_flag(INPUT_FLAG_6, true); + _footpathErrorOccured = false; + WindowFootpathSetEnabledAndPressedWidgets(); + break; + case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) + { + break; + } + + _windowFootpathCost = MONEY32_UNDEFINED; + tool_cancel(); + FootpathProvisionalUpdate(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL; + tool_set(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair); + input_set_flag(INPUT_FLAG_6, true); + _footpathErrorOccured = false; + WindowFootpathSetEnabledAndPressedWidgets(); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (selectedIndex < 0 || static_cast(selectedIndex) >= _dropdownEntries.size()) + return; + + auto entryIndex = _dropdownEntries[selectedIndex]; + if (widgetIndex == WIDX_FOOTPATH_TYPE) + { + gFootpathSelection.IsQueueSelected = false; + if (entryIndex.first == ObjectType::Paths) + { + gFootpathSelection.LegacyPath = entryIndex.second; + } + else + { + gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; + gFootpathSelection.NormalSurface = entryIndex.second; + } + } + else if (widgetIndex == WIDX_QUEUELINE_TYPE) + { + gFootpathSelection.IsQueueSelected = true; + if (entryIndex.first == ObjectType::Paths) + { + gFootpathSelection.LegacyPath = entryIndex.second; + } + else + { + gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; + gFootpathSelection.QueueSurface = entryIndex.second; + } + } + else if (widgetIndex == WIDX_RAILINGS_TYPE) + { + gFootpathSelection.Railings = entryIndex.second; + } + else + { + return; + } + + FootpathProvisionalUpdate(); + _windowFootpathCost = MONEY32_UNDEFINED; + Invalidate(); + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + WindowFootpathSetProvisionalPathAtPoint(screenCoords); + } + else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) + { + WindowFootpathSetSelectionStartBridgeAtPoint(screenCoords); + } + } + + void OnToolUp(WidgetIndex widgetIndex, const ScreenCoordsXY&) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + _footpathErrorOccured = false; + } + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + WindowFootpathPlacePathAtPoint(screenCoords); + } + else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) + { + WindowFootpathStartBridgeAtPoint(screenCoords); + } + } + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + WindowFootpathPlacePathAtPoint(screenCoords); + } + } + + void OnPrepareDraw() override + { + // Press / unpress footpath and queue type buttons + pressed_widgets &= ~(1uLL << WIDX_FOOTPATH_TYPE); + pressed_widgets &= ~(1uLL << WIDX_QUEUELINE_TYPE); + pressed_widgets |= gFootpathSelection.IsQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) : (1uLL << WIDX_FOOTPATH_TYPE); + + // Enable / disable construct button + window_footpath_widgets[WIDX_CONSTRUCT].type = _footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL + ? WindowWidgetType::ImgBtn + : WindowWidgetType::Empty; + + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::FlatBtn; + } + else + { + window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::Empty; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + ScreenCoordsXY screenCoords; + WindowDrawWidgets(*this, &dpi); + WindowFootpathDrawDropdownButtons(&dpi); + + if (!IsWidgetDisabled(WIDX_CONSTRUCT)) + { + // Get construction image + uint8_t direction = (_footpathConstructDirection + get_current_rotation()) % 4; + uint8_t slope = 0; + if (gFootpathConstructSlope == 2) + { + slope = TILE_ELEMENT_SLOPE_N_CORNER_UP; + } + else if (gFootpathConstructSlope == 6) + { + slope = TILE_ELEMENT_SLOPE_E_CORNER_UP; + } + + std::optional baseImage; + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + auto selectedPath = gFootpathSelection.GetSelectedSurface(); + const auto* pathType = GetPathSurfaceEntry(selectedPath); + if (pathType != nullptr) + { + baseImage = pathType->BaseImageId; + } + } + else + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto* pathObj = static_cast( + objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); + if (pathObj != nullptr) + { + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + if (gFootpathSelection.IsQueueSelected) + baseImage = pathEntry->GetQueueImage(); + else + baseImage = pathEntry->image; + } + } + + if (baseImage) + { + auto image = *baseImage + ConstructionPreviewImages[slope][direction]; + + // Draw construction image + screenCoords = this->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 }; + gfx_draw_sprite(&dpi, ImageId(image), screenCoords); + } + + // Draw build this... label + screenCoords = this->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 }; + DrawTextBasic(&dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); + } + + // Draw cost + screenCoords = this->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12 }; + if (_windowFootpathCost != MONEY32_UNDEFINED) + { + if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(_windowFootpathCost); + DrawTextBasic(&dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); + } + } + } + +#pragma endregion + +private: + /** + * + * rct2: 0x006A7760 + */ + void WindowFootpathUpdateProvisionalPathForBridgeMode() + { + if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + { + return; + } + + // Recheck area for construction. Set by ride_construction window + if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_2) + { + FootpathProvisionalRemove(); + gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_2; + } + + // Update provisional bridge mode path + if (!(gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)) + { + ObjectEntryIndex type; + ObjectEntryIndex railings = gFootpathSelection.Railings; + + CoordsXYZ footpathLoc; + int32_t slope; + FootpathGetNextPathInfo(&type, footpathLoc, &slope); + auto pathConstructFlags = FootpathCreateConstructFlags(type); + + _windowFootpathCost = FootpathProvisionalSet(type, railings, footpathLoc, slope, pathConstructFlags); + widget_invalidate(*this, WIDX_CONSTRUCT); + } + + auto curTime = Platform::GetTicks(); + + // Update little directional arrow on provisional bridge mode path + if (_footpathConstructionNextArrowPulse < curTime) + { + _footpathConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; + + gProvisionalFootpath.Flags ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW; + CoordsXYZ footpathLoc; + int32_t slope; + FootpathGetNextPathInfo(nullptr, footpathLoc, &slope); + gMapSelectArrowPosition = footpathLoc; + gMapSelectArrowDirection = _footpathConstructDirection; + if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + } + else + { + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + } + MapInvalidateTileFull(footpathLoc); + } + } + + void WindowFootpathDrawDropdownButtons(rct_drawpixelinfo* dpi) + { + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + // Set footpath and queue type button images + auto pathImage = static_cast(SPR_NONE); + auto queueImage = static_cast(SPR_NONE); + auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.NormalSurface); + if (pathEntry != nullptr) + { + pathImage = pathEntry->PreviewImageId; + } + + pathEntry = GetPathSurfaceEntry(gFootpathSelection.QueueSurface); + if (pathEntry != nullptr) + { + queueImage = pathEntry->PreviewImageId; + } + + WindowFootpathDrawDropdownButton(dpi, WIDX_FOOTPATH_TYPE, pathImage); + WindowFootpathDrawDropdownButton(dpi, WIDX_QUEUELINE_TYPE, queueImage); + + // Set railing + auto railingsImage = static_cast(SPR_NONE); + auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.Railings); + if (railingsEntry != nullptr) + { + railingsImage = railingsEntry->PreviewImageId; + } + WindowFootpathDrawDropdownButton(dpi, WIDX_RAILINGS_TYPE, railingsImage); + } + else + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + + // Set footpath and queue type button images + auto pathImage = static_cast(SPR_NONE); + auto queueImage = static_cast(SPR_NONE); + auto pathObj = static_cast( + objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); + if (pathObj != nullptr) + { + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + pathImage = pathEntry->GetPreviewImage(); + queueImage = pathEntry->GetQueuePreviewImage(); + } + + WindowFootpathDrawDropdownButton(dpi, WIDX_FOOTPATH_TYPE, pathImage); + WindowFootpathDrawDropdownButton(dpi, WIDX_QUEUELINE_TYPE, queueImage); + } + } + + void WindowFootpathDrawDropdownButton(rct_drawpixelinfo* dpi, WidgetIndex widgetIndex, ImageIndex image) + { + const auto& widget = widgets[widgetIndex]; + gfx_draw_sprite(dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top }); + } + + /** + * + * rct2: 0x006A7F88 + */ + void WindowFootpathShowFootpathTypesDialog(rct_widget* widget, bool showQueues) + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + + uint32_t numPathTypes = 0; + // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + + _dropdownEntries.clear(); + std::optional defaultIndex; + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) + { + const auto* pathType = static_cast( + objManager.GetLoadedObject(ObjectType::FootpathSurface, i)); + if (pathType == nullptr) + { + continue; + } + if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + { + continue; + } + if (showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + continue; + } + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL + && i == (showQueues ? gFootpathSelection.QueueSurface : gFootpathSelection.NormalSurface)) + { + defaultIndex = numPathTypes; + } + + gDropdownItems[numPathTypes].Format = STR_NONE; + Dropdown::SetImage(numPathTypes, ImageId(pathType->PreviewImageId)); + _dropdownEntries.push_back({ ObjectType::FootpathSurface, i }); + numPathTypes++; + } + + for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) + { + auto* pathObj = static_cast(objManager.GetLoadedObject(ObjectType::Paths, i)); + if (pathObj == nullptr) + { + continue; + } + + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + if ((pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + { + continue; + } + + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL && gFootpathSelection.LegacyPath == i) + { + defaultIndex = numPathTypes; + } + + gDropdownItems[numPathTypes].Format = STR_NONE; + Dropdown::SetImage( + numPathTypes, ImageId(showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage())); + _dropdownEntries.push_back({ ObjectType::Paths, i }); + numPathTypes++; + } + + auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numPathTypes); + WindowDropdownShowImage( + windowPos.x + widget->left, windowPos.y + widget->top, widget->height() + 1, colours[1], 0, numPathTypes, 47, 36, + itemsPerRow); + if (defaultIndex) + gDropdownDefaultIndex = static_cast(*defaultIndex); + } + + void WindowFootpathShowRailingsTypesDialog(rct_widget* widget) + { + uint32_t numRailingsTypes = 0; + // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor + + _dropdownEntries.clear(); + std::optional defaultIndex; + for (int32_t i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) + { + const auto* railingsEntry = GetPathRailingsEntry(i); + if (railingsEntry == nullptr) + { + continue; + } + if (i == gFootpathSelection.Railings) + { + defaultIndex = numRailingsTypes; + } + + gDropdownItems[numRailingsTypes].Format = STR_NONE; + Dropdown::SetImage(numRailingsTypes, ImageId(railingsEntry->PreviewImageId)); + _dropdownEntries.push_back({ ObjectType::FootpathRailings, i }); + numRailingsTypes++; + } + + auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numRailingsTypes); + WindowDropdownShowImage( + windowPos.x + widget->left, windowPos.y + widget->top, widget->height() + 1, colours[1], 0, numRailingsTypes, 47, + 36, itemsPerRow); + if (defaultIndex) + gDropdownDefaultIndex = static_cast(*defaultIndex); + } + + /** + * + * rct2: 0x006A8111 0x006A8135 0x006A815C 0x006A8183 + */ + void WindowFootpathMousedownDirection(int32_t direction) + { + FootpathProvisionalUpdate(); + _footpathConstructDirection = (direction - get_current_rotation()) & 3; + _windowFootpathCost = MONEY32_UNDEFINED; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * + * rct2: 0x006A81AA 0x006A81C5 0x006A81E0 + */ + void WindowFootpathMousedownSlope(int32_t slope) + { + FootpathProvisionalUpdate(); + gFootpathConstructSlope = slope; + _windowFootpathCost = MONEY32_UNDEFINED; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * + * rct2: 0x006A81FB + */ + void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords) + { + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + auto info = get_map_coordinates_from_pos( + screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); + + if (info.SpriteType == ViewportInteractionItem::None || info.Element == nullptr) + { + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + FootpathProvisionalUpdate(); + } + else + { + // Check for change + if ((gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) + && gProvisionalFootpath.Position == CoordsXYZ{ info.Loc, info.Element->GetBaseZ() }) + { + return; + } + + // Set map selection + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = info.Loc; + gMapSelectPositionB = info.Loc; + + FootpathProvisionalUpdate(); + + // Set provisional path + int32_t slope = 0; + switch (info.SpriteType) + { + case ViewportInteractionItem::Terrain: + { + auto surfaceElement = info.Element->AsSurface(); + if (surfaceElement != nullptr) + { + slope = DefaultPathSlope[surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; + } + break; + } + case ViewportInteractionItem::Footpath: + { + auto pathElement = info.Element->AsPath(); + if (pathElement != nullptr) + { + slope = pathElement->GetSlopeDirection(); + if (pathElement->IsSloped()) + { + slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; + } + } + break; + } + default: + break; + } + auto z = info.Element->GetBaseZ(); + if (slope & RAISE_FOOTPATH_FLAG) + { + slope &= ~RAISE_FOOTPATH_FLAG; + z += PATH_HEIGHT_STEP; + } + + auto pathType = gFootpathSelection.GetSelectedSurface(); + auto constructFlags = FootpathCreateConstructFlags(pathType); + _windowFootpathCost = FootpathProvisionalSet( + pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); + window_invalidate_by_class(WindowClass::Footpath); + } + } + + /** + * + * rct2: 0x006A8388 + */ + void WindowFootpathSetSelectionStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) + { + int32_t direction; + TileElement* tileElement; + + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); + if (mapCoords.IsNull()) + { + return; + } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords; + + int32_t z = tileElement->GetBaseZ(); + + if (tileElement->GetType() == TileElementType::Surface) + { + uint8_t slope = tileElement->AsSurface()->GetSlope(); + if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) + { + z += PATH_HEIGHT_STEP; + } // Add 2 for a slope + if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + z += PATH_HEIGHT_STEP; // Add another 2 for a steep slope + } + + gMapSelectArrowPosition = CoordsXYZ{ mapCoords, z }; + gMapSelectArrowDirection = direction; + + MapInvalidateSelectionRect(); + } + + /** + * + * rct2: 0x006A82C5 + */ + void WindowFootpathPlacePathAtPoint(const ScreenCoordsXY& screenCoords) + { + if (_footpathErrorOccured) + { + return; + } + + FootpathProvisionalUpdate(); + + const auto info = get_map_coordinates_from_pos( + screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); + + if (info.SpriteType == ViewportInteractionItem::None) + { + return; + } + + // Set path + auto slope = 0; + switch (info.SpriteType) + { + case ViewportInteractionItem::Terrain: + slope = DefaultPathSlope[info.Element->AsSurface()->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; + break; + case ViewportInteractionItem::Footpath: + slope = info.Element->AsPath()->GetSlopeDirection(); + if (info.Element->AsPath()->IsSloped()) + { + slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; + } + break; + default: + break; + } + auto z = info.Element->GetBaseZ(); + if (slope & RAISE_FOOTPATH_FLAG) + { + slope &= ~RAISE_FOOTPATH_FLAG; + z += PATH_HEIGHT_STEP; + } + + // Try and place path + auto selectedType = gFootpathSelection.GetSelectedSurface(); + PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); + + auto footpathPlaceAction = FootpathPlaceAction( + { info.Loc, z }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags); + footpathPlaceAction.SetCallback([this](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios + if (result->Cost != 0) + { + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + } + } + else + { + _footpathErrorOccured = true; + } + }); + GameActions::Execute(&footpathPlaceAction); + } + + /** + * + * rct2: 0x006A840F + */ + void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) + { + int32_t z, direction; + TileElement* tileElement; + + auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); + if (mapCoords.IsNull()) + { + return; + } + + if (tileElement->GetType() == TileElementType::Surface) + { + // If we start the path on a slope, the arrow is slightly raised, so we + // expect the path to be slightly raised as well. + uint8_t slope = tileElement->AsSurface()->GetSlope(); + z = tileElement->GetBaseZ(); + if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + { + // Steep diagonal slope + z += 2 * PATH_HEIGHT_STEP; + } + else if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) + { + // Normal slope + z += PATH_HEIGHT_STEP; + } + } + else + { + z = tileElement->GetBaseZ(); + if (tileElement->GetType() == TileElementType::Path) + { + if (tileElement->AsPath()->IsSloped()) + { + if (direction == (tileElement->AsPath()->GetSlopeDirection())) + { + z += PATH_HEIGHT_STEP; + } + } + } + } + + tool_cancel(); + gFootpathConstructFromPosition = { mapCoords, z }; + _footpathConstructDirection = direction; + gProvisionalFootpath.Flags = 0; + gFootpathConstructSlope = 0; + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; + _footpathConstructValidDirections = INVALID_DIRECTION; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * Construct a piece of footpath while in bridge building mode. + * rct2: 0x006A79B7 + */ + void WindowFootpathConstruct() + { + _windowFootpathCost = MONEY32_UNDEFINED; + FootpathProvisionalUpdate(); + + ObjectEntryIndex type; + int32_t slope; + CoordsXYZ footpathLoc; + FootpathGetNextPathInfo(&type, footpathLoc, &slope); + + PathConstructFlags constructFlags = FootpathCreateConstructFlags(type); + + auto footpathPlaceAction = FootpathPlaceAction( + footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); + footpathPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + + if (gFootpathConstructSlope == 0) + { + _footpathConstructValidDirections = INVALID_DIRECTION; + } + else + { + _footpathConstructValidDirections = _footpathConstructDirection; + } + + if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND) + { + viewport_set_visibility(1); + } + + gFootpathConstructFromPosition = footpathLoc; + // If we have just built an upwards slope, the next path to construct is + // a bit higher. Note that the z returned by footpath_get_next_path_info + // already is lowered if we are building a downwards slope. + if (gFootpathConstructSlope == 2) + { + gFootpathConstructFromPosition.z += PATH_HEIGHT_STEP; + } + } + WindowFootpathSetEnabledAndPressedWidgets(); + }); + GameActions::Execute(&footpathPlaceAction); + } + + /** + * + * rct2: 0x006A78EF + */ + void FootpathRemoveTileElement(TileElement* tileElement) + { + auto z = tileElement->GetBaseZ(); + if (tileElement->AsPath()->IsSloped()) + { + uint8_t slopeDirection = tileElement->AsPath()->GetSlopeDirection(); + slopeDirection = DirectionReverse(slopeDirection); + if (slopeDirection == _footpathConstructDirection) + { + z += PATH_HEIGHT_STEP; + } + } + + // Find a connected edge + int32_t edge = DirectionReverse(_footpathConstructDirection); + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = (edge + 1) & 3; + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = (edge + 2) & 3; + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = (edge - 1) & 3; + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = DirectionReverse(edge); + } + } + } + } + + gFootpathConstructFromPosition.z = tileElement->GetBaseZ(); + auto action = FootpathRemoveAction(gFootpathConstructFromPosition); + GameActions::Execute(&action); + + // Move selection + edge = DirectionReverse(edge); + gFootpathConstructFromPosition.x -= CoordsDirectionDelta[edge].x; + gFootpathConstructFromPosition.y -= CoordsDirectionDelta[edge].y; + gFootpathConstructFromPosition.z = z; + _footpathConstructDirection = edge; + _footpathConstructValidDirections = INVALID_DIRECTION; + } + + /** + * + * rct2: 0x006A7873 + */ + TileElement* FootpathGetTileElementToRemove() + { + TileElement* tileElement; + int32_t z, zLow; + + if (!MapIsLocationValid(gFootpathConstructFromPosition)) + { + return nullptr; + } + + z = std::min(255 * COORDS_Z_STEP, gFootpathConstructFromPosition.z); + zLow = z - PATH_HEIGHT_STEP; + + tileElement = MapGetFirstElementAt(gFootpathConstructFromPosition); + do + { + if (tileElement == nullptr) + break; + if (tileElement->GetType() == TileElementType::Path) + { + if (tileElement->GetBaseZ() == z) + { + if (tileElement->AsPath()->IsSloped()) + { + if (DirectionReverse(tileElement->AsPath()->GetSlopeDirection()) != _footpathConstructDirection) + { + continue; + } + } + + return tileElement; + } + if (tileElement->GetBaseZ() == zLow) + { + if (!tileElement->AsPath()->IsSloped()) + { + if ((tileElement->AsPath()->GetSlopeDirection()) == _footpathConstructDirection) + { + continue; + } + } + + return tileElement; + } + } + } while (!(tileElement++)->IsLastForTile()); + + return nullptr; + } + + /** + * + * rct2: 0x006A7863 + */ + void WindowFootpathRemove() + { + TileElement* tileElement; + + _windowFootpathCost = MONEY32_UNDEFINED; + FootpathProvisionalUpdate(); + + tileElement = FootpathGetTileElementToRemove(); + if (tileElement != nullptr) + { + FootpathRemoveTileElement(tileElement); + } + + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * + * rct2: 0x006A855C + */ + void WindowFootpathSetEnabledAndPressedWidgets() + { + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + { + MapInvalidateMapSelectionTiles(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; + + int32_t direction = _footpathConstructDirection; + gMapSelectionTiles.clear(); + gMapSelectionTiles.push_back({ gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, + gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); + MapInvalidateMapSelectionTiles(); + } + + uint64_t pressedWidgets = pressed_widgets + & ~((1LL << WIDX_DIRECTION_NW) | (1LL << WIDX_DIRECTION_NE) | (1LL << WIDX_DIRECTION_SW) + | (1LL << WIDX_DIRECTION_SE) | (1LL << WIDX_SLOPEDOWN) | (1LL << WIDX_LEVEL) | (1LL << WIDX_SLOPEUP)); + uint64_t disabledWidgets = 0; + int32_t currentRotation = get_current_rotation(); + if (_footpathConstructionMode >= PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + { + // Set pressed directional widget + int32_t direction = (_footpathConstructDirection + currentRotation) & 3; + pressedWidgets |= (1LL << (WIDX_DIRECTION_NW + direction)); + + // Set pressed slope widget + int32_t slope = gFootpathConstructSlope; + if (slope == TILE_ELEMENT_SLOPE_SE_SIDE_UP) + { + pressedWidgets |= (1uLL << WIDX_SLOPEDOWN); + } + else if (slope == TILE_ELEMENT_SLOPE_FLAT) + { + pressedWidgets |= (1uLL << WIDX_LEVEL); + } + else + { + pressedWidgets |= (1uLL << WIDX_SLOPEUP); + } + + // Enable / disable directional widgets + direction = _footpathConstructValidDirections; + if (direction != INVALID_DIRECTION) + { + disabledWidgets |= (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) | (1uLL << WIDX_DIRECTION_SW) + | (1uLL << WIDX_DIRECTION_SE); + + direction = (direction + currentRotation) & 3; + disabledWidgets &= ~(1 << (WIDX_DIRECTION_NW + direction)); + } + } + else + { + // Disable all bridge mode widgets + disabledWidgets |= (1uLL << WIDX_DIRECTION_GROUP) | (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) + | (1uLL << WIDX_DIRECTION_SW) | (1uLL << WIDX_DIRECTION_SE) | (1uLL << WIDX_SLOPE_GROUP) + | (1uLL << WIDX_SLOPEDOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPEUP) | (1uLL << WIDX_CONSTRUCT) + | (1uLL << WIDX_REMOVE); + } + + pressed_widgets = pressedWidgets; + disabled_widgets = disabledWidgets; + Invalidate(); + } + + /** + * + * rct2: 0x006A7B20 + */ + void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope) + { + auto direction = _footpathConstructDirection; + footpathLoc.x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x; + footpathLoc.y = gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y; + footpathLoc.z = gFootpathConstructFromPosition.z; + if (type != nullptr) + { + *type = gFootpathSelection.GetSelectedSurface(); + } + *slope = TILE_ELEMENT_SLOPE_FLAT; + if (gFootpathConstructSlope != 0) + { + *slope = _footpathConstructDirection | TILE_ELEMENT_SLOPE_S_CORNER_UP; + if (gFootpathConstructSlope != 2) + { + footpathLoc.z -= PATH_HEIGHT_STEP; + *slope ^= TILE_ELEMENT_SLOPE_E_CORNER_UP; + } + } + } + + PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type) + { + PathConstructFlags pathConstructFlags = 0; + if (gFootpathSelection.IsQueueSelected) + pathConstructFlags |= PathConstructFlag::IsQueue; + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; + type = gFootpathSelection.LegacyPath; + } + return pathConstructFlags; + } + +#pragma region Keyboard Shortcuts Events +public: + void KeyboardShortcutTurnLeft() + { + if (IsWidgetDisabled(WIDX_DIRECTION_NW) || IsWidgetDisabled(WIDX_DIRECTION_NE) || IsWidgetDisabled(WIDX_DIRECTION_SW) + || IsWidgetDisabled(WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) + { + return; + } + int32_t currentRotation = get_current_rotation(); + int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? 1 : -1); + WindowFootpathMousedownDirection(turnedRotation); + } + + void KeyboardShortcutTurnRight() + { + if (IsWidgetDisabled(WIDX_DIRECTION_NW) || IsWidgetDisabled(WIDX_DIRECTION_NE) || IsWidgetDisabled(WIDX_DIRECTION_SW) + || IsWidgetDisabled(WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) + { + return; + } + int32_t currentRotation = get_current_rotation(); + int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? -1 : 1); + WindowFootpathMousedownDirection(turnedRotation); + } + + void KeyboardShortcutShortcutSlopeDown() + { + if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) + || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + { + return; + } + + switch (gFootpathConstructSlope) + { + case 0: + OnMouseDown(WIDX_SLOPEDOWN); + break; + case 2: + OnMouseDown(WIDX_LEVEL); + break; + default: + case 6: + return; + } + } + + void KeyboardShortcutSlopeUp() + { + if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) + || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + { + return; + } + + switch (gFootpathConstructSlope) + { + case 6: + OnMouseDown(WIDX_LEVEL); + break; + case 0: + OnMouseDown(WIDX_SLOPEUP); + break; + default: + case 2: + return; + } + } + + void KeyboardShortcutSlopeLevel() + { + if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) + || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty || gFootpathConstructSlope == 0) + { + return; + } + + OnMouseDown(WIDX_LEVEL); + } + + void KeyboardShortcutDemolishCurrent() + { + if (IsWidgetDisabled(WIDX_REMOVE) || widgets[WIDX_REMOVE].type == WindowWidgetType::Empty + || (!gCheatsBuildInPauseMode && game_is_paused())) + { + return; + } + + WindowFootpathRemove(); + } + + void KeyboardShortcutBuildCurrent() + { + if (IsWidgetDisabled(WIDX_CONSTRUCT) || widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) + { + return; + } + + OnMouseUp(WIDX_CONSTRUCT); + } + +#pragma endregion +}; /** * @@ -198,1281 +1406,88 @@ rct_window* WindowFootpathOpen() return nullptr; } - // Check if window is already open - rct_window* window = window_bring_to_front_by_class(WindowClass::Footpath); - if (window != nullptr) - { - return window; - } - - window = WindowCreate(ScreenCoordsXY(0, 29), WW, WH, &window_footpath_events, WindowClass::Footpath, 0); - window->widgets = window_footpath_widgets; - - WindowInitScrollWidgets(*window); - window_push_others_right(*window); - show_gridlines(); - - tool_cancel(); - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; - tool_set(*window, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); - input_set_flag(INPUT_FLAG_6, true); - _footpathErrorOccured = false; - WindowFootpathSetEnabledAndPressedWidgets(); - - return window; -} - -/** - * - * rct2: 0x006A852F - */ -static void WindowFootpathClose(rct_window* w) -{ - footpath_provisional_update(); - viewport_set_visibility(0); - map_invalidate_map_selection_tiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - window_invalidate_by_class(WindowClass::TopToolbar); - hide_gridlines(); -} - -/** - * - * rct2: 0x006A7E92 - */ -static void WindowFootpathMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(*w); - break; - case WIDX_CONSTRUCT: - WindowFootpathConstruct(); - break; - case WIDX_REMOVE: - WindowFootpathRemove(); - break; - case WIDX_CONSTRUCT_ON_LAND: - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) - { - break; - } - - _window_footpath_cost = MONEY32_UNDEFINED; - tool_cancel(); - footpath_provisional_update(); - map_invalidate_map_selection_tiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; - tool_set(*w, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); - input_set_flag(INPUT_FLAG_6, true); - _footpathErrorOccured = false; - WindowFootpathSetEnabledAndPressedWidgets(); - break; - case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) - { - break; - } - - _window_footpath_cost = MONEY32_UNDEFINED; - tool_cancel(); - footpath_provisional_update(); - map_invalidate_map_selection_tiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL; - tool_set(*w, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair); - input_set_flag(INPUT_FLAG_6, true); - _footpathErrorOccured = false; - WindowFootpathSetEnabledAndPressedWidgets(); - break; - } -} - -/** - * - * rct2: 0x006A7EC5 - */ -static void WindowFootpathMousedown(rct_window* w, WidgetIndex widgetIndex, rct_widget* widget) -{ - switch (widgetIndex) - { - case WIDX_FOOTPATH_TYPE: - WindowFootpathShowFootpathTypesDialog(w, widget, false); - break; - case WIDX_QUEUELINE_TYPE: - WindowFootpathShowFootpathTypesDialog(w, widget, true); - break; - case WIDX_RAILINGS_TYPE: - WindowFootpathShowRailingsTypesDialog(w, widget); - break; - case WIDX_DIRECTION_NW: - WindowFootpathMousedownDirection(0); - break; - case WIDX_DIRECTION_NE: - WindowFootpathMousedownDirection(1); - break; - case WIDX_DIRECTION_SW: - WindowFootpathMousedownDirection(2); - break; - case WIDX_DIRECTION_SE: - WindowFootpathMousedownDirection(3); - break; - case WIDX_SLOPEDOWN: - WindowFootpathMousedownSlope(6); - break; - case WIDX_LEVEL: - WindowFootpathMousedownSlope(0); - break; - case WIDX_SLOPEUP: - WindowFootpathMousedownSlope(2); - break; - } -} - -/** - * - * rct2: 0x006A7F18 - */ -static void WindowFootpathDropdown(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex) -{ - if (dropdownIndex < 0 || static_cast(dropdownIndex) >= _dropdownEntries.size()) - return; - - auto entryIndex = _dropdownEntries[dropdownIndex]; - if (widgetIndex == WIDX_FOOTPATH_TYPE) - { - gFootpathSelection.IsQueueSelected = false; - if (entryIndex.first == ObjectType::Paths) - { - gFootpathSelection.LegacyPath = entryIndex.second; - } - else - { - gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; - gFootpathSelection.NormalSurface = entryIndex.second; - } - } - else if (widgetIndex == WIDX_QUEUELINE_TYPE) - { - gFootpathSelection.IsQueueSelected = true; - if (entryIndex.first == ObjectType::Paths) - { - gFootpathSelection.LegacyPath = entryIndex.second; - } - else - { - gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; - gFootpathSelection.QueueSurface = entryIndex.second; - } - } - else if (widgetIndex == WIDX_RAILINGS_TYPE) - { - gFootpathSelection.Railings = entryIndex.second; - } - else - { - return; - } - - footpath_provisional_update(); - _window_footpath_cost = MONEY32_UNDEFINED; - w->Invalidate(); -} - -/** - * - * rct2: 0x006A8032 - */ -static void WindowFootpathToolupdate(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - WindowFootpathSetProvisionalPathAtPoint(screenCoords); - } - else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) - { - WindowFootpathSetSelectionStartBridgeAtPoint(screenCoords); - } -} - -/** - * - * rct2: 0x006A8047 - */ -static void WindowFootpathTooldown(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - WindowFootpathPlacePathAtPoint(screenCoords); - } - else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) - { - WindowFootpathStartBridgeAtPoint(screenCoords); - } -} - -/** - * - * rct2: 0x006A8067 - */ -static void WindowFootpathTooldrag(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - WindowFootpathPlacePathAtPoint(screenCoords); - } -} - -/** - * - * rct2: 0x006A8066 - */ -static void WindowFootpathToolup(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - _footpathErrorOccured = false; - } -} - -/** - * - * rct2: 0x006A7760 - */ -static void WindowFootpathUpdateProvisionalPathForBridgeMode(rct_window* w) -{ - if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) - { - return; - } - - // Recheck area for construction. Set by ride_construction window - if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_2) - { - footpath_provisional_remove(); - gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_2; - } - - // Update provisional bridge mode path - if (!(gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)) - { - ObjectEntryIndex type; - ObjectEntryIndex railings = gFootpathSelection.Railings; - - CoordsXYZ footpathLoc; - int32_t slope; - FootpathGetNextPathInfo(&type, footpathLoc, &slope); - auto pathConstructFlags = FootpathCreateConstructFlags(type); - - _window_footpath_cost = footpath_provisional_set(type, railings, footpathLoc, slope, pathConstructFlags); - widget_invalidate(*w, WIDX_CONSTRUCT); - } - - auto curTime = Platform::GetTicks(); - - // Update little directional arrow on provisional bridge mode path - if (_footpathConstructionNextArrowPulse < curTime) - { - _footpathConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; - - gProvisionalFootpath.Flags ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW; - CoordsXYZ footpathLoc; - int32_t slope; - FootpathGetNextPathInfo(nullptr, footpathLoc, &slope); - gMapSelectArrowPosition = footpathLoc; - gMapSelectArrowDirection = _footpathConstructDirection; - if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - } - else - { - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - } - map_invalidate_tile_full(footpathLoc); - } -} - -/** - * - * rct2: 0x006A84BB - */ -static void WindowFootpathUpdate(rct_window* w) -{ - widget_invalidate(*w, WIDX_CONSTRUCT); - WindowFootpathUpdateProvisionalPathForBridgeMode(w); - - // #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed - uint8_t currentRotation = get_current_rotation(); - if (_lastUpdatedCameraRotation != currentRotation) - { - _lastUpdatedCameraRotation = currentRotation; - WindowFootpathSetEnabledAndPressedWidgets(); - } - - // Check tool - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) - { - if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) - { - window_close(*w); - } - else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) - { - window_close(*w); - } - else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_ON_LAND) - { - window_close(*w); - } - } - else if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) - { - if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE))) - { - window_close(*w); - } - else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) - { - window_close(*w); - } - else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) - { - window_close(*w); - } - } -} - -/** - * - * rct2: 0x006A7D1C - */ -static void WindowFootpathInvalidate(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 |= gFootpathSelection.IsQueueSelected ? (1ULL << WIDX_QUEUELINE_TYPE) : (1ULL << WIDX_FOOTPATH_TYPE); - - // Enable / disable construct button - window_footpath_widgets[WIDX_CONSTRUCT].type = _footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL - ? WindowWidgetType::ImgBtn - : WindowWidgetType::Empty; - - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) - { - window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::FlatBtn; - } - else - { - window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::Empty; - } -} - -static void WindowFootpathDrawDropdownButton(rct_window* w, rct_drawpixelinfo* dpi, WidgetIndex widgetIndex, ImageIndex image) -{ - const auto& widget = w->widgets[widgetIndex]; - gfx_draw_sprite(dpi, ImageId(image), { w->windowPos.x + widget.left, w->windowPos.y + widget.top }); -} - -static void WindowFootpathDrawDropdownButtons(rct_window* w, rct_drawpixelinfo* dpi) -{ - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) - { - // Set footpath and queue type button images - auto pathImage = static_cast(SPR_NONE); - auto queueImage = static_cast(SPR_NONE); - auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.NormalSurface); - if (pathEntry != nullptr) - { - pathImage = pathEntry->PreviewImageId; - } - - pathEntry = GetPathSurfaceEntry(gFootpathSelection.QueueSurface); - if (pathEntry != nullptr) - { - queueImage = pathEntry->PreviewImageId; - } - - WindowFootpathDrawDropdownButton(w, dpi, WIDX_FOOTPATH_TYPE, pathImage); - WindowFootpathDrawDropdownButton(w, dpi, WIDX_QUEUELINE_TYPE, queueImage); - - // Set railing - auto railingsImage = static_cast(SPR_NONE); - auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.Railings); - if (railingsEntry != nullptr) - { - railingsImage = railingsEntry->PreviewImageId; - } - WindowFootpathDrawDropdownButton(w, dpi, WIDX_RAILINGS_TYPE, railingsImage); - } - else - { - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - - // Set footpath and queue type button images - auto pathImage = static_cast(SPR_NONE); - auto queueImage = static_cast(SPR_NONE); - auto pathObj = static_cast( - objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); - if (pathObj != nullptr) - { - auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - pathImage = pathEntry->GetPreviewImage(); - queueImage = pathEntry->GetQueuePreviewImage(); - } - - WindowFootpathDrawDropdownButton(w, dpi, WIDX_FOOTPATH_TYPE, pathImage); - WindowFootpathDrawDropdownButton(w, dpi, WIDX_QUEUELINE_TYPE, queueImage); - } -} - -/** - * - * rct2: 0x006A7D8B - */ -static void WindowFootpathPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - ScreenCoordsXY screenCoords; - WindowDrawWidgets(*w, dpi); - WindowFootpathDrawDropdownButtons(w, dpi); - - if (!WidgetIsDisabled(*w, WIDX_CONSTRUCT)) - { - // Get construction image - uint8_t direction = (_footpathConstructDirection + get_current_rotation()) % 4; - uint8_t slope = 0; - if (gFootpathConstructSlope == 2) - { - slope = TILE_ELEMENT_SLOPE_N_CORNER_UP; - } - else if (gFootpathConstructSlope == 6) - { - slope = TILE_ELEMENT_SLOPE_E_CORNER_UP; - } - - std::optional baseImage; - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) - { - auto selectedPath = gFootpathSelection.GetSelectedSurface(); - const auto* pathType = GetPathSurfaceEntry(selectedPath); - if (pathType != nullptr) - { - baseImage = pathType->BaseImageId; - } - } - else - { - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - auto* pathObj = static_cast( - objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); - if (pathObj != nullptr) - { - auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - if (gFootpathSelection.IsQueueSelected) - baseImage = pathEntry->GetQueueImage(); - else - baseImage = pathEntry->image; - } - } - - if (baseImage) - { - auto image = *baseImage + ConstructionPreviewImages[slope][direction]; - - // Draw construction image - screenCoords = 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 - + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), - window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 }; - DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); - } - - // Draw cost - screenCoords = w->windowPos - + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12 }; - if (_window_footpath_cost != MONEY32_UNDEFINED) - { - if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(_window_footpath_cost); - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); - } - } -} - -/** - * - * rct2: 0x006A7F88 - */ -static void WindowFootpathShowFootpathTypesDialog(rct_window* w, rct_widget* widget, bool showQueues) -{ - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - - uint32_t numPathTypes = 0; - // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); - - _dropdownEntries.clear(); - std::optional defaultIndex; - for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) - { - const auto* pathType = static_cast(objManager.GetLoadedObject(ObjectType::FootpathSurface, i)); - if (pathType == nullptr) - { - continue; - } - if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) - { - continue; - } - if (showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) - { - continue; - } - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL - && i == (showQueues ? gFootpathSelection.QueueSurface : gFootpathSelection.NormalSurface)) - { - defaultIndex = numPathTypes; - } - - gDropdownItems[numPathTypes].Format = STR_NONE; - Dropdown::SetImage(numPathTypes, ImageId(pathType->PreviewImageId)); - _dropdownEntries.push_back({ ObjectType::FootpathSurface, i }); - numPathTypes++; - } - - for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) - { - auto* pathObj = static_cast(objManager.GetLoadedObject(ObjectType::Paths, i)); - if (pathObj == nullptr) - { - continue; - } - - auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - if ((pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) - { - continue; - } - - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL && gFootpathSelection.LegacyPath == i) - { - defaultIndex = numPathTypes; - } - - gDropdownItems[numPathTypes].Format = STR_NONE; - Dropdown::SetImage( - numPathTypes, ImageId(showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage())); - _dropdownEntries.push_back({ ObjectType::Paths, i }); - numPathTypes++; - } - - auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numPathTypes); - WindowDropdownShowImage( - 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); -} - -static void WindowFootpathShowRailingsTypesDialog(rct_window* w, rct_widget* widget) -{ - uint32_t numRailingsTypes = 0; - // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor - - _dropdownEntries.clear(); - std::optional defaultIndex; - for (int32_t i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) - { - const auto* railingsEntry = GetPathRailingsEntry(i); - if (railingsEntry == nullptr) - { - continue; - } - if (i == gFootpathSelection.Railings) - { - defaultIndex = numRailingsTypes; - } - - gDropdownItems[numRailingsTypes].Format = STR_NONE; - Dropdown::SetImage(numRailingsTypes, ImageId(railingsEntry->PreviewImageId)); - _dropdownEntries.push_back({ ObjectType::FootpathRailings, i }); - numRailingsTypes++; - } - - auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numRailingsTypes); - WindowDropdownShowImage( - w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height() + 1, w->colours[1], 0, numRailingsTypes, - 47, 36, itemsPerRow); - if (defaultIndex) - gDropdownDefaultIndex = static_cast(*defaultIndex); -} - -/** - * - * rct2: 0x006A8111 0x006A8135 0x006A815C 0x006A8183 - */ -static void WindowFootpathMousedownDirection(int32_t direction) -{ - footpath_provisional_update(); - _footpathConstructDirection = (direction - get_current_rotation()) & 3; - _window_footpath_cost = MONEY32_UNDEFINED; - WindowFootpathSetEnabledAndPressedWidgets(); -} - -/** - * - * rct2: 0x006A81AA 0x006A81C5 0x006A81E0 - */ -static void WindowFootpathMousedownSlope(int32_t slope) -{ - footpath_provisional_update(); - gFootpathConstructSlope = slope; - _window_footpath_cost = MONEY32_UNDEFINED; - WindowFootpathSetEnabledAndPressedWidgets(); -} - -/** - * - * rct2: 0x006A81FB - */ -static void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords) -{ - map_invalidate_selection_rect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - auto info = get_map_coordinates_from_pos( - screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); - - if (info.SpriteType == ViewportInteractionItem::None || info.Element == nullptr) - { - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - footpath_provisional_update(); - } - else - { - // Check for change - if ((gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) - && gProvisionalFootpath.Position == CoordsXYZ{ info.Loc, info.Element->GetBaseZ() }) - { - return; - } - - // Set map selection - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = info.Loc; - gMapSelectPositionB = info.Loc; - - footpath_provisional_update(); - - // Set provisional path - int32_t slope = 0; - switch (info.SpriteType) - { - case ViewportInteractionItem::Terrain: - { - auto surfaceElement = info.Element->AsSurface(); - if (surfaceElement != nullptr) - { - slope = DefaultPathSlope[surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; - } - break; - } - case ViewportInteractionItem::Footpath: - { - auto pathElement = info.Element->AsPath(); - if (pathElement != nullptr) - { - slope = pathElement->GetSlopeDirection(); - if (pathElement->IsSloped()) - { - slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; - } - } - break; - } - default: - break; - } - auto z = info.Element->GetBaseZ(); - if (slope & RAISE_FOOTPATH_FLAG) - { - slope &= ~RAISE_FOOTPATH_FLAG; - z += PATH_HEIGHT_STEP; - } - - auto pathType = gFootpathSelection.GetSelectedSurface(); - auto constructFlags = FootpathCreateConstructFlags(pathType); - _window_footpath_cost = footpath_provisional_set( - pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); - window_invalidate_by_class(WindowClass::Footpath); - } -} - -/** - * - * rct2: 0x006A8388 - */ -static void WindowFootpathSetSelectionStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) -{ - int32_t direction; - TileElement* tileElement; - - map_invalidate_selection_rect(); - 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()) - { - return; - } - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords; - - int32_t z = tileElement->GetBaseZ(); - - if (tileElement->GetType() == TileElementType::Surface) - { - uint8_t slope = tileElement->AsSurface()->GetSlope(); - if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - z += PATH_HEIGHT_STEP; - } // Add 2 for a slope - if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - z += PATH_HEIGHT_STEP; // Add another 2 for a steep slope - } - - gMapSelectArrowPosition = CoordsXYZ{ mapCoords, z }; - gMapSelectArrowDirection = direction; - - map_invalidate_selection_rect(); -} - -/** - * - * rct2: 0x006A82C5 - */ -static void WindowFootpathPlacePathAtPoint(const ScreenCoordsXY& screenCoords) -{ - if (_footpathErrorOccured) - { - return; - } - - footpath_provisional_update(); - - const auto info = get_map_coordinates_from_pos( - screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); - - if (info.SpriteType == ViewportInteractionItem::None) - { - return; - } - - // Set path - auto slope = 0; - switch (info.SpriteType) - { - case ViewportInteractionItem::Terrain: - slope = DefaultPathSlope[info.Element->AsSurface()->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; - break; - case ViewportInteractionItem::Footpath: - slope = info.Element->AsPath()->GetSlopeDirection(); - if (info.Element->AsPath()->IsSloped()) - { - slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; - } - break; - default: - break; - } - auto z = info.Element->GetBaseZ(); - if (slope & RAISE_FOOTPATH_FLAG) - { - slope &= ~RAISE_FOOTPATH_FLAG; - z += PATH_HEIGHT_STEP; - } - - // Try and place path - auto selectedType = gFootpathSelection.GetSelectedSurface(); - PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); - - auto footpathPlaceAction = FootpathPlaceAction( - { info.Loc, z }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags); - footpathPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios - if (result->Cost != 0) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - } - } - else - { - _footpathErrorOccured = true; - } - }); - GameActions::Execute(&footpathPlaceAction); -} - -/** - * - * rct2: 0x006A840F - */ -static void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) -{ - int32_t z, direction; - TileElement* tileElement; - - auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement); - if (mapCoords.IsNull()) - { - return; - } - - if (tileElement->GetType() == TileElementType::Surface) - { - // If we start the path on a slope, the arrow is slightly raised, so we - // expect the path to be slightly raised as well. - uint8_t slope = tileElement->AsSurface()->GetSlope(); - z = tileElement->GetBaseZ(); - if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - { - // Steep diagonal slope - z += 2 * PATH_HEIGHT_STEP; - } - else if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - // Normal slope - z += PATH_HEIGHT_STEP; - } - } - else - { - z = tileElement->GetBaseZ(); - if (tileElement->GetType() == TileElementType::Path) - { - if (tileElement->AsPath()->IsSloped()) - { - if (direction == (tileElement->AsPath()->GetSlopeDirection())) - { - z += PATH_HEIGHT_STEP; - } - } - } - } - - tool_cancel(); - gFootpathConstructFromPosition = { mapCoords, z }; - _footpathConstructDirection = direction; - gProvisionalFootpath.Flags = 0; - gFootpathConstructSlope = 0; - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; - _footpathConstructValidDirections = INVALID_DIRECTION; - WindowFootpathSetEnabledAndPressedWidgets(); -} - -/** - * Construct a piece of footpath while in bridge building mode. - * rct2: 0x006A79B7 - */ -static void WindowFootpathConstruct() -{ - _window_footpath_cost = MONEY32_UNDEFINED; - footpath_provisional_update(); - - ObjectEntryIndex type; - int32_t slope; - CoordsXYZ footpathLoc; - FootpathGetNextPathInfo(&type, footpathLoc, &slope); - - PathConstructFlags constructFlags = FootpathCreateConstructFlags(type); - - auto footpathPlaceAction = FootpathPlaceAction( - footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); - footpathPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - - if (gFootpathConstructSlope == 0) - { - _footpathConstructValidDirections = INVALID_DIRECTION; - } - else - { - _footpathConstructValidDirections = _footpathConstructDirection; - } - - if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND) - { - viewport_set_visibility(1); - } - - gFootpathConstructFromPosition = footpathLoc; - // If we have just built an upwards slope, the next path to construct is - // a bit higher. Note that the z returned by footpath_get_next_path_info - // already is lowered if we are building a downwards slope. - if (gFootpathConstructSlope == 2) - { - gFootpathConstructFromPosition.z += PATH_HEIGHT_STEP; - } - } - WindowFootpathSetEnabledAndPressedWidgets(); - }); - GameActions::Execute(&footpathPlaceAction); -} - -/** - * - * rct2: 0x006A78EF - */ -static void FootpathRemoveTileElement(TileElement* tileElement) -{ - auto z = tileElement->GetBaseZ(); - if (tileElement->AsPath()->IsSloped()) - { - uint8_t slopeDirection = tileElement->AsPath()->GetSlopeDirection(); - slopeDirection = direction_reverse(slopeDirection); - if (slopeDirection == _footpathConstructDirection) - { - z += PATH_HEIGHT_STEP; - } - } - - // Find a connected edge - int32_t edge = direction_reverse(_footpathConstructDirection); - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) - { - edge = (edge + 1) & 3; - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) - { - edge = (edge + 2) & 3; - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) - { - edge = (edge - 1) & 3; - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) - { - edge = direction_reverse(edge); - } - } - } - } - - gFootpathConstructFromPosition.z = tileElement->GetBaseZ(); - auto action = FootpathRemoveAction(gFootpathConstructFromPosition); - GameActions::Execute(&action); - - // Move selection - edge = direction_reverse(edge); - gFootpathConstructFromPosition.x -= CoordsDirectionDelta[edge].x; - gFootpathConstructFromPosition.y -= CoordsDirectionDelta[edge].y; - gFootpathConstructFromPosition.z = z; - _footpathConstructDirection = edge; - _footpathConstructValidDirections = INVALID_DIRECTION; -} - -/** - * - * rct2: 0x006A7873 - */ -static TileElement* FootpathGetTileElementToRemove() -{ - TileElement* tileElement; - int32_t z, zLow; - - if (!map_is_location_valid(gFootpathConstructFromPosition)) - { - return nullptr; - } - - z = std::min(255 * COORDS_Z_STEP, gFootpathConstructFromPosition.z); - zLow = z - PATH_HEIGHT_STEP; - - tileElement = map_get_first_element_at(gFootpathConstructFromPosition); - do - { - if (tileElement == nullptr) - break; - if (tileElement->GetType() == TileElementType::Path) - { - if (tileElement->GetBaseZ() == z) - { - if (tileElement->AsPath()->IsSloped()) - { - if (direction_reverse(tileElement->AsPath()->GetSlopeDirection()) != _footpathConstructDirection) - { - continue; - } - } - - return tileElement; - } - if (tileElement->GetBaseZ() == zLow) - { - if (!tileElement->AsPath()->IsSloped()) - { - if ((tileElement->AsPath()->GetSlopeDirection()) == _footpathConstructDirection) - { - continue; - } - } - - return tileElement; - } - } - } while (!(tileElement++)->IsLastForTile()); - - return nullptr; -} - -/** - * - * rct2: 0x006A7863 - */ -static void WindowFootpathRemove() -{ - TileElement* tileElement; - - _window_footpath_cost = MONEY32_UNDEFINED; - footpath_provisional_update(); - - tileElement = FootpathGetTileElementToRemove(); - if (tileElement != nullptr) - { - FootpathRemoveTileElement(tileElement); - } - - WindowFootpathSetEnabledAndPressedWidgets(); -} - -/** - * - * rct2: 0x006A855C - */ -static void WindowFootpathSetEnabledAndPressedWidgets() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr) - { - return; - } - - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) - { - map_invalidate_map_selection_tiles(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; - - int32_t direction = _footpathConstructDirection; - gMapSelectionTiles.clear(); - gMapSelectionTiles.push_back({ gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, - gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); - map_invalidate_map_selection_tiles(); - } - - uint64_t pressedWidgets = w->pressed_widgets - & ~((1LL << WIDX_DIRECTION_NW) | (1LL << WIDX_DIRECTION_NE) | (1LL << WIDX_DIRECTION_SW) | (1LL << WIDX_DIRECTION_SE) - | (1LL << WIDX_SLOPEDOWN) | (1LL << WIDX_LEVEL) | (1LL << WIDX_SLOPEUP)); - uint64_t disabledWidgets = 0; - int32_t currentRotation = get_current_rotation(); - if (_footpathConstructionMode >= PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) - { - // Set pressed directional widget - int32_t direction = (_footpathConstructDirection + currentRotation) & 3; - pressedWidgets |= (1LL << (WIDX_DIRECTION_NW + direction)); - - // Set pressed slope widget - int32_t slope = gFootpathConstructSlope; - if (slope == TILE_ELEMENT_SLOPE_SE_SIDE_UP) - { - pressedWidgets |= (1ULL << WIDX_SLOPEDOWN); - } - else if (slope == TILE_ELEMENT_SLOPE_FLAT) - { - pressedWidgets |= (1ULL << WIDX_LEVEL); - } - else - { - pressedWidgets |= (1ULL << WIDX_SLOPEUP); - } - - // Enable / disable directional widgets - direction = _footpathConstructValidDirections; - if (direction != INVALID_DIRECTION) - { - disabledWidgets |= (1ULL << WIDX_DIRECTION_NW) | (1ULL << WIDX_DIRECTION_NE) | (1ULL << WIDX_DIRECTION_SW) - | (1ULL << WIDX_DIRECTION_SE); - - direction = (direction + currentRotation) & 3; - disabledWidgets &= ~(1 << (WIDX_DIRECTION_NW + direction)); - } - } - else - { - // Disable all bridge mode widgets - disabledWidgets |= (1ULL << WIDX_DIRECTION_GROUP) | (1ULL << WIDX_DIRECTION_NW) | (1ULL << WIDX_DIRECTION_NE) - | (1ULL << WIDX_DIRECTION_SW) | (1ULL << WIDX_DIRECTION_SE) | (1ULL << WIDX_SLOPE_GROUP) | (1ULL << WIDX_SLOPEDOWN) - | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPEUP) | (1ULL << WIDX_CONSTRUCT) | (1ULL << WIDX_REMOVE); - } - - w->pressed_widgets = pressedWidgets; - w->disabled_widgets = disabledWidgets; - w->Invalidate(); -} - -/** - * - * rct2: 0x006A7B20 - */ -static void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope) -{ - auto direction = _footpathConstructDirection; - footpathLoc.x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x; - footpathLoc.y = gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y; - footpathLoc.z = gFootpathConstructFromPosition.z; - if (type != nullptr) - { - *type = gFootpathSelection.GetSelectedSurface(); - } - *slope = TILE_ELEMENT_SLOPE_FLAT; - if (gFootpathConstructSlope != 0) - { - *slope = _footpathConstructDirection | TILE_ELEMENT_SLOPE_S_CORNER_UP; - if (gFootpathConstructSlope != 2) - { - footpathLoc.z -= PATH_HEIGHT_STEP; - *slope ^= TILE_ELEMENT_SLOPE_E_CORNER_UP; - } - } -} - -static PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type) -{ - PathConstructFlags pathConstructFlags = 0; - if (gFootpathSelection.IsQueueSelected) - pathConstructFlags |= PathConstructFlag::IsQueue; - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) - { - pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; - type = gFootpathSelection.LegacyPath; - } - return pathConstructFlags; -} - -void window_footpath_keyboard_shortcut_turn_left() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_DIRECTION_NW) || WidgetIsDisabled(*w, WIDX_DIRECTION_NE) - || WidgetIsDisabled(*w, WIDX_DIRECTION_SW) || WidgetIsDisabled(*w, WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) - { - return; - } - int32_t currentRotation = get_current_rotation(); - int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? 1 : -1); - WindowFootpathMousedownDirection(turnedRotation); -} - -void window_footpath_keyboard_shortcut_turn_right() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_DIRECTION_NW) || WidgetIsDisabled(*w, WIDX_DIRECTION_NE) - || WidgetIsDisabled(*w, WIDX_DIRECTION_SW) || WidgetIsDisabled(*w, WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) - { - return; - } - int32_t currentRotation = get_current_rotation(); - int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? -1 : 1); - WindowFootpathMousedownDirection(turnedRotation); -} - -void window_footpath_keyboard_shortcut_slope_down() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_SLOPEDOWN) || WidgetIsDisabled(*w, WIDX_LEVEL) - || WidgetIsDisabled(*w, WIDX_SLOPEUP) || w->widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) - { - return; - } - - switch (gFootpathConstructSlope) - { - case 0: - window_event_mouse_down_call(w, WIDX_SLOPEDOWN); - break; - case 2: - window_event_mouse_down_call(w, WIDX_LEVEL); - break; - default: - case 6: - return; - } -} - -void window_footpath_keyboard_shortcut_slope_up() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_SLOPEDOWN) || WidgetIsDisabled(*w, WIDX_LEVEL) - || WidgetIsDisabled(*w, WIDX_SLOPEUP) || w->widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) - { - return; - } - - switch (gFootpathConstructSlope) - { - case 6: - window_event_mouse_down_call(w, WIDX_LEVEL); - break; - case 0: - window_event_mouse_down_call(w, WIDX_SLOPEUP); - break; - default: - case 2: - return; - } -} - -void window_footpath_keyboard_shortcut_demolish_current() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_REMOVE) || w->widgets[WIDX_REMOVE].type == WindowWidgetType::Empty - || (!gCheatsBuildInPauseMode && game_is_paused())) - { - return; - } - - WindowFootpathRemove(); -} - -void window_footpath_keyboard_shortcut_build_current() -{ - rct_window* w = window_find_by_class(WindowClass::Footpath); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_CONSTRUCT) || w->widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) - { - return; - } - - window_event_mouse_up_call(w, WIDX_CONSTRUCT); + return WindowFocusOrCreate(WindowClass::Footpath, WW_WINDOW, WH_WINDOW, 0); } void WindowFootpathResetSelectedPath() { gFootpathSelection = {}; } + +void window_footpath_keyboard_shortcut_turn_left() +{ + rct_window* w = window_find_by_class(WindowClass::Footpath); + if (w != nullptr) + { + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutTurnLeft(); + } + } +} + +void window_footpath_keyboard_shortcut_turn_right() +{ + rct_window* w = window_find_by_class(WindowClass::Footpath); + if (w != nullptr) + { + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutTurnRight(); + } + } +} + +void window_footpath_keyboard_shortcut_slope_down() +{ + rct_window* w = window_find_by_class(WindowClass::Footpath); + if (w != nullptr) + { + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutShortcutSlopeDown(); + } + } +} + +void window_footpath_keyboard_shortcut_slope_up() +{ + rct_window* w = window_find_by_class(WindowClass::Footpath); + if (w != nullptr) + { + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutSlopeUp(); + } + } +} + +void window_footpath_keyboard_shortcut_demolish_current() +{ + rct_window* w = window_find_by_class(WindowClass::Footpath); + if (w != nullptr) + { + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutDemolishCurrent(); + } + } +} + +void window_footpath_keyboard_shortcut_build_current() +{ + rct_window* w = window_find_by_class(WindowClass::Footpath); + if (w != nullptr) + { + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutBuildCurrent(); + } + } +} diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 0b41712fd2..2e1f9ec5b3 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -57,7 +57,7 @@ static rct_widget window_game_bottom_toolbar_widgets[] = MakeWidget({ 2, 21}, {138, 11}, WindowWidgetType::FlatBtn, WindowColour::Primary , 0xFFFFFFFF, STR_PARK_RATING_TIP ), // Park rating window MakeWidget({142, 0}, {356, 34}, WindowWidgetType::ImgBtn, WindowColour::Tertiary ), // Middle outset panel - MakeWidget({144, 2}, {352, 30}, WindowWidgetType::Placeholder, WindowColour::Tertiary ), // Middle inset panel + MakeWidget({144, 2}, {352, 30}, WindowWidgetType::FlatBtn, WindowColour::Tertiary ), // Middle inset panel MakeWidget({147, 5}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary, 0xFFFFFFFF, STR_SHOW_SUBJECT_TIP ), // Associated news item window MakeWidget({469, 5}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary, SPR_LOCATE, STR_LOCATE_SUBJECT_TIP ), // Scroll to news item target @@ -107,11 +107,11 @@ static void WindowGameBottomToolbarInvalidateDirtyWidgets(rct_window* w); */ rct_window* WindowGameBottomToolbarOpen() { - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); // Figure out how much line height we have to work with. - uint32_t line_height = font_get_line_height(FontSpriteBase::MEDIUM); + uint32_t line_height = font_get_line_height(FontStyle::Medium); uint32_t toolbar_height = line_height * 2 + 12; rct_window* window = WindowCreate( @@ -142,18 +142,18 @@ static void WindowGameBottomToolbarMouseup(rct_window* w, WidgetIndex widgetInde case WIDX_LEFT_OUTSET: case WIDX_MONEY: if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) - context_open_window(WindowClass::Finances); + ContextOpenWindow(WindowClass::Finances); break; case WIDX_GUESTS: - context_open_window_view(WV_PARK_GUESTS); + ContextOpenWindowView(WV_PARK_GUESTS); break; case WIDX_PARK_RATING: - context_open_window_view(WV_PARK_RATING); + ContextOpenWindowView(WV_PARK_RATING); break; case WIDX_MIDDLE_INSET: if (News::IsQueueEmpty()) { - context_open_window(WindowClass::RecentNews); + ContextOpenWindow(WindowClass::RecentNews); } else { @@ -183,7 +183,7 @@ static void WindowGameBottomToolbarMouseup(rct_window* w, WidgetIndex widgetInde break; case WIDX_RIGHT_OUTSET: case WIDX_DATE: - context_open_window(WindowClass::RecentNews); + ContextOpenWindow(WindowClass::RecentNews); break; } } @@ -220,11 +220,11 @@ static OpenRCT2String WindowGameBottomToolbarTooltip(rct_window* w, const Widget static void WindowGameBottomToolbarInvalidate(rct_window* w) { // Figure out how much line height we have to work with. - uint32_t line_height = font_get_line_height(FontSpriteBase::MEDIUM); + uint32_t line_height = font_get_line_height(FontStyle::Medium); // Reset dimensions as appropriate -- in case we're switching languages. w->height = line_height * 2 + 12; - w->windowPos.y = context_get_height() - w->height; + w->windowPos.y = ContextGetHeight() - w->height; // Change height of widgets in accordance with line height. w->widgets[WIDX_LEFT_OUTSET].bottom = w->widgets[WIDX_MIDDLE_OUTSET].bottom = w->widgets[WIDX_RIGHT_OUTSET].bottom @@ -255,7 +255,7 @@ static void WindowGameBottomToolbarInvalidate(rct_window* w) w->widgets[WIDX_DATE].bottom = line_height + 1; // Anchor the middle and right panel to the right - int32_t x = context_get_width(); + int32_t x = ContextGetWidth(); w->width = x; x--; window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right = x; @@ -291,7 +291,7 @@ static void WindowGameBottomToolbarInvalidate(rct_window* w) else { window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::ImgBtn; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::Placeholder; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::FlatBtn; window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::Empty; window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].colour = 0; @@ -302,30 +302,30 @@ static void WindowGameBottomToolbarInvalidate(rct_window* w) { News::Item* newsItem = News::GetItem(0); window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::ImgBtn; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::Placeholder; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::FlatBtn; window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::FlatBtn; window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::FlatBtn; window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].colour = 2; window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].colour = 2; - w->disabled_widgets &= ~(1ULL << WIDX_NEWS_SUBJECT); - w->disabled_widgets &= ~(1ULL << WIDX_NEWS_LOCATE); + w->disabled_widgets &= ~(1uLL << WIDX_NEWS_SUBJECT); + w->disabled_widgets &= ~(1uLL << WIDX_NEWS_LOCATE); // Find out if the news item is no longer valid auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); if (!subjectLoc.has_value()) - w->disabled_widgets |= (1ULL << WIDX_NEWS_LOCATE); + w->disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); if (!(newsItem->TypeHasSubject())) { - w->disabled_widgets |= (1ULL << WIDX_NEWS_SUBJECT); + w->disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; } if (newsItem->HasButton()) { - w->disabled_widgets |= (1ULL << WIDX_NEWS_SUBJECT); - w->disabled_widgets |= (1ULL << WIDX_NEWS_LOCATE); + w->disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); + w->disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); } } } @@ -396,7 +396,7 @@ static void WindowGameBottomToolbarDrawLeftPanel(rct_drawpixelinfo* dpi, rct_win gfx_fill_rect_inset(dpi, { topLeft, bottomRight }, w->colours[1], INSET_RECT_F_30); // Figure out how much line height we have to work with. - uint32_t line_height = font_get_line_height(FontSpriteBase::MEDIUM); + uint32_t line_height = font_get_line_height(FontStyle::Medium); // Draw money if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) @@ -465,12 +465,12 @@ static void WindowGameBottomToolbarDrawParkRating( bar_width = (factor * 114) / 255; gfx_fill_rect_inset( dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, w->colours[1], INSET_RECT_F_30); - if (!(colour & IMAGE_TYPE_REMAP_2_PLUS) || game_is_paused() || (gCurrentRealTimeTicks & 8)) + if (!(colour & BAR_BLINK) || game_is_paused() || (gCurrentRealTimeTicks & 8)) { if (bar_width > 2) { gfx_fill_rect_inset( - dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour & 0x7FFFFFFF, 0); + dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0); } } @@ -505,7 +505,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi = (gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == WIDX_DATE ? COLOUR_WHITE : NOT_TRANSLUCENT(w->colours[0])); - StringId stringId = DateFormatStringFormatIds[gConfigGeneral.date_format]; + StringId stringId = DateFormatStringFormatIds[gConfigGeneral.DateFormat]; auto ft = Formatter(); ft.Add(DateDayNames[day]); ft.Add(month); @@ -513,7 +513,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); // Figure out how much line height we have to work with. - uint32_t line_height = font_get_line_height(FontSpriteBase::MEDIUM); + uint32_t line_height = font_get_line_height(FontStyle::Medium); // Temperature screenCoords = { w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 15, @@ -521,7 +521,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi int32_t temperature = gClimateCurrent.Temperature; StringId format = STR_CELSIUS_VALUE; - if (gConfigGeneral.temperature_format == TemperatureUnit::Fahrenheit) + if (gConfigGeneral.TemperatureFormat == TemperatureUnit::Fahrenheit) { temperature = ClimateCelsiusToFahrenheit(temperature); format = STR_FAHRENHEIT_VALUE; @@ -630,6 +630,7 @@ static void WindowGameBottomToolbarDrawNewsItem(rct_drawpixelinfo* dpi, rct_wind break; } case News::ItemType::Money: + case News::ItemType::Campaign: gfx_draw_sprite(dpi, ImageId(SPR_FINANCE), screenCoords); break; case News::ItemType::Research: @@ -662,7 +663,7 @@ static void WindowGameBottomToolbarDrawMiddlePanel(rct_drawpixelinfo* dpi, rct_w w->colours[1], INSET_RECT_F_30); // Figure out how much line height we have to work with. - uint32_t line_height = font_get_line_height(FontSpriteBase::MEDIUM); + uint32_t line_height = font_get_line_height(FontStyle::Medium); ScreenCoordsXY middleWidgetCoords( w->windowPos.x + middleOutsetWidget->midX(), w->windowPos.y + middleOutsetWidget->top + line_height + 1); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 222a3a8713..3f3dc37938 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -430,7 +430,7 @@ private: InitScrollWidgets(); } - pressed_widgets |= 1ULL << (page + WIDX_TAB_1); + pressed_widgets |= 1uLL << (page + WIDX_TAB_1); const auto peep = GetGuest(); if (peep == nullptr) @@ -440,13 +440,7 @@ private: auto ft = Formatter::Common(); peep->FormatNameTo(ft); - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); window_align_tabs(this, WIDX_TAB_1, WIDX_TAB_7); } @@ -467,17 +461,17 @@ private: } else { - newDisabledWidgets = (1ULL << WIDX_PICKUP); + newDisabledWidgets = (1uLL << WIDX_PICKUP); if (!WidgetIsDisabled(*this, WIDX_PICKUP)) Invalidate(); } if (gParkFlags & PARK_FLAGS_NO_MONEY) { - newDisabledWidgets |= (1ULL << WIDX_TAB_4); // Disable finance tab if no money + newDisabledWidgets |= (1uLL << WIDX_TAB_4); // Disable finance tab if no money } - if (!gConfigGeneral.debugging_tools) + if (!gConfigGeneral.DebuggingTools) { - newDisabledWidgets |= (1ULL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on + newDisabledWidgets |= (1uLL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on } disabled_widgets = newDisabledWidgets; } @@ -816,7 +810,7 @@ private: { auto ft = Formatter(); peep_thought_set_format_args(&peep->Thoughts[i], ft); - DrawTextBasic(&dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontSpriteBase::SMALL }); + DrawTextBasic(&dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small }); } } @@ -827,10 +821,10 @@ private: { return; } - pressed_widgets &= ~(1ULL << WIDX_TRACK); + pressed_widgets &= ~(1uLL << WIDX_TRACK); if (peep->PeepFlags & PEEP_FLAGS_TRACKING) { - pressed_widgets |= (1ULL << WIDX_TRACK); + pressed_widgets |= (1uLL << WIDX_TRACK); } widgets[WIDX_VIEWPORT].right = width - 26; @@ -913,18 +907,18 @@ private: if (widgetIndex != WIDX_PICKUP) return; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - auto mapCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); + auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); if (!mapCoords.IsNull()) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } gPickupPeepImage = ImageId(); @@ -958,7 +952,7 @@ private: return; TileElement* tileElement; - auto destCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); + auto destCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); if (destCoords.IsNull()) return; @@ -1040,7 +1034,7 @@ private: void StatsBarsDraw(int32_t value, const ScreenCoordsXY& origCoords, rct_drawpixelinfo& dpi, int32_t colour, bool blinkFlag) { auto coords = origCoords; - if (font_get_line_height(FontSpriteBase::MEDIUM) > 10) + if (font_get_line_height(FontStyle::Medium) > 10) { coords.y += 1; } @@ -1295,7 +1289,7 @@ private: auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, list_item_positions[index]); - context_open_intent(&intent); + ContextOpenIntent(&intent); } void OnScrollMouseOverRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) @@ -1594,7 +1588,7 @@ private: auto ft = Formatter(); peep_thought_set_format_args(&thought, ft); - screenCoords.y += DrawTextWrapped(&dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontSpriteBase::SMALL }); + screenCoords.y += DrawTextWrapped(&dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small }); // If this is the last visible line end drawing. if (screenCoords.y > windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 32) @@ -1652,7 +1646,7 @@ private: { case ShopItem::Balloon: ft.Rewind(); - ft.Add(SPRITE_ID_PALETTE_COLOUR_1(guest.BalloonColour) | GetShopItemDescriptor(item).Image); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.BalloonColour)).ToUInt32()); break; case ShopItem::Photo: invRide = get_ride(guest.Photo1RideRef); @@ -1666,7 +1660,7 @@ private: break; case ShopItem::Umbrella: ft.Rewind(); - ft.Add(SPRITE_ID_PALETTE_COLOUR_1(guest.UmbrellaColour) | GetShopItemDescriptor(item).Image); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.UmbrellaColour)).ToUInt32()); break; case ShopItem::Voucher: switch (guest.VoucherType) @@ -1705,11 +1699,11 @@ private: break; case ShopItem::Hat: ft.Rewind(); - ft.Add(SPRITE_ID_PALETTE_COLOUR_1(guest.HatColour) | GetShopItemDescriptor(item).Image); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.HatColour)).ToUInt32()); break; case ShopItem::TShirt: ft.Rewind(); - ft.Add(SPRITE_ID_PALETTE_COLOUR_1(guest.TshirtColour) | GetShopItemDescriptor(item).Image); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.TshirtColour)).ToUInt32()); break; case ShopItem::Photo2: invRide = get_ride(guest.Photo2RideRef); @@ -1929,7 +1923,7 @@ rct_window* WindowGuestOpen(Peep* peep) if (window == nullptr) { int32_t windowWidth = 192; - if (gConfigGeneral.debugging_tools) + if (gConfigGeneral.DebuggingTools) windowWidth += TabWidth; window = WindowCreate(WindowClass::Peep, windowWidth, 157, WF_RESIZABLE); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index ab1c632682..5634d7cdb0 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -267,7 +267,7 @@ public: // Current tab image animation _tabAnimationIndex++; - if (_tabAnimationIndex >= (_selectedTab == TabId::Individual ? 24UL : 32UL)) + if (_tabAnimationIndex >= (_selectedTab == TabId::Individual ? 24uL : 32uL)) _tabAnimationIndex = 0; InvalidateWidget(WIDX_TAB_1 + static_cast(_selectedTab)); @@ -282,7 +282,7 @@ public: Close(); break; case WIDX_MAP: - context_open_window(WindowClass::Map); + ContextOpenWindow(WindowClass::Map); break; case WIDX_TRACKING: _trackingOnly = !_trackingOnly; @@ -414,13 +414,7 @@ public: if (_selectedTab == TabId::Individual && _selectedFilter) widgets[WIDX_MAP].type = WindowWidgetType::FlatBtn; - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TAB_CONTENT_PANEL].right = width - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); widgets[WIDX_GUEST_LIST].right = width - 4; widgets[WIDX_GUEST_LIST].bottom = height - 15; widgets[WIDX_MAP].left = 273 - 350 + width; @@ -649,9 +643,8 @@ private: // Tab 1 image auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0); i += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1; - i |= 0xA1600000; gfx_draw_sprite( - &dpi, ImageId::FromUInt32(i), + &dpi, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].midX(), widgets[WIDX_TAB_1].bottom - 6 }); // Tab 2 image @@ -717,7 +710,7 @@ private: ft = Formatter(); peep_thought_set_format_args(&thought, ft); - DrawTextEllipsised(&dpi, { 118, y }, 329, format, ft, { FontSpriteBase::SMALL }); + DrawTextEllipsised(&dpi, { 118, y }, 329, format, ft, { FontStyle::Small }); break; } break; @@ -762,7 +755,7 @@ private: // Draw small font if displaying guests if (_selectedView == GuestViewType::Thoughts) { - DrawTextEllipsised(&dpi, { 0, y }, 414, format, ft, { FontSpriteBase::SMALL }); + DrawTextEllipsised(&dpi, { 0, y }, 414, format, ft, { FontStyle::Small }); } else { diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 26f3778654..397a50d103 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -57,50 +57,365 @@ static rct_widget window_install_track_widgets[] = { WIDGETS_END, }; -static void WindowInstallTrackClose(rct_window *w); -static void WindowInstallTrackMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowInstallTrackInvalidate(rct_window *w); -static void WindowInstallTrackPaint(rct_window *w, rct_drawpixelinfo *dpi); -static void WindowInstallTrackTextInput(rct_window *w, WidgetIndex widgetIndex, char *text); - -static WindowEventList window_install_track_events([](auto& events) -{ - events.close = &WindowInstallTrackClose; - events.mouse_up = &WindowInstallTrackMouseup; - events.text_input = &WindowInstallTrackTextInput; - events.invalidate = &WindowInstallTrackInvalidate; - events.paint = &WindowInstallTrackPaint; -}); // clang-format on -static std::unique_ptr _trackDesign; -static std::string _trackPath; -static std::string _trackName; -static std::vector _trackDesignPreviewPixels; +class InstallTrackWindow final : public Window +{ +private: + std::unique_ptr _trackDesign; + std::string _trackPath; + std::string _trackName; + std::vector _trackDesignPreviewPixels; -static void WindowInstallTrackUpdatePreview(); -static void WindowInstallTrackDesign(rct_window* w); +public: + void SetupTrack(const utf8* path, std::unique_ptr trackDesign) + { + _trackDesign = std::move(trackDesign); + _trackPath = path; + _trackName = GetNameFromTrackPath(path); + _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); + + UpdatePreview(); + Invalidate(); + } + + void OnOpen() override + { + widgets = window_install_track_widgets; + track_list.track_list_being_updated = false; + + WindowInitScrollWidgets(*this); + window_push_others_right(*this); + } + + void OnClose() override + { + _trackPath.clear(); + _trackName.clear(); + _trackDesignPreviewPixels.clear(); + _trackDesignPreviewPixels.shrink_to_fit(); + _trackDesign = nullptr; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + case WIDX_CANCEL: + Close(); + break; + case WIDX_ROTATE: + _currentTrackPieceDirection++; + _currentTrackPieceDirection %= 4; + Invalidate(); + break; + case WIDX_TOGGLE_SCENERY: + gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; + UpdatePreview(); + Invalidate(); + break; + case WIDX_INSTALL: + InstallTrackDesign(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_INSTALL || text.empty()) + { + return; + } + + _trackName = std::string(text); + + window_event_mouse_up_call(this, WIDX_INSTALL); + } + + void OnPrepareDraw() override + { + pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; + if (!gTrackDesignSceneryToggle) + { + pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); + } + else + { + pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + + // Track preview + rct_widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW]; + auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; + int32_t colour = ColourMapA[colours[0]].darkest; + gfx_fill_rect(&dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); + + rct_g1_element g1temp = {}; + g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); + g1temp.width = 370; + g1temp.height = 217; + g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; + gfx_set_g1_element(SPR_TEMP, &g1temp); + drawing_engine_invalidate_image(SPR_TEMP); + gfx_draw_sprite(&dpi, ImageId(SPR_TEMP), screenPos); + + screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 }; + + // Warnings + const TrackDesign* td6 = _trackDesign.get(); + if (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) + { + if (!gTrackDesignSceneryToggle) + { + // Scenery not available + DrawTextEllipsised( + &dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + screenPos.y -= LIST_ROW_HEIGHT; + } + } + + // Information + screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 4 }; + // 0x006D3CF1 -- 0x006d3d71 missing + + // Track design name & type + { + auto trackName = _trackName.c_str(); + auto ft = Formatter(); + ft.Add(trackName); + DrawTextBasic(&dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + // Friendly Track name + { + auto ft = Formatter(); + + const auto* objectEntry = object_manager_load_object(&td6->vehicle_object.Entry); + if (objectEntry != nullptr) + { + auto groupIndex = object_manager_get_loaded_object_entry_index(objectEntry); + auto rideName = get_ride_naming(td6->type, get_ride_entry(groupIndex)); + ft.Add(rideName.Name); + } + else + { + // Fall back on the technical track name if the vehicle object cannot be loaded + ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); + } + + DrawTextBasic(&dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); + screenPos.y += LIST_ROW_HEIGHT + 4; + } + + // Stats + { + fixed32_2dp rating = td6->excitement * 10; + auto ft = Formatter(); + ft.Add(rating); + DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + { + fixed32_2dp rating = td6->intensity * 10; + auto ft = Formatter(); + ft.Add(rating); + DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + { + fixed32_2dp rating = td6->nausea * 10; + auto ft = Formatter(); + ft.Add(rating); + DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT + 4; + } + + if (td6->type != RIDE_TYPE_MAZE) + { + if (td6->type == RIDE_TYPE_MINI_GOLF) + { + // Holes + uint16_t holes = td6->holes & 0x1F; + auto ft = Formatter(); + ft.Add(holes); + DrawTextBasic(&dpi, screenPos, STR_HOLES, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + else + { + // Maximum speed + { + uint16_t speed = ((td6->max_speed << 16) * 9) >> 18; + auto ft = Formatter(); + ft.Add(speed); + DrawTextBasic(&dpi, screenPos, STR_MAX_SPEED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + // Average speed + { + uint16_t speed = ((td6->average_speed << 16) * 9) >> 18; + auto ft = Formatter(); + ft.Add(speed); + DrawTextBasic(&dpi, screenPos, STR_AVERAGE_SPEED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + + // Ride length + auto ft = Formatter(); + ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(td6->ride_length); + DrawTextEllipsised(&dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) + { + // Maximum positive vertical Gs + { + int32_t gForces = td6->max_positive_vertical_g * 32; + auto ft = Formatter(); + ft.Add(gForces); + DrawTextBasic(&dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + // Maximum negative vertical Gs + { + int32_t gForces = td6->max_negative_vertical_g * 32; + auto ft = Formatter(); + ft.Add(gForces); + DrawTextBasic(&dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + // Maximum lateral Gs + { + int32_t gForces = td6->max_lateral_g * 32; + auto ft = Formatter(); + ft.Add(gForces); + DrawTextBasic(&dpi, screenPos, STR_MAX_LATERAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + if (td6->total_air_time != 0) + { + // Total air time + int32_t airTime = td6->total_air_time * 25; + auto ft = Formatter(); + ft.Add(airTime); + DrawTextBasic(&dpi, screenPos, STR_TOTAL_AIR_TIME, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + + if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) + { + // Drops + uint16_t drops = td6->drops & 0x3F; + auto ft = Formatter(); + ft.Add(drops); + DrawTextBasic(&dpi, screenPos, STR_DROPS, ft); + screenPos.y += LIST_ROW_HEIGHT; + + // Drop height is multiplied by 0.75 + DrawTextBasic(&dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (td6->type != RIDE_TYPE_MINI_GOLF) + { + uint16_t inversions = td6->inversions & 0x1F; + if (inversions != 0) + { + // Inversions + auto ft = Formatter(); + ft.Add(inversions); + DrawTextBasic(&dpi, screenPos, STR_INVERSIONS, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + screenPos.y += 4; + + if (td6->space_required_x != 0xFF) + { + // Space required + auto ft = Formatter(); + ft.Add(td6->space_required_x); + ft.Add(td6->space_required_y); + DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (td6->cost != 0) + { + auto ft = Formatter(); + ft.Add(td6->cost); + DrawTextBasic(&dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); + } + } + +private: + void UpdatePreview() + { + TrackDesignDrawPreview(_trackDesign.get(), _trackDesignPreviewPixels.data()); + } + + void InstallTrackDesign() + { + auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); + auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK); + if (!Platform::EnsureDirectoryExists(destPath.c_str())) + { + log_error("Unable to create directory '%s'", destPath.c_str()); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + return; + } + + destPath = Path::Combine(destPath, _trackName + u8".td6"); + + if (File::Exists(destPath)) + { + log_info("%s already exists, prompting user for a different track design name", destPath.c_str()); + ContextShowError(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE, {}); + WindowTextInputRawOpen( + this, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, + {}, _trackName.c_str(), 255); + } + else + { + if (track_repository_install(_trackPath.c_str(), _trackName.c_str())) + { + Close(); + } + else + { + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + } + } + } +}; -/** - * - * rct2: 0x006D386D - */ rct_window* WindowInstallTrackOpen(const utf8* path) { - _trackDesign = TrackDesignImport(path); - if (_trackDesign == nullptr) + auto trackDesign = TrackDesignImport(path); + if (trackDesign == nullptr) { - context_show_error(STR_UNABLE_TO_LOAD_FILE, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_LOAD_FILE, STR_NONE, {}); return nullptr; } object_manager_unload_all_objects(); - if (_trackDesign->type == RIDE_TYPE_NULL) + if (trackDesign->type == RIDE_TYPE_NULL) { log_error("Failed to load track (ride type null): %s", path); return nullptr; } - if (object_manager_load_object(&_trackDesign->vehicle_object.Entry) == nullptr) + if (object_manager_load_object(&trackDesign->vehicle_object.Entry) == nullptr) { log_error("Failed to load track (vehicle load fail): %s", path); return nullptr; @@ -112,353 +427,12 @@ rct_window* WindowInstallTrackOpen(const utf8* path) gTrackDesignSceneryToggle = false; _currentTrackPieceDirection = 2; - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); - int32_t x = screenWidth / 2 - 201; - int32_t y = std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; - rct_window* w = WindowCreate(ScreenCoordsXY(x, y), WW, WH, &window_install_track_events, WindowClass::InstallTrack, 0); - w->widgets = window_install_track_widgets; - WindowInitScrollWidgets(*w); - w->track_list.track_list_being_updated = false; - window_push_others_right(*w); + auto* window = WindowFocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); + window->SetupTrack(path, std::move(trackDesign)); - _trackPath = path; - _trackName = GetNameFromTrackPath(path); - _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); - - WindowInstallTrackUpdatePreview(); - w->Invalidate(); - - return w; -} - -/** - * - * rct2: 0x006D41DC - */ -static void WindowInstallTrackClose(rct_window* w) -{ - _trackPath.clear(); - _trackName.clear(); - _trackDesignPreviewPixels.clear(); - _trackDesignPreviewPixels.shrink_to_fit(); - _trackDesign = nullptr; -} - -/** - * - * rct2: 0x006D407A - */ -static void WindowInstallTrackMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - case WIDX_CANCEL: - window_close(*w); - break; - case WIDX_ROTATE: - _currentTrackPieceDirection++; - _currentTrackPieceDirection %= 4; - w->Invalidate(); - break; - case WIDX_TOGGLE_SCENERY: - gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; - WindowInstallTrackUpdatePreview(); - w->Invalidate(); - break; - case WIDX_INSTALL: - WindowInstallTrackDesign(w); - break; - } -} - -/** - * - * rct2: 0x006D3B06 - */ -static void WindowInstallTrackInvalidate(rct_window* w) -{ - w->pressed_widgets |= 1ULL << WIDX_TRACK_PREVIEW; - if (!gTrackDesignSceneryToggle) - { - w->pressed_widgets |= (1ULL << WIDX_TOGGLE_SCENERY); - } - else - { - w->pressed_widgets &= ~(1ULL << WIDX_TOGGLE_SCENERY); - } -} - -/** - * - * rct2: 0x006D3B1F - */ -static void WindowInstallTrackPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(*w, dpi); - - // Track preview - rct_widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW]; - auto screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - int32_t colour = ColourMapA[w->colours[0]].darkest; - gfx_fill_rect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); - - rct_g1_element g1temp = {}; - g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); - g1temp.width = 370; - g1temp.height = 217; - g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; - gfx_set_g1_element(SPR_TEMP, &g1temp); - drawing_engine_invalidate_image(SPR_TEMP); - gfx_draw_sprite(dpi, ImageId(SPR_TEMP), screenPos); - - screenPos = w->windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 }; - - // Warnings - const TrackDesign* td6 = _trackDesign.get(); - if (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) - { - if (!gTrackDesignSceneryToggle) - { - // Scenery not available - DrawTextEllipsised( - dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); - screenPos.y -= LIST_ROW_HEIGHT; - } - } - - // Information - screenPos = w->windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 4 }; - // 0x006D3CF1 -- 0x006d3d71 missing - - // Track design name & type - { - auto trackName = _trackName.c_str(); - auto ft = Formatter(); - ft.Add(trackName); - DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - // Friendly Track name - { - auto ft = Formatter(); - - const auto* objectEntry = object_manager_load_object(&td6->vehicle_object.Entry); - if (objectEntry != nullptr) - { - auto groupIndex = object_manager_get_loaded_object_entry_index(objectEntry); - auto rideName = get_ride_naming(td6->type, get_ride_entry(groupIndex)); - ft.Add(rideName.Name); - } - else - { - // Fall back on the technical track name if the vehicle object cannot be loaded - ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); - } - - DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; - } - - // Stats - { - fixed32_2dp rating = td6->excitement * 10; - auto ft = Formatter(); - ft.Add(rating); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - { - fixed32_2dp rating = td6->intensity * 10; - auto ft = Formatter(); - ft.Add(rating); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - { - fixed32_2dp rating = td6->nausea * 10; - auto ft = Formatter(); - ft.Add(rating); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; - } - - if (td6->type != RIDE_TYPE_MAZE) - { - if (td6->type == RIDE_TYPE_MINI_GOLF) - { - // Holes - uint16_t holes = td6->holes & 0x1F; - auto ft = Formatter(); - ft.Add(holes); - DrawTextBasic(dpi, screenPos, STR_HOLES, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - else - { - // Maximum speed - { - uint16_t speed = ((td6->max_speed << 16) * 9) >> 18; - auto ft = Formatter(); - ft.Add(speed); - DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - // Average speed - { - uint16_t speed = ((td6->average_speed << 16) * 9) >> 18; - auto ft = Formatter(); - ft.Add(speed); - DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - } - - // Ride length - auto ft = Formatter(); - ft.Add(STR_RIDE_LENGTH_ENTRY); - ft.Add(td6->ride_length); - DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) - { - // Maximum positive vertical Gs - { - int32_t gForces = td6->max_positive_vertical_g * 32; - auto ft = Formatter(); - ft.Add(gForces); - DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - // Maximum negative vertical Gs - { - int32_t gForces = td6->max_negative_vertical_g * 32; - auto ft = Formatter(); - ft.Add(gForces); - DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - // Maximum lateral Gs - { - int32_t gForces = td6->max_lateral_g * 32; - auto ft = Formatter(); - ft.Add(gForces); - DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - if (td6->total_air_time != 0) - { - // Total air time - int32_t airTime = td6->total_air_time * 25; - auto ft = Formatter(); - ft.Add(airTime); - DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - } - - if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) - { - // Drops - uint16_t drops = td6->drops & 0x3F; - auto ft = Formatter(); - ft.Add(drops); - DrawTextBasic(dpi, screenPos, STR_DROPS, ft); - screenPos.y += LIST_ROW_HEIGHT; - - // Drop height is multiplied by 0.75 - DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (td6->type != RIDE_TYPE_MINI_GOLF) - { - uint16_t inversions = td6->inversions & 0x1F; - if (inversions != 0) - { - // Inversions - auto ft = Formatter(); - ft.Add(inversions); - DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - } - screenPos.y += 4; - - if (td6->space_required_x != 0xFF) - { - // Space required - auto ft = Formatter(); - ft.Add(td6->space_required_x); - ft.Add(td6->space_required_y); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (td6->cost != 0) - { - auto ft = Formatter(); - ft.Add(td6->cost); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); - } -} - -/** - * - * rct2: 0x006D40A7 - */ -static void WindowInstallTrackTextInput(rct_window* w, WidgetIndex widgetIndex, char* text) -{ - if (widgetIndex != WIDX_INSTALL || str_is_null_or_empty(text)) - { - return; - } - - _trackName = text; - - window_event_mouse_up_call(w, WIDX_INSTALL); -} - -static void WindowInstallTrackUpdatePreview() -{ - TrackDesignDrawPreview(_trackDesign.get(), _trackDesignPreviewPixels.data()); -} - -static void WindowInstallTrackDesign(rct_window* w) -{ - auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK); - if (!Platform::EnsureDirectoryExists(destPath.c_str())) - { - log_error("Unable to create directory '%s'", destPath.c_str()); - context_show_error(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); - return; - } - - destPath = Path::Combine(destPath, _trackName + u8".td6"); - - if (File::Exists(destPath)) - { - log_info("%s already exists, prompting user for a different track design name", destPath.c_str()); - context_show_error(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE, {}); - WindowTextInputRawOpen( - w, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, {}, - _trackName.c_str(), 255); - } - else - { - if (track_repository_install(_trackPath.c_str(), _trackName.c_str())) - { - window_close(*w); - } - else - { - context_show_error(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); - } - } + return window; } diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 428c87199b..a6544b7dd5 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -70,7 +70,7 @@ public: void OnOpen() override { widgets = window_land_widgets; - hold_down_widgets = (1ULL << WIDX_DECREMENT) | (1ULL << WIDX_INCREMENT); + hold_down_widgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT); WindowInitScrollWidgets(*this); window_push_others_below(*this); @@ -340,5 +340,5 @@ private: rct_window* WindowLandOpen() { - return WindowFocusOrCreate(WindowClass::Land, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); + return WindowFocusOrCreate(WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index a81d500ffa..a0d4867918 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -58,11 +58,11 @@ public: void OnOpen() override { widgets = window_land_rights_widgets; - hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); window_push_others_below(*this); _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; - pressed_widgets = (1ULL << WIDX_BUY_LAND_RIGHTS); + pressed_widgets = (1uLL << WIDX_BUY_LAND_RIGHTS); gLandToolSize = 1; @@ -80,6 +80,7 @@ public: void OnClose() override { + hide_gridlines(); if (gLandRemainingConstructionSales == 0) { hide_construction_rights(); @@ -236,7 +237,7 @@ public: void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; auto mapTile = screen_get_map_xy(screenCoords, nullptr); @@ -303,7 +304,7 @@ public: state_changed++; } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (!state_changed) return; @@ -318,7 +319,6 @@ public: void OnToolAbort(WidgetIndex widgetIndex) override { - hide_gridlines(); if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) { hide_land_rights(); @@ -402,5 +402,5 @@ private: rct_window* WindowLandRightsOpen() { return WindowFocusOrCreate( - WindowClass::LandRights, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); + WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 94e85d3375..0692e23de2 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -153,16 +154,16 @@ static u8string GetLastDirectoryByType(int32_t type) switch (type & 0x0E) { case LOADSAVETYPE_GAME: - return gConfigGeneral.last_save_game_directory; + return gConfigGeneral.LastSaveGameDirectory; case LOADSAVETYPE_LANDSCAPE: - return gConfigGeneral.last_save_landscape_directory; + return gConfigGeneral.LastSaveLandscapeDirectory; case LOADSAVETYPE_SCENARIO: - return gConfigGeneral.last_save_scenario_directory; + return gConfigGeneral.LastSaveScenarioDirectory; case LOADSAVETYPE_TRACK: - return gConfigGeneral.last_save_track_directory; + return gConfigGeneral.LastSaveTrackDirectory; default: return u8string(); @@ -262,7 +263,7 @@ rct_window* WindowLoadsaveOpen( // Bypass the lot? auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); - if (gConfigGeneral.use_native_browse_dialog && hasFilePicker) + if (gConfigGeneral.UseNativeBrowseDialog && hasFilePicker) { const u8string path = Browse(isSave); if (!path.empty()) @@ -287,7 +288,7 @@ rct_window* WindowLoadsaveOpen( if (!hasFilePicker) { - w->disabled_widgets |= (1ULL << WIDX_BROWSE); + w->disabled_widgets |= (1uLL << WIDX_BROWSE); window_loadsave_widgets[WIDX_BROWSE].type = WindowWidgetType::Empty; } } @@ -479,29 +480,29 @@ static void WindowLoadsaveMouseup(rct_window* w, WidgetIndex widgetIndex) break; case WIDX_SORT_NAME: - if (gConfigGeneral.load_save_sort == Sort::NameAscending) + if (gConfigGeneral.LoadSaveSort == Sort::NameAscending) { - gConfigGeneral.load_save_sort = Sort::NameDescending; + gConfigGeneral.LoadSaveSort = Sort::NameDescending; } else { - gConfigGeneral.load_save_sort = Sort::NameAscending; + gConfigGeneral.LoadSaveSort = Sort::NameAscending; } - config_save_default(); + ConfigSaveDefault(); WindowLoadsaveSortList(); w->Invalidate(); break; case WIDX_SORT_DATE: - if (gConfigGeneral.load_save_sort == Sort::DateDescending) + if (gConfigGeneral.LoadSaveSort == Sort::DateDescending) { - gConfigGeneral.load_save_sort = Sort::DateAscending; + gConfigGeneral.LoadSaveSort = Sort::DateAscending; } else { - gConfigGeneral.load_save_sort = Sort::DateDescending; + gConfigGeneral.LoadSaveSort = Sort::DateDescending; } - config_save_default(); + ConfigSaveDefault(); WindowLoadsaveSortList(); w->Invalidate(); break; @@ -570,25 +571,23 @@ static void WindowLoadsaveScrollmouseover(rct_window* w, int32_t scrollIndex, co static void WindowLoadsaveTextinput(rct_window* w, WidgetIndex widgetIndex, char* text) { - bool overwrite; - if (text == nullptr || text[0] == 0) return; + if (!Platform::IsFilenameValid(text)) + { + ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + return; + } + switch (widgetIndex) { case WIDX_NEW_FOLDER: { - if (!Platform::IsFilenameValid(text)) - { - context_show_error(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); - return; - } - const u8string path = Path::Combine(_directory, text); if (!Platform::EnsureDirectoryExists(path)) { - context_show_error(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); return; } @@ -608,17 +607,7 @@ static void WindowLoadsaveTextinput(rct_window* w, WidgetIndex widgetIndex, char const u8string path = Path::WithExtension( Path::Combine(_directory, text), RemovePatternWildcard(_extensionPattern)); - overwrite = false; - for (auto& item : _listItems) - { - if (String::Equals(item.path, path)) - { - overwrite = true; - break; - } - } - - if (overwrite) + if (File::Exists(path)) WindowOverwritePromptOpen(text, path.c_str()); else WindowLoadsaveSelect(w, path.c_str()); @@ -647,7 +636,7 @@ static void WindowLoadsaveComputeMaxDateWidth() // Check how this date is represented (e.g. 2000-02-20, or 00/02/20) std::string date = Platform::FormatShortDate(long_time); - maxDateWidth = gfx_get_string_width(date.c_str(), FontSpriteBase::MEDIUM) + DATE_TIME_GAP; + maxDateWidth = gfx_get_string_width(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP; // Some locales do not use leading zeros for months and days, so let's try October, too. tm.tm_mon = 10; @@ -656,25 +645,16 @@ static void WindowLoadsaveComputeMaxDateWidth() // Again, check how this date is represented (e.g. 2000-10-20, or 00/10/20) date = Platform::FormatShortDate(long_time); - maxDateWidth = std::max(maxDateWidth, gfx_get_string_width(date.c_str(), FontSpriteBase::MEDIUM) + DATE_TIME_GAP); + maxDateWidth = std::max(maxDateWidth, gfx_get_string_width(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP); // Time appears to be universally represented with two digits for minutes, so 12:00 or 00:00 should be representable. std::string time = Platform::FormatTime(long_time); - maxTimeWidth = gfx_get_string_width(time.c_str(), FontSpriteBase::MEDIUM) + DATE_TIME_GAP; + maxTimeWidth = gfx_get_string_width(time.c_str(), FontStyle::Medium) + DATE_TIME_GAP; } static void WindowLoadsaveInvalidate(rct_window* w) { - window_loadsave_widgets[WIDX_TITLE].right = w->width - 2; - // close button has to move if it's on the right side - window_loadsave_widgets[WIDX_CLOSE].left = w->width - 13; - window_loadsave_widgets[WIDX_CLOSE].right = w->width - 3; - - window_loadsave_widgets[WIDX_BACKGROUND].right = w->width - 1; - window_loadsave_widgets[WIDX_BACKGROUND].bottom = w->height - 1; - window_loadsave_widgets[WIDX_RESIZE].top = w->height - 1; - window_loadsave_widgets[WIDX_RESIZE].right = w->width - 1; - window_loadsave_widgets[WIDX_RESIZE].bottom = w->height - 1; + w->ResizeFrameWithPage(); rct_widget* date_widget = &window_loadsave_widgets[WIDX_SORT_DATE]; date_widget->right = w->width - 5; @@ -696,7 +676,7 @@ static void WindowLoadsavePaint(rct_window* w, rct_drawpixelinfo* dpi) if (_shortenedDirectory[0] == '\0') { - shorten_path(_shortenedDirectory, sizeof(_shortenedDirectory), _directory, w->width - 8, FontSpriteBase::MEDIUM); + shorten_path(_shortenedDirectory, sizeof(_shortenedDirectory), _directory, w->width - 8, FontStyle::Medium); } // Format text @@ -713,9 +693,9 @@ static void WindowLoadsavePaint(rct_window* w, rct_drawpixelinfo* dpi) // Name button text StringId id = STR_NONE; - if (gConfigGeneral.load_save_sort == Sort::NameAscending) + if (gConfigGeneral.LoadSaveSort == Sort::NameAscending) id = STR_UP; - else if (gConfigGeneral.load_save_sort == Sort::NameDescending) + else if (gConfigGeneral.LoadSaveSort == Sort::NameDescending) id = STR_DOWN; // Draw name button indicator. @@ -727,9 +707,9 @@ static void WindowLoadsavePaint(rct_window* w, rct_drawpixelinfo* dpi) { COLOUR_GREY }); // Date button text - if (gConfigGeneral.load_save_sort == Sort::DateAscending) + if (gConfigGeneral.LoadSaveSort == Sort::DateAscending) id = STR_UP; - else if (gConfigGeneral.load_save_sort == Sort::DateDescending) + else if (gConfigGeneral.LoadSaveSort == Sort::DateDescending) id = STR_DOWN; else id = STR_NONE; @@ -803,7 +783,7 @@ static bool ListItemSort(LoadSaveListItem& a, LoadSaveListItem& b) if (a.type != b.type) return a.type - b.type < 0; - switch (gConfigGeneral.load_save_sort) + switch (gConfigGeneral.LoadSaveSort) { case Sort::NameAscending: return strlogicalcmp(a.name.c_str(), b.name.c_str()) < 0; @@ -841,8 +821,9 @@ static void WindowLoadsavePopulateList( if (directory.empty() && drives) { // List Windows drives - w->disabled_widgets |= (1ULL << WIDX_NEW_FILE) | (1ULL << WIDX_NEW_FOLDER) | (1ULL << WIDX_UP); - for (int32_t x = 0; x < 26; x++) + w->disabled_widgets |= (1uLL << WIDX_NEW_FILE) | (1uLL << WIDX_NEW_FOLDER) | (1uLL << WIDX_UP); + static constexpr auto NumDriveLetters = 26; + for (int32_t x = 0; x < NumDriveLetters; x++) { if (drives & (1 << x)) { @@ -885,13 +866,13 @@ static void WindowLoadsavePopulateList( // Disable the Up button if the current directory is the root directory if (str_is_null_or_empty(_parentDirectory) && !drives) - w->disabled_widgets |= (1ULL << WIDX_UP); + w->disabled_widgets |= (1uLL << WIDX_UP); else - w->disabled_widgets &= ~(1ULL << WIDX_UP); + w->disabled_widgets &= ~(1uLL << WIDX_UP); // Re-enable the "new" buttons if these were disabled - w->disabled_widgets &= ~(1ULL << WIDX_NEW_FILE); - w->disabled_widgets &= ~(1ULL << WIDX_NEW_FOLDER); + w->disabled_widgets &= ~(1uLL << WIDX_NEW_FILE); + w->disabled_widgets &= ~(1uLL << WIDX_NEW_FOLDER); // List all directories auto subDirectories = Path::GetDirectories(absoluteDirectory); @@ -961,7 +942,7 @@ static void WindowLoadsaveInvokeCallback(int32_t result, const utf8* path) static void SetAndSaveConfigPath(u8string& config_str, u8string_view path) { config_str = Path::GetDirectory(path); - config_save_default(); + ConfigSaveDefault(); } static bool IsValidPath(const char* path) @@ -978,7 +959,7 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) { if (!IsValidPath(path)) { - context_show_error(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); return; } @@ -988,15 +969,15 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) switch (_type & 0x0F) { case (LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME): - SetAndSaveConfigPath(gConfigGeneral.last_save_game_directory, pathBuffer); + SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer); WindowLoadsaveInvokeCallback(MODAL_RESULT_OK, pathBuffer); window_close_by_class(WindowClass::Loadsave); gfx_invalidate_screen(); break; case (LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME): - SetAndSaveConfigPath(gConfigGeneral.last_save_game_directory, pathBuffer); - if (scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 1 : 0)) + SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer); + if (scenario_save(pathBuffer, gConfigGeneral.SavePluginData ? 1 : 0)) { gScenarioSavePath = pathBuffer; gCurrentLoadedPath = pathBuffer; @@ -1010,13 +991,13 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) } else { - context_show_error(STR_SAVE_GAME, STR_GAME_SAVE_FAILED, {}); + ContextShowError(STR_SAVE_GAME, STR_GAME_SAVE_FAILED, {}); WindowLoadsaveInvokeCallback(MODAL_RESULT_FAIL, pathBuffer); } break; case (LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE): - SetAndSaveConfigPath(gConfigGeneral.last_save_landscape_directory, pathBuffer); + SetAndSaveConfigPath(gConfigGeneral.LastSaveLandscapeDirectory, pathBuffer); if (Editor::LoadLandscape(pathBuffer)) { gCurrentLoadedPath = pathBuffer; @@ -1026,15 +1007,15 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) else { // Not the best message... - context_show_error(STR_LOAD_LANDSCAPE, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {}); + ContextShowError(STR_LOAD_LANDSCAPE, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {}); WindowLoadsaveInvokeCallback(MODAL_RESULT_FAIL, pathBuffer); } break; case (LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE): - SetAndSaveConfigPath(gConfigGeneral.last_save_landscape_directory, pathBuffer); + SetAndSaveConfigPath(gConfigGeneral.LastSaveLandscapeDirectory, pathBuffer); gScenarioFileName = std::string(String::ToStringView(pathBuffer, std::size(pathBuffer))); - if (scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 3 : 2)) + if (scenario_save(pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2)) { gCurrentLoadedPath = pathBuffer; window_close_by_class(WindowClass::Loadsave); @@ -1043,19 +1024,19 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) } else { - context_show_error(STR_SAVE_LANDSCAPE, STR_LANDSCAPE_SAVE_FAILED, {}); + ContextShowError(STR_SAVE_LANDSCAPE, STR_LANDSCAPE_SAVE_FAILED, {}); WindowLoadsaveInvokeCallback(MODAL_RESULT_FAIL, pathBuffer); } break; case (LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO): { - SetAndSaveConfigPath(gConfigGeneral.last_save_scenario_directory, pathBuffer); + SetAndSaveConfigPath(gConfigGeneral.LastSaveScenarioDirectory, pathBuffer); int32_t parkFlagsBackup = gParkFlags; gParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED; gEditorStep = EditorStep::Invalid; gScenarioFileName = std::string(String::ToStringView(pathBuffer, std::size(pathBuffer))); - int32_t success = scenario_save(pathBuffer, gConfigGeneral.save_plugin_data ? 3 : 2); + int32_t success = scenario_save(pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2); gParkFlags = parkFlagsBackup; if (success) @@ -1066,7 +1047,7 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) } else { - context_show_error(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); + ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); gEditorStep = EditorStep::ObjectiveSelection; WindowLoadsaveInvokeCallback(MODAL_RESULT_FAIL, pathBuffer); } @@ -1075,10 +1056,10 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) case (LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK): { - SetAndSaveConfigPath(gConfigGeneral.last_save_track_directory, pathBuffer); + SetAndSaveConfigPath(gConfigGeneral.LastSaveTrackDirectory, pathBuffer); auto intent = Intent(WindowClass::InstallTrack); intent.putExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer }); - context_open_intent(&intent); + ContextOpenIntent(&intent); window_close_by_class(WindowClass::Loadsave); WindowLoadsaveInvokeCallback(MODAL_RESULT_OK, pathBuffer); break; @@ -1086,7 +1067,7 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) case (LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK): { - SetAndSaveConfigPath(gConfigGeneral.last_save_track_directory, pathBuffer); + SetAndSaveConfigPath(gConfigGeneral.LastSaveTrackDirectory, pathBuffer); const auto withExtension = Path::WithExtension(pathBuffer, "td6"); String::Set(pathBuffer, sizeof(pathBuffer), withExtension.c_str()); @@ -1103,7 +1084,7 @@ static void WindowLoadsaveSelect(rct_window* w, const char* path) } else { - context_show_error(STR_FILE_DIALOG_TITLE_SAVE_TRACK, STR_TRACK_SAVE_FAILED, {}); + ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_TRACK, STR_TRACK_SAVE_FAILED, {}); WindowLoadsaveInvokeCallback(MODAL_RESULT_FAIL, path); } break; diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 7af6e59c6b..7c7df24b62 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -39,7 +39,7 @@ public: gCurrentRotation = 0; gShowGridLinesRefCount = 0; gShowLandRightsRefCount = 0; - gShowConstuctionRightsRefCount = 0; + gShowConstructionRightsRefCount = 0; WindowFootpathResetSelectedPath(); } @@ -52,17 +52,17 @@ private: void SetViewportFlags() { viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - if (gConfigGeneral.invisible_rides) + if (gConfigGeneral.InvisibleRides) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES; - if (gConfigGeneral.invisible_vehicles) + if (gConfigGeneral.InvisibleVehicles) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEHICLES; - if (gConfigGeneral.invisible_trees) + if (gConfigGeneral.InvisibleTrees) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEGETATION; - if (gConfigGeneral.invisible_scenery) + if (gConfigGeneral.InvisibleScenery) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SCENERY; - if (gConfigGeneral.invisible_paths) + if (gConfigGeneral.InvisiblePaths) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_PATHS; - if (gConfigGeneral.invisible_supports) + if (gConfigGeneral.InvisibleSupports) viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SUPPORTS; } }; @@ -73,6 +73,5 @@ private: */ rct_window* WindowMainOpen() { - return WindowCreate( - WindowClass::MainWindow, { 0, 0 }, context_get_width(), context_get_height(), WF_STICK_TO_BACK); + return WindowCreate(WindowClass::MainWindow, { 0, 0 }, ContextGetWidth(), ContextGetHeight(), WF_STICK_TO_BACK); } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 35df97ec56..d6ca8e0a61 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -148,9 +148,9 @@ public: { widgets = window_map_widgets; - hold_down_widgets = (1ULL << WIDX_MAP_SIZE_SPINNER_Y_UP) | (1ULL << WIDX_MAP_SIZE_SPINNER_Y_DOWN) - | (1ULL << WIDX_MAP_SIZE_SPINNER_X_UP) | (1ULL << WIDX_MAP_SIZE_SPINNER_X_DOWN) | (1ULL << WIDX_LAND_TOOL_LARGER) - | (1ULL << WIDX_LAND_TOOL_SMALLER); + hold_down_widgets = (1uLL << WIDX_MAP_SIZE_SPINNER_Y_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_Y_DOWN) + | (1uLL << WIDX_MAP_SIZE_SPINNER_X_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_X_DOWN) | (1uLL << WIDX_LAND_TOOL_LARGER) + | (1uLL << WIDX_LAND_TOOL_SMALLER); InitScrollWidgets(); @@ -271,7 +271,7 @@ public: _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; break; case WIDX_MAP_GENERATOR: - context_open_window(WindowClass::Mapgen); + ContextOpenWindow(WindowClass::Mapgen); break; default: if (widgetIndex >= WIDX_PEOPLE_TAB && widgetIndex <= WIDX_RIDES_TAB) @@ -410,7 +410,7 @@ public: hide_construction_rights(); break; case WIDX_BUILD_PARK_ENTRANCE: - park_entrance_remove_ghost(); + ParkEntranceRemoveGhost(); Invalidate(); hide_gridlines(); hide_land_rights(); @@ -427,7 +427,7 @@ public: void SetLandRightsToolUpdate(const ScreenCoordsXY& screenCoords) { - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; auto mapCoords = screen_get_map_xy(screenCoords, nullptr); if (!mapCoords.has_value()) @@ -447,7 +447,7 @@ public: gMapSelectPositionA = *mapCoords; gMapSelectPositionB.x = mapCoords->x + size; gMapSelectPositionB.y = mapCoords->y + size; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } CoordsXYZD PlaceParkEntranceGetMapPosition(const ScreenCoordsXY& screenCoords) @@ -458,7 +458,7 @@ public: if (parkEntranceMapPosition.IsNull()) return parkEntranceMapPosition; - auto surfaceElement = map_get_surface_element_at(mapCoords); + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); if (surfaceElement == nullptr) { parkEntranceMapPosition.SetNull(); @@ -484,15 +484,15 @@ public: void PlaceParkEntranceToolUpdate(const ScreenCoordsXY& screenCoords) { - map_invalidate_selection_rect(); - map_invalidate_map_selection_tiles(); + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); if (parkEntrancePosition.IsNull()) { - park_entrance_remove_ghost(); + ParkEntranceRemoveGhost(); return; } @@ -508,13 +508,13 @@ public: gMapSelectArrowDirection = parkEntrancePosition.direction; gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT | MAP_SELECT_FLAG_ENABLE_ARROW; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); if (gParkEntranceGhostExists && parkEntrancePosition == gParkEntranceGhostPosition) { return; } - park_entrance_remove_ghost(); + ParkEntranceRemoveGhost(); auto gameAction = PlaceParkEntranceAction(parkEntrancePosition, gFootpathSelectedId); gameAction.SetFlags(GAME_COMMAND_FLAG_GHOST); @@ -529,7 +529,7 @@ public: void PlaceParkEntranceToolDown(const ScreenCoordsXY& screenCoords) { - park_entrance_remove_ghost(); + ParkEntranceRemoveGhost(); CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); if (!parkEntrancePosition.IsNull()) @@ -547,10 +547,10 @@ public: { int32_t direction; TileElement* tileElement; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - auto mapCoords = footpath_bridge_get_info_from_pos(screenCoords, &direction, &tileElement); + auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); if (mapCoords.IsNull()) return; @@ -569,8 +569,8 @@ public: gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords; gMapSelectArrowPosition = CoordsXYZ{ mapCoords, mapZ }; - gMapSelectArrowDirection = direction_reverse(direction); - map_invalidate_selection_rect(); + gMapSelectArrowDirection = DirectionReverse(direction); + MapInvalidateSelectionRect(); } void SetPeepSpawnToolDown(const ScreenCoordsXY& screenCoords) @@ -578,7 +578,7 @@ public: // Verify footpath exists at location, and retrieve coordinates TileElement* tileElement; int32_t direction; - auto mapCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement); + auto mapCoords = FootpathGetCoordinatesFromPos(screenCoords, &direction, &tileElement); if (mapCoords.IsNull()) return; @@ -648,7 +648,7 @@ public: { CoordsXY c = ScreenToMap(screenCoords); auto mapCoords = CoordsXY{ std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1), std::clamp(c.y, 0, MAXIMUM_MAP_SIZE_BIG - 1) }; - auto mapZ = tile_element_height(mapCoords); + auto mapZ = TileElementHeight(mapCoords); rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) @@ -664,12 +664,12 @@ public: int32_t radius = (landToolSize * 16) - 16; mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart(); - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords + CoordsXY{ size, size }; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); auto surfaceSetStyleAction = SurfaceSetStyleAction( { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, @@ -684,12 +684,12 @@ public: int32_t radius = (landRightsToolSize * 16) - 16; mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart(); - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords + CoordsXY{ size, size }; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); auto landSetRightsAction = LandSetRightsAction( { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, @@ -733,32 +733,26 @@ public: // Set the pressed widgets pressed_widgets = 0; SetWidgetPressed(WIDX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); - pressed_widgets |= (1ULL << (WIDX_PEOPLE_TAB + selected_tab)); - pressed_widgets |= (1ULL << WIDX_LAND_TOOL); + pressed_widgets |= (1uLL << (WIDX_PEOPLE_TAB + selected_tab)); + pressed_widgets |= (1uLL << WIDX_LAND_TOOL); if (_activeTool & (1 << 3)) - pressed_widgets |= (1ULL << WIDX_LAND_SALE_CHECKBOX); + pressed_widgets |= (1uLL << WIDX_LAND_SALE_CHECKBOX); if (_activeTool & (1 << 2)) - pressed_widgets |= (1ULL << WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX); + pressed_widgets |= (1uLL << WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX); if (_activeTool & (1 << 1)) - pressed_widgets |= (1ULL << WIDX_LAND_OWNED_CHECKBOX); + pressed_widgets |= (1uLL << WIDX_LAND_OWNED_CHECKBOX); if (_activeTool & (1 << 0)) - pressed_widgets |= (1ULL << WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX); + pressed_widgets |= (1uLL << WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX); // Set disabled widgets SetWidgetDisabled(WIDX_MAP_SIZE_LINK, gMapSize.x != gMapSize.y); // Resize widgets to window size - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_RESIZE].right = width - 1; - widgets[WIDX_RESIZE].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 2 - 11; - widgets[WIDX_CLOSE].right = width - 2 - 11 + 10; + ResizeFrameWithPage(); widgets[WIDX_MAP].right = width - 4; if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) @@ -804,11 +798,11 @@ public: // Land tool mode (4 checkboxes) int checkboxY = height - 55; - for (int32_t i = 0; i < 4; i++) + for (int32_t i = WIDX_LAND_OWNED_CHECKBOX; i <= WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX; i++) { - widgets[WIDX_LAND_OWNED_CHECKBOX + i].top = checkboxY; + widgets[i].top = checkboxY; checkboxY += 11; - widgets[WIDX_LAND_OWNED_CHECKBOX + i].bottom = checkboxY; + widgets[i].bottom = checkboxY; checkboxY += 2; } @@ -844,8 +838,8 @@ public: widgets[WIDX_LAND_TOOL_SMALLER].type = WindowWidgetType::TrnBtn; widgets[WIDX_LAND_TOOL_LARGER].type = WindowWidgetType::TrnBtn; - for (int32_t i = 0; i < 4; i++) - widgets[WIDX_LAND_OWNED_CHECKBOX + i].type = WindowWidgetType::Checkbox; + for (int32_t i = WIDX_LAND_OWNED_CHECKBOX; i <= WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX; i++) + widgets[i].type = WindowWidgetType::Checkbox; widgets[WIDX_LAND_TOOL].image = LandTool::SizeToSpriteIndex(_landRightsToolSize); } @@ -1037,7 +1031,7 @@ private: for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) { - if (!map_is_edge({ x, y })) + if (!MapIsEdge({ x, y })) { uint16_t colour = 0; switch (selected_tab) @@ -1066,7 +1060,7 @@ private: uint16_t GetPixelColourPeep(const CoordsXY& c) { - auto* surfaceElement = map_get_surface_element_at(c); + auto* surfaceElement = MapGetSurfaceElementAt(c); if (surfaceElement == nullptr) return 0; @@ -1109,7 +1103,7 @@ private: uint16_t colourB = MapColour(PALETTE_INDEX_13); // surface colour (dark grey) // as an improvement we could use first_element to show underground stuff? - TileElement* tileElement = reinterpret_cast(map_get_surface_element_at(c)); + TileElement* tileElement = reinterpret_cast(MapGetSurfaceElementAt(c)); do { if (tileElement == nullptr) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index ebff392e95..348a1ccd1e 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -284,65 +284,65 @@ static uint64_t PageDisabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { 0, - (1ULL << WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP) | - (1ULL << WIDX_HEIGHTMAP_STRENGTH) | - (1ULL << WIDX_HEIGHTMAP_STRENGTH_UP) | - (1ULL << WIDX_HEIGHTMAP_STRENGTH_DOWN) | - (1ULL << WIDX_HEIGHTMAP_NORMALIZE) | - (1ULL << WIDX_HEIGHTMAP_SMOOTH_TILES) | - (1ULL << WIDX_HEIGHTMAP_HIGH) | - (1ULL << WIDX_HEIGHTMAP_HIGH_UP) | - (1ULL << WIDX_HEIGHTMAP_HIGH_DOWN) | - (1ULL << WIDX_HEIGHTMAP_LOW) | - (1ULL << WIDX_HEIGHTMAP_LOW_UP) | - (1ULL << WIDX_HEIGHTMAP_LOW_DOWN) | - (1ULL << WIDX_HEIGHTMAP_WATER_LEVEL) | - (1ULL << WIDX_HEIGHTMAP_WATER_LEVEL_UP) | - (1ULL << WIDX_HEIGHTMAP_WATER_LEVEL_DOWN) + (1uLL << WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP) | + (1uLL << WIDX_HEIGHTMAP_STRENGTH) | + (1uLL << WIDX_HEIGHTMAP_STRENGTH_UP) | + (1uLL << WIDX_HEIGHTMAP_STRENGTH_DOWN) | + (1uLL << WIDX_HEIGHTMAP_NORMALIZE) | + (1uLL << WIDX_HEIGHTMAP_SMOOTH_TILES) | + (1uLL << WIDX_HEIGHTMAP_HIGH) | + (1uLL << WIDX_HEIGHTMAP_HIGH_UP) | + (1uLL << WIDX_HEIGHTMAP_HIGH_DOWN) | + (1uLL << WIDX_HEIGHTMAP_LOW) | + (1uLL << WIDX_HEIGHTMAP_LOW_UP) | + (1uLL << WIDX_HEIGHTMAP_LOW_DOWN) | + (1uLL << WIDX_HEIGHTMAP_WATER_LEVEL) | + (1uLL << WIDX_HEIGHTMAP_WATER_LEVEL_UP) | + (1uLL << WIDX_HEIGHTMAP_WATER_LEVEL_DOWN) }; static uint64_t HoldDownWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { - (1ULL << WIDX_MAP_SIZE_Y_UP) | - (1ULL << WIDX_MAP_SIZE_Y_DOWN) | - (1ULL << WIDX_MAP_SIZE_X_UP) | - (1ULL << WIDX_MAP_SIZE_X_DOWN) | - (1ULL << WIDX_BASE_HEIGHT_UP) | - (1ULL << WIDX_BASE_HEIGHT_DOWN) | - (1ULL << WIDX_WATER_LEVEL_UP) | - (1ULL << WIDX_WATER_LEVEL_DOWN), + (1uLL << WIDX_MAP_SIZE_Y_UP) | + (1uLL << WIDX_MAP_SIZE_Y_DOWN) | + (1uLL << WIDX_MAP_SIZE_X_UP) | + (1uLL << WIDX_MAP_SIZE_X_DOWN) | + (1uLL << WIDX_BASE_HEIGHT_UP) | + (1uLL << WIDX_BASE_HEIGHT_DOWN) | + (1uLL << WIDX_WATER_LEVEL_UP) | + (1uLL << WIDX_WATER_LEVEL_DOWN), 0, - (1ULL << WIDX_SIMPLEX_LOW_UP) | - (1ULL << WIDX_SIMPLEX_LOW_DOWN) | - (1ULL << WIDX_SIMPLEX_HIGH_UP) | - (1ULL << WIDX_SIMPLEX_HIGH_DOWN) | - (1ULL << WIDX_SIMPLEX_BASE_FREQ_UP) | - (1ULL << WIDX_SIMPLEX_BASE_FREQ_DOWN) | - (1ULL << WIDX_SIMPLEX_OCTAVES_UP) | - (1ULL << WIDX_SIMPLEX_OCTAVES_DOWN) | - (1ULL << WIDX_SIMPLEX_MAP_SIZE_Y_UP) | - (1ULL << WIDX_SIMPLEX_MAP_SIZE_Y_DOWN) | - (1ULL << WIDX_SIMPLEX_MAP_SIZE_X_UP) | - (1ULL << WIDX_SIMPLEX_MAP_SIZE_X_DOWN) | - (1ULL << WIDX_SIMPLEX_WATER_LEVEL_UP) | - (1ULL << WIDX_SIMPLEX_WATER_LEVEL_DOWN), + (1uLL << WIDX_SIMPLEX_LOW_UP) | + (1uLL << WIDX_SIMPLEX_LOW_DOWN) | + (1uLL << WIDX_SIMPLEX_HIGH_UP) | + (1uLL << WIDX_SIMPLEX_HIGH_DOWN) | + (1uLL << WIDX_SIMPLEX_BASE_FREQ_UP) | + (1uLL << WIDX_SIMPLEX_BASE_FREQ_DOWN) | + (1uLL << WIDX_SIMPLEX_OCTAVES_UP) | + (1uLL << WIDX_SIMPLEX_OCTAVES_DOWN) | + (1uLL << WIDX_SIMPLEX_MAP_SIZE_Y_UP) | + (1uLL << WIDX_SIMPLEX_MAP_SIZE_Y_DOWN) | + (1uLL << WIDX_SIMPLEX_MAP_SIZE_X_UP) | + (1uLL << WIDX_SIMPLEX_MAP_SIZE_X_DOWN) | + (1uLL << WIDX_SIMPLEX_WATER_LEVEL_UP) | + (1uLL << WIDX_SIMPLEX_WATER_LEVEL_DOWN), - (1ULL << WIDX_HEIGHTMAP_STRENGTH_UP) | - (1ULL << WIDX_HEIGHTMAP_STRENGTH_DOWN) | - (1ULL << WIDX_HEIGHTMAP_LOW_UP) | - (1ULL << WIDX_HEIGHTMAP_LOW_DOWN) | - (1ULL << WIDX_HEIGHTMAP_HIGH_UP) | - (1ULL << WIDX_HEIGHTMAP_HIGH_DOWN) | - (1ULL << WIDX_HEIGHTMAP_WATER_LEVEL_UP) | - (1ULL << WIDX_HEIGHTMAP_WATER_LEVEL_DOWN) + (1uLL << WIDX_HEIGHTMAP_STRENGTH_UP) | + (1uLL << WIDX_HEIGHTMAP_STRENGTH_DOWN) | + (1uLL << WIDX_HEIGHTMAP_LOW_UP) | + (1uLL << WIDX_HEIGHTMAP_LOW_DOWN) | + (1uLL << WIDX_HEIGHTMAP_HIGH_UP) | + (1uLL << WIDX_HEIGHTMAP_HIGH_DOWN) | + (1uLL << WIDX_HEIGHTMAP_WATER_LEVEL_UP) | + (1uLL << WIDX_HEIGHTMAP_WATER_LEVEL_DOWN) }; static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { 0, 0, 0, - (1ULL << WIDX_HEIGHTMAP_SMOOTH_TILES) + (1uLL << WIDX_HEIGHTMAP_SMOOTH_TILES) }; // clang-format on @@ -447,7 +447,7 @@ rct_window* WindowMapgenOpen() static void WindowMapgenSharedClose(rct_window* w) { - mapgen_unload_heightmap(); + MapGenUnloadHeightmap(); } static void WindowMapgenSharedMouseup(rct_window* w, WidgetIndex widgetIndex) @@ -494,7 +494,7 @@ static void WindowMapgenBaseMouseup(rct_window* w, WidgetIndex widgetIndex) mapgenSettings.floor = _floorTexture; mapgenSettings.wall = _wallTexture; - mapgen_generate_blank(&mapgenSettings); + MapGenGenerateBlank(&mapgenSettings); gfx_invalidate_screen(); break; case WIDX_MAP_SIZE_Y: @@ -788,7 +788,7 @@ static void WindowMapgenRandomMouseup(rct_window* w, WidgetIndex widgetIndex) mapgenSettings.simplex_base_freq = 1.75f; mapgenSettings.simplex_octaves = 6; - mapgen_generate(&mapgenSettings); + MapGenGenerate(&mapgenSettings); gfx_invalidate_screen(); break; case WIDX_RANDOM_TERRAIN: @@ -822,9 +822,9 @@ static void WindowMapgenRandomInvalidate(rct_window* w) w->pressed_widgets = 0; if (_randomTerrain) - w->pressed_widgets |= 1ULL << WIDX_RANDOM_TERRAIN; + w->pressed_widgets |= 1uLL << WIDX_RANDOM_TERRAIN; if (_placeTrees) - w->pressed_widgets |= 1ULL << WIDX_RANDOM_PLACE_TREES; + w->pressed_widgets |= 1uLL << WIDX_RANDOM_PLACE_TREES; WindowMapgenSetPressedTab(w); } @@ -872,7 +872,7 @@ static void WindowMapgenSimplexMouseup(rct_window* w, WidgetIndex widgetIndex) mapgenSettings.simplex_base_freq = (static_cast(_simplex_base_freq)) / 100.00f; mapgenSettings.simplex_octaves = _simplex_octaves; - mapgen_generate(&mapgenSettings); + MapGenGenerate(&mapgenSettings); gfx_invalidate_screen(); break; } @@ -1165,7 +1165,7 @@ static void WindowMapgenHeightmapGenerateMap() mapgenSettings.normalize_height = _heightmapNormalize; mapgenSettings.simplex_low = _heightmapLow; mapgenSettings.simplex_high = _heightmapHigh; - mapgen_generate_from_heightmap(&mapgenSettings); + MapGenGenerateFromHeightmap(&mapgenSettings); gfx_invalidate_screen(); } @@ -1173,14 +1173,14 @@ static void WindowMapgenHeightmapLoadsaveCallback(int32_t result, const utf8* pa { if (result == MODAL_RESULT_OK) { - if (!mapgen_load_heightmap(path)) + if (!MapGenLoadHeightmap(path)) { // TODO: Display error popup return; } // The window needs to be open while using the map - rct_window* const w = context_open_window(WindowClass::Mapgen); + rct_window* const w = ContextOpenWindow(WindowClass::Mapgen); _heightmapLoaded = true; WindowMapgenSetPage(w, WINDOW_MAPGEN_PAGE_HEIGHTMAP); @@ -1207,7 +1207,7 @@ static void WindowMapgenHeightmapMouseup(rct_window* w, WidgetIndex widgetIndex) auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(WindowMapgenHeightmapLoadsaveCallback)); - context_open_intent(&intent); + ContextOpenIntent(&intent); return; } case WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP: diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 5ebada2ae4..0fa177a0b8 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -65,7 +65,7 @@ void WindowMapTooltipUpdateVisibility() return; } - const CursorState* state = context_get_cursor_state(); + const CursorState* state = ContextGetCursorState(); auto cursor = state->position; auto cursorChange = cursor - _lastCursor; @@ -104,7 +104,7 @@ static void WindowMapTooltipOpen() constexpr int32_t width = 200; constexpr int32_t height = 44; - const CursorState* state = context_get_cursor_state(); + const CursorState* state = ContextGetCursorState(); ScreenCoordsXY pos = { state->position.x - (width / 2), state->position.y + 15 }; w = window_find_by_class(WindowClass::MapTooltip); diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index a10439110c..90883ea862 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -104,7 +104,7 @@ public: ride_construction_invalidate_current_track(); viewport_set_visibility(0); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -130,7 +130,7 @@ public: { auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } } @@ -161,14 +161,14 @@ public: 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)); + |= ((1uLL << WIDX_MAZE_BUILD_MODE) | (1uLL << WIDX_MAZE_MOVE_MODE) | (1uLL << WIDX_MAZE_FILL_MODE) + | (1uLL << WIDX_MAZE_DIRECTION_NW) | (1uLL << WIDX_MAZE_DIRECTION_NE) | (1uLL << WIDX_MAZE_DIRECTION_SW) + | (1uLL << WIDX_MAZE_DIRECTION_SE)); } else if (_rideConstructionState == RideConstructionState::EntranceExit) { - disabledWidgets = (1ULL << WIDX_MAZE_DIRECTION_NW) | (1ULL << WIDX_MAZE_DIRECTION_NE) - | (1ULL << WIDX_MAZE_DIRECTION_SW) | (1ULL << WIDX_MAZE_DIRECTION_SE); + disabledWidgets = (1uLL << WIDX_MAZE_DIRECTION_NW) | (1uLL << WIDX_MAZE_DIRECTION_NE) + | (1uLL << WIDX_MAZE_DIRECTION_SW) | (1uLL << WIDX_MAZE_DIRECTION_SE); } // Set and invalidate the changed widgets @@ -178,7 +178,7 @@ public: for (WidgetIndex i = 0; i < 64; i++) { - if ((disabledWidgets & (1ULL << i)) != (currentDisabledWidgets & (1ULL << i))) + if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) { widget_invalidate(*this, i); } @@ -333,7 +333,7 @@ private: { ride_construction_invalidate_current_track(); - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -348,7 +348,7 @@ private: RideId rideIndex = gRideEntranceExitPlaceRideIndex; auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( - entranceOrExitCoords, direction_reverse(entranceOrExitCoords.direction), rideIndex, + entranceOrExitCoords, DirectionReverse(entranceOrExitCoords.direction), rideIndex, gRideEntranceExitPlaceStationIndex, gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_EXIT); rideEntranceExitPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 2fb47106ea..67ce26f6bf 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -266,20 +266,14 @@ static void WindowMultiplayerSetPage(rct_window* w, int32_t page) static void WindowMultiplayerAnchorBorderWidgets(rct_window* w) { - w->widgets[WIDX_BACKGROUND].right = w->width - 1; - w->widgets[WIDX_BACKGROUND].bottom = w->height - 1; - w->widgets[WIDX_TITLE].right = w->width - 2; - w->widgets[WIDX_CONTENT_PANEL].right = w->width - 1; - w->widgets[WIDX_CONTENT_PANEL].bottom = w->height - 1; - w->widgets[WIDX_CLOSE].left = w->width - 13; - w->widgets[WIDX_CLOSE].right = w->width - 3; + w->ResizeFrameWithPage(); } static void WindowMultiplayerSetPressedTab(rct_window* w) { - for (int32_t i = 0; i < 2; i++) + for (int32_t i = WIDX_TAB1; i <= WIDX_TAB4; i++) { - w->pressed_widgets &= ~(1 << (WIDX_TAB1 + i)); + w->pressed_widgets &= ~(1 << i); } w->pressed_widgets |= 1LL << (WIDX_TAB1 + w->page); } @@ -340,7 +334,7 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize() return _windowInformationSize; } - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + int32_t lineHeight = font_get_line_height(FontStyle::Medium); // Base dimensions. const int32_t width = 450; @@ -350,7 +344,7 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize() // Server name is displayed word-wrapped, so figure out how high it will be. { u8string buffer = network_get_server_name(); - gfx_wrap_string(buffer.data(), width, FontSpriteBase::MEDIUM, &numLines); + gfx_wrap_string(buffer.data(), width, FontStyle::Medium, &numLines); height += ++numLines * lineHeight + (LIST_ROW_HEIGHT / 2); } @@ -359,7 +353,7 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize() if (!str_is_null_or_empty(descString)) { u8string buffer = descString; - gfx_wrap_string(buffer.data(), width, FontSpriteBase::MEDIUM, &numLines); + gfx_wrap_string(buffer.data(), width, FontStyle::Medium, &numLines); height += ++numLines * lineHeight + (LIST_ROW_HEIGHT / 2); } @@ -466,7 +460,7 @@ static void WindowMultiplayerInformationPaint(rct_window* w, rct_drawpixelinfo* static bool IsServerPlayerInvisible() { - return network_is_server_player_invisible() && !gConfigGeneral.debugging_tools; + return network_is_server_player_invisible() && !gConfigGeneral.DebuggingTools; } static void WindowMultiplayerPlayersMouseup(rct_window* w, WidgetIndex widgetIndex) @@ -623,7 +617,7 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo _buffer += network_get_player_name(player); } screenCoords.x = 0; - gfx_clip_string(_buffer.data(), 230, FontSpriteBase::MEDIUM); + gfx_clip_string(_buffer.data(), 230, FontStyle::Medium); gfx_draw_string(dpi, screenCoords, _buffer.c_str(), { colour }); // Draw group name @@ -634,7 +628,7 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo _buffer += "{BLACK}"; screenCoords.x = 173; _buffer += network_get_group_name(group); - gfx_clip_string(_buffer.data(), 80, FontSpriteBase::MEDIUM); + gfx_clip_string(_buffer.data(), 80, FontStyle::Medium); gfx_draw_string(dpi, screenCoords, _buffer.c_str(), { colour }); } @@ -958,16 +952,16 @@ static void WindowMultiplayerOptionsMouseup(rct_window* w, WidgetIndex widgetInd } break; case WIDX_LOG_CHAT_CHECKBOX: - gConfigNetwork.log_chat = !gConfigNetwork.log_chat; - config_save_default(); + gConfigNetwork.LogChat = !gConfigNetwork.LogChat; + ConfigSaveDefault(); break; case WIDX_LOG_SERVER_ACTIONS_CHECKBOX: - gConfigNetwork.log_server_actions = !gConfigNetwork.log_server_actions; - config_save_default(); + gConfigNetwork.LogServerActions = !gConfigNetwork.LogServerActions; + ConfigSaveDefault(); break; case WIDX_KNOWN_KEYS_ONLY_CHECKBOX: - gConfigNetwork.known_keys_only = !gConfigNetwork.known_keys_only; - config_save_default(); + gConfigNetwork.KnownKeysOnly = !gConfigNetwork.KnownKeysOnly; + ConfigSaveDefault(); break; } } @@ -994,9 +988,9 @@ static void WindowMultiplayerOptionsInvalidate(rct_window* w) w->widgets[WIDX_KNOWN_KEYS_ONLY_CHECKBOX].type = WindowWidgetType::Empty; } - WidgetSetCheckboxValue(*w, WIDX_LOG_CHAT_CHECKBOX, gConfigNetwork.log_chat); - WidgetSetCheckboxValue(*w, WIDX_LOG_SERVER_ACTIONS_CHECKBOX, gConfigNetwork.log_server_actions); - WidgetSetCheckboxValue(*w, WIDX_KNOWN_KEYS_ONLY_CHECKBOX, gConfigNetwork.known_keys_only); + WidgetSetCheckboxValue(*w, WIDX_LOG_CHAT_CHECKBOX, gConfigNetwork.LogChat); + WidgetSetCheckboxValue(*w, WIDX_LOG_SERVER_ACTIONS_CHECKBOX, gConfigNetwork.LogServerActions); + WidgetSetCheckboxValue(*w, WIDX_KNOWN_KEYS_ONLY_CHECKBOX, gConfigNetwork.KnownKeysOnly); } static void WindowMultiplayerOptionsPaint(rct_window* w, rct_drawpixelinfo* dpi) diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 6d92a0d93a..69d5ef63a4 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -15,8 +15,6 @@ #include // clang-format off -static char _password[33]; - enum WindowNetworkStatusWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -31,135 +29,135 @@ static rct_widget window_network_status_widgets[] = { WIDGETS_END, }; -static char window_network_status_text[1024]; - -static void WindowNetworkStatusOnclose(rct_window *w); -static void WindowNetworkStatusMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowNetworkStatusUpdate(rct_window *w); -static void WindowNetworkStatusTextinput(rct_window *w, WidgetIndex widgetIndex, char *text); -static void WindowNetworkStatusInvalidate(rct_window *w); -static void WindowNetworkStatusPaint(rct_window *w, rct_drawpixelinfo *dpi); - -static WindowEventList window_network_status_events([](auto& events) -{ - events.close = &WindowNetworkStatusOnclose; - events.mouse_up = &WindowNetworkStatusMouseup; - events.update = &WindowNetworkStatusUpdate; - events.text_input = &WindowNetworkStatusTextinput; - events.invalidate = &WindowNetworkStatusInvalidate; - events.paint = &WindowNetworkStatusPaint; -}); // clang-format on - -static close_callback _onClose = nullptr; - -rct_window* WindowNetworkStatusOpen(const char* text, close_callback onClose) +class NetworkStatusWindow final : public Window { - _onClose = onClose; - safe_strcpy(window_network_status_text, text, sizeof(window_network_status_text)); +public: + void OnOpen() override + { + widgets = window_network_status_widgets; + WindowInitScrollWidgets(*this); - // Check if window is already open - rct_window* window = window_bring_to_front_by_class_with_flags(WindowClass::NetworkStatus, 0); - if (window != nullptr) - return window; + no_list_items = 0; + selected_list_item = -1; + frame_no = 0; + min_width = 320; + min_height = 90; + max_width = min_width; + max_height = min_height; - window = WindowCreateCentred(420, 90, &window_network_status_events, WindowClass::NetworkStatus, WF_10 | WF_TRANSPARENT); + page = 0; + list_information_type = 0; + } - window->widgets = window_network_status_widgets; - WindowInitScrollWidgets(*window); - window->no_list_items = 0; - window->selected_list_item = -1; - window->frame_no = 0; - window->min_width = 320; - window->min_height = 90; - window->max_width = window->min_width; - window->max_height = window->min_height; + void OnClose() override + { + if (_onClose != nullptr) + { + _onClose(); + } + } - window->page = 0; - window->list_information_type = 0; + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + } + } + void OnUpdate() override + { + InvalidateWidget(WIDX_BACKGROUND); + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + _password.clear(); + switch (widgetIndex) + { + case WIDX_PASSWORD: + _password = text; + break; + } + if (text.empty()) + { + network_shutdown_client(); + } + else + { + network_send_password(_password); + } + } + + void OnPrepareDraw() override + { + ResizeFrame(); + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + WindowDrawWidgets(*this, &dpi); + thread_local std::string _buffer; + _buffer.assign("{BLACK}"); + _buffer += _windowNetworkStatusText; + gfx_clip_string(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium); + ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2)); + screenCoords.x -= gfx_get_string_width(_buffer, FontStyle::Medium) / 2; + gfx_draw_string(&dpi, screenCoords, _buffer.c_str()); + } + + void SetCloseCallBack(close_callback onClose) + { + _onClose = onClose; + } + + void SetWindowNetworkStatusText(const std::string& text) + { + _windowNetworkStatusText = text; + } + + void SetPassword(char* password) + { + _password = password; + } + +private: + close_callback _onClose = nullptr; + std::string _windowNetworkStatusText; + std::string _password; +}; + +rct_window* WindowNetworkStatusOpen(const std::string& text, close_callback onClose) +{ + auto window = WindowFocusOrCreate( + WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); + window->SetCloseCallBack(onClose); + window->SetWindowNetworkStatusText(text); return window; } +// force close void WindowNetworkStatusClose() { - _onClose = nullptr; - window_close_by_class(WindowClass::NetworkStatus); + auto window = window_find_by_class(WindowClass::NetworkStatus); + if (window == nullptr) + { + return; + } + auto networkWindow = static_cast(window); + networkWindow->SetCloseCallBack(nullptr); + networkWindow->Close(); } rct_window* WindowNetworkStatusOpenPassword() { - rct_window* window; - window = window_bring_to_front_by_class(WindowClass::NetworkStatus); - if (window == nullptr) - return nullptr; - - WindowTextInputRawOpen(window, WIDX_PASSWORD, STR_PASSWORD_REQUIRED, STR_PASSWORD_REQUIRED_DESC, {}, _password, 32); - + auto window = WindowFocusOrCreate( + WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); + char password[33]{}; + WindowTextInputRawOpen(window, WIDX_PASSWORD, STR_PASSWORD_REQUIRED, STR_PASSWORD_REQUIRED_DESC, {}, password, 32); + window->SetPassword(password); return window; } - -static void WindowNetworkStatusOnclose(rct_window* w) -{ - if (_onClose != nullptr) - { - _onClose(); - } -} - -static void WindowNetworkStatusMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_CLOSE: - window_close(*w); - break; - } -} - -static void WindowNetworkStatusUpdate(rct_window* w) -{ - widget_invalidate(*w, WIDX_BACKGROUND); -} - -static void WindowNetworkStatusTextinput(rct_window* w, WidgetIndex widgetIndex, char* text) -{ - _password[0] = '\0'; - switch (widgetIndex) - { - case WIDX_PASSWORD: - if (text != nullptr) - safe_strcpy(_password, text, sizeof(_password)); - break; - } - if (text == nullptr) - { - network_shutdown_client(); - } - else - { - network_send_password(_password); - } -} - -static void WindowNetworkStatusInvalidate(rct_window* w) -{ - window_network_status_widgets[WIDX_BACKGROUND].right = w->width - 1; - window_network_status_widgets[WIDX_BACKGROUND].bottom = w->height - 1; - window_network_status_widgets[WIDX_TITLE].right = w->width - 2; - window_network_status_widgets[WIDX_CLOSE].left = w->width - 2 - 0x0B; - window_network_status_widgets[WIDX_CLOSE].right = w->width - 2 - 0x0B + 0x0A; -} - -static void WindowNetworkStatusPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(*w, dpi); - - thread_local std::string _buffer; - _buffer.assign("{BLACK}"); - _buffer += window_network_status_text; - gfx_clip_string(_buffer.data(), w->widgets[WIDX_BACKGROUND].right - 50, FontSpriteBase::MEDIUM); - ScreenCoordsXY screenCoords(w->windowPos.x + (w->width / 2), w->windowPos.y + (w->height / 2)); - screenCoords.x -= gfx_get_string_width(_buffer, FontSpriteBase::MEDIUM) / 2; - gfx_draw_string(dpi, screenCoords, _buffer.c_str()); -} diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 4387617a9d..bbde080870 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -155,7 +155,7 @@ public: void OnOpen() override { widgets = window_new_campaign_widgets; - hold_down_widgets = (1ULL << WIDX_WEEKS_INCREASE_BUTTON) | (1ULL << WIDX_WEEKS_DECREASE_BUTTON); + hold_down_widgets = (1uLL << WIDX_WEEKS_INCREASE_BUTTON) | (1uLL << WIDX_WEEKS_DECREASE_BUTTON); WindowInitScrollWidgets(*this); } diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 36f02d0c69..381ffe7f84 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -340,11 +340,11 @@ public: News::OpenSubject(News::ItemType::Research, gResearchLastItem->rawValue); break; case WIDX_RESEARCH_FUNDING_BUTTON: - context_open_window_view(WV_FINANCES_RESEARCH); + ContextOpenWindowView(WV_FINANCES_RESEARCH); break; case WIDX_GROUP_BY_TRACK_TYPE: - gConfigInterface.list_ride_vehicles_separately = !gConfigInterface.list_ride_vehicles_separately; - config_save_default(); + gConfigInterface.ListRideVehiclesSeparately = !gConfigInterface.ListRideVehiclesSeparately; + ConfigSaveDefault(); SetPage(_currentTab); break; } @@ -362,7 +362,7 @@ public: { SetPressedTab(); - if (!gConfigInterface.list_ride_vehicles_separately) + if (!gConfigInterface.ListRideVehiclesSeparately) pressed_widgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); else pressed_widgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); @@ -386,7 +386,7 @@ public: const auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); auto string = ls.GetString(STR_GROUP_BY_TRACK_TYPE); - auto strWidth = gfx_get_string_width(string, FontSpriteBase::MEDIUM); + auto strWidth = gfx_get_string_width(string, FontStyle::Medium); auto localizedGroupByTrackTypeWidth = strWidth + 14; widgets[WIDX_GROUP_BY_TRACK_TYPE].left = width - 8 - localizedGroupByTrackTypeWidth; } @@ -530,7 +530,7 @@ private: auto intent = Intent(WindowClass::TrackDesignList); intent.putExtra(INTENT_EXTRA_RIDE_TYPE, item.Type); intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, item.EntryIndex); - context_open_intent(&intent); + ContextOpenIntent(&intent); return; } @@ -646,7 +646,7 @@ private: rct_ride_entry* rideEntry = get_ride_entry(rideEntryIndex); // Skip if the vehicle isn't the preferred vehicle for this generic track type - if (!gConfigInterface.list_ride_vehicles_separately + if (!gConfigInterface.ListRideVehiclesSeparately && !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY) && highestVehiclePriority > rideEntry->BuildMenuPriority) { @@ -656,7 +656,7 @@ private: highestVehiclePriority = rideEntry->BuildMenuPriority; // Determines how and where to draw a button for this ride type/vehicle. - if (gConfigInterface.list_ride_vehicles_separately + if (gConfigInterface.ListRideVehiclesSeparately || GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) { // Separate, draw apart @@ -762,18 +762,12 @@ private: Invalidate(); // Resize widgets to new window size - widgets[WIDX_BACKGROUND].right = newWidth - 1; - widgets[WIDX_BACKGROUND].bottom = newHeight - 1; - widgets[WIDX_PAGE_BACKGROUND].right = newWidth - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = newHeight - 1; - widgets[WIDX_TITLE].right = newWidth - 2; - widgets[WIDX_CLOSE].left = newWidth - 13; - widgets[WIDX_CLOSE].right = newWidth - 3; + width = newWidth; + height = newHeight; + ResizeFrameWithPage(); widgets[WIDX_GROUP_BY_TRACK_TYPE].left = newWidth - 8 - GroupByTrackTypeWidth; widgets[WIDX_GROUP_BY_TRACK_TYPE].right = newWidth - 8; - width = newWidth; - height = newHeight; Invalidate(); } @@ -843,7 +837,7 @@ private: if (!_vehicleAvailability.empty()) { - if (gConfigInterface.list_ride_vehicles_separately) + if (gConfigInterface.ListRideVehiclesSeparately) { ft = Formatter(); ft.Add(rideEntry->naming.Name); @@ -989,7 +983,9 @@ void WindowNewRideFocus(RideSelection rideItem) } rct_ride_entry* rideEntry = get_ride_entry(rideItem.EntryIndex); - auto rideTypeIndex = ride_entry_get_first_non_null_ride_type(rideEntry); + if (rideEntry == nullptr) + return; + auto rideTypeIndex = rideEntry->GetFirstNonNullRideType(); w->SetPage(GetRideTypeDescriptor(rideTypeIndex).Category); } diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 71a3345154..9d2e123d64 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -50,7 +50,7 @@ private: int32_t _pressedNewsItemIndex{}, _pressedButtonIndex{}, _suspendUpdateTicks{}; static int32_t CalculateItemHeight() { - return 4 * font_get_line_height(FontSpriteBase::SMALL) + 2; + return 4 * font_get_line_height(FontStyle::Small) + 2; } public: @@ -75,7 +75,7 @@ public: Close(); break; case WIDX_SETTINGS: - context_open_window(WindowClass::NotificationOptions); + ContextOpenWindow(WindowClass::NotificationOptions); break; } } @@ -173,7 +173,7 @@ public: void OnScrollDraw(int32_t scrollIndex, rct_drawpixelinfo& dpi) override { - int32_t lineHeight = font_get_line_height(FontSpriteBase::SMALL); + int32_t lineHeight = font_get_line_height(FontStyle::Small); int32_t itemHeight = CalculateItemHeight(); int32_t y = 0; int32_t i = 0; @@ -199,13 +199,13 @@ public: auto ft = Formatter(); ft.Add(DateDayNames[newsItem.Day - 1]); ft.Add(DateGameMonthNames[date_get_month(newsItem.MonthYear)]); - DrawTextBasic(&dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontSpriteBase::SMALL }); + DrawTextBasic(&dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small }); } // Item text { auto ft = Formatter(); ft.Add(newsItem.Text.c_str()); - DrawTextWrapped(&dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontSpriteBase::SMALL }); + DrawTextWrapped(&dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small }); } // Subject button if ((newsItem.TypeHasSubject()) && !(newsItem.HasButton())) @@ -258,14 +258,13 @@ public: } } - uint32_t image_id = GetPeepAnimation(spriteType).base_image; - image_id += 0xA0000001; - image_id |= (peep->TshirtColour << 19) | (peep->TrousersColour << 24); - - gfx_draw_sprite(&cliped_dpi, ImageId::FromUInt32(image_id), clipCoords); + ImageIndex imageId = GetPeepAnimation(spriteType).base_image + 1; + auto image = ImageId(imageId, peep->TshirtColour, peep->TrousersColour); + gfx_draw_sprite(&cliped_dpi, image, clipCoords); break; } case News::ItemType::Money: + case News::ItemType::Campaign: gfx_draw_sprite(&dpi, ImageId(SPR_FINANCE), screenCoords); break; case News::ItemType::Research: diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index fac94b9bb8..1e088d73b1 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -35,24 +35,24 @@ struct NotificationDef }; static constexpr const NotificationDef NewsItemOptionDefinitions[] = { - { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(NotificationConfiguration, park_award) }, - { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(NotificationConfiguration, park_marketing_campaign_finished) }, - { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(NotificationConfiguration, park_warnings) }, - { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(NotificationConfiguration, park_rating_warnings) }, - { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(NotificationConfiguration, ride_broken_down) }, - { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(NotificationConfiguration, ride_crashed) }, - { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_CASUALTIES, offsetof(NotificationConfiguration, ride_casualties) }, - { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(NotificationConfiguration, ride_warnings) }, - { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(NotificationConfiguration, ride_researched) }, - { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_VEHICLE_STALLED, offsetof(NotificationConfiguration, ride_stalled_vehicles) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(NotificationConfiguration, guest_warnings) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(NotificationConfiguration, guest_left_park) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(NotificationConfiguration, guest_queuing_for_ride) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(NotificationConfiguration, guest_on_ride) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(NotificationConfiguration, guest_left_ride) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(NotificationConfiguration, guest_bought_item) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(NotificationConfiguration, guest_used_facility) }, - { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(NotificationConfiguration, guest_died) }, + { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_AWARD, offsetof(NotificationConfiguration, ParkAward) }, + { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_MARKETING_CAMPAIGN_FINISHED, offsetof(NotificationConfiguration, ParkMarketingCampaignFinished) }, + { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_WARNINGS, offsetof(NotificationConfiguration, ParkWarnings) }, + { NOTIFICATION_CATEGORY_PARK, STR_NOTIFICATION_PARK_RATING_WARNINGS, offsetof(NotificationConfiguration, ParkRatingWarnings) }, + { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_BROKEN_DOWN, offsetof(NotificationConfiguration, RideBrokenDown) }, + { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_CRASHED, offsetof(NotificationConfiguration, RideCrashed) }, + { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_CASUALTIES, offsetof(NotificationConfiguration, RideCasualties) }, + { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_WARNINGS, offsetof(NotificationConfiguration, RideWarnings) }, + { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_RESEARCHED, offsetof(NotificationConfiguration, RideResearched) }, + { NOTIFICATION_CATEGORY_RIDE, STR_NOTIFICATION_RIDE_VEHICLE_STALLED, offsetof(NotificationConfiguration, RideStalledVehicles) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_WARNINGS, offsetof(NotificationConfiguration, GuestWarnings) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_PARK, offsetof(NotificationConfiguration, GuestLeftPark) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_QUEUING_FOR_RIDE, offsetof(NotificationConfiguration, GuestQueuingForRide) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_ON_RIDE, offsetof(NotificationConfiguration, GuestOnRide) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_LEFT_RIDE, offsetof(NotificationConfiguration, GuestLeftRide) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_BOUGHT_ITEM, offsetof(NotificationConfiguration, GuestBoughtItem) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_USED_FACILITY, offsetof(NotificationConfiguration, GuestUsedFacility) }, + { NOTIFICATION_CATEGORY_GUEST, STR_NOTIFICATION_GUEST_DIED, offsetof(NotificationConfiguration, GuestDied) }, }; enum WindowNewsOptionsWidgetIdx @@ -129,7 +129,7 @@ public: bool* configValue = GetNotificationValuePtr(ndef); *configValue = !(*configValue); - config_save_default(); + ConfigSaveDefault(); InvalidateWidget(widgetIndex); break; diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index f9cbbca4a7..c218863891 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -110,7 +110,7 @@ private: if (_downloadStatusInfo == DownloadStatusInfo()) { - context_force_close_window_by_class(WindowClass::NetworkStatus); + ContextForceCloseWindowByClass(WindowClass::NetworkStatus); } else { @@ -136,7 +136,7 @@ private: auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string(str_downloading_objects)); intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { _downloadingObjects = false; }); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } } diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 255fdbbe5c..cba4c21b9d 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -196,7 +196,6 @@ enum WindowOptionsWidgetIdx { // Advanced WIDX_DEBUGGING_TOOLS = WIDX_PAGE_START, - WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM, WIDX_SAVE_PLUGIN_DATA_CHECKBOX, WIDX_STAY_CONNECTED_AFTER_DESYNC, WIDX_ALWAYS_NATIVE_LOADSAVE, @@ -384,7 +383,6 @@ static rct_widget window_options_misc_widgets[] = { static rct_widget window_options_advanced_widgets[] = { MAIN_OPTIONS_WIDGETS, MakeWidget ({ 10, 54}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_ENABLE_DEBUGGING_TOOLS, STR_ENABLE_DEBUGGING_TOOLS_TIP ), // Enable debugging tools - MakeWidget ({ 10, 69}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM, STR_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM_TIP), // Allow loading with incorrect checksum MakeWidget ({ 10, 84}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_SAVE_PLUGIN_DATA, STR_SAVE_PLUGIN_DATA_TIP ), // Export plug-in objects with saved games MakeWidget ({ 10, 99}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_STAY_CONNECTED_AFTER_DESYNC, STR_STAY_CONNECTED_AFTER_DESYNC_TIP ), // Do not disconnect after the client desynchronises with the server MakeWidget ({ 10, 114}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_ALWAYS_NATIVE_LOADSAVE, STR_ALWAYS_NATIVE_LOADSAVE_TIP ), // Use native load/save window @@ -651,7 +649,7 @@ private: auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); if (!hasFilePicker) { - disabled_widgets |= (1ULL << WIDX_ALWAYS_NATIVE_LOADSAVE); + disabled_widgets |= (1uLL << WIDX_ALWAYS_NATIVE_LOADSAVE); widgets[WIDX_ALWAYS_NATIVE_LOADSAVE].type = WindowWidgetType::Empty; } } @@ -683,42 +681,42 @@ private: switch (widgetIndex) { case WIDX_UNCAP_FPS_CHECKBOX: - gConfigGeneral.uncap_fps ^= 1; - drawing_engine_set_vsync(gConfigGeneral.use_vsync); - config_save_default(); + gConfigGeneral.UncapFPS ^= 1; + drawing_engine_set_vsync(gConfigGeneral.UseVSync); + ConfigSaveDefault(); Invalidate(); break; case WIDX_USE_VSYNC_CHECKBOX: - gConfigGeneral.use_vsync ^= 1; - drawing_engine_set_vsync(gConfigGeneral.use_vsync); - config_save_default(); + gConfigGeneral.UseVSync ^= 1; + drawing_engine_set_vsync(gConfigGeneral.UseVSync); + ConfigSaveDefault(); Invalidate(); break; case WIDX_SHOW_FPS_CHECKBOX: - gConfigGeneral.show_fps ^= 1; - config_save_default(); + gConfigGeneral.ShowFPS ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_MULTITHREADING_CHECKBOX: - gConfigGeneral.multithreading ^= 1; - config_save_default(); + gConfigGeneral.MultiThreading ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_MINIMIZE_FOCUS_LOSS: - gConfigGeneral.minimize_fullscreen_focus_loss ^= 1; + gConfigGeneral.MinimizeFullscreenFocusLoss ^= 1; RefreshVideo(false); - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; case WIDX_STEAM_OVERLAY_PAUSE: - gConfigGeneral.steam_overlay_pause ^= 1; - config_save_default(); + gConfigGeneral.SteamOverlayPause ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_DISABLE_SCREENSAVER_LOCK: - gConfigGeneral.disable_screensaver ^= 1; + gConfigGeneral.DisableScreensaver ^= 1; ApplyScreenSaverLockSetting(); - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; } @@ -746,8 +744,8 @@ private: args[1] = resolution.Width; args[2] = resolution.Height; - if (resolution.Width == gConfigGeneral.fullscreen_width - && resolution.Height == gConfigGeneral.fullscreen_height) + if (resolution.Width == gConfigGeneral.FullscreenWidth + && resolution.Height == gConfigGeneral.FullscreenHeight) { selectedResolution = static_cast(i); } @@ -772,7 +770,7 @@ private: ShowDropdown(widget, 3); - Dropdown::SetChecked(gConfigGeneral.fullscreen_mode, true); + Dropdown::SetChecked(gConfigGeneral.FullscreenMode, true); break; case WIDX_DRAWING_ENGINE_DROPDOWN: { @@ -787,23 +785,23 @@ private: gDropdownItems[i].Args = DrawingEngineStringIds[i]; } ShowDropdown(widget, numItems); - Dropdown::SetChecked(EnumValue(gConfigGeneral.drawing_engine), true); + Dropdown::SetChecked(EnumValue(gConfigGeneral.DrawingEngine), true); break; } case WIDX_SCALE_UP: - gConfigGeneral.window_scale += 0.25f; - config_save_default(); + gConfigGeneral.WindowScale += 0.25f; + ConfigSaveDefault(); gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); + ContextTriggerResize(); + ContextUpdateCursorScale(); break; case WIDX_SCALE_DOWN: - gConfigGeneral.window_scale -= 0.25f; - gConfigGeneral.window_scale = std::max(0.5f, gConfigGeneral.window_scale); - config_save_default(); + gConfigGeneral.WindowScale -= 0.25f; + gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale); + ConfigSaveDefault(); gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); + ContextTriggerResize(); + ContextUpdateCursorScale(); break; } } @@ -817,40 +815,39 @@ private: const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); const Resolution& resolution = resolutions[dropdownIndex]; - if (resolution.Width != gConfigGeneral.fullscreen_width - || resolution.Height != gConfigGeneral.fullscreen_height) + if (resolution.Width != gConfigGeneral.FullscreenWidth || resolution.Height != gConfigGeneral.FullscreenHeight) { - gConfigGeneral.fullscreen_width = resolution.Width; - gConfigGeneral.fullscreen_height = resolution.Height; + gConfigGeneral.FullscreenWidth = resolution.Width; + gConfigGeneral.FullscreenHeight = resolution.Height; - if (gConfigGeneral.fullscreen_mode == static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) - context_set_fullscreen_mode(static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)); + if (gConfigGeneral.FullscreenMode == static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + ContextSetFullscreenMode(static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)); - config_save_default(); + ConfigSaveDefault(); gfx_invalidate_screen(); } } break; case WIDX_FULLSCREEN_DROPDOWN: - if (dropdownIndex != gConfigGeneral.fullscreen_mode) + if (dropdownIndex != gConfigGeneral.FullscreenMode) { - context_set_fullscreen_mode(dropdownIndex); + ContextSetFullscreenMode(dropdownIndex); - gConfigGeneral.fullscreen_mode = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.FullscreenMode = static_cast(dropdownIndex); + ConfigSaveDefault(); gfx_invalidate_screen(); } break; case WIDX_DRAWING_ENGINE_DROPDOWN: - if (dropdownIndex != EnumValue(gConfigGeneral.drawing_engine)) + if (dropdownIndex != EnumValue(gConfigGeneral.DrawingEngine)) { DrawingEngine srcEngine = drawing_engine_get_type(); DrawingEngine dstEngine = static_cast(dropdownIndex); - gConfigGeneral.drawing_engine = dstEngine; + gConfigGeneral.DrawingEngine = dstEngine; bool recreate_window = drawing_engine_requires_new_window(srcEngine, dstEngine); RefreshVideo(recreate_window); - config_save_default(); + ConfigSaveDefault(); Invalidate(); } break; @@ -862,60 +859,60 @@ private: // Resolution dropdown caption. auto ft = Formatter::Common(); ft.Increment(16); - ft.Add(static_cast(gConfigGeneral.fullscreen_width)); - ft.Add(static_cast(gConfigGeneral.fullscreen_height)); + ft.Add(static_cast(gConfigGeneral.FullscreenWidth)); + ft.Add(static_cast(gConfigGeneral.FullscreenHeight)); // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" - if (gConfigGeneral.fullscreen_mode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + if (gConfigGeneral.FullscreenMode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) { - disabled_widgets |= (1ULL << WIDX_RESOLUTION_DROPDOWN); - disabled_widgets |= (1ULL << WIDX_RESOLUTION); - disabled_widgets |= (1ULL << WIDX_RESOLUTION_LABEL); + disabled_widgets |= (1uLL << WIDX_RESOLUTION_DROPDOWN); + disabled_widgets |= (1uLL << WIDX_RESOLUTION); + disabled_widgets |= (1uLL << WIDX_RESOLUTION_LABEL); } else { - disabled_widgets &= ~(1ULL << WIDX_RESOLUTION_DROPDOWN); - disabled_widgets &= ~(1ULL << WIDX_RESOLUTION); - disabled_widgets &= ~(1ULL << WIDX_RESOLUTION_LABEL); + disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_DROPDOWN); + disabled_widgets &= ~(1uLL << WIDX_RESOLUTION); + disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_LABEL); } // Disable Steam Overlay checkbox when using software or OpenGL rendering. - if (gConfigGeneral.drawing_engine == DrawingEngine::Software || gConfigGeneral.drawing_engine == DrawingEngine::OpenGL) + if (gConfigGeneral.DrawingEngine == DrawingEngine::Software || gConfigGeneral.DrawingEngine == DrawingEngine::OpenGL) { - disabled_widgets |= (1ULL << WIDX_STEAM_OVERLAY_PAUSE); + disabled_widgets |= (1uLL << WIDX_STEAM_OVERLAY_PAUSE); } else { - disabled_widgets &= ~(1ULL << WIDX_STEAM_OVERLAY_PAUSE); + disabled_widgets &= ~(1uLL << WIDX_STEAM_OVERLAY_PAUSE); } // Disable changing VSync for Software engine, as we can't control its use of VSync - if (gConfigGeneral.drawing_engine == DrawingEngine::Software) + if (gConfigGeneral.DrawingEngine == DrawingEngine::Software) { - disabled_widgets |= (1ULL << WIDX_USE_VSYNC_CHECKBOX); + disabled_widgets |= (1uLL << WIDX_USE_VSYNC_CHECKBOX); } else { - disabled_widgets &= ~(1ULL << WIDX_USE_VSYNC_CHECKBOX); + disabled_widgets &= ~(1uLL << WIDX_USE_VSYNC_CHECKBOX); } - SetCheckboxValue(WIDX_UNCAP_FPS_CHECKBOX, gConfigGeneral.uncap_fps); - SetCheckboxValue(WIDX_USE_VSYNC_CHECKBOX, gConfigGeneral.use_vsync); - SetCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, gConfigGeneral.show_fps); - SetCheckboxValue(WIDX_MULTITHREADING_CHECKBOX, gConfigGeneral.multithreading); - SetCheckboxValue(WIDX_MINIMIZE_FOCUS_LOSS, gConfigGeneral.minimize_fullscreen_focus_loss); - SetCheckboxValue(WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.steam_overlay_pause); - SetCheckboxValue(WIDX_DISABLE_SCREENSAVER_LOCK, gConfigGeneral.disable_screensaver); + SetCheckboxValue(WIDX_UNCAP_FPS_CHECKBOX, gConfigGeneral.UncapFPS); + SetCheckboxValue(WIDX_USE_VSYNC_CHECKBOX, gConfigGeneral.UseVSync); + SetCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, gConfigGeneral.ShowFPS); + SetCheckboxValue(WIDX_MULTITHREADING_CHECKBOX, gConfigGeneral.MultiThreading); + SetCheckboxValue(WIDX_MINIMIZE_FOCUS_LOSS, gConfigGeneral.MinimizeFullscreenFocusLoss); + SetCheckboxValue(WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.SteamOverlayPause); + SetCheckboxValue(WIDX_DISABLE_SCREENSAVER_LOCK, gConfigGeneral.DisableScreensaver); // Dropdown captions for straightforward strings. - widgets[WIDX_FULLSCREEN].text = FullscreenModeNames[gConfigGeneral.fullscreen_mode]; - widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.drawing_engine)]; + widgets[WIDX_FULLSCREEN].text = FullscreenModeNames[gConfigGeneral.FullscreenMode]; + widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.DrawingEngine)]; } void DisplayDraw(rct_drawpixelinfo* dpi) { auto ft = Formatter(); - ft.Add(static_cast(gConfigGeneral.window_scale * 100)); + ft.Add(static_cast(gConfigGeneral.WindowScale * 100)); DrawTextBasic( dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 }, STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { colours[1] }); @@ -928,19 +925,19 @@ private: switch (widgetIndex) { case WIDX_TILE_SMOOTHING_CHECKBOX: - gConfigGeneral.landscape_smoothing ^= 1; - config_save_default(); + gConfigGeneral.LandscapeSmoothing ^= 1; + ConfigSaveDefault(); gfx_invalidate_screen(); break; case WIDX_GRIDLINES_CHECKBOX: { - gConfigGeneral.always_show_gridlines ^= 1; - config_save_default(); + gConfigGeneral.AlwaysShowGridlines ^= 1; + ConfigSaveDefault(); gfx_invalidate_screen(); rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) { - if (gConfigGeneral.always_show_gridlines) + if (gConfigGeneral.AlwaysShowGridlines) mainWindow->viewport->flags |= VIEWPORT_FLAG_GRIDLINES; else mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; @@ -948,46 +945,46 @@ private: break; } case WIDX_DAY_NIGHT_CHECKBOX: - gConfigGeneral.day_night_cycle ^= 1; - config_save_default(); + gConfigGeneral.DayNightCycle ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_ENABLE_LIGHT_FX_CHECKBOX: - gConfigGeneral.enable_light_fx ^= 1; - config_save_default(); + gConfigGeneral.EnableLightFx ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX: - gConfigGeneral.enable_light_fx_for_vehicles ^= 1; - config_save_default(); + gConfigGeneral.EnableLightFxForVehicles ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_UPPER_CASE_BANNERS_CHECKBOX: - gConfigGeneral.upper_case_banners ^= 1; - config_save_default(); + gConfigGeneral.UpperCaseBanners ^= 1; + ConfigSaveDefault(); Invalidate(); scrolling_text_invalidate(); break; case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX: - gConfigGeneral.disable_lightning_effect ^= 1; - config_save_default(); + gConfigGeneral.DisableLightningEffect ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX: - gConfigGeneral.render_weather_effects ^= 1; - gConfigGeneral.render_weather_gloom = gConfigGeneral.render_weather_effects; - config_save_default(); + gConfigGeneral.RenderWeatherEffects ^= 1; + gConfigGeneral.RenderWeatherGloom = gConfigGeneral.RenderWeatherEffects; + ConfigSaveDefault(); Invalidate(); gfx_invalidate_screen(); break; case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX: - gConfigGeneral.show_guest_purchases ^= 1; - config_save_default(); + gConfigGeneral.ShowGuestPurchases ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX: - gConfigGeneral.transparent_screenshot ^= 1; - config_save_default(); + gConfigGeneral.TransparentScreenshot ^= 1; + ConfigSaveDefault(); Invalidate(); break; } @@ -1008,7 +1005,7 @@ private: rct_widget* widget = &widgets[widgetIndex - 1]; ShowDropdown(widget, 3); - Dropdown::SetChecked(static_cast(gConfigGeneral.virtual_floor_style), true); + Dropdown::SetChecked(static_cast(gConfigGeneral.VirtualFloorStyle), true); break; } } @@ -1018,20 +1015,20 @@ private: switch (widgetIndex) { case WIDX_VIRTUAL_FLOOR_DROPDOWN: - gConfigGeneral.virtual_floor_style = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.VirtualFloorStyle = static_cast(dropdownIndex); + ConfigSaveDefault(); break; } } void RenderingPrepareDraw() { - SetCheckboxValue(WIDX_TILE_SMOOTHING_CHECKBOX, gConfigGeneral.landscape_smoothing); - SetCheckboxValue(WIDX_GRIDLINES_CHECKBOX, gConfigGeneral.always_show_gridlines); - SetCheckboxValue(WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.day_night_cycle); - SetCheckboxValue(WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.show_guest_purchases); - SetCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.transparent_screenshot); - SetCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners); + SetCheckboxValue(WIDX_TILE_SMOOTHING_CHECKBOX, gConfigGeneral.LandscapeSmoothing); + SetCheckboxValue(WIDX_GRIDLINES_CHECKBOX, gConfigGeneral.AlwaysShowGridlines); + SetCheckboxValue(WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.DayNightCycle); + SetCheckboxValue(WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.ShowGuestPurchases); + SetCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.TransparentScreenshot); + SetCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.UpperCaseBanners); static constexpr StringId _virtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED, @@ -1039,43 +1036,43 @@ private: STR_VIRTUAL_FLOOR_STYLE_GLASSY, }; - widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[static_cast(gConfigGeneral.virtual_floor_style)]; + widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[static_cast(gConfigGeneral.VirtualFloorStyle)]; - SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.enable_light_fx); - if (gConfigGeneral.day_night_cycle && gConfigGeneral.drawing_engine == DrawingEngine::SoftwareWithHardwareDisplay) + SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.EnableLightFx); + if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) { - disabled_widgets &= ~(1ULL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); } else { - disabled_widgets |= (1ULL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); - gConfigGeneral.enable_light_fx = false; + disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + gConfigGeneral.EnableLightFx = false; } - SetCheckboxValue(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) + SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, gConfigGeneral.EnableLightFxForVehicles); + if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay + && gConfigGeneral.EnableLightFx) { - disabled_widgets &= ~(1ULL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); } else { - disabled_widgets |= (1ULL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); - gConfigGeneral.enable_light_fx_for_vehicles = false; + disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + gConfigGeneral.EnableLightFxForVehicles = false; } WidgetSetCheckboxValue( *this, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, - gConfigGeneral.render_weather_effects || gConfigGeneral.render_weather_gloom); - SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.disable_lightning_effect); - if (!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom) + gConfigGeneral.RenderWeatherEffects || gConfigGeneral.RenderWeatherGloom); + SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.DisableLightningEffect); + if (!gConfigGeneral.RenderWeatherEffects && !gConfigGeneral.RenderWeatherGloom) { SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); - disabled_widgets |= (1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + disabled_widgets |= (1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); } else { - disabled_widgets &= ~(1ULL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + disabled_widgets &= ~(1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); } } @@ -1096,7 +1093,7 @@ private: ShowDropdown(widget, 2); - Dropdown::SetChecked(gConfigGeneral.show_height_as_units ? 0 : 1, true); + Dropdown::SetChecked(gConfigGeneral.ShowHeightAsUnits ? 0 : 1, true); break; case WIDX_CURRENCY_DROPDOWN: { @@ -1119,13 +1116,13 @@ private: ShowDropdown(widget, numItems); - if (gConfigGeneral.currency_format == CurrencyType::Custom) + if (gConfigGeneral.CurrencyFormat == CurrencyType::Custom) { - Dropdown::SetChecked(EnumValue(gConfigGeneral.currency_format) + 1, true); + Dropdown::SetChecked(EnumValue(gConfigGeneral.CurrencyFormat) + 1, true); } else { - Dropdown::SetChecked(EnumValue(gConfigGeneral.currency_format), true); + Dropdown::SetChecked(EnumValue(gConfigGeneral.CurrencyFormat), true); } break; } @@ -1139,7 +1136,7 @@ private: ShowDropdown(widget, 3); - Dropdown::SetChecked(static_cast(gConfigGeneral.measurement_format), true); + Dropdown::SetChecked(static_cast(gConfigGeneral.MeasurementFormat), true); break; case WIDX_TEMPERATURE_DROPDOWN: gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; @@ -1149,7 +1146,7 @@ private: ShowDropdown(widget, 2); - Dropdown::SetChecked(static_cast(gConfigGeneral.temperature_format), true); + Dropdown::SetChecked(static_cast(gConfigGeneral.TemperatureFormat), true); break; case WIDX_LANGUAGE_DROPDOWN: for (size_t i = 1; i < LANGUAGE_COUNT; i++) @@ -1167,7 +1164,7 @@ private: gDropdownItems[i].Args = DateFormatStringIds[i]; } ShowDropdown(widget, 4); - Dropdown::SetChecked(gConfigGeneral.date_format, true); + Dropdown::SetChecked(gConfigGeneral.DateFormat, true); break; } } @@ -1178,38 +1175,38 @@ private: { case WIDX_HEIGHT_LABELS_DROPDOWN: // reset flag and set it to 1 if height as units is selected - gConfigGeneral.show_height_as_units = 0; + gConfigGeneral.ShowHeightAsUnits = 0; if (dropdownIndex == 0) { - gConfigGeneral.show_height_as_units = 1; + gConfigGeneral.ShowHeightAsUnits = 1; } - config_save_default(); + ConfigSaveDefault(); 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(WindowClass::CustomCurrencyConfig); + gConfigGeneral.CurrencyFormat = static_cast(dropdownIndex - 1); + ContextOpenWindow(WindowClass::CustomCurrencyConfig); } else { - gConfigGeneral.currency_format = static_cast(dropdownIndex); + gConfigGeneral.CurrencyFormat = static_cast(dropdownIndex); } - config_save_default(); + ConfigSaveDefault(); gfx_invalidate_screen(); break; case WIDX_DISTANCE_DROPDOWN: - gConfigGeneral.measurement_format = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.MeasurementFormat = static_cast(dropdownIndex); + ConfigSaveDefault(); UpdateHeightMarkers(); break; case WIDX_TEMPERATURE_DROPDOWN: - if (dropdownIndex != static_cast(gConfigGeneral.temperature_format)) + if (dropdownIndex != static_cast(gConfigGeneral.TemperatureFormat)) { - gConfigGeneral.temperature_format = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.TemperatureFormat = static_cast(dropdownIndex); + ConfigSaveDefault(); gfx_invalidate_screen(); } break; @@ -1225,25 +1222,25 @@ private: 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, {}); + ContextShowError(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(); + gConfigGeneral.Language = dropdownIndex + 1; + ConfigSaveDefault(); gfx_invalidate_screen(); } } } break; case WIDX_DATE_FORMAT_DROPDOWN: - if (dropdownIndex != gConfigGeneral.date_format) + if (dropdownIndex != gConfigGeneral.DateFormat) { - gConfigGeneral.date_format = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.DateFormat = static_cast(dropdownIndex); + ConfigSaveDefault(); gfx_invalidate_screen(); } break; @@ -1257,12 +1254,12 @@ private: ft.Add(LanguagesDescriptors[LocalisationService_GetCurrentLanguage()].native_name); // Currency: pounds, dollars, etc. (10 total) - widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)].stringId; + widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)].stringId; // Distance: metric / imperial / si { StringId stringId = STR_NONE; - switch (gConfigGeneral.measurement_format) + switch (gConfigGeneral.MeasurementFormat) { case MeasurementFormat::Imperial: stringId = STR_IMPERIAL; @@ -1278,14 +1275,14 @@ private: } // Date format - widgets[WIDX_DATE_FORMAT].text = DateFormatStringIds[gConfigGeneral.date_format]; + widgets[WIDX_DATE_FORMAT].text = DateFormatStringIds[gConfigGeneral.DateFormat]; // Temperature: celsius/fahrenheit - widgets[WIDX_TEMPERATURE].text = gConfigGeneral.temperature_format == TemperatureUnit::Fahrenheit ? STR_FAHRENHEIT - : STR_CELSIUS; + widgets[WIDX_TEMPERATURE].text = gConfigGeneral.TemperatureFormat == TemperatureUnit::Fahrenheit ? STR_FAHRENHEIT + : STR_CELSIUS; // Height: units/real values - widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.show_height_as_units ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; + widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.ShowHeightAsUnits ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; } #pragma endregion @@ -1296,35 +1293,35 @@ private: switch (widgetIndex) { case WIDX_SOUND_CHECKBOX: - gConfigSound.sound_enabled = !gConfigSound.sound_enabled; - config_save_default(); + gConfigSound.SoundEnabled = !gConfigSound.SoundEnabled; + ConfigSaveDefault(); Invalidate(); break; case WIDX_MASTER_SOUND_CHECKBOX: - gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; - if (!gConfigSound.master_sound_enabled) + gConfigSound.MasterSoundEnabled = !gConfigSound.MasterSoundEnabled; + if (!gConfigSound.MasterSoundEnabled) OpenRCT2::Audio::Pause(); else OpenRCT2::Audio::Resume(); window_invalidate_by_class(WindowClass::TopToolbar); - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; case WIDX_MUSIC_CHECKBOX: - gConfigSound.ride_music_enabled = !gConfigSound.ride_music_enabled; - if (!gConfigSound.ride_music_enabled) + gConfigSound.RideMusicEnabled = !gConfigSound.RideMusicEnabled; + if (!gConfigSound.RideMusicEnabled) { OpenRCT2::RideAudio::StopAllChannels(); } - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; case WIDX_AUDIO_FOCUS_CHECKBOX: gConfigSound.audio_focus = !gConfigSound.audio_focus; - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; } @@ -1361,9 +1358,9 @@ private: gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[numItems++].Args = TitleMusicNames[2]; ShowDropdown(widget, numItems); - if (gConfigSound.title_music == TitleMusicKind::None) + if (gConfigSound.TitleMusic == TitleMusicKind::None) Dropdown::SetChecked(0, true); - else if (gConfigSound.title_music == TitleMusicKind::Rct2) + else if (gConfigSound.TitleMusic == TitleMusicKind::Rct2) Dropdown::SetChecked(1, true); } else @@ -1376,7 +1373,7 @@ private: gDropdownItems[numItems++].Args = musicName; } ShowDropdown(widget, numItems); - Dropdown::SetChecked(EnumValue(gConfigSound.title_music), true); + Dropdown::SetChecked(EnumValue(gConfigSound.TitleMusic), true); } break; } @@ -1395,15 +1392,15 @@ private: if (dropdownIndex == 0) { audioContext->SetOutputDevice(""); - gConfigSound.device = ""; + gConfigSound.Device = ""; } else { const auto& deviceName = GetDeviceName(dropdownIndex); audioContext->SetOutputDevice(deviceName); - gConfigSound.device = deviceName; + gConfigSound.Device = deviceName; } - config_save_default(); + ConfigSaveDefault(); OpenRCT2::Audio::PlayTitleMusic(); } Invalidate(); @@ -1416,8 +1413,8 @@ private: titleMusic = TitleMusicKind::Rct2; } - gConfigSound.title_music = titleMusic; - config_save_default(); + gConfigSound.TitleMusic = titleMusic; + ConfigSaveDefault(); Invalidate(); OpenRCT2::Audio::StopTitleMusic(); @@ -1435,30 +1432,30 @@ private: const auto& masterVolumeWidget = widgets[WIDX_MASTER_VOLUME]; const auto& masterVolumeScroll = scrolls[0]; uint8_t masterVolume = GetScrollPercentage(masterVolumeWidget, masterVolumeScroll); - if (masterVolume != gConfigSound.master_volume) + if (masterVolume != gConfigSound.MasterVolume) { - gConfigSound.master_volume = masterVolume; - config_save_default(); + gConfigSound.MasterVolume = masterVolume; + ConfigSaveDefault(); InvalidateWidget(WIDX_MASTER_VOLUME); } const auto& soundVolumeWidget = widgets[WIDX_MASTER_VOLUME]; const auto& soundVolumeScroll = scrolls[1]; uint8_t soundVolume = GetScrollPercentage(soundVolumeWidget, soundVolumeScroll); - if (soundVolume != gConfigSound.sound_volume) + if (soundVolume != gConfigSound.SoundVolume) { - gConfigSound.sound_volume = soundVolume; - config_save_default(); + gConfigSound.SoundVolume = soundVolume; + ConfigSaveDefault(); InvalidateWidget(WIDX_SOUND_VOLUME); } const auto& musicVolumeWidget = widgets[WIDX_MASTER_VOLUME]; const auto& musicVolumeScroll = scrolls[2]; uint8_t rideMusicVolume = GetScrollPercentage(musicVolumeWidget, musicVolumeScroll); - if (rideMusicVolume != gConfigSound.ride_music_volume) + if (rideMusicVolume != gConfigSound.AudioFocus) { - gConfigSound.ride_music_volume = rideMusicVolume; - config_save_default(); + gConfigSound.AudioFocus = rideMusicVolume; + ConfigSaveDefault(); InvalidateWidget(WIDX_MUSIC_VOLUME); } } @@ -1470,7 +1467,7 @@ private: StringId GetTitleMusicName() { - auto index = EnumValue(gConfigSound.title_music); + auto index = EnumValue(gConfigSound.TitleMusic); if (index < 0 || static_cast(index) >= std::size(TitleMusicNames)) { index = EnumValue(TitleMusicKind::None); @@ -1509,19 +1506,19 @@ private: widgets[WIDX_TITLE_MUSIC].text = GetTitleMusicName(); - SetCheckboxValue(WIDX_SOUND_CHECKBOX, gConfigSound.sound_enabled); - SetCheckboxValue(WIDX_MASTER_SOUND_CHECKBOX, gConfigSound.master_sound_enabled); - SetCheckboxValue(WIDX_MUSIC_CHECKBOX, gConfigSound.ride_music_enabled); + SetCheckboxValue(WIDX_SOUND_CHECKBOX, gConfigSound.SoundEnabled); + SetCheckboxValue(WIDX_MASTER_SOUND_CHECKBOX, gConfigSound.MasterSoundEnabled); + SetCheckboxValue(WIDX_MUSIC_CHECKBOX, gConfigSound.RideMusicEnabled); SetCheckboxValue(WIDX_AUDIO_FOCUS_CHECKBOX, gConfigSound.audio_focus); - WidgetSetEnabled(*this, WIDX_SOUND_CHECKBOX, gConfigSound.master_sound_enabled); - WidgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, gConfigSound.master_sound_enabled); + WidgetSetEnabled(*this, WIDX_SOUND_CHECKBOX, gConfigSound.MasterSoundEnabled); + WidgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, gConfigSound.MasterSoundEnabled); // Initialize only on first frame, otherwise the scrollbars won't be able to be modified if (frame_no == 0) { - InitializeScrollPosition(WIDX_MASTER_VOLUME, 0, gConfigSound.master_volume); - InitializeScrollPosition(WIDX_SOUND_VOLUME, 1, gConfigSound.sound_volume); - InitializeScrollPosition(WIDX_MUSIC_VOLUME, 2, gConfigSound.ride_music_volume); + InitializeScrollPosition(WIDX_MASTER_VOLUME, 0, gConfigSound.MasterVolume); + InitializeScrollPosition(WIDX_SOUND_VOLUME, 1, gConfigSound.SoundVolume); + InitializeScrollPosition(WIDX_MUSIC_VOLUME, 2, gConfigSound.AudioFocus); } } @@ -1533,73 +1530,73 @@ private: switch (widgetIndex) { case WIDX_HOTKEY_DROPDOWN: - context_open_window(WindowClass::KeyboardShortcutList); + ContextOpenWindow(WindowClass::KeyboardShortcutList); break; case WIDX_SCREEN_EDGE_SCROLLING: - gConfigGeneral.edge_scrolling ^= 1; - config_save_default(); + gConfigGeneral.EdgeScrolling ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_TRAP_CURSOR: - gConfigGeneral.trap_cursor ^= 1; - config_save_default(); - context_set_cursor_trap(gConfigGeneral.trap_cursor); + gConfigGeneral.TrapCursor ^= 1; + ConfigSaveDefault(); + ContextSetCursorTrap(gConfigGeneral.TrapCursor); Invalidate(); break; case WIDX_ZOOM_TO_CURSOR: - gConfigGeneral.zoom_to_cursor ^= 1; - config_save_default(); + gConfigGeneral.ZoomToCursor ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_TOOLBAR_SHOW_FINANCES: - gConfigInterface.toolbar_show_finances ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowFinances ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_RESEARCH: - gConfigInterface.toolbar_show_research ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowResearch ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_CHEATS: - gConfigInterface.toolbar_show_cheats ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowCheats ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_NEWS: - gConfigInterface.toolbar_show_news ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowNews ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_MUTE: - gConfigInterface.toolbar_show_mute ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowMute ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_CHAT: - gConfigInterface.toolbar_show_chat ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowChat ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_TOOLBAR_SHOW_ZOOM: - gConfigInterface.toolbar_show_zoom ^= 1; - config_save_default(); + gConfigInterface.ToolbarShowZoom ^= 1; + ConfigSaveDefault(); Invalidate(); window_invalidate_by_class(WindowClass::TopToolbar); break; case WIDX_INVERT_DRAG: - gConfigGeneral.invert_viewport_drag ^= 1; - config_save_default(); + gConfigGeneral.InvertViewportDrag ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_THEMES_BUTTON: - context_open_window(WindowClass::Themes); + ContextOpenWindow(WindowClass::Themes); Invalidate(); break; } @@ -1639,24 +1636,24 @@ private: { ThemeManagerSetActiveAvailableTheme(dropdownIndex); } - config_save_default(); + ConfigSaveDefault(); break; } } void ControlsPrepareDraw() { - SetCheckboxValue(WIDX_SCREEN_EDGE_SCROLLING, gConfigGeneral.edge_scrolling); - SetCheckboxValue(WIDX_TRAP_CURSOR, gConfigGeneral.trap_cursor); - SetCheckboxValue(WIDX_INVERT_DRAG, gConfigGeneral.invert_viewport_drag); - SetCheckboxValue(WIDX_ZOOM_TO_CURSOR, gConfigGeneral.zoom_to_cursor); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.toolbar_show_finances); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.toolbar_show_research); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.toolbar_show_cheats); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.toolbar_show_news); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.toolbar_show_mute); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.toolbar_show_chat); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.toolbar_show_zoom); + SetCheckboxValue(WIDX_SCREEN_EDGE_SCROLLING, gConfigGeneral.EdgeScrolling); + SetCheckboxValue(WIDX_TRAP_CURSOR, gConfigGeneral.TrapCursor); + SetCheckboxValue(WIDX_INVERT_DRAG, gConfigGeneral.InvertViewportDrag); + SetCheckboxValue(WIDX_ZOOM_TO_CURSOR, gConfigGeneral.ZoomToCursor); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.ToolbarShowFinances); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.ToolbarShowResearch); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.ToolbarShowCheats); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.ToolbarShowNews); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.ToolbarShowMute); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.ToolbarShowChat); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.ToolbarShowZoom); size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); @@ -1672,37 +1669,37 @@ private: switch (widgetIndex) { case WIDX_REAL_NAME_CHECKBOX: - gConfigGeneral.show_real_names_of_guests ^= 1; - config_save_default(); + gConfigGeneral.ShowRealNamesOfGuests ^= 1; + ConfigSaveDefault(); Invalidate(); - peep_update_names(gConfigGeneral.show_real_names_of_guests); + peep_update_names(gConfigGeneral.ShowRealNamesOfGuests); break; case WIDX_AUTO_STAFF_PLACEMENT: - gConfigGeneral.auto_staff_placement ^= 1; - config_save_default(); + gConfigGeneral.AutoStaffPlacement ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_SCENARIO_UNLOCKING: - gConfigGeneral.scenario_unlocking_enabled ^= 1; - config_save_default(); + gConfigGeneral.ScenarioUnlockingEnabled ^= 1; + ConfigSaveDefault(); window_close_by_class(WindowClass::ScenarioSelect); break; case WIDX_AUTO_OPEN_SHOPS: - gConfigGeneral.auto_open_shops = !gConfigGeneral.auto_open_shops; - config_save_default(); + gConfigGeneral.AutoOpenShops = !gConfigGeneral.AutoOpenShops; + ConfigSaveDefault(); Invalidate(); break; case WIDX_ALLOW_EARLY_COMPLETION: - gConfigGeneral.allow_early_completion ^= 1; + gConfigGeneral.AllowEarlyCompletion ^= 1; // Only the server can control this setting and needs to send the // current value of allow_early_completion to all clients if (network_get_mode() == NETWORK_MODE_SERVER) { auto setAllowEarlyCompletionAction = ScenarioSetSettingAction( - ScenarioSetSetting::AllowEarlyCompletion, gConfigGeneral.allow_early_completion); + ScenarioSetSetting::AllowEarlyCompletion, gConfigGeneral.AllowEarlyCompletion); GameActions::Execute(&setAllowEarlyCompletionAction); } - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; } @@ -1733,9 +1730,8 @@ private: { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], Dropdown::Flag::StayOpen, numItems); - auto selectedIndex = gConfigInterface.random_title_sequence - ? numItems - 1 - : static_cast(title_get_current_sequence()); + auto selectedIndex = gConfigInterface.RandomTitleSequence ? numItems - 1 + : static_cast(title_get_current_sequence()); Dropdown::SetChecked(selectedIndex, true); break; } @@ -1752,7 +1748,7 @@ private: { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, numItems, widget->width() - 3); - Dropdown::SetChecked(gConfigGeneral.scenario_select_mode, true); + Dropdown::SetChecked(gConfigGeneral.ScenarioSelectMode, true); break; } case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: @@ -1763,7 +1759,7 @@ private: } ShowDropdown(widget, 7); - Dropdown::SetChecked(gConfigGeneral.default_inspection_interval, true); + Dropdown::SetChecked(gConfigGeneral.DefaultInspectionInterval, true); break; } } @@ -1777,33 +1773,33 @@ private: auto numItems = static_cast(title_sequence_manager_get_count()); if (dropdownIndex < numItems && dropdownIndex != static_cast(title_get_current_sequence())) { - gConfigInterface.random_title_sequence = false; + gConfigInterface.RandomTitleSequence = false; title_sequence_change_preset(static_cast(dropdownIndex)); - config_save_default(); + ConfigSaveDefault(); Invalidate(); } else if (dropdownIndex == numItems + 1) { - gConfigInterface.random_title_sequence = true; - config_save_default(); + gConfigInterface.RandomTitleSequence = true; + ConfigSaveDefault(); Invalidate(); } break; } case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: - if (dropdownIndex != gConfigGeneral.default_inspection_interval) + if (dropdownIndex != gConfigGeneral.DefaultInspectionInterval) { - gConfigGeneral.default_inspection_interval = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.DefaultInspectionInterval = static_cast(dropdownIndex); + ConfigSaveDefault(); Invalidate(); } break; case WIDX_SCENARIO_GROUPING_DROPDOWN: - if (dropdownIndex != gConfigGeneral.scenario_select_mode) + if (dropdownIndex != gConfigGeneral.ScenarioSelectMode) { - gConfigGeneral.scenario_select_mode = dropdownIndex; - gConfigInterface.scenarioselect_last_tab = 0; - config_save_default(); + gConfigGeneral.ScenarioSelectMode = dropdownIndex; + gConfigInterface.ScenarioselectLastTab = 0; + ConfigSaveDefault(); Invalidate(); window_close_by_class(WindowClass::ScenarioSelect); } @@ -1814,7 +1810,7 @@ private: void MiscPrepareDraw() { auto ft = Formatter::Common(); - if (gConfigInterface.random_title_sequence) + if (gConfigInterface.RandomTitleSequence) { ft.Add(STR_TITLE_SEQUENCE_RANDOM); } @@ -1829,41 +1825,40 @@ private: // and the server cannot change the setting during gameplay to prevent desyncs if (network_get_mode() != NETWORK_MODE_NONE) { - disabled_widgets |= (1ULL << WIDX_REAL_NAME_CHECKBOX); + disabled_widgets |= (1uLL << WIDX_REAL_NAME_CHECKBOX); widgets[WIDX_REAL_NAME_CHECKBOX].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; // Disable the use of the allow_early_completion option during network play on clients. // This is to prevent confusion on clients because changing this setting during network play wouldn't change // the way scenarios are completed during this network-session if (network_get_mode() == NETWORK_MODE_CLIENT) { - disabled_widgets |= (1ULL << WIDX_ALLOW_EARLY_COMPLETION); + disabled_widgets |= (1uLL << WIDX_ALLOW_EARLY_COMPLETION); widgets[WIDX_ALLOW_EARLY_COMPLETION].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; } } - SetCheckboxValue(WIDX_REAL_NAME_CHECKBOX, gConfigGeneral.show_real_names_of_guests); - SetCheckboxValue(WIDX_AUTO_STAFF_PLACEMENT, gConfigGeneral.auto_staff_placement); - SetCheckboxValue(WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.auto_open_shops); - SetCheckboxValue(WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.allow_early_completion); + SetCheckboxValue(WIDX_REAL_NAME_CHECKBOX, gConfigGeneral.ShowRealNamesOfGuests); + SetCheckboxValue(WIDX_AUTO_STAFF_PLACEMENT, gConfigGeneral.AutoStaffPlacement); + SetCheckboxValue(WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.AutoOpenShops); + SetCheckboxValue(WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.AllowEarlyCompletion); - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_DIFFICULTY) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_DIFFICULTY) widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_DIFFICULTY; else widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_ORIGIN; - SetCheckboxValue(WIDX_SCENARIO_UNLOCKING, gConfigGeneral.scenario_unlocking_enabled); + SetCheckboxValue(WIDX_SCENARIO_UNLOCKING, gConfigGeneral.ScenarioUnlockingEnabled); - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) { - disabled_widgets &= ~(1ULL << WIDX_SCENARIO_UNLOCKING); + disabled_widgets &= ~(1uLL << WIDX_SCENARIO_UNLOCKING); } else { - disabled_widgets |= (1ULL << WIDX_SCENARIO_UNLOCKING); + disabled_widgets |= (1uLL << WIDX_SCENARIO_UNLOCKING); } - widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[gConfigGeneral - .default_inspection_interval]; + widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[gConfigGeneral.DefaultInspectionInterval]; } #pragma endregion @@ -1874,28 +1869,23 @@ private: switch (widgetIndex) { case WIDX_DEBUGGING_TOOLS: - gConfigGeneral.debugging_tools ^= 1; - config_save_default(); + gConfigGeneral.DebuggingTools ^= 1; + ConfigSaveDefault(); 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(); - Invalidate(); - break; case WIDX_SAVE_PLUGIN_DATA_CHECKBOX: - gConfigGeneral.save_plugin_data ^= 1; - config_save_default(); + gConfigGeneral.SavePluginData ^= 1; + ConfigSaveDefault(); Invalidate(); break; case WIDX_STAY_CONNECTED_AFTER_DESYNC: - gConfigNetwork.stay_connected = !gConfigNetwork.stay_connected; - config_save_default(); + gConfigNetwork.StayConnected = !gConfigNetwork.StayConnected; + ConfigSaveDefault(); Invalidate(); break; case WIDX_ALWAYS_NATIVE_LOADSAVE: - gConfigGeneral.use_native_browse_dialog = !gConfigGeneral.use_native_browse_dialog; - config_save_default(); + gConfigGeneral.UseNativeBrowseDialog = !gConfigGeneral.UseNativeBrowseDialog; + ConfigSaveDefault(); Invalidate(); break; case WIDX_PATH_TO_RCT1_BUTTON: @@ -1911,39 +1901,39 @@ private: { if (CsgAtLocationIsUsable(rct1path)) { - gConfigGeneral.rct1_path = std::move(rct1path); - gConfigInterface.scenarioselect_last_tab = 0; - config_save_default(); - context_show_error(STR_RESTART_REQUIRED, STR_NONE, {}); + gConfigGeneral.RCT1Path = std::move(rct1path); + gConfigInterface.ScenarioselectLastTab = 0; + ConfigSaveDefault(); + ContextShowError(STR_RESTART_REQUIRED, STR_NONE, {}); } else { - context_show_error(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); } } else { - context_show_error(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); } } else { - context_show_error(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); } } Invalidate(); break; } case WIDX_PATH_TO_RCT1_CLEAR: - if (!gConfigGeneral.rct1_path.empty()) + if (!gConfigGeneral.RCT1Path.empty()) { - gConfigGeneral.rct1_path.clear(); - config_save_default(); + gConfigGeneral.RCT1Path.clear(); + ConfigSaveDefault(); } Invalidate(); break; case WIDX_ASSET_PACKS: - context_open_window(WindowClass::AssetPacks); + ContextOpenWindow(WindowClass::AssetPacks); break; } } @@ -1962,20 +1952,20 @@ private: } ShowDropdown(widget, AUTOSAVE_NEVER + 1); - Dropdown::SetChecked(gConfigGeneral.autosave_frequency, true); + Dropdown::SetChecked(gConfigGeneral.AutosaveFrequency, true); break; case WIDX_AUTOSAVE_AMOUNT_UP: - gConfigGeneral.autosave_amount += 1; - config_save_default(); + gConfigGeneral.AutosaveAmount += 1; + ConfigSaveDefault(); InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY); InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); InvalidateWidget(WIDX_AUTOSAVE_AMOUNT); break; case WIDX_AUTOSAVE_AMOUNT_DOWN: - if (gConfigGeneral.autosave_amount > 1) + if (gConfigGeneral.AutosaveAmount > 1) { - gConfigGeneral.autosave_amount -= 1; - config_save_default(); + gConfigGeneral.AutosaveAmount -= 1; + ConfigSaveDefault(); InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY); InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); InvalidateWidget(WIDX_AUTOSAVE_AMOUNT); @@ -1988,10 +1978,10 @@ private: switch (widgetIndex) { case WIDX_AUTOSAVE_FREQUENCY_DROPDOWN: - if (dropdownIndex != gConfigGeneral.autosave_frequency) + if (dropdownIndex != gConfigGeneral.AutosaveFrequency) { - gConfigGeneral.autosave_frequency = static_cast(dropdownIndex); - config_save_default(); + gConfigGeneral.AutosaveFrequency = static_cast(dropdownIndex); + ConfigSaveDefault(); Invalidate(); } break; @@ -2000,24 +1990,22 @@ private: void AdvancedPrepareDraw() { - SetCheckboxValue(WIDX_DEBUGGING_TOOLS, gConfigGeneral.debugging_tools); - WidgetSetCheckboxValue( - *this, WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM, gConfigGeneral.allow_loading_with_incorrect_checksum); - SetCheckboxValue(WIDX_SAVE_PLUGIN_DATA_CHECKBOX, gConfigGeneral.save_plugin_data); - SetCheckboxValue(WIDX_STAY_CONNECTED_AFTER_DESYNC, gConfigNetwork.stay_connected); - SetCheckboxValue(WIDX_ALWAYS_NATIVE_LOADSAVE, gConfigGeneral.use_native_browse_dialog); - widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[gConfigGeneral.autosave_frequency]; + SetCheckboxValue(WIDX_DEBUGGING_TOOLS, gConfigGeneral.DebuggingTools); + SetCheckboxValue(WIDX_SAVE_PLUGIN_DATA_CHECKBOX, gConfigGeneral.SavePluginData); + SetCheckboxValue(WIDX_STAY_CONNECTED_AFTER_DESYNC, gConfigNetwork.StayConnected); + SetCheckboxValue(WIDX_ALWAYS_NATIVE_LOADSAVE, gConfigGeneral.UseNativeBrowseDialog); + widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[gConfigGeneral.AutosaveFrequency]; } void AdvancedDraw(rct_drawpixelinfo* dpi) { auto ft = Formatter(); - ft.Add(static_cast(gConfigGeneral.autosave_amount)); + ft.Add(static_cast(gConfigGeneral.AutosaveAmount)); DrawTextBasic( dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, STR_WINDOW_COLOUR_2_COMMA16, ft, { colours[1] }); - const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.rct1_path); + const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.RCT1Path); ft = Formatter(); ft.Add(normalisedPath.c_str()); @@ -2025,7 +2013,7 @@ private: // Apply vertical alignment if appropriate. int32_t widgetHeight = pathWidget.bottom - pathWidget.top; - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + int32_t lineHeight = font_get_line_height(FontStyle::Medium); uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0; ScreenCoordsXY screenCoords = { windowPos.x + pathWidget.left + 1, windowPos.y + pathWidget.top + static_cast(padding) }; @@ -2036,14 +2024,14 @@ private: { if (widgetIndex == WIDX_PATH_TO_RCT1_BUTTON) { - if (gConfigGeneral.rct1_path.empty()) + if (gConfigGeneral.RCT1Path.empty()) { // No tooltip if the path is empty return { STR_NONE, {} }; } auto ft = Formatter(); - ft.Add(gConfigGeneral.rct1_path.c_str()); + ft.Add(gConfigGeneral.RCT1Path.c_str()); return { fallback, ft }; } return { fallback, {} }; @@ -2125,7 +2113,7 @@ private: void UpdateHeightMarkers() { - config_save_default(); + ConfigSaveDefault(); gfx_invalidate_screen(); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index b1c8e9cf33..ec24a12710 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -155,8 +155,8 @@ static std::array _pagedHoldDownWidgets = { 0, 0, 0, - (1ULL << WIDX_INCREASE_PRICE) | - (1ULL << WIDX_DECREASE_PRICE), + (1uLL << WIDX_INCREASE_PRICE) | + (1uLL << WIDX_DECREASE_PRICE), 0, 0, 0, @@ -394,7 +394,7 @@ private: void SetDisabledTabs() { // Disable price tab if money is disabled - disabled_widgets = (gParkFlags & PARK_FLAGS_NO_MONEY) ? (1ULL << WIDX_TAB_4) : 0; + disabled_widgets = (gParkFlags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0; } void PrepareWindowTitleText() @@ -413,7 +413,7 @@ private: switch (widgetIndex) { case WIDX_BUY_LAND_RIGHTS: - context_open_window(WindowClass::LandRights); + ContextOpenWindow(WindowClass::LandRights); break; case WIDX_LOCATE: ScrollToViewport(); @@ -426,10 +426,10 @@ private: break; } case WIDX_CLOSE_LIGHT: - park_set_open(false); + ParkSetOpen(false); break; case WIDX_OPEN_LIGHT: - park_set_open(true); + ParkSetOpen(true); break; } } @@ -453,7 +453,7 @@ private: WindowDropdownShowText( { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2); - if (park_is_open()) + if (ParkIsOpen()) { gDropdownDefaultIndex = 0; Dropdown::SetChecked(1, true); @@ -475,11 +475,11 @@ private: if (dropdownIndex != 0) { - park_set_open(true); + ParkSetOpen(true); } else { - park_set_open(false); + ParkSetOpen(false); } } } @@ -515,17 +515,16 @@ private: ft.Add(STR_STRING); ft.Add(parkName); } - widgets[WIDX_OPEN_OR_CLOSE].image = park_is_open() ? SPR_OPEN : SPR_CLOSED; - widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + !park_is_open() * 2 + widgets[WIDX_OPEN_OR_CLOSE].image = ParkIsOpen() ? SPR_OPEN : SPR_CLOSED; + widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + !ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); - widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + park_is_open() * 2 - + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); + widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); // Only allow closing of park for guest / rating objective if (gScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) - disabled_widgets |= (1ULL << WIDX_OPEN_OR_CLOSE) | (1ULL << WIDX_CLOSE_LIGHT) | (1ULL << WIDX_OPEN_LIGHT); + disabled_widgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT); else - disabled_widgets &= ~((1ULL << WIDX_OPEN_OR_CLOSE) | (1ULL << WIDX_CLOSE_LIGHT) | (1ULL << WIDX_OPEN_LIGHT)); + disabled_widgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT)); // Only allow purchase of land when there is money if (gParkFlags & PARK_FLAGS_NO_MONEY) @@ -600,7 +599,7 @@ private: // Draw park closed / open label auto ft = Formatter(); - ft.Add(park_is_open() ? STR_PARK_OPEN : STR_PARK_CLOSED); + ft.Add(ParkIsOpen() ? STR_PARK_OPEN : STR_PARK_CLOSED); auto* labelWidget = &widgets[WIDX_STATUS]; DrawTextEllipsised( @@ -623,7 +622,7 @@ private: int32_t viewportFlags{}; if (viewport == nullptr) { - viewportFlags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewportFlags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; } else { @@ -714,7 +713,7 @@ private: ft.Add(axisValue); DrawTextBasic( &dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, - { FontSpriteBase::SMALL, TextAlignment::RIGHT }); + { FontStyle::Small, TextAlignment::RIGHT }); gfx_fill_rect_inset( &dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -787,7 +786,7 @@ private: ft.Add(axisValue); DrawTextBasic( &dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, - { FontSpriteBase::SMALL, TextAlignment::RIGHT }); + { FontStyle::Small, TextAlignment::RIGHT }); gfx_fill_rect_inset( &dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], INSET_RECT_FLAG_BORDER_INSET); @@ -864,14 +863,14 @@ private: widgets[WIDX_PRICE_LABEL].tooltip = STR_NONE; widgets[WIDX_PRICE].tooltip = STR_NONE; - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) { widgets[WIDX_PRICE_LABEL].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; widgets[WIDX_PRICE].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; } // If the entry price is locked at free, disable the widget, unless the unlock_all_prices cheat is active. - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !park_entry_price_unlocked()) + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !ParkEntranceFeeUnlocked()) { widgets[WIDX_PRICE].type = WindowWidgetType::LabelCentred; widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Empty; @@ -899,7 +898,7 @@ private: ft.Add(gTotalIncomeFromAdmissions); DrawTextBasic(&dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); - money64 parkEntranceFee = park_get_entrance_fee(); + money64 parkEntranceFee = ParkGetEntranceFee(); auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PRICE].left + 1, widgets[WIDX_PRICE].top + 1 }; ft = Formatter(); @@ -963,7 +962,7 @@ private: // Draw park size auto parkSize = gParkSize * 10; auto stringIndex = STR_PARK_SIZE_METRIC_LABEL; - if (gConfigGeneral.measurement_format == MeasurementFormat::Imperial) + if (gConfigGeneral.MeasurementFormat == MeasurementFormat::Imperial) { stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL; parkSize = squaredmetres_to_squaredfeet(parkSize); @@ -1203,19 +1202,13 @@ private: void AnchorBorderWidgets() { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); } void SetPressedTab() { - for (auto i = 0; i < 7; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + for (int32_t i = WIDX_TAB_1; i <= WIDX_TAB_7; i++) + pressed_widgets &= ~(1 << i); pressed_widgets |= 1LL << (WIDX_TAB_1 + page); } @@ -1343,8 +1336,8 @@ rct_window* WindowParkObjectiveOpen() if (wnd != nullptr) { wnd->Invalidate(); - wnd->windowPos.x = context_get_width() / 2 - 115; - wnd->windowPos.y = context_get_height() / 2 - 87; + wnd->windowPos.x = ContextGetWidth() / 2 - 115; + wnd->windowPos.y = ContextGetHeight() / 2 - 87; wnd->Invalidate(); } return wnd; diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 0a600b8dc7..c0d5e43ebb 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -55,7 +55,7 @@ public: void OnOpen() override { widgets = PatrolAreaWidgets; - hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); window_push_others_below(*this); gLandToolSize = 4; @@ -176,14 +176,14 @@ public: if (stateChanged) { // Invalidate previous area - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); // Update and invalidate new area gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA = posA; gMapSelectPositionB = posB; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } } @@ -280,7 +280,7 @@ private: std::optional GetBestCoordsFromPos(const ScreenCoordsXY& pos) { - auto coords = footpath_get_coordinates_from_pos(pos, nullptr, nullptr); + auto coords = FootpathGetCoordinatesFromPos(pos, nullptr, nullptr); return coords.IsNull() ? std::nullopt : std::make_optional(coords); } }; @@ -288,7 +288,7 @@ private: rct_window* WindowPatrolAreaOpen(EntityId staffId) { auto w = WindowFocusOrCreate( - WindowClass::PatrolArea, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); + WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); if (w != nullptr) { w->SetStaffId(staffId); diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index e3c8f1e351..a5c76bc83d 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -375,17 +375,11 @@ void WindowPlayerOverviewInvalidate(rct_window* w) w->pressed_widgets &= ~(WIDX_TAB_1); w->pressed_widgets &= ~(WIDX_TAB_2); - w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1); + w->pressed_widgets |= 1uLL << (w->page + WIDX_TAB_1); WindowPlayerUpdateTitle(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; + w->ResizeFrameWithPage(); w->widgets[WIDX_LOCATE].right = w->width - 2; w->widgets[WIDX_LOCATE].left = w->width - 25; w->widgets[WIDX_KICK].right = w->width - 2; @@ -468,17 +462,11 @@ void WindowPlayerStatisticsInvalidate(rct_window* w) w->pressed_widgets &= ~(WIDX_TAB_1); w->pressed_widgets &= ~(WIDX_TAB_2); - w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1); + w->pressed_widgets |= 1uLL << (w->page + WIDX_TAB_1); WindowPlayerUpdateTitle(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; + w->ResizeFrameWithPage(); window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_2); } diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index e723fb070a..5452b06a2d 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include @@ -425,15 +426,12 @@ static void WindowResearchFundingMouseup(rct_window* w, WidgetIndex widgetIndex) */ static void WindowResearchFundingMousedown(rct_window* w, WidgetIndex widgetIndex, rct_widget* widget) { - rct_widget* dropdownWidget; - int32_t i; - if (widgetIndex != WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON) return; - dropdownWidget = widget - 1; + rct_widget* dropdownWidget = widget - 1; - for (i = 0; i < 4; i++) + for (std::size_t i = 0; i < std::size(ResearchFundingLevelNames); i++) { gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[i].Args = ResearchFundingLevelNames[i]; diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 49e20f7774..932ad46643 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -185,7 +185,7 @@ enum { WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN, WIDX_VEHICLE_COLOUR_INDEX, WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN, - WIDX_VEHICLE_BODY_COLOR, + WIDX_VEHICLE_BODY_COLOUR, WIDX_VEHICLE_TRIM_COLOUR, WIDX_VEHICLE_TERNARY_COLOUR, WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX, @@ -398,29 +398,29 @@ static rct_widget *window_ride_page_widgets[] = { static constexpr const uint64_t window_ride_page_hold_down_widgets[] = { 0, - (1ULL << WIDX_VEHICLE_TRAINS_INCREASE) | - (1ULL << WIDX_VEHICLE_TRAINS_DECREASE) | - (1ULL << WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE) | - (1ULL << WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE), - (1ULL << WIDX_MODE_TWEAK_INCREASE) | - (1ULL << WIDX_MODE_TWEAK_DECREASE) | - (1ULL << WIDX_LIFT_HILL_SPEED_INCREASE) | - (1ULL << WIDX_LIFT_HILL_SPEED_DECREASE) | - (1ULL << WIDX_MINIMUM_LENGTH_INCREASE) | - (1ULL << WIDX_MINIMUM_LENGTH_DECREASE) | - (1ULL << WIDX_MAXIMUM_LENGTH_INCREASE) | - (1ULL << WIDX_MAXIMUM_LENGTH_DECREASE) | - (1ULL << WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE) | - (1ULL << WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE), + (1uLL << WIDX_VEHICLE_TRAINS_INCREASE) | + (1uLL << WIDX_VEHICLE_TRAINS_DECREASE) | + (1uLL << WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE) | + (1uLL << WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE), + (1uLL << WIDX_MODE_TWEAK_INCREASE) | + (1uLL << WIDX_MODE_TWEAK_DECREASE) | + (1uLL << WIDX_LIFT_HILL_SPEED_INCREASE) | + (1uLL << WIDX_LIFT_HILL_SPEED_DECREASE) | + (1uLL << WIDX_MINIMUM_LENGTH_INCREASE) | + (1uLL << WIDX_MINIMUM_LENGTH_DECREASE) | + (1uLL << WIDX_MAXIMUM_LENGTH_INCREASE) | + (1uLL << WIDX_MAXIMUM_LENGTH_DECREASE) | + (1uLL << WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE) | + (1uLL << WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE), 0, 0, 0, 0, 0, - (1ULL << WIDX_PRIMARY_PRICE_INCREASE) | - (1ULL << WIDX_PRIMARY_PRICE_DECREASE) | - (1ULL << WIDX_SECONDARY_PRICE_INCREASE) | - (1ULL << WIDX_SECONDARY_PRICE_DECREASE), + (1uLL << WIDX_PRIMARY_PRICE_INCREASE) | + (1uLL << WIDX_PRIMARY_PRICE_DECREASE) | + (1uLL << WIDX_SECONDARY_PRICE_INCREASE) | + (1uLL << WIDX_SECONDARY_PRICE_DECREASE), 0, }; // clang-format on @@ -628,7 +628,7 @@ static WindowEventList window_ride_graphs_events([](auto& events) { events.mouse_down = &WindowRideGraphsMousedown; events.update = &WindowRideGraphsUpdate; events.get_scroll_size = &WindowRideGraphsScrollgetheight; - events.unknown_15 = &WindowRideGraphs15; + events.scroll_select = &WindowRideGraphs15; events.tooltip = &WindowRideGraphsTooltip; events.invalidate = &WindowRideGraphsInvalidate; events.paint = &WindowRideGraphsPaint; @@ -1003,12 +1003,11 @@ static void WindowRideDrawTabCustomer(rct_drawpixelinfo* dpi, rct_window* w) if (w->page == WINDOW_RIDE_PAGE_CUSTOMER) spriteIndex = w->picked_peep_frame & ~3; - spriteIndex += GetPeepAnimation(PeepSpriteType::Normal).base_image; - spriteIndex += 1; - spriteIndex |= 0xA9E00000; + spriteIndex += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1; gfx_draw_sprite( - dpi, ImageId::FromUInt32(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 }); + dpi, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL), + w->windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 }); } } @@ -1044,46 +1043,46 @@ static void WindowRideDisableTabs(rct_window* w) const auto& rtd = ride->GetRideTypeDescriptor(); if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING)) - disabled_tabs |= (1ULL << WIDX_TAB_8); // 0x800 + disabled_tabs |= (1uLL << WIDX_TAB_8); // 0x800 if (ride->type == RIDE_TYPE_MINI_GOLF) - disabled_tabs |= (1ULL << WIDX_TAB_2 | 1ULL << WIDX_TAB_3 | 1ULL << WIDX_TAB_4); // 0xE0 + disabled_tabs |= (1uLL << WIDX_TAB_2 | 1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4); // 0xE0 if (rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) - disabled_tabs |= (1ULL << WIDX_TAB_2); // 0x20 + disabled_tabs |= (1uLL << WIDX_TAB_2); // 0x20 if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)) { - disabled_tabs |= (1ULL << WIDX_TAB_5); // 0x100 + disabled_tabs |= (1uLL << WIDX_TAB_5); // 0x100 } if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) - disabled_tabs |= (1ULL << WIDX_TAB_3 | 1ULL << WIDX_TAB_4 | 1ULL << WIDX_TAB_7); // 0x4C0 + disabled_tabs |= (1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_7); // 0x4C0 if (!rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) { - disabled_tabs |= (1ULL << WIDX_TAB_6); // 0x200 + disabled_tabs |= (1uLL << WIDX_TAB_6); // 0x200 } if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_CASH_MACHINE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_FIRST_AID) || (gParkFlags & PARK_FLAGS_NO_MONEY) != 0) - disabled_tabs |= (1ULL << WIDX_TAB_9); // 0x1000 + disabled_tabs |= (1uLL << WIDX_TAB_9); // 0x1000 if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) != 0) - disabled_tabs |= (1ULL << WIDX_TAB_4 | 1ULL << WIDX_TAB_6 | 1ULL << WIDX_TAB_9 | 1ULL << WIDX_TAB_10); // 0x3280 + disabled_tabs |= (1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_6 | 1uLL << WIDX_TAB_9 | 1uLL << WIDX_TAB_10); // 0x3280 rct_ride_entry* rideEntry = get_ride_entry(ride->subtype); if (rideEntry == nullptr) { - disabled_tabs |= 1ULL << WIDX_TAB_2 | 1ULL << WIDX_TAB_3 | 1ULL << WIDX_TAB_4 | 1ULL << WIDX_TAB_5 | 1ULL << WIDX_TAB_6 - | 1ULL << WIDX_TAB_7 | 1ULL << WIDX_TAB_8 | 1ULL << WIDX_TAB_9 | 1ULL << WIDX_TAB_10; + disabled_tabs |= 1uLL << WIDX_TAB_2 | 1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_5 | 1uLL << WIDX_TAB_6 + | 1uLL << WIDX_TAB_7 | 1uLL << WIDX_TAB_8 | 1uLL << WIDX_TAB_9 | 1uLL << WIDX_TAB_10; } else if ((rideEntry->flags & RIDE_ENTRY_FLAG_DISABLE_COLOUR_TAB) != 0) { - disabled_tabs |= (1ULL << WIDX_TAB_5); + disabled_tabs |= (1uLL << WIDX_TAB_5); } w->disabled_widgets = disabled_tabs; @@ -1094,14 +1093,14 @@ static void WindowRideUpdateOverallView(Ride* ride) // Calculate x, y, z bounds of the entire ride using its track elements tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); CoordsXYZ min = { std::numeric_limits::max(), std::numeric_limits::max(), std::numeric_limits::max() }; CoordsXYZ max = { std::numeric_limits::min(), std::numeric_limits::min(), std::numeric_limits::min() }; - while (tile_element_iterator_next(&it)) + while (TileElementIteratorNext(&it)) { if (it.element->GetType() != TileElementType::Track) continue; @@ -1366,7 +1365,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle) { auto intent = Intent(WindowClass::Peep); intent.putExtra(INTENT_EXTRA_PEEP, peep); - context_open_intent(&intent); + ContextOpenIntent(&intent); openedPeepWindow = 1; break; @@ -1469,13 +1468,7 @@ static void WindowRideSetPressedTab(rct_window* w) static void WindowRideAnchorBorderWidgets(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; + w->ResizeFrameWithPage(); } #pragma region Main @@ -1573,7 +1566,7 @@ static void WindowRideInitViewport(rct_window* w) viewport_flags = w->viewport->flags; w->RemoveViewport(); } - else if (gConfigGeneral.always_show_gridlines) + else if (gConfigGeneral.AlwaysShowGridlines) { viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } @@ -1658,7 +1651,7 @@ static void WindowRideMainMouseup(rct_window* w, WidgetIndex widgetIndex) WindowRideRename(w); break; case WIDX_DEMOLISH: - context_open_detail_window(WD_DEMOLISH_RIDE, w->number); + ContextOpenDetailWindow(WD_DEMOLISH_RIDE, w->number); break; case WIDX_CLOSE_LIGHT: case WIDX_SIMULATE_LIGHT: @@ -2074,9 +2067,10 @@ static void WindowRideShowVehicleTypeDropdown(rct_window* w, rct_widget* widget) } rct_widget* dropdownWidget = widget - 1; + auto width = WindowDropDownHasMultipleColumns(numItems) ? dropdownWidget->width() - 24 : dropdownWidget->width(); WindowDropdownShowTextCustomWidth( { w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - w->colours[1], 0, Dropdown::Flag::StayOpen, numItems, widget->right - dropdownWidget->left); + w->colours[1], 0, Dropdown::Flag::StayOpen, numItems, width); // Find the current vehicle type in the ordered list. int32_t pos = 0; @@ -2301,9 +2295,9 @@ static void WindowRideMainInvalidate(rct_window* w) if (ride == nullptr) return; - w->disabled_widgets &= ~((1ULL << WIDX_DEMOLISH) | (1ULL << WIDX_CONSTRUCTION)); + w->disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK)) - w->disabled_widgets |= (1ULL << WIDX_DEMOLISH); + w->disabled_widgets |= (1uLL << WIDX_DEMOLISH); auto ft = Formatter::Common(); ride->FormatNameTo(ft); @@ -2682,8 +2676,7 @@ static void WindowRideVehicleMousedown(rct_window* w, WidgetIndex widgetIndex, r ride->SetNumCarsPerVehicle(ride->num_cars_per_train + 1); break; case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: - rct_ride_entry* rideEntry = ride->GetRideEntry(); - if (ride->num_cars_per_train > rideEntry->zero_cars + 1) + if (ride->num_cars_per_train > 1) ride->SetNumCarsPerVehicle(ride->num_cars_per_train - 1); break; } @@ -2855,13 +2848,13 @@ static void WindowRideVehicleInvalidate(rct_window* w) WindowRideAnchorBorderWidgets(w); window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); - if (ride->num_cars_per_train > (rideEntry->zero_cars + 1)) + if (abs(ride->num_cars_per_train - rideEntry->zero_cars) == 1) { - window_ride_vehicle_widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_X_CARS_PER_TRAIN; + window_ride_vehicle_widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_1_CAR_PER_TRAIN; } else { - window_ride_vehicle_widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_1_CAR_PER_TRAIN; + window_ride_vehicle_widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_X_CARS_PER_TRAIN; } } @@ -2896,40 +2889,43 @@ static void WindowRideVehiclePaint(rct_window* w, rct_drawpixelinfo* dpi) DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); // Excitement Factor - if (rideEntry->excitement_multiplier > 0) + if (rideEntry->excitement_multiplier != 0) { screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(rideEntry->excitement_multiplier); - DrawTextBasic(dpi, screenCoords, STR_EXCITEMENT_FACTOR, ft); + ft.Add(abs(rideEntry->excitement_multiplier)); + StringId stringId = rideEntry->excitement_multiplier > 0 ? STR_EXCITEMENT_FACTOR : STR_EXCITEMENT_FACTOR_NEGATIVE; + DrawTextBasic(dpi, screenCoords, stringId, ft); } // Intensity Factor - if (rideEntry->intensity_multiplier > 0) + if (rideEntry->intensity_multiplier != 0) { - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + int32_t lineHeight = font_get_line_height(FontStyle::Medium); if (lineHeight != 10) screenCoords.x += 150; else screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(rideEntry->intensity_multiplier); - DrawTextBasic(dpi, screenCoords, STR_INTENSITY_FACTOR, ft); + ft.Add(abs(rideEntry->intensity_multiplier)); + StringId stringId = rideEntry->intensity_multiplier > 0 ? STR_INTENSITY_FACTOR : STR_INTENSITY_FACTOR_NEGATIVE; + DrawTextBasic(dpi, screenCoords, stringId, ft); if (lineHeight != 10) screenCoords.x -= 150; } // Nausea Factor - if (rideEntry->nausea_multiplier > 0) + if (rideEntry->nausea_multiplier != 0) { screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(rideEntry->nausea_multiplier); - DrawTextBasic(dpi, screenCoords, STR_NAUSEA_FACTOR, ft); + ft.Add(abs(rideEntry->nausea_multiplier)); + StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE; + DrawTextBasic(dpi, screenCoords, stringId, ft); } } @@ -3098,7 +3094,7 @@ static void WindowRideModeDropdown(rct_window* w, rct_widget* widget) auto checkedIndex = -1; for (auto i = 0; i < static_cast(RideMode::Count); i++) { - if (availableModes & (1ULL << i)) + if (availableModes & (1uLL << i)) { gDropdownItems[numAvailableModes].Format = STR_DROPDOWN_MENU_LABEL; gDropdownItems[numAvailableModes].Args = RideModeNames[i]; @@ -3482,9 +3478,9 @@ static void WindowRideOperatingInvalidate(rct_window* w) // Widget setup w->pressed_widgets &= ~( - (1ULL << WIDX_LOAD_CHECKBOX) | (1ULL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX) - | (1ULL << WIDX_MINIMUM_LENGTH_CHECKBOX) | (1ULL << WIDX_MAXIMUM_LENGTH_CHECKBOX) - | (1ULL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX)); + (1uLL << WIDX_LOAD_CHECKBOX) | (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX) + | (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX) | (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX) + | (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX)); // Sometimes, only one of the alternatives support lift hill pieces. Make sure to check both. bool hasAlternativeType = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE); @@ -3588,7 +3584,7 @@ static void WindowRideOperatingInvalidate(rct_window* w) ft.Add(ride->max_waiting_time); if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD) - w->pressed_widgets |= (1ULL << WIDX_LOAD_CHECKBOX); + w->pressed_widgets |= (1uLL << WIDX_LOAD_CHECKBOX); } else { @@ -3608,13 +3604,13 @@ static void WindowRideOperatingInvalidate(rct_window* w) } if (ride->depart_flags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) - w->pressed_widgets |= (1ULL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); + w->pressed_widgets |= (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) - w->pressed_widgets |= (1ULL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); + w->pressed_widgets |= (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) - w->pressed_widgets |= (1ULL << WIDX_MINIMUM_LENGTH_CHECKBOX); + w->pressed_widgets |= (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX); if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) - w->pressed_widgets |= (1ULL << WIDX_MAXIMUM_LENGTH_CHECKBOX); + w->pressed_widgets |= (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX); // Mode specific functionality auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; @@ -3685,7 +3681,7 @@ static void WindowRideOperatingInvalidate(rct_window* w) window_ride_operating_widgets[WIDX_MODE_TWEAK].text = format; window_ride_operating_widgets[WIDX_MODE_TWEAK_INCREASE].type = WindowWidgetType::Button; window_ride_operating_widgets[WIDX_MODE_TWEAK_DECREASE].type = WindowWidgetType::Button; - w->pressed_widgets &= ~(1ULL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); + w->pressed_widgets &= ~(1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); } else { @@ -3752,12 +3748,12 @@ static void WindowRideLocateMechanic(rct_window* w) mechanic = ride_find_closest_mechanic(ride, 1); if (mechanic == nullptr) - context_show_error(STR_UNABLE_TO_LOCATE_MECHANIC, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, STR_NONE, {}); else { auto intent = Intent(WindowClass::Peep); intent.putExtra(INTENT_EXTRA_PEEP, mechanic); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } @@ -3810,7 +3806,7 @@ static void WindowRideMaintenanceMouseup(rct_window* w, WidgetIndex widgetIndex) WindowRideLocateMechanic(w); break; case WIDX_REFURBISH_RIDE: - context_open_detail_window(WD_REFURBISH_RIDE, w->number); + ContextOpenDetailWindow(WD_REFURBISH_RIDE, w->number); break; } } @@ -3883,7 +3879,7 @@ static void WindowRideMaintenanceMousedown(rct_window* w, WidgetIndex widgetInde } if (num_items == 1) { - context_show_error(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, STR_NONE, {}); + ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, STR_NONE, {}); } else { @@ -3993,11 +3989,11 @@ static void WindowRideMaintenanceDropdown(rct_window* w, WidgetIndex widgetIndex if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) { - context_show_error(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_ALREADY_BROKEN, {}); + ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_ALREADY_BROKEN, {}); } else if (ride->status == RideStatus::Closed) { - context_show_error(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_IS_CLOSED, {}); + ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_IS_CLOSED, {}); } else { @@ -4075,7 +4071,7 @@ static void WindowRideMaintenanceInvalidate(rct_window* w) WindowRideAnchorBorderWidgets(w); window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10); - if (gConfigGeneral.debugging_tools && network_get_mode() == NETWORK_MODE_NONE) + if (gConfigGeneral.DebuggingTools && network_get_mode() == NETWORK_MODE_NONE) { window_ride_maintenance_widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::FlatBtn; } @@ -4086,12 +4082,12 @@ static void WindowRideMaintenanceInvalidate(rct_window* w) if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0 || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) { - w->disabled_widgets |= (1ULL << WIDX_REFURBISH_RIDE); + w->disabled_widgets |= (1uLL << WIDX_REFURBISH_RIDE); window_ride_maintenance_widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED; } else { - w->disabled_widgets &= ~(1ULL << WIDX_REFURBISH_RIDE); + w->disabled_widgets &= ~(1uLL << WIDX_REFURBISH_RIDE); window_ride_maintenance_widgets[WIDX_REFURBISH_RIDE].tooltip = STR_REFURBISH_RIDE_TIP; } } @@ -4218,11 +4214,6 @@ static void WindowRideMaintenancePaint(rct_window* w, rct_drawpixelinfo* dpi) #pragma region Colour -static uint32_t WindowRideGetColourButtonImage(int32_t colour) -{ - return IMAGE_TYPE_TRANSPARENT | SPRITE_ID_PALETTE_COLOUR_1(colour) | SPR_PALETTE_BTN; -} - static int32_t WindowRideHasTrackColour(Ride* ride, int32_t trackColour) { // Get station flags (shops don't have them) @@ -4457,7 +4448,7 @@ static void WindowRideColourMousedown(rct_window* w, WidgetIndex widgetIndex, rc Dropdown::SetChecked(w->vehicleIndex, true); break; - case WIDX_VEHICLE_BODY_COLOR: + case WIDX_VEHICLE_BODY_COLOUR: vehicleColour = ride_get_vehicle_colour(ride, w->vehicleIndex); WindowDropdownShowColour(w, widget, w->colours[1], vehicleColour.Body); break; @@ -4554,7 +4545,7 @@ static void WindowRideColourDropdown(rct_window* w, WidgetIndex widgetIndex, int w->vehicleIndex = dropdownIndex; w->Invalidate(); break; - case WIDX_VEHICLE_BODY_COLOR: + case WIDX_VEHICLE_BODY_COLOUR: { auto rideSetAppearanceAction = RideSetAppearanceAction( rideId, RideSetAppearanceType::VehicleColourBody, dropdownIndex, w->vehicleIndex); @@ -4676,7 +4667,7 @@ static void WindowRideColourInvalidate(rct_window* w) if (WindowRideHasTrackColour(ride, 0)) { window_ride_colour_widgets[WIDX_TRACK_MAIN_COLOUR].type = WindowWidgetType::ColourBtn; - window_ride_colour_widgets[WIDX_TRACK_MAIN_COLOUR].image = WindowRideGetColourButtonImage(trackColour.main); + window_ride_colour_widgets[WIDX_TRACK_MAIN_COLOUR].image = GetColourButtonImage(trackColour.main).ToUInt32(); } else { @@ -4687,7 +4678,8 @@ static void WindowRideColourInvalidate(rct_window* w) if (WindowRideHasTrackColour(ride, 1)) { window_ride_colour_widgets[WIDX_TRACK_ADDITIONAL_COLOUR].type = WindowWidgetType::ColourBtn; - window_ride_colour_widgets[WIDX_TRACK_ADDITIONAL_COLOUR].image = WindowRideGetColourButtonImage(trackColour.additional); + window_ride_colour_widgets[WIDX_TRACK_ADDITIONAL_COLOUR].image = GetColourButtonImage(trackColour.additional) + .ToUInt32(); } else { @@ -4700,11 +4692,11 @@ static void WindowRideColourInvalidate(rct_window* w) window_ride_colour_widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WindowWidgetType::Checkbox; if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) { - w->pressed_widgets |= (1ULL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); + w->pressed_widgets |= (1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } else { - w->pressed_widgets &= ~(1ULL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); + w->pressed_widgets &= ~(1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } } else @@ -4716,7 +4708,7 @@ static void WindowRideColourInvalidate(rct_window* w) if (WindowRideHasTrackColour(ride, 2) && ride->type != RIDE_TYPE_MAZE) { window_ride_colour_widgets[WIDX_TRACK_SUPPORT_COLOUR].type = WindowWidgetType::ColourBtn; - window_ride_colour_widgets[WIDX_TRACK_SUPPORT_COLOUR].image = WindowRideGetColourButtonImage(trackColour.supports); + window_ride_colour_widgets[WIDX_TRACK_SUPPORT_COLOUR].image = GetColourButtonImage(trackColour.supports).ToUInt32(); } else { @@ -4764,8 +4756,8 @@ static void WindowRideColourInvalidate(rct_window* w) vehicleColour = ride_get_vehicle_colour(ride, w->vehicleIndex); window_ride_colour_widgets[WIDX_VEHICLE_PREVIEW].type = WindowWidgetType::Scroll; - window_ride_colour_widgets[WIDX_VEHICLE_BODY_COLOR].type = WindowWidgetType::ColourBtn; - window_ride_colour_widgets[WIDX_VEHICLE_BODY_COLOR].image = WindowRideGetColourButtonImage(vehicleColour.Body); + window_ride_colour_widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::ColourBtn; + window_ride_colour_widgets[WIDX_VEHICLE_BODY_COLOUR].image = GetColourButtonImage(vehicleColour.Body).ToUInt32(); bool allowChangingTrimColour = false; bool allowChangingTernaryColour = false; @@ -4788,12 +4780,12 @@ static void WindowRideColourInvalidate(rct_window* w) if (allowChangingTrimColour) { window_ride_colour_widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::ColourBtn; - window_ride_colour_widgets[WIDX_VEHICLE_TRIM_COLOUR].image = WindowRideGetColourButtonImage(vehicleColour.Trim); + window_ride_colour_widgets[WIDX_VEHICLE_TRIM_COLOUR].image = GetColourButtonImage(vehicleColour.Trim).ToUInt32(); if (allowChangingTernaryColour) { window_ride_colour_widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::ColourBtn; - window_ride_colour_widgets[WIDX_VEHICLE_TERNARY_COLOUR].image = WindowRideGetColourButtonImage( - vehicleColour.Tertiary); + window_ride_colour_widgets[WIDX_VEHICLE_TERNARY_COLOUR].image = GetColourButtonImage(vehicleColour.Tertiary) + .ToUInt32(); } else { @@ -4847,7 +4839,7 @@ static void WindowRideColourInvalidate(rct_window* w) window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::Empty; window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Empty; - window_ride_colour_widgets[WIDX_VEHICLE_BODY_COLOR].type = WindowWidgetType::Empty; + window_ride_colour_widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::Empty; window_ride_colour_widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::Empty; window_ride_colour_widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; } @@ -5227,15 +5219,15 @@ static void WindowRideMusicInvalidate(rct_window* w) auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; if (isMusicActivated) { - w->pressed_widgets |= (1ULL << WIDX_PLAY_MUSIC); - w->disabled_widgets &= ~(1ULL << WIDX_MUSIC); - w->disabled_widgets &= ~(1ULL << WIDX_MUSIC_DROPDOWN); + w->pressed_widgets |= (1uLL << WIDX_PLAY_MUSIC); + w->disabled_widgets &= ~(1uLL << WIDX_MUSIC); + w->disabled_widgets &= ~(1uLL << WIDX_MUSIC_DROPDOWN); } else { - w->pressed_widgets &= ~(1ULL << WIDX_PLAY_MUSIC); - w->disabled_widgets |= (1ULL << WIDX_MUSIC); - w->disabled_widgets |= (1ULL << WIDX_MUSIC_DROPDOWN); + w->pressed_widgets &= ~(1uLL << WIDX_PLAY_MUSIC); + w->disabled_widgets |= (1uLL << WIDX_MUSIC); + w->disabled_widgets |= (1uLL << WIDX_MUSIC_DROPDOWN); } WindowRideAnchorBorderWidgets(w); @@ -5372,7 +5364,7 @@ static void WindowRideMeasurementsDesignSave(rct_window* w) auto errMessage = _trackDesign->CreateTrackDesignScenery(tds); if (errMessage != STR_NONE) { - context_show_error(STR_CANT_SAVE_TRACK_DESIGN, errMessage, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, errMessage, {}); return; } } @@ -5384,7 +5376,7 @@ static void WindowRideMeasurementsDesignSave(rct_window* w) intent.putExtra(INTENT_EXTRA_PATH, trackName); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(&TrackDesignCallback)); - context_open_intent(&intent); + ContextOpenIntent(&intent); } /** @@ -5603,12 +5595,12 @@ static void WindowRideMeasurementsInvalidate(rct_window* w) window_ride_measurements_widgets[WIDX_CANCEL_DESIGN].type = WindowWidgetType::Empty; window_ride_measurements_widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::FlatBtn; - w->disabled_widgets |= (1ULL << WIDX_SAVE_TRACK_DESIGN); + w->disabled_widgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) { if (ride->excitement != RIDE_RATING_UNDEFINED) { - w->disabled_widgets &= ~(1ULL << WIDX_SAVE_TRACK_DESIGN); + w->disabled_widgets &= ~(1uLL << WIDX_SAVE_TRACK_DESIGN); window_ride_measurements_widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN; } } @@ -6066,10 +6058,10 @@ static void WindowRideGraphsInvalidate(rct_window* w) ride->FormatNameTo(ft); // Set pressed graph button type - w->pressed_widgets &= ~(1ULL << WIDX_GRAPH_VELOCITY); - w->pressed_widgets &= ~(1ULL << WIDX_GRAPH_ALTITUDE); - w->pressed_widgets &= ~(1ULL << WIDX_GRAPH_VERTICAL); - w->pressed_widgets &= ~(1ULL << WIDX_GRAPH_LATERAL); + w->pressed_widgets &= ~(1uLL << WIDX_GRAPH_VELOCITY); + w->pressed_widgets &= ~(1uLL << WIDX_GRAPH_ALTITUDE); + w->pressed_widgets &= ~(1uLL << WIDX_GRAPH_VERTICAL); + w->pressed_widgets &= ~(1uLL << WIDX_GRAPH_LATERAL); w->pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + (w->list_information_type & 0xFF))); // Hide graph buttons that are not applicable @@ -6188,7 +6180,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i auto ft = Formatter(); ft.Add(scaled_yUnit); - DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontSpriteBase::SMALL }); + DrawTextBasic(dpi, { w->scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small }); } // Time marks @@ -6198,7 +6190,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i auto ft = Formatter(); ft.Add(time); if (x + 80 >= dpi->x) - DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontSpriteBase::SMALL }); + DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small }); time += 5; } @@ -6448,7 +6440,7 @@ static bool WindowRideIncomeCanModifyPrimaryPrice(rct_window* w) auto rideEntry = ride->GetRideEntry(); const auto& rtd = ride->GetRideTypeDescriptor(); - return park_ride_prices_unlocked() || rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) + return ParkRidePricesUnlocked() || rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::None); } @@ -6640,17 +6632,17 @@ static void WindowRideIncomeInvalidate(rct_window* w) return; // Primary item - w->pressed_widgets &= ~(1ULL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); - w->disabled_widgets &= ~(1ULL << WIDX_PRIMARY_PRICE); + w->pressed_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); + w->disabled_widgets &= ~(1uLL << WIDX_PRIMARY_PRICE); window_ride_income_widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_NONE; window_ride_income_widgets[WIDX_PRIMARY_PRICE].tooltip = STR_NONE; // If ride prices are locked, do not allow setting the price, unless we're dealing with a shop or toilet. const auto& rtd = ride->GetRideTypeDescriptor(); - if (!park_ride_prices_unlocked() && rideEntry->shop_item[0] == ShopItem::None && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) + if (!ParkRidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) { - w->disabled_widgets |= (1ULL << WIDX_PRIMARY_PRICE); + w->disabled_widgets |= (1uLL << WIDX_PRIMARY_PRICE); window_ride_income_widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; window_ride_income_widgets[WIDX_PRIMARY_PRICE].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; } @@ -6672,7 +6664,7 @@ static void WindowRideIncomeInvalidate(rct_window* w) window_ride_income_widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Checkbox; if (shop_item_has_common_price(primaryItem)) - w->pressed_widgets |= (1ULL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); + w->pressed_widgets |= (1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); window_ride_income_widgets[WIDX_PRIMARY_PRICE_LABEL].text = GetShopItemDescriptor(primaryItem).Naming.PriceLabel; } @@ -6700,9 +6692,9 @@ static void WindowRideIncomeInvalidate(rct_window* w) else { // Set same price throughout park checkbox - w->pressed_widgets &= ~(1ULL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); + w->pressed_widgets &= ~(1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); if (shop_item_has_common_price(secondaryItem)) - w->pressed_widgets |= (1ULL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); + w->pressed_widgets |= (1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); // Show widgets window_ride_income_widgets[WIDX_SECONDARY_PRICE_LABEL].type = WindowWidgetType::Label; @@ -6860,7 +6852,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex) auto intent = Intent(WindowClass::GuestList); intent.putExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsThinkingAboutRide)); intent.putExtra(INTENT_EXTRA_RIDE_ID, w->number); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case WIDX_SHOW_GUESTS_ON_RIDE: @@ -6868,7 +6860,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex) auto intent = Intent(WindowClass::GuestList); intent.putExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsOnRide)); intent.putExtra(INTENT_EXTRA_RIDE_ID, w->number); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case WIDX_SHOW_GUESTS_QUEUING: @@ -6876,7 +6868,7 @@ static void WindowRideCustomerMouseup(rct_window* w, WidgetIndex widgetIndex) auto intent = Intent(WindowClass::GuestList); intent.putExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsInQueue)); intent.putExtra(INTENT_EXTRA_RIDE_ID, w->number); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 9765965b88..4f98dcfb4a 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -249,7 +249,7 @@ public: ride_construction_invalidate_current_track(); viewport_set_visibility(0); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -272,7 +272,7 @@ public: if (ride_try_get_origin_element(currentRide, nullptr)) { // Auto open shops if required. - if (currentRide->mode == RideMode::ShopStall && gConfigGeneral.auto_open_shops) + if (currentRide->mode == RideMode::ShopStall && gConfigGeneral.AutoOpenShops) { // HACK: Until we find a good a way to defer the game command for opening the shop, stop this // from getting stuck in an infinite loop as opening the currentRide will try to close this window @@ -288,7 +288,7 @@ public: currentRide->SetToDefaultInspectionInterval(); auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); - context_open_intent(&intent); + ContextOpenIntent(&intent); } else { @@ -316,24 +316,24 @@ public: if (_currentTrackCurve & RideConstructionSpecialPieceSelected) { - disabledWidgets |= (1ULL << WIDX_SLOPE_GROUPBOX) | (1ULL << WIDX_BANKING_GROUPBOX) | (1ULL << WIDX_SLOPE_DOWN_STEEP) - | (1ULL << WIDX_SLOPE_DOWN) | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP) - | (1ULL << WIDX_CHAIN_LIFT) | (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_STRAIGHT) - | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_SLOPE_DOWN_STEEP) + | (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP) + | (1uLL << WIDX_CHAIN_LIFT) | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) + | (1uLL << WIDX_BANK_RIGHT); } // Disable large curves if the start or end of the track is sloped. if (_previousTrackSlopeEnd != TRACK_SLOPE_NONE || _currentTrackSlopeEnd != TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); } if (IsTrackEnabled(TRACK_SLOPE_CURVE) && IsTrackEnabled(TRACK_CURVE_VERY_SMALL)) { // Disable small curves if the start or end of the track is sloped. if (_previousTrackSlopeEnd != TRACK_SLOPE_NONE || _currentTrackSlopeEnd != TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_RIGHT_CURVE) - | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); } } if (!IsTrackEnabled(TRACK_SLOPE_CURVE)) @@ -345,9 +345,9 @@ public: { if (_previousTrackSlopeEnd != TRACK_SLOPE_DOWN_90 || _currentTrackSlopeEnd != TRACK_SLOPE_DOWN_90) { - 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); + 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); } } } @@ -356,31 +356,31 @@ public: // Disable all curves on sloped track if (_previousTrackSlopeEnd != TRACK_SLOPE_NONE || _currentTrackSlopeEnd != TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE_SMALL) - | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL) - | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL); + 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 (!IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) { // Disable banking - disabledWidgets |= (1ULL << WIDX_BANKING_GROUPBOX) | (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_STRAIGHT) - | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) + | (1uLL << WIDX_BANK_RIGHT); } // Disable banking if the start track is steep and the end of the track becomes flat. if ((_previousTrackSlopeEnd == TRACK_SLOPE_DOWN_60 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_60) && _currentTrackSlopeEnd == TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } if (!IsTrackEnabled(TRACK_SLOPE) && !IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN) && !IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) { if (!currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) { // Disable all slopes - disabledWidgets |= (1ULL << WIDX_SLOPE_GROUPBOX) | (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_DOWN) - | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN) + | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); } } if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) @@ -389,16 +389,16 @@ public: // Disable lift hill toggle and banking if current track piece is uphill if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_25 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_60 || _currentTrackSlopeEnd == TRACK_SLOPE_UP_25 || _currentTrackSlopeEnd == TRACK_SLOPE_UP_60) - disabledWidgets |= 1ULL << WIDX_CHAIN_LIFT | (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= 1uLL << WIDX_CHAIN_LIFT | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); // Disable upward slope if current track piece is not flat if ((_previousTrackSlopeEnd != TRACK_SLOPE_NONE || _previousTrackBankEnd != TRACK_BANK_NONE) && !(_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED)) - disabledWidgets |= (1ULL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP); } if (_rideConstructionState == RideConstructionState::State0) { - disabledWidgets |= (1ULL << WIDX_CONSTRUCT) | (1ULL << WIDX_DEMOLISH) | (1ULL << WIDX_PREVIOUS_SECTION) - | (1ULL << WIDX_NEXT_SECTION); + disabledWidgets |= (1uLL << WIDX_CONSTRUCT) | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) + | (1uLL << WIDX_NEXT_SECTION); } switch (_currentTrackCurve) { @@ -406,28 +406,28 @@ public: case TRACK_CURVE_LEFT_SMALL: case TRACK_CURVE_LEFT: case TRACK_CURVE_LEFT_LARGE: - disabledWidgets |= (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_RIGHT); if (_previousTrackBankEnd == TRACK_BANK_NONE) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT); } else { - disabledWidgets |= (1ULL << WIDX_BANK_STRAIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT); } break; case TRACK_CURVE_RIGHT_LARGE: case TRACK_CURVE_RIGHT: case TRACK_CURVE_RIGHT_SMALL: case TRACK_CURVE_RIGHT_VERY_SMALL: - disabledWidgets |= (1ULL << WIDX_BANK_LEFT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT); if (_previousTrackBankEnd == TRACK_BANK_NONE) { - disabledWidgets |= (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_RIGHT); } else { - disabledWidgets |= (1ULL << WIDX_BANK_STRAIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT); } break; } @@ -435,7 +435,7 @@ public: { if (_currentTrackBankEnd != TRACK_BANK_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN) | (1ULL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); } } if (_previousTrackSlopeEnd == _currentTrackSlopeEnd) @@ -444,20 +444,20 @@ public: { case TRACK_SLOPE_UP_60: case TRACK_SLOPE_DOWN_60: - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE) - | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); if (!IsTrackEnabled(TRACK_SLOPE_CURVE_STEEP)) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_SMALL); } break; case TRACK_SLOPE_UP_90: case TRACK_SLOPE_DOWN_90: - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE) - | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); if (!IsTrackEnabled(TRACK_CURVE_VERTICAL)) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_SMALL); } break; } @@ -465,9 +465,9 @@ public: else { // Disable all curves - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE_SMALL) - | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL) - | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); } switch (_previousTrackSlopeEnd) @@ -476,72 +476,72 @@ public: if (_currentTrackCurve != TRACK_CURVE_NONE || (IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) && TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); } break; case TRACK_SLOPE_DOWN_25: - disabledWidgets |= (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); break; case TRACK_SLOPE_DOWN_60: - disabledWidgets |= (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); if (!IsTrackEnabled(TRACK_SLOPE_LONG) && !(IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) && !TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) { - disabledWidgets |= (1ULL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_LEVEL); } break; case TRACK_SLOPE_UP_25: - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_DOWN); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN); break; case TRACK_SLOPE_UP_60: - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_DOWN); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN); if (!IsTrackEnabled(TRACK_SLOPE_LONG) && !(IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) && !TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) { - disabledWidgets |= (1ULL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_LEVEL); } break; case TRACK_SLOPE_DOWN_90: case TRACK_SLOPE_UP_90: - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN) | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP); break; } if (_previousTrackSlopeEnd == TRACK_SLOPE_NONE) { if (!IsTrackEnabled(TRACK_SLOPE_LONG) && !IsTrackEnabled(TRACK_SLOPE_STEEP_LONG)) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); } } if (IsTrackEnabled(TRACK_SLOPE_VERTICAL)) { if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_60 && _currentTrackPieceDirection < 4) { - disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); } if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_90) { - disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); } if (_previousTrackSlopeEnd == TRACK_SLOPE_DOWN_60 && _currentTrackPieceDirection < 4) { - disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); } } if (_previousTrackBankEnd == TRACK_BANK_LEFT) { - disabledWidgets |= (1ULL << WIDX_RIGHT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_LARGE) - | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_LARGE) + | (1uLL << WIDX_BANK_RIGHT); } if (_previousTrackBankEnd == TRACK_BANK_RIGHT) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_LEFT_CURVE_LARGE) - | (1ULL << WIDX_BANK_LEFT); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) + | (1uLL << WIDX_BANK_LEFT); } if (_currentTrackBankEnd != _previousTrackBankEnd) { - disabledWidgets |= (1ULL << WIDX_RIGHT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_LARGE) - | (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_LEFT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_LARGE) + | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE); } if (_currentTrackSlopeEnd != TRACK_SLOPE_NONE) { @@ -551,194 +551,194 @@ public: { if (_currentTrackSlopeEnd != TRACK_SLOPE_UP_25 && _currentTrackSlopeEnd != TRACK_SLOPE_DOWN_25) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } } else { if (_currentTrackSlopeEnd != _previousTrackSlopeEnd) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } else { if (_currentTrackSlopeEnd != TRACK_SLOPE_UP_25 && _currentTrackSlopeEnd != TRACK_SLOPE_DOWN_25) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } } } } else { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } } if (_currentTrackBankEnd != TRACK_BANK_NONE || _previousTrackBankEnd != TRACK_BANK_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_UP_STEEP) | (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT); } if (_currentTrackCurve != TRACK_CURVE_NONE) { if (!IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) { - disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } if (_currentTrackSlopeEnd == TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } if (_currentTrackSlopeEnd == TRACK_SLOPE_UP_60) { - disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } if (_currentTrackSlopeEnd == TRACK_SLOPE_DOWN_60) { - disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } } if (_currentTrackSlopeEnd == TRACK_SLOPE_UP_90 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_90) { - disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } if (!IsTrackEnabled(TRACK_LIFT_HILL_STEEP)) { if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_60 || _currentTrackSlopeEnd == TRACK_SLOPE_UP_60) { - disabledWidgets |= (1ULL << WIDX_CHAIN_LIFT); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } } if (_previousTrackBankEnd == TRACK_BANK_UPSIDE_DOWN) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_LEFT_CURVE_LARGE) - | (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE) - | (1ULL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) + | (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_LARGE); } if (_currentTrackCurve != TRACK_CURVE_NONE) { if (_currentTrackSlopeEnd == TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN) | (1ULL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); } if (_currentTrackSlopeEnd == _previousTrackSlopeEnd) { if (_currentTrackSlopeEnd == TRACK_SLOPE_UP_25) { - disabledWidgets |= (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); if (_currentTrackCurve == TRACK_CURVE_LEFT || _currentTrackCurve == TRACK_CURVE_RIGHT || _rideConstructionState != RideConstructionState::Back || !IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) { - disabledWidgets |= (1ULL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_LEVEL); } } if (_currentTrackSlopeEnd == TRACK_SLOPE_DOWN_25) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP); if (_currentTrackCurve == TRACK_CURVE_LEFT || _currentTrackCurve == TRACK_CURVE_RIGHT || _rideConstructionState != RideConstructionState::Front || !IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) { - disabledWidgets |= (1ULL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_LEVEL); } } } else if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); if (_currentTrackBankEnd == TRACK_BANK_LEFT) { - disabledWidgets |= (1ULL << WIDX_BANK_STRAIGHT) | (1ULL << WIDX_BANK_RIGHT); - disabledWidgets &= ~(1ULL << WIDX_BANK_LEFT); + disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_LEFT); } if (_currentTrackBankEnd == TRACK_BANK_RIGHT) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_STRAIGHT); - disabledWidgets &= ~(1ULL << WIDX_BANK_RIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_RIGHT); } if (_currentTrackBankEnd == TRACK_BANK_NONE) { - disabledWidgets |= (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_RIGHT); - disabledWidgets &= ~(1ULL << WIDX_BANK_STRAIGHT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_STRAIGHT); } if (_currentTrackSlopeEnd == TRACK_SLOPE_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN) | (1ULL << WIDX_SLOPE_UP); - disabledWidgets &= ~(1ULL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); + disabledWidgets &= ~(1uLL << WIDX_LEVEL); } if (_currentTrackSlopeEnd == TRACK_SLOPE_UP_25) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN) | (1ULL << WIDX_LEVEL); - disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); } if (_currentTrackSlopeEnd == TRACK_SLOPE_DOWN_25) { - disabledWidgets |= (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP); - disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN); + disabledWidgets |= (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN); } if (_currentTrackCurve == TRACK_CURVE_LEFT_SMALL) { - disabledWidgets &= ~(1ULL << WIDX_LEFT_CURVE_SMALL); + disabledWidgets &= ~(1uLL << WIDX_LEFT_CURVE_SMALL); } if (_currentTrackCurve == TRACK_CURVE_RIGHT_SMALL) { - disabledWidgets &= ~(1ULL << WIDX_RIGHT_CURVE_SMALL); + disabledWidgets &= ~(1uLL << WIDX_RIGHT_CURVE_SMALL); } } } if (_currentTrackCurve != TRACK_CURVE_NONE && _currentTrackSlopeEnd == TRACK_SLOPE_UP_60) { - disabledWidgets |= (1ULL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP); } if (_currentTrackCurve != TRACK_CURVE_NONE && _currentTrackSlopeEnd == TRACK_SLOPE_DOWN_60) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN); } if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !gCheatsEnableChainLiftOnAllTrack) { if (_currentTrackSlopeEnd != TRACK_SLOPE_NONE && !IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_LEFT_CURVE_LARGE) - | (1ULL << WIDX_RIGHT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) + | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); } if (!IsTrackEnabled(TRACK_LIFT_HILL_STEEP)) { if (widgets[WIDX_SLOPE_UP_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP) { - disabledWidgets |= (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); } } } if (_previousTrackSlopeEnd == TRACK_SLOPE_UP_60 && _currentTrackCurve != TRACK_CURVE_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_LEVEL); } if (_previousTrackSlopeEnd == TRACK_SLOPE_DOWN_60 && _currentTrackCurve != TRACK_CURVE_NONE) { - disabledWidgets |= (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP_STEEP); } if (_currentTrackSlopeEnd == TRACK_SLOPE_UP_90 || _previousTrackSlopeEnd == TRACK_SLOPE_UP_90) { if (_currentTrackCurve != TRACK_CURVE_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); } - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) { - disabledWidgets |= (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL) - | (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE); + disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); } } else if (_currentTrackSlopeEnd == TRACK_SLOPE_DOWN_90 || _previousTrackSlopeEnd == TRACK_SLOPE_DOWN_90) { if (_currentTrackCurve != TRACK_CURVE_NONE) { - disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP); } - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) { - disabledWidgets |= (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL) - | (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE); + disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); } } if (IsTrackEnabled(TRACK_HELIX_LARGE_UNBANKED)) @@ -749,8 +749,8 @@ public: { if (_currentTrackSlopeEnd == _previousTrackSlopeEnd) { - disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN_STEEP); - disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); } } } @@ -766,10 +766,10 @@ public: if (_previousTrackSlopeEnd == _currentTrackSlopeEnd) { // Enable helix - disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); if (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) || gCheatsEnableAllDrawableTrackPieces) - disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP_STEEP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); } } if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) @@ -782,7 +782,7 @@ public: && (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) || gCheatsEnableAllDrawableTrackPieces)) { - disabledWidgets &= ~(1ULL << WIDX_SLOPE_UP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); } } } @@ -792,61 +792,61 @@ public: { if (_currentTrackSlopeEnd == TRACK_SLOPE_NONE && _previousTrackBankEnd != TRACK_BANK_NONE) { - disabledWidgets &= ~(1ULL << WIDX_SLOPE_DOWN); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN); } } } } if (_currentTrackPieceDirection >= 4) { - disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE_SMALL) - | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL) - | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); } if (_rideConstructionState == RideConstructionState::Front) { - disabledWidgets |= (1ULL << WIDX_NEXT_SECTION); + disabledWidgets |= (1uLL << WIDX_NEXT_SECTION); if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { - disabledWidgets |= (1ULL << WIDX_CONSTRUCT); + disabledWidgets |= (1uLL << WIDX_CONSTRUCT); } } else if (_rideConstructionState == RideConstructionState::Back) { - disabledWidgets |= (1ULL << WIDX_PREVIOUS_SECTION); + disabledWidgets |= (1uLL << WIDX_PREVIOUS_SECTION); if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { - disabledWidgets |= (1ULL << WIDX_CONSTRUCT); + disabledWidgets |= (1uLL << WIDX_CONSTRUCT); } } if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) { - disabledWidgets &= ~(1ULL << WIDX_BANKING_GROUPBOX); + disabledWidgets &= ~(1uLL << WIDX_BANKING_GROUPBOX); } if (_rideConstructionState == RideConstructionState::EntranceExit || _rideConstructionState == RideConstructionState::Selected) { - disabledWidgets |= (1ULL << WIDX_DIRECTION_GROUPBOX) | (1ULL << WIDX_SLOPE_GROUPBOX) - | (1ULL << WIDX_BANKING_GROUPBOX) | (1ULL << WIDX_LEFT_CURVE_VERY_SMALL) | (1ULL << WIDX_LEFT_CURVE_SMALL) - | (1ULL << WIDX_LEFT_CURVE) | (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) - | (1ULL << WIDX_RIGHT_CURVE_SMALL) | (1ULL << WIDX_RIGHT_CURVE_VERY_SMALL) - | (1ULL << WIDX_SPECIAL_TRACK_DROPDOWN) | (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_DOWN) - | (1ULL << WIDX_LEVEL) | (1ULL << WIDX_SLOPE_UP) | (1ULL << WIDX_SLOPE_UP_STEEP) | (1ULL << WIDX_CHAIN_LIFT) - | (1ULL << WIDX_BANK_LEFT) | (1ULL << WIDX_BANK_STRAIGHT) | (1ULL << WIDX_BANK_RIGHT) - | (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_DIRECTION_GROUPBOX) | (1uLL << WIDX_SLOPE_GROUPBOX) + | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL) + | (1uLL << WIDX_SPECIAL_TRACK_DROPDOWN) | (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN) + | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT) + | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT) + | (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); } if (_currentlyShowingBrakeOrBoosterSpeed) { - disabledWidgets &= ~(1ULL << WIDX_BANKING_GROUPBOX); - disabledWidgets &= ~(1ULL << WIDX_BANK_LEFT); - disabledWidgets &= ~(1ULL << WIDX_BANK_STRAIGHT); - disabledWidgets &= ~(1ULL << WIDX_BANK_RIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANKING_GROUPBOX); + disabledWidgets &= ~(1uLL << WIDX_BANK_LEFT); + disabledWidgets &= ~(1uLL << WIDX_BANK_STRAIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_RIGHT); } // If chain lift cheat is enabled then show the chain lift widget no matter what if (gCheatsEnableChainLiftOnAllTrack) { - disabledWidgets &= ~(1ULL << WIDX_CHAIN_LIFT); + disabledWidgets &= ~(1uLL << WIDX_CHAIN_LIFT); } // Set and invalidate the changed widgets @@ -856,7 +856,7 @@ public: for (WidgetIndex i = 0; i < 64; i++) { - if ((disabledWidgets & (1ULL << i)) != (currentDisabledWidgets & (1ULL << i))) + if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) { widget_invalidate(*this, i); } @@ -1473,11 +1473,11 @@ public: simulateWidget.type = WindowWidgetType::FlatBtn; if (currentRide->status == RideStatus::Simulating) { - pressed_widgets |= (1ULL << WIDX_SIMULATE); + pressed_widgets |= (1uLL << WIDX_SIMULATE); } else { - pressed_widgets &= ~(1ULL << WIDX_SIMULATE); + pressed_widgets &= ~(1uLL << WIDX_SIMULATE); } } @@ -1889,7 +1889,7 @@ public: widgets[WIDX_BANK_RIGHT].right = 83; widgets[WIDX_BANK_RIGHT].top = 139; widgets[WIDX_BANK_RIGHT].bottom = 148; - hold_down_widgets |= (1ULL << WIDX_BANK_STRAIGHT) | (1ULL << WIDX_BANK_RIGHT); + hold_down_widgets |= (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT); } widgets[WIDX_BANKING_GROUPBOX].right = 162; @@ -1918,10 +1918,10 @@ public: } uint64_t pressedWidgets = pressed_widgets - & ((1ULL << WIDX_BACKGROUND) | (1ULL << WIDX_TITLE) | (1ULL << WIDX_CLOSE) | (1ULL << WIDX_DIRECTION_GROUPBOX) - | (1ULL << WIDX_SLOPE_GROUPBOX) | (1ULL << WIDX_BANKING_GROUPBOX) | (1ULL << WIDX_CONSTRUCT) - | (1ULL << WIDX_DEMOLISH) | (1ULL << WIDX_PREVIOUS_SECTION) | (1ULL << WIDX_NEXT_SECTION) - | (1ULL << WIDX_ENTRANCE_EXIT_GROUPBOX) | (1ULL << WIDX_ENTRANCE) | (1ULL << WIDX_EXIT)); + & ((1uLL << WIDX_BACKGROUND) | (1uLL << WIDX_TITLE) | (1uLL << WIDX_CLOSE) | (1uLL << WIDX_DIRECTION_GROUPBOX) + | (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_CONSTRUCT) + | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) | (1uLL << WIDX_NEXT_SECTION) + | (1uLL << WIDX_ENTRANCE_EXIT_GROUPBOX) | (1uLL << WIDX_ENTRANCE) | (1uLL << WIDX_EXIT)); widgets[WIDX_CONSTRUCT].type = WindowWidgetType::Empty; widgets[WIDX_DEMOLISH].type = WindowWidgetType::FlatBtn; @@ -1999,7 +1999,7 @@ public: widgetIndex = WIDX_SPECIAL_TRACK_DROPDOWN; break; } - pressedWidgets |= (1ULL << widgetIndex); + pressedWidgets |= (1uLL << widgetIndex); switch (_currentTrackSlopeEnd) { @@ -2021,7 +2021,7 @@ public: widgetIndex = WIDX_LEVEL; break; } - pressedWidgets |= (1ULL << widgetIndex); + pressedWidgets |= (1uLL << widgetIndex); if (!_currentlyShowingBrakeOrBoosterSpeed) { @@ -2029,11 +2029,11 @@ public: { if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES) { - pressed_widgets |= (1ULL << WIDX_O_TRACK); + pressed_widgets |= (1uLL << WIDX_O_TRACK); } else { - pressed_widgets |= (1ULL << WIDX_U_TRACK); + pressed_widgets |= (1uLL << WIDX_U_TRACK); } } switch (_currentTrackBankEnd) @@ -2048,11 +2048,11 @@ public: widgetIndex = WIDX_BANK_RIGHT; break; } - pressedWidgets |= (1ULL << widgetIndex); + pressedWidgets |= (1uLL << widgetIndex); } if (_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) - pressedWidgets |= (1ULL << WIDX_CHAIN_LIFT); + pressedWidgets |= (1uLL << WIDX_CHAIN_LIFT); pressed_widgets = pressedWidgets; Invalidate(); @@ -2119,13 +2119,22 @@ public: && (bank != _previousTrackBankEnd)) continue; + if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + && !gCheatsEnableAllDrawableTrackPieces + && (( + trackType == TrackElemType::LeftHalfBankedHelixUpSmall + || trackType == TrackElemType::RightHalfBankedHelixUpSmall + || trackType == TrackElemType::LeftHalfBankedHelixUpLarge + || trackType == TrackElemType::RightHalfBankedHelixUpLarge))) + continue; + _currentPossibleRideConfigurations[currentPossibleRideConfigurationIndex] = trackType; - _currentDisabledSpecialTrackPieces |= (1ULL << currentPossibleRideConfigurationIndex); + _currentDisabledSpecialTrackPieces |= (1uLL << currentPossibleRideConfigurationIndex); if (_currentTrackPieceDirection < 4 && slope == _previousTrackSlopeEnd && bank == _previousTrackBankEnd && (trackType != TrackElemType::TowerBase || currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES))) { - _currentDisabledSpecialTrackPieces &= ~(1ULL << currentPossibleRideConfigurationIndex); + _currentDisabledSpecialTrackPieces &= ~(1uLL << currentPossibleRideConfigurationIndex); _numCurrentPossibleSpecialTrackPieces++; } currentPossibleRideConfigurationIndex++; @@ -2138,7 +2147,7 @@ public: int32_t trackType, trackDirection; CoordsXYZ trackPos{}; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; @@ -2170,7 +2179,7 @@ public: if (get_ride(_currentRideIndex)) { SelectMapTiles(trackType, trackDirection, trackPos); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); } } @@ -2524,7 +2533,7 @@ private: for (int32_t i = 0; i < 64; i++) { - if (_currentDisabledSpecialTrackPieces & (1ULL << i)) + if (_currentDisabledSpecialTrackPieces & (1uLL << i)) { Dropdown::SetDisabled(i, true); } @@ -2543,7 +2552,7 @@ private: void ToolDownEntranceExit(const ScreenCoordsXY& screenCoords) { ride_construction_invalidate_current_track(); - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -2552,7 +2561,7 @@ private: return; auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( - entranceOrExitCoords, direction_reverse(gRideEntranceExitPlaceDirection), gRideEntranceExitPlaceRideIndex, + entranceOrExitCoords, DirectionReverse(gRideEntranceExitPlaceDirection), gRideEntranceExitPlaceRideIndex, gRideEntranceExitPlaceStationIndex, gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_EXIT); rideEntranceExitPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { @@ -2613,7 +2622,7 @@ private: int16_t previewZOffset = ted.Definition.preview_z_offset; mapCoords.z -= previewZOffset; - const ScreenCoordsXY rotatedScreenCoords = translate_3d_to_2d_with_z(get_current_rotation(), mapCoords); + const ScreenCoordsXY rotatedScreenCoords = Translate3DTo2DWithZ(get_current_rotation(), mapCoords); dpi->x += rotatedScreenCoords.x - widgetWidth / 2; dpi->y += rotatedScreenCoords.y - widgetHeight / 2 - 16; @@ -2628,7 +2637,7 @@ private: TileElement tempSideTrackTileElement{ 0x80, 0x8F, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; TileElement tempTrackTileElement{}; TileElement* backupTileElementArrays[5]{}; - paint_session* session = PaintSessionAlloc(dpi, 0); + PaintSession* session = PaintSessionAlloc(dpi, 0); trackDirection &= 3; auto currentRide = get_ride(rideIndex); @@ -2673,16 +2682,16 @@ private: auto southTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_SOUTH]; // Replace map elements with temporary ones containing track - 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); - map_set_tile_element(northTileCoords, &tempSideTrackTileElement); - map_set_tile_element(southTileCoords, &tempSideTrackTileElement); + backupTileElementArrays[0] = MapGetFirstElementAt(centreTileCoords); + backupTileElementArrays[1] = MapGetFirstElementAt(eastTileCoords); + backupTileElementArrays[2] = MapGetFirstElementAt(westTileCoords); + backupTileElementArrays[3] = MapGetFirstElementAt(northTileCoords); + backupTileElementArrays[4] = MapGetFirstElementAt(southTileCoords); + MapSetTileElement(centreTileCoords, &tempTrackTileElement); + MapSetTileElement(eastTileCoords, &tempSideTrackTileElement); + MapSetTileElement(westTileCoords, &tempSideTrackTileElement); + MapSetTileElement(northTileCoords, &tempSideTrackTileElement); + MapSetTileElement(southTileCoords, &tempSideTrackTileElement); // Set the temporary track element tempTrackTileElement.SetOccupiedQuadrants(quarterTile.GetBaseQuarterOccupied()); @@ -2691,14 +2700,14 @@ private: tempTrackTileElement.AsTrack()->SetSequenceIndex(trackBlock->index); // Draw this map tile - tile_element_paint_setup(*session, coords, true); + TileElementPaintSetup(*session, coords, true); // Restore map elements - map_set_tile_element(centreTileCoords, backupTileElementArrays[0]); - map_set_tile_element(eastTileCoords, backupTileElementArrays[1]); - map_set_tile_element(westTileCoords, backupTileElementArrays[2]); - map_set_tile_element(northTileCoords, backupTileElementArrays[3]); - map_set_tile_element(southTileCoords, backupTileElementArrays[4]); + MapSetTileElement(centreTileCoords, backupTileElementArrays[0]); + MapSetTileElement(eastTileCoords, backupTileElementArrays[1]); + MapSetTileElement(westTileCoords, backupTileElementArrays[2]); + MapSetTileElement(northTileCoords, backupTileElementArrays[3]); + MapSetTileElement(southTileCoords, backupTileElementArrays[4]); trackBlock++; } @@ -2773,7 +2782,7 @@ rct_window* WindowRideConstructionOpen() switch (rtd.ConstructionWindowContext) { case RideConstructionWindowContext::Maze: - return context_open_window_view(WV_MAZE_CONSTRUCTION); + return ContextOpenWindowView(WV_MAZE_CONSTRUCTION); case RideConstructionWindowContext::Default: return WindowCreate( WindowClass::RideConstruction, ScreenCoordsXY(0, 29), 166, 394, WF_NO_AUTO_CLOSE); @@ -2877,7 +2886,7 @@ static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, auto ride = get_ride(_currentRideIndex); if (ride != nullptr) { - auto trackDirection = direction_reverse(_currentTrackPieceDirection); + auto trackDirection = DirectionReverse(_currentTrackPieceDirection); auto trackPos = _currentTrackBegin; if (!(trackDirection & 4)) { @@ -2982,7 +2991,7 @@ static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoor _trackPlaceZ = 0; if (_trackPlaceShiftState) { - auto surfaceElement = map_get_surface_element_at(mapCoords); + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); if (surfaceElement == nullptr) return std::nullopt; auto mapZ = floor2(surfaceElement->GetBaseZ(), 16); @@ -3133,13 +3142,13 @@ void UpdateGhostTrackAndArrow() if (direction >= 4) direction += 4; if (_rideConstructionState == RideConstructionState::Back) - direction = direction_reverse(direction); + direction = DirectionReverse(direction); gMapSelectArrowPosition = trackPos; gMapSelectArrowDirection = direction; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - map_invalidate_tile_full(trackPos); + MapInvalidateTileFull(trackPos); break; } case RideConstructionState::Selected: @@ -3189,7 +3198,7 @@ void UpdateGhostTrackAndArrow() gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - map_invalidate_tile_full(trackPos); + MapInvalidateTileFull(trackPos); break; } default: @@ -3206,7 +3215,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) int32_t z; const rct_preview_track* trackBlock; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -3214,13 +3223,13 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) if (!mapCoords) { ride_construction_invalidate_current_track(); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); return; } z = _trackPlaceZ; if (z == 0) - z = map_get_highest_z(*mapCoords); + z = MapGetHighestZ(*mapCoords); gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; @@ -3236,7 +3245,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) { ride_construction_invalidate_current_track(); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); return; } _currentTrackPieceType = trackType; @@ -3268,16 +3277,16 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) int32_t highestZ = 0; for (const auto& selectedTile : gMapSelectionTiles) { - if (map_is_location_valid(selectedTile)) + if (MapIsLocationValid(selectedTile)) { - z = map_get_highest_z(selectedTile); + z = MapGetHighestZ(selectedTile); if (z > highestZ) highestZ = z; } } } // loc_6CC8BF: - // z = map_get_highest_z(x >> 5, y >> 5); + // z = MapGetHighestZ(x >> 5, y >> 5); } // loc_6CC91B: const auto& ted = GetTrackElementDescriptor(trackType); @@ -3296,7 +3305,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) _currentTrackBegin.z = z; if ((_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) && _currentTrackBegin == _previousTrackPiece) { - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); return; } @@ -3324,8 +3333,8 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) } auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - context_broadcast_intent(&intent); - map_invalidate_map_selection_tiles(); + ContextBroadcastIntent(&intent); + MapInvalidateMapSelectionTiles(); return; } @@ -3357,13 +3366,13 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) for (int8_t i = 0; i < NumOrthogonalDirections; i++) { const auto testLoc = CoordsXYZ{ *mapCoords + CoordsDirectionDelta[i], z }; - if (!map_is_location_owned(testLoc)) + if (!MapIsLocationOwned(testLoc)) { pathsByDir[i] = nullptr; continue; } - pathsByDir[i] = map_get_footpath_element(testLoc); + pathsByDir[i] = MapGetFootpathElement(testLoc); if (pathsByDir[i] != nullptr && (pathsByDir[i])->AsPath()->IsSloped() && (pathsByDir[i])->AsPath()->GetSlopeDirection() != i) @@ -3374,11 +3383,11 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) // Sloped path on the level below if (pathsByDir[i] == nullptr) { - pathsByDir[i] = map_get_footpath_element({ *mapCoords + CoordsDirectionDelta[i], z - PATH_HEIGHT_STEP }); + pathsByDir[i] = MapGetFootpathElement({ *mapCoords + CoordsDirectionDelta[i], z - PATH_HEIGHT_STEP }); if (pathsByDir[i] != nullptr && (!(pathsByDir[i])->AsPath()->IsSloped() - || (pathsByDir[i])->AsPath()->GetSlopeDirection() != direction_reverse(i))) + || (pathsByDir[i])->AsPath()->GetSlopeDirection() != DirectionReverse(i))) { pathsByDir[i] = nullptr; } @@ -3416,7 +3425,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) } window_ride_construction_update_active_elements(); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); } /** @@ -3425,8 +3434,8 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords) */ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoords) { - map_invalidate_selection_rect(); - map_invalidate_map_selection_tiles(); + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -3442,10 +3451,10 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor gMapSelectPositionA = entranceOrExitCoords; gMapSelectPositionB = entranceOrExitCoords; gMapSelectArrowPosition = entranceOrExitCoords; - gMapSelectArrowDirection = direction_reverse(entranceOrExitCoords.direction); - map_invalidate_selection_rect(); + gMapSelectArrowDirection = DirectionReverse(entranceOrExitCoords.direction); + MapInvalidateSelectionRect(); - entranceOrExitCoords.direction = direction_reverse(gRideEntranceExitPlaceDirection); + entranceOrExitCoords.direction = DirectionReverse(gRideEntranceExitPlaceDirection); StationIndex stationNum = gRideEntranceExitPlaceStationIndex; if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) || entranceOrExitCoords != gRideEntranceExitGhostPosition || stationNum != gRideEntranceExitGhostStationIndex) @@ -3453,7 +3462,7 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor auto ride = get_ride(_currentRideIndex); if (ride != nullptr) { - _currentTrackPrice = ride_entrance_exit_place_ghost( + _currentTrackPrice = RideEntranceExitPlaceGhost( ride, entranceOrExitCoords, entranceOrExitCoords.direction, gRideEntranceExitPlaceType, stationNum); } window_ride_construction_update_active_elements(); @@ -3466,11 +3475,11 @@ void ride_construction_toolupdate_entrance_exit(const ScreenCoordsXY& screenCoor */ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) { - const CursorState* state = context_get_cursor_state(); + const CursorState* state = ContextGetCursorState(); rct_window* w; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); ride_construction_invalidate_current_track(); CoordsXYZ mapCoords{}; @@ -3488,10 +3497,10 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) { for (const auto& selectedTile : gMapSelectionTiles) { - if (!map_is_location_valid(selectedTile)) + if (!MapIsLocationValid(selectedTile)) continue; - z = map_get_highest_z(selectedTile); + z = MapGetHighestZ(selectedTile); if (z > highestZ) highestZ = z; } @@ -3508,7 +3517,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) z = _trackPlaceZ; if (z == 0) - z = map_get_highest_z(mapCoords); + z = MapGetHighestZ(mapCoords); tool_cancel(); @@ -3552,7 +3561,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) _currentTrackBegin.z = z; _currentTrackSelectionFlags = 0; auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); w = window_find_by_class(WindowClass::RideConstruction); if (w == nullptr) break; @@ -3595,7 +3604,7 @@ void ride_construction_tooldown_construct(const ScreenCoordsXY& screenCoords) _trackPlaceShiftState = false; } auto intent2 = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - context_broadcast_intent(&intent2); + ContextBroadcastIntent(&intent2); break; } z += 16; diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 6286d786b9..b40fc4778c 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -412,7 +412,7 @@ public: { auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, rideIndex.ToUnderlying()); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } @@ -446,19 +446,11 @@ public: widgets[WIDX_TITLE].text = page_names[page]; if (_quickDemolishMode) - pressed_widgets |= (1ULL << WIDX_QUICK_DEMOLISH); + pressed_widgets |= (1uLL << WIDX_QUICK_DEMOLISH); else - pressed_widgets &= ~(1ULL << WIDX_QUICK_DEMOLISH); + pressed_widgets &= ~(1uLL << WIDX_QUICK_DEMOLISH); - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_PAGE_BACKGROUND].right = width - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - - // if close button is on the right then it must move - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); widgets[WIDX_LIST].right = width - 26; widgets[WIDX_LIST].bottom = height - 15; diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 508b79cfe5..2492be7fd7 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -65,36 +65,134 @@ static constexpr const StringId window_save_prompt_labels[][2] = { { STR_QUIT_GAME_PROMPT_TITLE, STR_SAVE_BEFORE_QUITTING }, { STR_QUIT_GAME_2_PROMPT_TITLE, STR_SAVE_BEFORE_QUITTING_2 }, }; - - -static void WindowSavePromptClose(rct_window *w); -static void WindowSavePromptMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowSavePromptPaint(rct_window *w, rct_drawpixelinfo *dpi); -static void WindowSavePromptCallback(int32_t result, const utf8 * path); - -static WindowEventList window_save_prompt_events([](auto& events) -{ - events.close = &WindowSavePromptClose; - events.mouse_up = &WindowSavePromptMouseup; - events.paint = &WindowSavePromptPaint; -}); // clang-format on -/** - * - * rct2: 0x0066DCBE - */ +static void WindowSavePromptCallback(int32_t result, const utf8* path) +{ + if (result == MODAL_RESULT_OK) + { + game_load_or_quit_no_save_prompt(); + } +} + +class SavePromptWindow final : public Window +{ +private: + PromptMode _promptMode; + +public: + SavePromptWindow(PromptMode promptMode) + : _promptMode(promptMode) + { + } + + void OnOpen() override + { + if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + { + widgets = window_quit_prompt_widgets; + } + else + { + widgets = window_save_prompt_widgets; + } + InitScrollWidgets(); + + // Pause the game if not network play. + if (network_get_mode() == NETWORK_MODE_NONE) + { + gGamePaused |= GAME_PAUSED_MODAL; + OpenRCT2::Audio::StopAll(); + } + + window_invalidate_by_class(WindowClass::TopToolbar); + + StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0]; + if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE; + } + else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + stringId = STR_QUIT_SCENARIO_EDITOR; + } + window_save_prompt_widgets[WIDX_TITLE].text = stringId; + window_save_prompt_widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1]; + } + + void OnClose() override + { + // Unpause the game + if (network_get_mode() == NETWORK_MODE_NONE) + { + gGamePaused &= ~GAME_PAUSED_MODAL; + OpenRCT2::Audio::Resume(); + } + + window_invalidate_by_class(WindowClass::TopToolbar); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + { + switch (widgetIndex) + { + case WQIDX_OK: + game_load_or_quit_no_save_prompt(); + break; + case WQIDX_CLOSE: + case WQIDX_CANCEL: + Close(); + break; + } + return; + } + + switch (widgetIndex) + { + case WIDX_SAVE: + { + std::unique_ptr intent; + + if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) + { + intent = std::make_unique(WindowClass::Loadsave); + intent->putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent->putExtra(INTENT_EXTRA_PATH, gScenarioName); + } + else + { + intent = create_save_game_as_intent(); + } + Close(); + intent->putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(WindowSavePromptCallback)); + ContextOpenIntent(intent.get()); + break; + } + case WIDX_DONT_SAVE: + game_load_or_quit_no_save_prompt(); + return; + case WIDX_CLOSE: + case WIDX_CANCEL: + Close(); + return; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + } +}; + rct_window* WindowSavePromptOpen() { - int32_t width, height; - StringId stringId; - rct_window* window; - PromptMode prompt_mode; - rct_widget* widgets; - - prompt_mode = gSavePromptMode; + PromptMode prompt_mode = gSavePromptMode; if (prompt_mode == PromptMode::Quit) + { prompt_mode = PromptMode::SaveBeforeQuit; + } // do not show save prompt if we're in the title demo and click on load game if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) @@ -103,7 +201,7 @@ rct_window* WindowSavePromptOpen() return nullptr; } - if (!gConfigGeneral.confirmation_prompt) + if (!gConfigGeneral.ConfirmationPrompt) { /* game_load_or_quit_no_save_prompt() will exec requested task and close this window * immediately again. @@ -119,133 +217,28 @@ rct_window* WindowSavePromptOpen() } // Check if window is already open - window = window_bring_to_front_by_class(WindowClass::SavePrompt); + rct_window* window = window_bring_to_front_by_class(WindowClass::SavePrompt); if (window != nullptr) { window_close(*window); } - if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - { - widgets = window_quit_prompt_widgets; - width = WW_QUIT; - height = WH_QUIT; - } - else - { - widgets = window_save_prompt_widgets; - width = WW_SAVE; - height = WH_SAVE; - } - if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels)) { log_warning("Invalid save prompt mode %u", prompt_mode); return nullptr; } - window = WindowCreateCentred( - width, height, &window_save_prompt_events, WindowClass::SavePrompt, WF_TRANSPARENT | WF_STICK_TO_FRONT); - window->widgets = widgets; - WindowInitScrollWidgets(*window); - - // Pause the game if not network play. - if (network_get_mode() == NETWORK_MODE_NONE) + int32_t width = WW_SAVE; + int32_t height = WH_SAVE; + if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) { - gGamePaused |= GAME_PAUSED_MODAL; - OpenRCT2::Audio::StopAll(); + width = WW_QUIT; + height = WH_QUIT; } - window_invalidate_by_class(WindowClass::TopToolbar); - - stringId = window_save_prompt_labels[EnumValue(prompt_mode)][0]; - if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE; - if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - stringId = STR_QUIT_SCENARIO_EDITOR; - window_save_prompt_widgets[WIDX_TITLE].text = stringId; - window_save_prompt_widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(prompt_mode)][1]; - - return window; -} - -/** - * - * rct2: 0x0066DF17 - */ -static void WindowSavePromptClose(rct_window* w) -{ - // Unpause the game - if (network_get_mode() == NETWORK_MODE_NONE) - { - gGamePaused &= ~GAME_PAUSED_MODAL; - OpenRCT2::Audio::Resume(); - } - - window_invalidate_by_class(WindowClass::TopToolbar); -} - -/** - * - * rct2: 0x0066DDF2 - */ -static void WindowSavePromptMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - { - switch (widgetIndex) - { - case WQIDX_OK: - game_load_or_quit_no_save_prompt(); - break; - case WQIDX_CLOSE: - case WQIDX_CANCEL: - window_close(*w); - break; - } - return; - } - - switch (widgetIndex) - { - case WIDX_SAVE: - { - std::unique_ptr intent; - - if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) - { - intent = std::make_unique(WindowClass::Loadsave); - intent->putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent->putExtra(INTENT_EXTRA_PATH, gScenarioName); - } - else - { - intent = create_save_game_as_intent(); - } - window_close(*w); - intent->putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(WindowSavePromptCallback)); - context_open_intent(intent.get()); - break; - } - case WIDX_DONT_SAVE: - game_load_or_quit_no_save_prompt(); - return; - case WIDX_CLOSE: - case WIDX_CANCEL: - window_close(*w); - return; - } -} - -static void WindowSavePromptPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(*w, dpi); -} - -static void WindowSavePromptCallback(int32_t result, const utf8* path) -{ - if (result == MODAL_RESULT_OK) - { - game_load_or_quit_no_save_prompt(); - } + auto savePromptWindow = std::make_unique(prompt_mode); + return WindowCreate( + std::move(savePromptWindow), WindowClass::SavePrompt, {}, width, height, + WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); } diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index c9db7d4e24..64ecb49d6b 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -35,7 +35,7 @@ static constexpr const int32_t TabHeight = 34; static constexpr const int32_t WidgetsStart = 17; static constexpr const int32_t TabsStart = WidgetsStart; #define INITIAL_NUM_UNLOCKED_SCENARIOS 5 -constexpr const uint8_t NumTabs = 9; +constexpr const uint8_t NumTabs = 10; // clang-format off enum class ListItemType : uint8_t @@ -77,22 +77,24 @@ enum { WIDX_TAB7, WIDX_TAB8, WIDX_TAB9, + WIDX_TAB10, WIDX_SCENARIOLIST }; static rct_widget window_scenarioselect_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget ({ TabWidth + 1, WidgetsStart }, { WW, 284}, WindowWidgetType::Resize, WindowColour::Secondary), // tab content panel - MakeRemapWidget({ 3, TabsStart + (TabHeight * 0) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 1 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 1) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 2 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 2) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 3 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 3) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 4 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 4) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 5 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 5) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 6 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 6) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 7 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 7) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 8 - MakeRemapWidget({ 3, TabsStart + (TabHeight * 8) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 9 - MakeWidget ({ TabWidth + 3, WidgetsStart + 1 }, { WW - SidebarWidth, 276 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), // level list + MakeWidget ({ TabWidth + 1, WidgetsStart }, { WW, 284}, WindowWidgetType::Resize, WindowColour::Secondary), // tab content panel + MakeRemapWidget({ 3, TabsStart + (TabHeight * 0) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 01 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 1) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 02 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 2) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 03 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 3) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 04 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 4) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 05 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 5) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 06 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 6) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 07 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 7) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 08 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 8) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 09 + MakeRemapWidget({ 3, TabsStart + (TabHeight * 8) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 10 + MakeWidget ({ TabWidth + 3, WidgetsStart + 1 }, { WW - SidebarWidth, 276 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), // level list WIDGETS_END, }; @@ -103,6 +105,7 @@ static constexpr const StringId ScenarioOriginStringIds[] = { STR_SCENARIO_CATEGORY_RCT2, STR_SCENARIO_CATEGORY_RCT2_WW, STR_SCENARIO_CATEGORY_RCT2_TT, + STR_SCENARIO_CATEGORY_UCES, STR_SCENARIO_CATEGORY_REAL_PARKS, STR_SCENARIO_CATEGORY_EXTRAS_PARKS, STR_SCENARIO_CATEGORY_OTHER_PARKS, @@ -204,7 +207,7 @@ static void WindowScenarioselectInitTabs(rct_window* w) for (size_t i = 0; i < numScenarios; i++) { const scenario_index_entry* scenario = scenario_repository_get_by_index(i); - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) { if (_titleEditor && scenario->source_game == ScenarioSource::Other) continue; @@ -221,9 +224,9 @@ static void WindowScenarioselectInitTabs(rct_window* w) } } - if (showPages & (1 << gConfigInterface.scenarioselect_last_tab)) + if (showPages & (1 << gConfigInterface.ScenarioselectLastTab)) { - w->selected_tab = gConfigInterface.scenarioselect_last_tab; + w->selected_tab = gConfigInterface.ScenarioselectLastTab; } else { @@ -267,12 +270,12 @@ static void WindowScenarioselectMouseup(rct_window* w, WidgetIndex widgetIndex) static void WindowScenarioselectMousedown(rct_window* w, WidgetIndex widgetIndex, rct_widget* widget) { - if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB9) + if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB10) { w->selected_tab = widgetIndex - 4; w->highlighted_scenario = nullptr; - gConfigInterface.scenarioselect_last_tab = w->selected_tab; - config_save_default(); + gConfigInterface.ScenarioselectLastTab = w->selected_tab; + ConfigSaveDefault(); InitialiseListItems(w); w->Invalidate(); window_event_resize_call(w); @@ -288,10 +291,10 @@ static int32_t GetScenarioListItemSize() return 24; // Scenario title - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + int32_t lineHeight = font_get_line_height(FontStyle::Medium); // 'Completed by' line - lineHeight += font_get_line_height(FontSpriteBase::SMALL); + lineHeight += font_get_line_height(FontStyle::Small); return lineHeight; } @@ -407,25 +410,17 @@ static void WindowScenarioselectScrollmouseover(rct_window* w, int32_t scrollInd static void WindowScenarioselectInvalidate(rct_window* w) { w->pressed_widgets &= ~( - (1ULL << WIDX_CLOSE) | (1ULL << WIDX_TAB1) | (1ULL << WIDX_TAB2) | (1ULL << WIDX_TAB3) | (1ULL << WIDX_TAB4) - | (1ULL << WIDX_TAB5) | (1ULL << WIDX_TAB6) | (1ULL << WIDX_TAB7) | (1ULL << WIDX_TAB8) | (1ULL << WIDX_TAB9)); + (1uLL << WIDX_CLOSE) | (1uLL << WIDX_TAB1) | (1uLL << WIDX_TAB2) | (1uLL << WIDX_TAB3) | (1uLL << WIDX_TAB4) + | (1uLL << WIDX_TAB5) | (1uLL << WIDX_TAB6) | (1uLL << WIDX_TAB7) | (1uLL << WIDX_TAB8) | (1uLL << WIDX_TAB9) + | (1uLL << WIDX_TAB10)); w->pressed_widgets |= 1LL << (w->selected_tab + WIDX_TAB1); - int32_t windowWidth = w->width; - window_scenarioselect_widgets[WIDX_BACKGROUND].right = windowWidth - 1; - window_scenarioselect_widgets[WIDX_TITLEBAR].right = windowWidth - 2; - window_scenarioselect_widgets[WIDX_CLOSE].left = windowWidth - 13; - window_scenarioselect_widgets[WIDX_CLOSE].right = windowWidth - 3; - window_scenarioselect_widgets[WIDX_TABCONTENT].right = windowWidth - 1; - window_scenarioselect_widgets[WIDX_SCENARIOLIST].right = windowWidth - 179; + w->ResizeFrameWithPage(); - int32_t windowHeight = w->height; - window_scenarioselect_widgets[WIDX_BACKGROUND].bottom = windowHeight - 1; - window_scenarioselect_widgets[WIDX_TABCONTENT].bottom = windowHeight - 1; - - const int32_t bottomMargin = gConfigGeneral.debugging_tools ? 17 : 5; - window_scenarioselect_widgets[WIDX_SCENARIOLIST].bottom = windowHeight - bottomMargin; + const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? 17 : 5; + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right = w->width - 179; + window_scenarioselect_widgets[WIDX_SCENARIOLIST].bottom = w->height - bottomMargin; } static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) @@ -436,7 +431,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) WindowDrawWidgets(*w, dpi); format = ScenarioSelectUseSmallFont() ? STR_SMALL_WINDOW_COLOUR_2_STRINGID : STR_WINDOW_COLOUR_2_STRINGID; - FontSpriteBase fontSpriteBase = ScenarioSelectUseSmallFont() ? FontSpriteBase::SMALL : FontSpriteBase::MEDIUM; + FontStyle fontStyle = ScenarioSelectUseSmallFont() ? FontStyle::Small : FontStyle::Medium; // Text for each tab for (uint32_t i = 0; i < std::size(ScenarioOriginStringIds); i++) @@ -446,7 +441,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) continue; auto ft = Formatter(); - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) { ft.Add(ScenarioOriginStringIds[i]); } @@ -456,7 +451,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) } ScreenCoordsXY stringCoords(widget->midX() + w->windowPos.x, widget->midY() + w->windowPos.y - 3); - DrawTextWrapped(dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontSpriteBase, TextAlignment::CENTRE }); + DrawTextWrapped(dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE }); } // Return if no scenario highlighted @@ -486,11 +481,11 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi) } // Scenario path - if (gConfigGeneral.debugging_tools) + if (gConfigGeneral.DebuggingTools) { utf8 path[MAX_PATH]; - shorten_path(path, sizeof(path), scenario->path, w->width - 6 - TabWidth, FontSpriteBase::MEDIUM); + shorten_path(path, sizeof(path), scenario->path, w->width - 6 - TabWidth, FontStyle::Medium); const utf8* pathPtr = path; auto ft = Formatter(); @@ -571,7 +566,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp const int32_t scenarioItemHeight = GetScenarioListItemSize(); // Scenario title - int32_t scenarioTitleHeight = font_get_line_height(FontSpriteBase::MEDIUM); + int32_t scenarioTitleHeight = font_get_line_height(FontStyle::Medium); int32_t y = 0; for (const auto& listItem : _listItems) @@ -613,10 +608,11 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp ft.Add(STR_STRING); ft.Add(buffer); colour_t colour = isDisabled ? w->colours[1] | COLOUR_FLAG_INSET : COLOUR_BLACK; - FontSpriteBase fontSpriteBase = isDisabled ? FontSpriteBase::MEDIUM_DARK : FontSpriteBase::MEDIUM; + auto darkness = isDisabled ? TextDarkness::Dark : TextDarkness::Regular; const auto scrollCentre = window_scenarioselect_widgets[WIDX_SCENARIOLIST].width() / 2; - DrawTextBasic(dpi, { scrollCentre, y + 1 }, format, ft, { colour, fontSpriteBase, TextAlignment::CENTRE }); + DrawTextBasic( + dpi, { scrollCentre, y + 1 }, format, ft, { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness }); // Check if scenario is completed if (isCompleted) @@ -639,7 +635,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp ft.Add(buffer); DrawTextBasic( dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft, - { FontSpriteBase::SMALL, TextAlignment::CENTRE }); + { FontStyle::Small, TextAlignment::CENTRE }); } y += scenarioItemHeight; @@ -661,9 +657,10 @@ static void DrawCategoryHeading( DrawTextBasic(dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE }); // Get string dimensions - utf8* buffer = gCommonStringFormatBuffer; - format_string(buffer, 256, stringId, nullptr); - int32_t categoryStringHalfWidth = (gfx_get_string_width(buffer, FontSpriteBase::MEDIUM) / 2) + 4; + utf8 buffer[CommonTextBufferSize]; + auto bufferPtr = buffer; + format_string(bufferPtr, sizeof(buffer), stringId, nullptr); + int32_t categoryStringHalfWidth = (gfx_get_string_width(bufferPtr, FontStyle::Medium) / 2) + 4; int32_t strLeft = centreX - categoryStringHalfWidth; int32_t strRight = centreX + categoryStringHalfWidth; @@ -711,7 +708,7 @@ static void InitialiseListItems(rct_window* w) // Category heading StringId headingStringId = STR_NONE; - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) { if (w->selected_tab != static_cast(ScenarioSource::Real) && currentHeading != scenario->category) { @@ -790,7 +787,7 @@ static void InitialiseListItems(rct_window* w) { bool megaParkLocked = (rct1CompletedScenarios & rct1RequiredCompletedScenarios) != rct1RequiredCompletedScenarios; _listItems[megaParkListItemIndex].scenario.is_locked = megaParkLocked; - if (megaParkLocked && gConfigGeneral.scenario_hide_mega_park) + if (megaParkLocked && gConfigGeneral.ScenarioHideMegaPark) { // Remove mega park _listItems.pop_back(); @@ -816,7 +813,7 @@ static void InitialiseListItems(rct_window* w) static bool IsScenarioVisible(rct_window* w, const scenario_index_entry* scenario) { - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor) { if (static_cast(scenario->source_game) != w->selected_tab) { @@ -840,9 +837,9 @@ static bool IsScenarioVisible(rct_window* w, const scenario_index_entry* scenari static bool IsLockingEnabled(rct_window* w) { - if (gConfigGeneral.scenario_select_mode != SCENARIO_SELECT_MODE_ORIGIN) + if (gConfigGeneral.ScenarioSelectMode != SCENARIO_SELECT_MODE_ORIGIN) return false; - if (!gConfigGeneral.scenario_unlocking_enabled) + if (!gConfigGeneral.ScenarioUnlockingEnabled) return false; if (w->selected_tab >= 6) return false; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index b222aeaca6..8b2d12d5df 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -120,7 +120,7 @@ private: const rct_scenery_group_entry* GetSceneryGroupEntry() const { - return get_scenery_group_entry(SceneryGroupIndex); + return ::GetSceneryGroupEntry(SceneryGroupIndex); } }; @@ -160,13 +160,13 @@ public: _activeTabIndex = 0; } - window_move_position(*this, { context_get_width() - GetRequiredWidth(), 0x1D }); + window_move_position(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D }); window_push_others_below(*this); } void OnClose() override { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); hide_gridlines(); viewport_set_visibility(0); @@ -189,7 +189,7 @@ public: case WIDX_SCENERY_ROTATE_OBJECTS_BUTTON: gWindowSceneryRotation++; gWindowSceneryRotation = gWindowSceneryRotation % 4; - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); Invalidate(); break; case WIDX_SCENERY_REPAINT_SCENERY_BUTTON: @@ -204,7 +204,7 @@ public: gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled; if (gWindowSceneryScatterEnabled) window_close_by_class(WindowClass::SceneryScatter); - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); Invalidate(); break; case WIDX_SCENERY_BUILD_CLUSTER_BUTTON: @@ -220,7 +220,7 @@ public: } else { - context_show_error(STR_CANT_DO_THIS, STR_PERMISSION_DENIED, {}); + ContextShowError(STR_CANT_DO_THIS, STR_PERMISSION_DENIED, {}); } Invalidate(); break; @@ -315,7 +315,7 @@ public: if (!_selectedScenery.IsUndefined()) { // Find out what scenery the cursor is over - const CursorState* state = context_get_cursor_state(); + const CursorState* state = ContextGetCursorState(); WidgetIndex widgetIndex = window_find_widget_from_point(*this, state->position); if (widgetIndex == WIDX_SCENERY_LIST) { @@ -342,7 +342,7 @@ public: void OnUpdate() override { - const CursorState* state = context_get_cursor_state(); + const CursorState* state = ContextGetCursorState(); rct_window* other = window_find_from_point(state->position); if (other == this) { @@ -416,19 +416,19 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) { - gCurrentToolId = static_cast(get_large_scenery_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetLargeSceneryEntry(tabSelectedScenery.EntryIndex)->tool_id); } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) { - gCurrentToolId = static_cast(get_wall_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetWallEntry(tabSelectedScenery.EntryIndex)->tool_id); } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_PATH_ITEM) { // path bit - gCurrentToolId = static_cast(get_footpath_item_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetFootpathItemEntry(tabSelectedScenery.EntryIndex)->tool_id); } else { // small scenery - gCurrentToolId = static_cast(get_small_scenery_entry(tabSelectedScenery.EntryIndex)->tool_id); + gCurrentToolId = static_cast(GetSmallSceneryEntry(tabSelectedScenery.EntryIndex)->tool_id); } } } @@ -503,13 +503,13 @@ public: widgets[WIDX_SCENERY_TITLE].text = titleStringId; pressed_widgets = 0; - pressed_widgets |= 1ULL << (tabIndex + WIDX_SCENERY_TAB_1); + pressed_widgets |= 1uLL << (tabIndex + WIDX_SCENERY_TAB_1); if (gWindowSceneryPaintEnabled == 1) - pressed_widgets |= (1ULL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON); + pressed_widgets |= (1uLL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON); if (gWindowSceneryEyedropperEnabled) - pressed_widgets |= (1ULL << WIDX_SCENERY_EYEDROPPER_BUTTON); + pressed_widgets |= (1uLL << WIDX_SCENERY_EYEDROPPER_BUTTON); if (gWindowSceneryScatterEnabled) - pressed_widgets |= (1ULL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); + pressed_widgets |= (1uLL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::Empty; @@ -530,7 +530,7 @@ public: widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; } - auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(tabSelectedScenery.EntryIndex); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) { widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; @@ -542,12 +542,9 @@ public: } } - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryPrimaryColour) - | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowScenerySecondaryColour) - | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryTertiaryColour) - | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowSceneryPrimaryColour).ToUInt32(); + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowScenerySecondaryColour).ToUInt32(); + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowSceneryTertiaryColour).ToUInt32(); widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; @@ -564,7 +561,7 @@ public: { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) { - auto* bannerEntry = get_banner_entry(tabSelectedScenery.EntryIndex); + auto* bannerEntry = GetBannerEntry(tabSelectedScenery.EntryIndex); if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; @@ -572,7 +569,7 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) { - auto* sceneryEntry = get_large_scenery_entry(tabSelectedScenery.EntryIndex); + auto* sceneryEntry = GetLargeSceneryEntry(tabSelectedScenery.EntryIndex); if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; @@ -583,7 +580,7 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) { - auto* wallEntry = get_wall_entry(tabSelectedScenery.EntryIndex); + auto* wallEntry = GetWallEntry(tabSelectedScenery.EntryIndex); if (wallEntry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS)) { widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; @@ -601,7 +598,7 @@ public: } else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) { - auto* sceneryEntry = get_small_scenery_entry(tabSelectedScenery.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(tabSelectedScenery.EntryIndex); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) { @@ -721,7 +718,7 @@ public: gWindowSceneryRotation = rotation.value(); } gWindowSceneryEyedropperEnabled = false; - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, ContextGetWidth() / 2); _hoverCounter = -16; gSceneryPlaceCost = MONEY32_UNDEFINED; Invalidate(); @@ -750,7 +747,7 @@ public: for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < MaxTabs - 1; scenerySetIndex++) { - const auto* sceneryGroupEntry = get_scenery_group_entry(scenerySetIndex); + const auto* sceneryGroupEntry = GetSceneryGroupEntry(scenerySetIndex); if (sceneryGroupEntry != nullptr && scenery_group_is_invented(scenerySetIndex)) { SceneryTabInfo tabInfo; @@ -775,7 +772,7 @@ public: // small scenery for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_small_scenery_entry(sceneryId); + const auto* sceneryEntry = GetSmallSceneryEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_SMALL, sceneryId }, sceneryEntry->scenery_tab_id); @@ -785,7 +782,7 @@ public: // large scenery for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_LARGE_SCENERY_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_large_scenery_entry(sceneryId); + const auto* sceneryEntry = GetLargeSceneryEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_LARGE, sceneryId }, sceneryEntry->scenery_tab_id); @@ -795,7 +792,7 @@ public: // walls for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_wall_entry(sceneryId); + const auto* sceneryEntry = GetWallEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_WALL, sceneryId }, sceneryEntry->scenery_tab_id); @@ -805,7 +802,7 @@ public: // banners for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_banner_entry(sceneryId); + const auto* sceneryEntry = GetBannerEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_BANNER, sceneryId }, sceneryEntry->scenery_tab_id); @@ -815,7 +812,7 @@ public: // path bits for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++) { - const auto* sceneryEntry = get_footpath_item_entry(sceneryId); + const auto* sceneryEntry = GetFootpathItemEntry(sceneryId); if (sceneryEntry != nullptr) { InitSceneryEntry({ SCENERY_TYPE_PATH_ITEM, sceneryId }, sceneryEntry->scenery_tab_id); @@ -1121,7 +1118,7 @@ private: { case SCENERY_TYPE_SMALL: { - auto* sceneryEntry = get_small_scenery_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1131,7 +1128,7 @@ private: } case SCENERY_TYPE_PATH_ITEM: { - auto* sceneryEntry = get_footpath_item_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetFootpathItemEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1141,7 +1138,7 @@ private: } case SCENERY_TYPE_WALL: { - auto* sceneryEntry = get_wall_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetWallEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1151,7 +1148,7 @@ private: } case SCENERY_TYPE_LARGE: { - auto* sceneryEntry = get_large_scenery_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetLargeSceneryEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1161,7 +1158,7 @@ private: } case SCENERY_TYPE_BANNER: { - auto* sceneryEntry = get_banner_entry(selectedScenery.EntryIndex); + auto* sceneryEntry = GetBannerEntry(selectedScenery.EntryIndex); if (sceneryEntry != nullptr) { price = sceneryEntry->price; @@ -1193,14 +1190,14 @@ private: { if (scenerySelection.SceneryType == SCENERY_TYPE_BANNER) { - auto bannerEntry = get_banner_entry(scenerySelection.EntryIndex); + auto bannerEntry = GetBannerEntry(scenerySelection.EntryIndex); auto imageId = ImageId(bannerEntry->image + gWindowSceneryRotation * 2, gWindowSceneryPrimaryColour); gfx_draw_sprite(&dpi, imageId, { 33, 40 }); gfx_draw_sprite(&dpi, imageId.WithIndexOffset(1), { 33, 40 }); } else if (scenerySelection.SceneryType == SCENERY_TYPE_LARGE) { - auto sceneryEntry = get_large_scenery_entry(scenerySelection.EntryIndex); + auto sceneryEntry = GetLargeSceneryEntry(scenerySelection.EntryIndex); auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); @@ -1212,7 +1209,7 @@ private: } else if (scenerySelection.SceneryType == SCENERY_TYPE_WALL) { - auto wallEntry = get_wall_entry(scenerySelection.EntryIndex); + auto wallEntry = GetWallEntry(scenerySelection.EntryIndex); auto imageId = ImageId(wallEntry->image); auto spriteTop = (wallEntry->height * 2) + 0x32; if (wallEntry->flags & WALL_SCENERY_HAS_GLASS) @@ -1248,13 +1245,13 @@ private: } else if (scenerySelection.SceneryType == SCENERY_TYPE_PATH_ITEM) { - auto* pathBitEntry = get_footpath_item_entry(scenerySelection.EntryIndex); + auto* pathBitEntry = GetFootpathItemEntry(scenerySelection.EntryIndex); auto imageId = ImageId(pathBitEntry->image); gfx_draw_sprite(&dpi, imageId, { 11, 16 }); } else { - auto sceneryEntry = get_small_scenery_entry(scenerySelection.EntryIndex); + auto sceneryEntry = GetSmallSceneryEntry(scenerySelection.EntryIndex); auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) { diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index e41af08d5e..6e9a21947d 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -58,7 +58,7 @@ public: void OnOpen() override { widgets = window_scenery_scatter_widgets; - hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); window_push_others_below(*this); @@ -154,21 +154,21 @@ public: void OnPrepareDraw() override { // Set the preview image button to be pressed down - pressed_widgets = (1ULL << WIDX_PREVIEW); + pressed_widgets = (1uLL << WIDX_PREVIEW); // Set density buttons' pressed state. switch (gWindowSceneryScatterDensity) { case ScatterToolDensity::LowDensity: - pressed_widgets |= (1ULL << WIDX_DENSITY_LOW); + pressed_widgets |= (1uLL << WIDX_DENSITY_LOW); break; case ScatterToolDensity::MediumDensity: - pressed_widgets |= (1ULL << WIDX_DENSITY_MEDIUM); + pressed_widgets |= (1uLL << WIDX_DENSITY_MEDIUM); break; case ScatterToolDensity::HighDensity: - pressed_widgets |= (1ULL << WIDX_DENSITY_HIGH); + pressed_widgets |= (1uLL << WIDX_DENSITY_HIGH); break; } diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 65fd96d821..dd8496bb89 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -144,7 +144,7 @@ rct_window* WindowServerListOpen() window_set_resize(*window, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); - safe_strcpy(_playerName, gConfigNetwork.player_name.c_str(), sizeof(_playerName)); + safe_strcpy(_playerName, gConfigNetwork.PlayerName.c_str(), sizeof(_playerName)); window->no_list_items = static_cast(_serverList.GetCount()); @@ -183,7 +183,7 @@ static void WindowServerListMouseup(rct_window* w, WidgetIndex widgetIndex) { Formatter ft; ft.Add(server.Version.c_str()); - context_show_error(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); } } break; @@ -195,7 +195,7 @@ static void WindowServerListMouseup(rct_window* w, WidgetIndex widgetIndex) WindowTextInputOpen(w, widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, STR_NONE, 0, 128); break; case WIDX_START_SERVER: - context_open_window(WindowClass::ServerStart); + ContextOpenWindow(WindowClass::ServerStart); break; } } @@ -222,7 +222,7 @@ static void WindowServerListDropdown(rct_window* w, WidgetIndex widgetIndex, int { Formatter ft; ft.Add(server.Version.c_str()); - context_show_error(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); } break; case DDIDX_FAVOURITE: @@ -322,8 +322,8 @@ static void WindowServerListTextinput(rct_window* w, WidgetIndex widgetIndex, ch if (_playerName[0] != '\0') { - gConfigNetwork.player_name = _playerName; - config_save_default(); + gConfigNetwork.PlayerName = _playerName; + ConfigSaveDefault(); } widget_invalidate(*w, WIDX_PLAYER_NAME_INPUT); @@ -352,11 +352,7 @@ static OpenRCT2String WindowServerListTooltip(rct_window* const w, const WidgetI static void WindowServerListInvalidate(rct_window* w) { - window_server_list_widgets[WIDX_BACKGROUND].right = w->width - 1; - window_server_list_widgets[WIDX_BACKGROUND].bottom = w->height - 1; - window_server_list_widgets[WIDX_TITLE].right = w->width - 2; - window_server_list_widgets[WIDX_CLOSE].left = w->width - 2 - 11; - window_server_list_widgets[WIDX_CLOSE].right = w->width - 2 - 11 + 10; + w->ResizeFrame(); int32_t margin = 6; int32_t buttonHeight = 13; @@ -441,7 +437,7 @@ static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i { snprintf(players, sizeof(players), "%d/%d", serverDetails.Players, serverDetails.MaxPlayers); } - const int16_t numPlayersStringWidth = gfx_get_string_width(players, FontSpriteBase::MEDIUM); + const int16_t numPlayersStringWidth = gfx_get_string_width(players, FontStyle::Medium); // How much space we have for the server info depends on the size of everything rendered after. const int16_t spaceAvailableForInfo = width - numPlayersStringWidth - SCROLLBAR_WIDTH - 35; @@ -520,7 +516,7 @@ static void JoinServer(std::string address) if (!network_begin_client(address, port)) { - context_show_error(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); } } diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index fa081f7a2e..c6bba0558c 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -84,10 +84,10 @@ public: page = 0; list_information_type = 0; - snprintf(_port, 7, "%u", gConfigNetwork.default_port); - safe_strcpy(_name, gConfigNetwork.server_name.c_str(), sizeof(_name)); - safe_strcpy(_description, gConfigNetwork.server_description.c_str(), sizeof(_description)); - safe_strcpy(_greeting, gConfigNetwork.server_greeting.c_str(), sizeof(_greeting)); + snprintf(_port, 7, "%u", gConfigNetwork.DefaultPort); + safe_strcpy(_name, gConfigNetwork.ServerName.c_str(), sizeof(_name)); + safe_strcpy(_description, gConfigNetwork.ServerDescription.c_str(), sizeof(_description)); + safe_strcpy(_greeting, gConfigNetwork.ServerGreeting.c_str(), sizeof(_greeting)); } void OnMouseUp(WidgetIndex widgetIndex) override { @@ -112,24 +112,24 @@ public: window_start_textbox(*this, widgetIndex, STR_STRING, _password, 32); break; case WIDX_MAXPLAYERS_INCREASE: - if (gConfigNetwork.maxplayers < 255) + if (gConfigNetwork.Maxplayers < 255) { - gConfigNetwork.maxplayers++; + gConfigNetwork.Maxplayers++; } - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; case WIDX_MAXPLAYERS_DECREASE: - if (gConfigNetwork.maxplayers > 1) + if (gConfigNetwork.Maxplayers > 1) { - gConfigNetwork.maxplayers--; + gConfigNetwork.Maxplayers--; } - config_save_default(); + ConfigSaveDefault(); Invalidate(); break; case WIDX_ADVERTISE_CHECKBOX: - gConfigNetwork.advertise = !gConfigNetwork.advertise; - config_save_default(); + gConfigNetwork.Advertise = !gConfigNetwork.Advertise; + ConfigSaveDefault(); Invalidate(); break; case WIDX_START_SERVER: @@ -141,7 +141,7 @@ public: auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(LoadSaveCallback)); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } } @@ -149,10 +149,10 @@ public: { ColourSchemeUpdateByClass(this, WindowClass::ServerList); - WidgetSetCheckboxValue(*this, WIDX_ADVERTISE_CHECKBOX, gConfigNetwork.advertise); + WidgetSetCheckboxValue(*this, WIDX_ADVERTISE_CHECKBOX, gConfigNetwork.Advertise); auto ft = Formatter::Common(); ft.Increment(18); - ft.Add(gConfigNetwork.maxplayers); + ft.Add(gConfigNetwork.Maxplayers); } void OnUpdate() override { @@ -184,8 +184,8 @@ public: safe_strcpy(_port, temp.c_str(), sizeof(_port)); } - gConfigNetwork.default_port = atoi(_port); - config_save_default(); + gConfigNetwork.DefaultPort = atoi(_port); + ConfigSaveDefault(); widget_invalidate(*this, WIDX_NAME_INPUT); break; @@ -201,8 +201,8 @@ public: if (_name[0] != '\0') { - gConfigNetwork.server_name = _name; - config_save_default(); + gConfigNetwork.ServerName = _name; + ConfigSaveDefault(); } widget_invalidate(*this, WIDX_NAME_INPUT); @@ -219,8 +219,8 @@ public: if (_description[0] != '\0') { - gConfigNetwork.server_description = _description; - config_save_default(); + gConfigNetwork.ServerDescription = _description; + ConfigSaveDefault(); } widget_invalidate(*this, WIDX_DESCRIPTION_INPUT); @@ -237,8 +237,8 @@ public: if (_greeting[0] != '\0') { - gConfigNetwork.server_greeting = _greeting; - config_save_default(); + gConfigNetwork.ServerGreeting = _greeting; + ConfigSaveDefault(); } widget_invalidate(*this, WIDX_GREETING_INPUT); @@ -284,7 +284,7 @@ private: game_notify_map_change(); if (GetContext()->LoadParkFromFile(path, false, true)) { - network_begin_server(gConfigNetwork.default_port, gConfigNetwork.listen_address); + network_begin_server(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress); } } @@ -293,8 +293,8 @@ private: if (result == MODAL_RESULT_OK) { game_notify_map_change(); - context_load_park_from_file(path); - network_begin_server(gConfigNetwork.default_port, gConfigNetwork.listen_address); + GetContext()->LoadParkFromFile(path); + network_begin_server(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress); } } }; diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 10bd97b1a0..9fa5a71bd6 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -234,13 +234,7 @@ public: void OnPrepareDraw() override { - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - widgets[WIDX_TITLE].right = width - 2; - widgets[WIDX_CLOSE].right = width - 3; - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_TAB_CONTENT_PANEL].right = width - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = height - 1; + ResizeFrameWithPage(); widgets[WIDX_SCROLL].right = width - 5; widgets[WIDX_SCROLL].bottom = height - 19; widgets[WIDX_RESET].top = height - 16; diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 8d079aee2e..effa0e64f9 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -135,7 +135,7 @@ public: this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ })); - viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); return true; @@ -244,7 +244,7 @@ public: if (_isSmall) { - auto* wallEntry = get_wall_entry(_sceneryEntry); + auto* wallEntry = GetWallEntry(_sceneryEntry); main_colour_btn->type = WindowWidgetType::Empty; text_colour_btn->type = WindowWidgetType::Empty; @@ -260,7 +260,7 @@ public: } else { - auto* sceneryEntry = get_large_scenery_entry(_sceneryEntry); + auto* sceneryEntry = GetLargeSceneryEntry(_sceneryEntry); main_colour_btn->type = WindowWidgetType::Empty; text_colour_btn->type = WindowWidgetType::Empty; @@ -275,8 +275,8 @@ public: } } - main_colour_btn->image = SPRITE_ID_PALETTE_COLOUR_1(_mainColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; - text_colour_btn->image = SPRITE_ID_PALETTE_COLOUR_1(_textColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; + main_colour_btn->image = GetColourButtonImage(_mainColour).ToUInt32(); + text_colour_btn->image = GetColourButtonImage(_textColour).ToUInt32(); } void OnDraw(rct_drawpixelinfo& dpi) override @@ -307,7 +307,7 @@ public: this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos })); if (viewport != nullptr) - viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; Invalidate(); } }; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index ea8341ea02..bb8f709ec2 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -339,16 +339,7 @@ private: auto ft = Formatter::Common(); staff->FormatNameTo(ft); - widgets[WIDX_BACKGROUND].right = width - 1; - widgets[WIDX_BACKGROUND].bottom = height - 1; - - widgets[WIDX_RESIZE].right = width - 1; - widgets[WIDX_RESIZE].bottom = height - 1; - - widgets[WIDX_TITLE].right = width - 2; - - widgets[WIDX_CLOSE].left = width - 13; - widgets[WIDX_CLOSE].right = width - 3; + ResizeFrameWithPage(); } void CommonPrepareDrawAfter() @@ -391,7 +382,7 @@ private: { auto intent = Intent(WindowClass::FirePrompt); intent.putExtra(INTENT_EXTRA_PEEP, staff); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case WIDX_RENAME: @@ -651,18 +642,18 @@ private: if (widgetIndex != WIDX_PICKUP) return; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - auto mapCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); + auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); if (!mapCoords.IsNull()) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; gMapSelectPositionA = mapCoords; gMapSelectPositionB = mapCoords; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } gPickupPeepImage = ImageId(); @@ -695,7 +686,7 @@ private: const auto staffEntityId = EntityId::FromUnderlying(number); TileElement* tileElement; - auto destCoords = footpath_get_coordinates_from_pos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); + auto destCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); if (destCoords.IsNull()) return; @@ -1158,7 +1149,7 @@ private: else { viewport_flags = 0; - if (gConfigGeneral.always_show_gridlines) + if (gConfigGeneral.AlwaysShowGridlines) viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 8b5819b767..1b0e406877 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -39,71 +39,57 @@ static rct_widget window_staff_fire_widgets[] = { WIDGETS_END, }; -static void WindowStaffFireMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowStaffFirePaint(rct_window *w, rct_drawpixelinfo *dpi); - -//0x9A3F7C -static WindowEventList window_staff_fire_events([](auto& events) -{ - events.mouse_up = &WindowStaffFireMouseup; - events.paint = &WindowStaffFirePaint; -}); // clang-format on -/** Based off of rct2: 0x6C0A77 */ +class StaffFirePromptWindow final : public Window +{ +public: + void SetWindowNumber(rct_windownumber windownumber) + { + number = windownumber; + } + + void OnOpen() override + { + widgets = window_staff_fire_widgets; + WindowInitScrollWidgets(*this); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_YES: + { + auto staffFireAction = StaffFireAction(EntityId::FromUnderlying(number)); + GameActions::Execute(&staffFireAction); + break; + } + case WIDX_CLOSE: + case WIDX_CANCEL: + Close(); + break; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + + Peep* peep = GetEntity(EntityId::FromUnderlying(number)); + auto ft = Formatter(); + peep->FormatNameTo(ft); + + ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ WW / 2, (WH / 2) - 3 }); + DrawTextWrapped(&dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE }); + } +}; + rct_window* WindowStaffFirePromptOpen(Peep* peep) { - rct_window* w; - - // Check if the confirm window already exists. - w = window_bring_to_front_by_number(WindowClass::FirePrompt, peep->sprite_index.ToUnderlying()); - if (w != nullptr) - { - return w; - } - - w = WindowCreateCentred(WW, WH, &window_staff_fire_events, WindowClass::FirePrompt, WF_TRANSPARENT); - w->widgets = window_staff_fire_widgets; - - WindowInitScrollWidgets(*w); - - w->number = peep->sprite_index.ToUnderlying(); - - return w; -} - -/** - * - * rct2: 0x006C0B40 - */ -static void WindowStaffFireMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_YES: - { - auto staffFireAction = StaffFireAction(EntityId::FromUnderlying(w->number)); - GameActions::Execute(&staffFireAction); - break; - } - case WIDX_CANCEL: - case WIDX_CLOSE: - window_close(*w); - } -} - -/** - * - * rct2: 0x006C0AF2 - */ -static void WindowStaffFirePaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(*w, dpi); - - Peep* peep = GetEntity(EntityId::FromUnderlying(w->number)); - auto ft = Formatter(); - peep->FormatNameTo(ft); - - ScreenCoordsXY stringCoords(w->windowPos.x + WW / 2, w->windowPos.y + (WH / 2) - 3); - DrawTextWrapped(dpi, stringCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE }); + // Check if the confirm window already exists + auto* window = WindowFocusOrCreate( + WindowClass::FirePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + window->SetWindowNumber(peep->sprite_index.ToUnderlying()); + return window; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index b55a4920ef..862e3d2a52 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -147,7 +147,7 @@ public: } break; case WIDX_STAFF_LIST_MAP: - context_open_window(WindowClass::Map); + ContextOpenWindow(WindowClass::Map); break; case WIDX_STAFF_LIST_QUICK_FIRE: _quickFireMode = !_quickFireMode; @@ -252,8 +252,9 @@ public: if (GetSelectedStaffType() != StaffType::Entertainer) { widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::ColourBtn; - auto spriteIdPalette = SPRITE_ID_PALETTE_COLOUR_1(static_cast(staff_get_colour(GetSelectedStaffType()))); - widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = spriteIdPalette | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN; + widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = GetColourButtonImage( + staff_get_colour(GetSelectedStaffType())) + .ToUInt32(); } SetWidgetPressed(WIDX_STAFF_LIST_QUICK_FIRE, _quickFireMode); @@ -357,7 +358,7 @@ public: { auto intent = Intent(WindowClass::Peep); intent.putExtra(INTENT_EXTRA_PEEP, peep); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } break; @@ -461,7 +462,7 @@ public: { auto ft = Formatter(); ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); - context_show_error(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); + ContextShowError(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); } } } @@ -500,7 +501,7 @@ private: */ void HireNewMember(StaffType staffType, EntertainerCostume entertainerType) { - bool autoPosition = gConfigGeneral.auto_staff_placement; + bool autoPosition = gConfigGeneral.AutoStaffPlacement; if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) { autoPosition = autoPosition ^ 1; @@ -511,7 +512,7 @@ private: if (staffType == StaffType::Handyman) { staffOrders = STAFF_ORDERS_SWEEPING | STAFF_ORDERS_WATER_FLOWERS | STAFF_ORDERS_EMPTY_BINS; - if (gConfigGeneral.handymen_mow_default) + if (gConfigGeneral.HandymenMowByDefault) { staffOrders |= STAFF_ORDERS_MOWING; } @@ -531,7 +532,7 @@ private: auto* staff = GetEntity(actionResult.StaffEntityId); auto intent = Intent(WindowClass::Peep); intent.putExtra(INTENT_EXTRA_PEEP, staff); - context_open_intent(&intent); + ContextOpenIntent(&intent); }); GameActions::Execute(&hireStaffAction); @@ -590,7 +591,7 @@ private: { int32_t direction{}; TileElement* tileElement{}; - auto footpathCoords = footpath_get_coordinates_from_pos(screenCoords, &direction, &tileElement); + auto footpathCoords = FootpathGetCoordinatesFromPos(screenCoords, &direction, &tileElement); if (footpathCoords.IsNull()) return nullptr; diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 2cba21cc0d..e9a205cfdd 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -111,7 +111,7 @@ public: _buffer.resize(maxLength); safe_strcpy(_buffer.data(), std::string(text).c_str(), maxLength); _maxInputLength = maxLength; - gTextInput = context_start_text_input(_buffer.data(), maxLength); + gTextInput = ContextStartTextInput(_buffer.data(), maxLength); } void SetCallback(std::function callback, std::function cancelCallback) @@ -124,7 +124,7 @@ public: { // Make sure that we take it out of the text input // mode otherwise problems may occur. - context_stop_text_input(); + ContextStopTextInput(); } void OnPeriodicUpdate() override @@ -154,12 +154,12 @@ public: { case WIDX_CANCEL: case WIDX_CLOSE: - context_stop_text_input(); + ContextStopTextInput(); ExecuteCallback(false); window_close(*this); break; case WIDX_OKAY: - context_stop_text_input(); + ContextStopTextInput(); ExecuteCallback(true); window_close(*this); } @@ -223,7 +223,7 @@ public: // String length needs to add 12 either side of box // +13 for cursor when max length. - gfx_wrap_string(wrapped_string, WW - (24 + 13), FontSpriteBase::MEDIUM, &no_lines); + gfx_wrap_string(wrapped_string, WW - (24 + 13), FontStyle::Medium, &no_lines); gfx_fill_rect_inset( &dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } }, @@ -240,7 +240,7 @@ public: for (int32_t line = 0; line <= no_lines; line++) { screenCoords.x = windowPos.x + 12; - gfx_draw_string_no_formatting(&dpi, screenCoords, wrap_pointer, { colours[1], FontSpriteBase::MEDIUM }); + gfx_draw_string_no_formatting(&dpi, screenCoords, wrap_pointer, { colours[1], FontStyle::Medium }); size_t string_length = get_string_size(wrap_pointer) - 1; @@ -249,7 +249,7 @@ public: // Make a copy of the string for measuring the width. char temp_string[TEXT_INPUT_SIZE] = { 0 }; std::memcpy(temp_string, wrap_pointer, gTextInput->SelectionStart - char_count); - cursorX = windowPos.x + 13 + gfx_get_string_width_no_formatting(temp_string, FontSpriteBase::MEDIUM); + cursorX = windowPos.x + 13 + gfx_get_string_width_no_formatting(temp_string, FontStyle::Medium); cursorY = screenCoords.y; int32_t textWidth = 6; @@ -260,7 +260,7 @@ public: utf8 tmp[5] = { 0 }; // This is easier than setting temp_string[0..5] uint32_t codepoint = utf8_get_next(_buffer.data() + gTextInput->SelectionStart, nullptr); utf8_write_codepoint(tmp, codepoint); - textWidth = std::max(gfx_get_string_width_no_formatting(tmp, FontSpriteBase::MEDIUM) - 2, 4); + textWidth = std::max(gfx_get_string_width_no_formatting(tmp, FontStyle::Medium) - 2, 4); } if (_cursorBlink > 15) @@ -298,7 +298,7 @@ public: void OnReturnPressed() { - context_stop_text_input(); + ContextStopTextInput(); ExecuteCallback(true); window_close(*this); } @@ -310,14 +310,14 @@ public: // String length needs to add 12 either side of box +13 for cursor when max length. int32_t numLines{}; - gfx_wrap_string(wrappedString.data(), WW - (24 + 13), FontSpriteBase::MEDIUM, &numLines); + gfx_wrap_string(wrappedString.data(), WW - (24 + 13), FontStyle::Medium, &numLines); return numLines * 10 + WH; } private: static void DrawIMEComposition(rct_drawpixelinfo& dpi, int32_t cursorX, int32_t cursorY) { - int compositionWidth = gfx_get_string_width(gTextInput->ImeBuffer, FontSpriteBase::MEDIUM); + int compositionWidth = gfx_get_string_width(gTextInput->ImeBuffer, FontStyle::Medium); ScreenCoordsXY screenCoords(cursorX - (compositionWidth / 2), cursorY + 13); int width = compositionWidth; int height = 10; diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index a3ae54fb12..c2fde36cc6 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -517,7 +517,7 @@ public: case WIDX_THEMES_RCT1_RIDE_LIGHTS: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { @@ -529,7 +529,7 @@ public: case WIDX_THEMES_RCT1_PARK_LIGHTS: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { @@ -541,7 +541,7 @@ public: case WIDX_THEMES_RCT1_SCENARIO_FONT: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { @@ -553,7 +553,7 @@ public: case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { @@ -584,7 +584,7 @@ public: case WIDX_THEMES_DELETE_BUTTON: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { @@ -594,7 +594,7 @@ public: case WIDX_THEMES_RENAME_BUTTON: if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { @@ -659,12 +659,12 @@ public: } else { - context_show_error(STR_THEMES_ERR_NAME_ALREADY_EXISTS, STR_NONE, {}); + ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, STR_NONE, {}); } } else { - context_show_error(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); } break; } @@ -706,7 +706,7 @@ public: { if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); } else { @@ -736,7 +736,7 @@ public: { if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); } else { @@ -823,7 +823,7 @@ public: { gfx_draw_string( &dpi, topLeft, static_cast(CheckBoxMarkString), - { static_cast(colours[1] & 0x7F), FontSpriteBase::MEDIUM_DARK }); + { static_cast(colours[1] & 0x7F), FontStyle::Medium, TextDarkness::Dark }); } } } diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 7500a15a08..a88a612163 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -442,26 +442,26 @@ static constexpr int32_t ViewportInteractionFlags = EnumsToFlags( // clang-format off static uint64_t PageHoldDownWidgets[] = { - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_SURFACE_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_SURFACE_SPINNER_HEIGHT_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_PATH_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_PATH_SPINNER_HEIGHT_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_TRACK_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_TRACK_SPINNER_HEIGHT_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_SCENERY_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_SCENERY_SPINNER_HEIGHT_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_WALL_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_WALL_SPINNER_HEIGHT_DECREASE) | (1ULL << WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE) | (1ULL << WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE), - (1ULL << WIDX_SPINNER_X_INCREASE) | (1ULL << WIDX_SPINNER_X_DECREASE) | (1ULL << WIDX_SPINNER_Y_INCREASE) | (1ULL << WIDX_SPINNER_Y_DECREASE) | (1ULL << WIDX_BANNER_SPINNER_HEIGHT_INCREASE) | (1ULL << WIDX_BANNER_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_SURFACE_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_SURFACE_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_PATH_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_PATH_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_TRACK_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_TRACK_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_SCENERY_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_SCENERY_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_WALL_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_WALL_SPINNER_HEIGHT_DECREASE) | (1uLL << WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE) | (1uLL << WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE), + (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE) | (1uLL << WIDX_BANNER_SPINNER_HEIGHT_INCREASE) | (1uLL << WIDX_BANNER_SPINNER_HEIGHT_DECREASE), }; static uint64_t PageDisabledWidgets[] = { - (1ULL << WIDX_BUTTON_MOVE_UP) | (1ULL << WIDX_BUTTON_MOVE_DOWN) | (1ULL << WIDX_BUTTON_REMOVE) | (1ULL << WIDX_BUTTON_ROTATE) | (1ULL << WIDX_BUTTON_COPY), + (1uLL << WIDX_BUTTON_MOVE_UP) | (1uLL << WIDX_BUTTON_MOVE_DOWN) | (1uLL << WIDX_BUTTON_REMOVE) | (1uLL << WIDX_BUTTON_ROTATE) | (1uLL << WIDX_BUTTON_COPY), 0, 0, 0, 0, 0, 0, - (1ULL << WIDX_BUTTON_ROTATE), + (1uLL << WIDX_BUTTON_ROTATE), 0, }; // clang-format on @@ -923,7 +923,7 @@ public: void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; CoordsXY mapCoords; @@ -953,7 +953,7 @@ public: gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectType = MAP_SELECT_TYPE_FULL; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override @@ -1144,7 +1144,7 @@ public: if (tileElement->AsPath()->HasAddition()) { const auto pathAdditionType = tileElement->AsPath()->GetAdditionEntryIndex(); - const auto* pathBitEntry = get_footpath_item_entry(pathAdditionType); + const auto* pathBitEntry = GetFootpathItemEntry(pathAdditionType); StringId additionNameId = pathBitEntry != nullptr ? pathBitEntry->name : static_cast(STR_UNKNOWN_OBJECT_TYPE); auto ft = Formatter(); @@ -1320,7 +1320,7 @@ public: { // TODO: Make this work with Left/Right park entrance parts ft = Formatter(); - ft.Add(park_entrance_get_index({ _toolMap, tileElement->GetBaseZ() })); + ft.Add(ParkEntranceGetIndex({ _toolMap, tileElement->GetBaseZ() })); DrawTextBasic( &dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, { colours[1] }); @@ -1459,7 +1459,7 @@ public: { colours[1] }); // Banner info - auto* largeSceneryEntry = get_large_scenery_entry(largeSceneryType); + auto* largeSceneryEntry = GetLargeSceneryEntry(largeSceneryType); if (largeSceneryEntry != nullptr && largeSceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) { auto banner = sceneryElement->GetBanner(); @@ -1539,7 +1539,7 @@ public: { auto& listWidget = widgets[WIDX_LIST]; auto centrePos = ScreenCoordsXY{ listWidget.width() / 2, - (listWidget.height() - font_get_line_height(FontSpriteBase::MEDIUM)) / 2 }; + (listWidget.height() - font_get_line_height(FontStyle::Medium)) / 2 }; auto ft = Formatter{}; auto textPaint = TextPaint{ colours[1], TextAlignment::CENTRE }; DrawTextWrapped(&dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint); @@ -1551,7 +1551,7 @@ public: int32_t i = 0; char buffer[256]; - const TileElement* tileElement = map_get_first_element_at(_toolMap); + const TileElement* tileElement = MapGetFirstElementAt(_toolMap); do { @@ -1775,7 +1775,7 @@ private: windowTileInspectorSelectedIndex = -1; scrolls[0].v_top = 0; - TileElement* element = map_get_first_element_at(_toolMap); + TileElement* element = MapGetFirstElementAt(_toolMap); int16_t numItems = 0; do { @@ -1967,7 +1967,7 @@ private: openrct2_assert( windowTileInspectorSelectedIndex >= 0 && windowTileInspectorSelectedIndex < windowTileInspectorElementCount, "Selected list item out of range"); - return map_get_first_element_at(_toolMap) + windowTileInspectorSelectedIndex; + return MapGetFirstElementAt(_toolMap) + windowTileInspectorSelectedIndex; } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index 8274419dee..cb0c5ea687 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -24,57 +24,43 @@ static rct_widget window_title_exit_widgets[] = { MakeWidget({0, 0}, {40, 64}, WindowWidgetType::ImgBtn, WindowColour::Tertiary, SPR_MENU_EXIT, STR_EXIT), WIDGETS_END, }; - -static void WindowTitleExitPaint(rct_window *w, rct_drawpixelinfo *dpi); -static void WindowTitleExitMouseup(rct_window *w, WidgetIndex widgetIndex); - -static WindowEventList window_title_exit_events([](auto& events) -{ - events.mouse_up = &WindowTitleExitMouseup; - events.paint = &WindowTitleExitPaint; -}); // clang-format on +class TitleExitWindow final : public Window +{ + void OnOpen() override + { + widgets = window_title_exit_widgets; + InitScrollWidgets(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + if (gIntroState != IntroState::None) + return; + + switch (widgetIndex) + { + case WIDX_EXIT: + ContextQuit(); + // game_do_command(0, 1, 0, 0, 5, 3, 0); + break; + }; + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + } +}; + /** * Creates the window containing the exit button on the title screen. * rct2: 0x0066B624 (part of 0x0066B3E8) */ rct_window* WindowTitleExitOpen() { - rct_window* window; - - window = WindowCreate( - ScreenCoordsXY(context_get_width() - 40, context_get_height() - 64), 40, 64, &window_title_exit_events, - WindowClass::TitleExit, WF_STICK_TO_BACK | WF_TRANSPARENT); - window->widgets = window_title_exit_widgets; - WindowInitScrollWidgets(*window); - - return window; -} - -/** - * - * rct2: 0x0066B83C - */ -static void WindowTitleExitMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - if (gIntroState != IntroState::None) - return; - - switch (widgetIndex) - { - case WIDX_EXIT: - context_quit(); - // game_do_command(0, 1, 0, 0, 5, 3, 0); - break; - }; -} - -/** - * - * rct2: 0x0066B836 - */ -static void WindowTitleExitPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(*w, dpi); + return WindowCreate( + WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), 40, 64, + WF_STICK_TO_BACK | WF_TRANSPARENT); } diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index a748a8e278..2c6e35d30d 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -27,51 +27,51 @@ static rct_widget window_title_logo_widgets[] = { WIDGETS_END, }; -static void WindowTitleMenuMouseup(rct_window* w, WidgetIndex widgetIndex); -static void WindowTitleLogoPaint(rct_window* w, rct_drawpixelinfo* dpi); - -// clang-format off -static WindowEventList window_title_logo_events([](auto& events) +class TitleLogoWindow final : public Window { - events.mouse_up = &WindowTitleMenuMouseup; - events.paint = &WindowTitleLogoPaint; -}); -// clang-format on +public: + /** + * Creates the window containing the logo and the expansion packs on the title screen. + * rct2: 0x0066B679 (part of 0x0066B3E8) + */ + void OnOpen() override + { + widgets = window_title_logo_widgets; + WindowInitScrollWidgets(*this); + colours[0] = TRANSLUCENT(COLOUR_GREY); + colours[1] = TRANSLUCENT(COLOUR_GREY); + colours[2] = TRANSLUCENT(COLOUR_GREY); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_LOGO: + WindowAboutOpen(); + break; + } + } + + /** + * + * rct2: 0x0066B872 + */ + void OnDraw(rct_drawpixelinfo& dpi) override + { + auto screenCoords = windowPos + ScreenCoordsXY{ 2, 2 }; + gfx_draw_sprite(&dpi, ImageId(SPR_G2_LOGO), screenCoords); + gfx_draw_sprite(&dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 }); + } +}; -/** - * Creates the window containing the logo and the expansion packs on the title screen. - * rct2: 0x0066B679 (part of 0x0066B3E8) - */ rct_window* WindowTitleLogoOpen() { - rct_window* window = WindowCreate( - ScreenCoordsXY(0, 0), WW, WH, &window_title_logo_events, WindowClass::TitleLogo, WF_STICK_TO_BACK | WF_TRANSPARENT); - window->widgets = window_title_logo_widgets; - WindowInitScrollWidgets(*window); - window->colours[0] = TRANSLUCENT(COLOUR_GREY); - window->colours[1] = TRANSLUCENT(COLOUR_GREY); - window->colours[2] = TRANSLUCENT(COLOUR_GREY); - + auto* window = window_bring_to_front_by_class(WindowClass::TitleLogo); + if (window == nullptr) + { + window = WindowCreate( + WindowClass::TitleLogo, ScreenCoordsXY(0, 0), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT); + } return window; } - -static void WindowTitleMenuMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - switch (widgetIndex) - { - case WIDX_LOGO: - WindowAboutOpen(); - break; - } -} - -/** - * - * rct2: 0x0066B872 - */ -static void WindowTitleLogoPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - auto screenCoords = w->windowPos + ScreenCoordsXY{ 2, 2 }; - gfx_draw_sprite(dpi, ImageId(SPR_G2_LOGO), screenCoords); - gfx_draw_sprite(dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 }); -} diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index b5445a5fb1..afb857395a 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -42,7 +42,6 @@ enum DDIDX_CUSTOM_BEGIN = 6, }; -static ScreenRect _filterRect; static constexpr ScreenSize MenuButtonDims = { 82, 82 }; static constexpr ScreenSize UpdateButtonDims = { MenuButtonDims.width * 4, 28 }; @@ -54,67 +53,8 @@ static rct_widget window_title_menu_widgets[] = { MakeWidget({0, 0}, UpdateButtonDims, WindowWidgetType::Empty, WindowColour::Secondary, STR_UPDATE_AVAILABLE), WIDGETS_END, }; - -static void WindowTitleMenuMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowTitleMenuMousedown(rct_window *w, WidgetIndex widgetIndex, rct_widget* widget); -static void WindowTitleMenuDropdown(rct_window *w, WidgetIndex widgetIndex, int32_t dropdownIndex); -static void WindowTitleMenuCursor(rct_window *w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, CursorID *cursorId); -static void WindowTitleMenuInvalidate(rct_window *w); -static void WindowTitleMenuPaint(rct_window *w, rct_drawpixelinfo *dpi); - -static WindowEventList window_title_menu_events([](auto& events) -{ - events.mouse_up = &WindowTitleMenuMouseup; - events.mouse_down = &WindowTitleMenuMousedown; - events.dropdown = &WindowTitleMenuDropdown; - events.cursor = &WindowTitleMenuCursor; - events.invalidate = &WindowTitleMenuInvalidate; - events.paint = &WindowTitleMenuPaint; -}); // clang-format on -/** - * Creates the window containing the menu buttons on the title screen. - * rct2: 0x0066B5C0 (part of 0x0066B3E8) - */ -rct_window* WindowTitleMenuOpen() -{ - rct_window* window; - - const uint16_t windowHeight = MenuButtonDims.height + UpdateButtonDims.height; - window = WindowCreate( - ScreenCoordsXY(0, context_get_height() - 182), 0, windowHeight, &window_title_menu_events, WindowClass::TitleMenu, - WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND); - - window->widgets = window_title_menu_widgets; - -#ifdef DISABLE_NETWORK - window->widgets[WIDX_MULTIPLAYER].type = WindowWidgetType::Empty; -#endif - - WidgetIndex i = 0; - int32_t x = 0; - for (rct_widget* widget = window->widgets; widget != &window->widgets[WIDX_NEW_VERSION]; widget++) - { - if (widget->type != WindowWidgetType::Empty) - { - widget->left = x; - widget->right = x + MenuButtonDims.width - 1; - - x += MenuButtonDims.width; - } - i++; - } - window->width = x; - window->widgets[WIDX_NEW_VERSION].right = window->width; - window->windowPos.x = (context_get_width() - window->width) / 2; - window->colours[1] = TRANSLUCENT(COLOUR_LIGHT_ORANGE); - - WindowInitScrollWidgets(*window); - - return window; -} - static void WindowTitleMenuScenarioselectCallback(const utf8* path) { game_notify_map_change(); @@ -123,106 +63,6 @@ static void WindowTitleMenuScenarioselectCallback(const utf8* path) game_notify_map_changed(); } -static void WindowTitleMenuMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - rct_window* windowToOpen = nullptr; - - switch (widgetIndex) - { - case WIDX_START_NEW_GAME: - windowToOpen = window_find_by_class(WindowClass::ScenarioSelect); - if (windowToOpen != nullptr) - { - window_bring_to_front(*windowToOpen); - } - else - { - window_close_by_class(WindowClass::Loadsave); - window_close_by_class(WindowClass::ServerList); - WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback, false); - } - break; - case WIDX_CONTINUE_SAVED_GAME: - windowToOpen = window_find_by_class(WindowClass::Loadsave); - if (windowToOpen != nullptr) - { - window_bring_to_front(*windowToOpen); - } - else - { - window_close_by_class(WindowClass::ScenarioSelect); - window_close_by_class(WindowClass::ServerList); - auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); - GameActions::Execute(&loadOrQuitAction); - } - break; - case WIDX_MULTIPLAYER: - windowToOpen = window_find_by_class(WindowClass::ServerList); - if (windowToOpen != nullptr) - { - window_bring_to_front(*windowToOpen); - } - else - { - window_close_by_class(WindowClass::ScenarioSelect); - window_close_by_class(WindowClass::Loadsave); - context_open_window(WindowClass::ServerList); - } - break; - case WIDX_NEW_VERSION: - context_open_window_view(WV_NEW_VERSION_INFO); - break; - } -} - -static void WindowTitleMenuMousedown(rct_window* w, WidgetIndex widgetIndex, rct_widget* widget) -{ - if (widgetIndex == WIDX_GAME_TOOLS) - { - int32_t i = 0; - gDropdownItems[i++].Format = STR_SCENARIO_EDITOR; - gDropdownItems[i++].Format = STR_CONVERT_SAVED_GAME_TO_SCENARIO; - gDropdownItems[i++].Format = STR_ROLLER_COASTER_DESIGNER; - gDropdownItems[i++].Format = STR_TRACK_DESIGNS_MANAGER; - gDropdownItems[i++].Format = STR_OPEN_USER_CONTENT_FOLDER; - -#ifdef ENABLE_SCRIPTING - auto hasCustomItems = false; - const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; - if (!customMenuItems.empty()) - { - for (const auto& item : customMenuItems) - { - if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Toolbox) - { - // Add seperator - if (!hasCustomItems) - { - hasCustomItems = true; - gDropdownItems[i++].Format = STR_EMPTY; - } - - gDropdownItems[i].Format = STR_STRING; - auto sz = item.Text.c_str(); - std::memcpy(&gDropdownItems[i].Args, &sz, sizeof(const char*)); - i++; - } - } - } -#endif - - int32_t yOffset = 0; - if (i > 5) - { - yOffset = -(widget->height() + 5 + (i * 12)); - } - - WindowDropdownShowText( - { w->windowPos.x + widget->left, w->windowPos.y + widget->top + yOffset }, widget->height() + 1, - TRANSLUCENT(w->colours[0]), Dropdown::Flag::StayOpen, i); - } -} - static void InvokeCustomToolboxMenuItem(size_t index) { #ifdef ENABLE_SCRIPTING @@ -243,58 +83,206 @@ static void InvokeCustomToolboxMenuItem(size_t index) #endif } -static void WindowTitleMenuDropdown(rct_window* w, WidgetIndex widgetIndex, int32_t dropdownIndex) +class TitleMenuWindow final : public Window { - if (widgetIndex == WIDX_GAME_TOOLS) +private: + ScreenRect _filterRect; + +public: + void OnOpen() override { - switch (dropdownIndex) + widgets = window_title_menu_widgets; + +#ifdef DISABLE_NETWORK + widgets[WIDX_MULTIPLAYER].type = WindowWidgetType::Empty; +#endif + + WidgetIndex i = 0; + int32_t x = 0; + for (rct_widget* widget = widgets; widget != &widgets[WIDX_NEW_VERSION]; widget++) { - case DDIDX_SCENARIO_EDITOR: - Editor::Load(); - break; - case DDIDX_CONVERT_SAVED_GAME: - Editor::ConvertSaveToScenario(); - break; - case DDIDX_TRACK_DESIGNER: - Editor::LoadTrackDesigner(); - break; - case DDIDX_TRACK_MANAGER: - Editor::LoadTrackManager(); - break; - case DDIDX_OPEN_CONTENT_FOLDER: + if (widget->type != WindowWidgetType::Empty) { - auto context = OpenRCT2::GetContext(); - auto env = context->GetPlatformEnvironment(); - auto uiContext = context->GetUiContext(); - uiContext->OpenFolder(env->GetDirectoryPath(OpenRCT2::DIRBASE::USER)); - break; + widget->left = x; + widget->right = x + MenuButtonDims.width - 1; + + x += MenuButtonDims.width; } - default: - InvokeCustomToolboxMenuItem(dropdownIndex - DDIDX_CUSTOM_BEGIN); + i++; + } + width = x; + widgets[WIDX_NEW_VERSION].right = width; + windowPos.x = (ContextGetWidth() - width) / 2; + colours[1] = TRANSLUCENT(COLOUR_LIGHT_ORANGE); + + InitScrollWidgets(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + rct_window* windowToOpen = nullptr; + + switch (widgetIndex) + { + case WIDX_START_NEW_GAME: + windowToOpen = window_find_by_class(WindowClass::ScenarioSelect); + if (windowToOpen != nullptr) + { + window_bring_to_front(*windowToOpen); + } + else + { + window_close_by_class(WindowClass::Loadsave); + window_close_by_class(WindowClass::ServerList); + WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback, false); + } + break; + case WIDX_CONTINUE_SAVED_GAME: + windowToOpen = window_find_by_class(WindowClass::Loadsave); + if (windowToOpen != nullptr) + { + window_bring_to_front(*windowToOpen); + } + else + { + window_close_by_class(WindowClass::ScenarioSelect); + window_close_by_class(WindowClass::ServerList); + auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); + GameActions::Execute(&loadOrQuitAction); + } + break; + case WIDX_MULTIPLAYER: + windowToOpen = window_find_by_class(WindowClass::ServerList); + if (windowToOpen != nullptr) + { + window_bring_to_front(*windowToOpen); + } + else + { + window_close_by_class(WindowClass::ScenarioSelect); + window_close_by_class(WindowClass::Loadsave); + ContextOpenWindow(WindowClass::ServerList); + } + break; + case WIDX_NEW_VERSION: + ContextOpenWindowView(WV_NEW_VERSION_INFO); break; } } -} -static void WindowTitleMenuCursor( - rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, CursorID* cursorId) -{ - gTooltipTimeout = 2000; -} - -static void WindowTitleMenuInvalidate(rct_window* w) -{ - _filterRect = { w->windowPos.x, w->windowPos.y + UpdateButtonDims.height, w->windowPos.x + w->width - 1, - w->windowPos.y + MenuButtonDims.height + UpdateButtonDims.height - 1 }; - if (OpenRCT2::GetContext()->HasNewVersionInfo()) + void OnMouseDown(WidgetIndex widgetIndex) override { - w->widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; - _filterRect.Point1.y = w->windowPos.y; - } -} + if (widgetIndex == WIDX_GAME_TOOLS) + { + int32_t i = 0; + gDropdownItems[i++].Format = STR_SCENARIO_EDITOR; + gDropdownItems[i++].Format = STR_CONVERT_SAVED_GAME_TO_SCENARIO; + gDropdownItems[i++].Format = STR_ROLLER_COASTER_DESIGNER; + gDropdownItems[i++].Format = STR_TRACK_DESIGNS_MANAGER; + gDropdownItems[i++].Format = STR_OPEN_USER_CONTENT_FOLDER; -static void WindowTitleMenuPaint(rct_window* w, rct_drawpixelinfo* dpi) +#ifdef ENABLE_SCRIPTING + auto hasCustomItems = false; + const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; + if (!customMenuItems.empty()) + { + for (const auto& item : customMenuItems) + { + if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Toolbox) + { + // Add seperator + if (!hasCustomItems) + { + hasCustomItems = true; + gDropdownItems[i++].Format = STR_EMPTY; + } + + gDropdownItems[i].Format = STR_STRING; + auto sz = item.Text.c_str(); + std::memcpy(&gDropdownItems[i].Args, &sz, sizeof(const char*)); + i++; + } + } + } +#endif + + rct_widget* widget = &widgets[widgetIndex]; + int32_t yOffset = 0; + if (i > 5) + { + yOffset = -(widget->height() + 5 + (i * 12)); + } + + WindowDropdownShowText( + windowPos + ScreenCoordsXY{ widget->left, widget->top + yOffset }, widget->height() + 1, + TRANSLUCENT(colours[0]), Dropdown::Flag::StayOpen, i); + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (widgetIndex == WIDX_GAME_TOOLS) + { + switch (selectedIndex) + { + case DDIDX_SCENARIO_EDITOR: + Editor::Load(); + break; + case DDIDX_CONVERT_SAVED_GAME: + Editor::ConvertSaveToScenario(); + break; + case DDIDX_TRACK_DESIGNER: + Editor::LoadTrackDesigner(); + break; + case DDIDX_TRACK_MANAGER: + Editor::LoadTrackManager(); + break; + case DDIDX_OPEN_CONTENT_FOLDER: + { + auto context = OpenRCT2::GetContext(); + auto env = context->GetPlatformEnvironment(); + auto uiContext = context->GetUiContext(); + uiContext->OpenFolder(env->GetDirectoryPath(OpenRCT2::DIRBASE::USER)); + break; + } + default: + InvokeCustomToolboxMenuItem(selectedIndex - DDIDX_CUSTOM_BEGIN); + break; + } + } + } + + CursorID OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID cursorId) override + { + gTooltipTimeout = 2000; + return cursorId; + } + + void OnPrepareDraw() override + { + _filterRect = { windowPos + ScreenCoordsXY{ 0, UpdateButtonDims.height }, + windowPos + ScreenCoordsXY{ width - 1, MenuButtonDims.height + UpdateButtonDims.height - 1 } }; + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + { + widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; + _filterRect.Point1.y = windowPos.y; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + gfx_filter_rect(&dpi, _filterRect, FilterPaletteID::Palette51); + DrawWidgets(dpi); + } +}; + +/** + * Creates the window containing the menu buttons on the title screen. + */ +rct_window* WindowTitleMenuOpen() { - gfx_filter_rect(dpi, _filterRect, FilterPaletteID::Palette51); - WindowDrawWidgets(*w, dpi); + const uint16_t windowHeight = MenuButtonDims.height + UpdateButtonDims.height; + return WindowCreate( + WindowClass::TitleMenu, ScreenCoordsXY(0, ContextGetHeight() - 182), 0, windowHeight, + WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND); } diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index 3940600657..6161f68ed4 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -19,49 +19,48 @@ enum WindowTitleOptionsWidgetIdx { WIDX_OPTIONS, }; -static rct_widget window_title_options_widgets[] = { +static rct_widget _windowTitleOptionsWidgets[] = { MakeWidget({0, 0}, {80, 15}, WindowWidgetType::Button, WindowColour::Tertiary, STR_OPTIONS, STR_OPTIONS_TIP), WIDGETS_END, }; - -static void WindowTitleOptionsMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowTitleOptionsPaint(rct_window *w, rct_drawpixelinfo *dpi); - -static WindowEventList window_title_options_events([](auto& events) -{ - events.mouse_up = &WindowTitleOptionsMouseup; - events.paint = &WindowTitleOptionsPaint; -}); // clang-format on +class TitleOptionsWindow final : public Window +{ +public: + void OnOpen() override + { + widgets = _windowTitleOptionsWidgets; + WindowInitScrollWidgets(*this); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_OPTIONS: + ContextOpenWindow(WindowClass::Options); + break; + } + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + DrawWidgets(dpi); + } +}; + /** * Creates the window containing the options button on the title screen. */ rct_window* WindowTitleOptionsOpen() { - rct_window* window = WindowCreate( - ScreenCoordsXY(context_get_width() - 80, 0), 80, 15, &window_title_options_events, WindowClass::TitleOptions, - WF_STICK_TO_BACK | WF_TRANSPARENT); - window->widgets = window_title_options_widgets; - WindowInitScrollWidgets(*window); + auto* window = window_bring_to_front_by_class(WindowClass::TitleOptions); + if (window == nullptr) + { + window = WindowCreate( + WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), 80, 15, WF_STICK_TO_BACK | WF_TRANSPARENT); + } return window; } - -static void WindowTitleOptionsMouseup(rct_window* w, WidgetIndex widgetIndex) -{ - if (gIntroState != IntroState::None) - return; - - switch (widgetIndex) - { - case WIDX_OPTIONS: - context_open_window(WindowClass::Options); - break; - } -} - -static void WindowTitleOptionsPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - WindowDrawWidgets(*w, dpi); -} diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index a3f2c56e19..255b4ffe30 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -26,18 +26,102 @@ static rct_widget window_tooltip_widgets[] = { WIDGETS_END, }; -static void WindowTooltipUpdate(rct_window *w); -static void WindowTooltipPaint(rct_window *w, rct_drawpixelinfo *dpi); - -static WindowEventList window_tooltip_events([](auto& events) -{ - events.update = &WindowTooltipUpdate; - events.paint = &WindowTooltipPaint; -}); // clang-format on -static utf8 _tooltipText[sizeof(gCommonStringFormatBuffer)]; -static int16_t _tooltipNumLines; +class TooltipWindow final : public Window +{ +private: + utf8 _tooltipText[CommonTextBufferSize]{}; + int16_t _tooltipNumLines = 1; + +public: + TooltipWindow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) + { + int32_t textWidth = FormatTextForTooltip(message); + width = textWidth + 3; + height = ((_tooltipNumLines + 1) * font_get_line_height(FontStyle::Small)) + 4; + + window_tooltip_widgets[WIDX_BACKGROUND].right = width; + window_tooltip_widgets[WIDX_BACKGROUND].bottom = height; + + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + screenCoords.x = std::clamp(screenCoords.x - (width / 2), 0, screenWidth - width); + + // TODO The cursor size will be relative to the window DPI. + // The amount to offset the y should be adjusted. + + int32_t max_y = screenHeight - height; + screenCoords.y += 26; // Normally, we'd display the tooltip 26 lower + if (screenCoords.y > max_y) + // If y is too large, the tooltip could be forced below the cursor if we'd just clamped y, + // so we'll subtract a bit more + screenCoords.y -= height + 40; + screenCoords.y = std::clamp(screenCoords.y, 22, max_y); + + windowPos = screenCoords; + } + + void OnOpen() override + { + widgets = window_tooltip_widgets; + reset_tooltip_not_shown(); + } + + void OnUpdate() override + { + reset_tooltip_not_shown(); + } + + void OnDraw(rct_drawpixelinfo& dpi) override + { + int32_t left = windowPos.x; + int32_t top = windowPos.y; + int32_t right = windowPos.x + width - 1; + int32_t bottom = windowPos.y + height - 1; + + // Background + gfx_filter_rect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45); + gfx_filter_rect(&dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange); + + // Sides + gfx_filter_rect(&dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); + gfx_filter_rect(&dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); + gfx_filter_rect(&dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3); + gfx_filter_rect(&dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3); + + // Corners + gfx_filter_pixel(&dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3); + gfx_filter_pixel(&dpi, { right - 1, top + 1 }, FilterPaletteID::PaletteDarken3); + gfx_filter_pixel(&dpi, { left + 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); + gfx_filter_pixel(&dpi, { right - 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); + + // Text + left = windowPos.x + ((width + 1) / 2) - 1; + top = windowPos.y + 1; + draw_string_centred_raw(&dpi, { left, top }, _tooltipNumLines, _tooltipText, FontStyle::Small); + } + +private: + // Returns the width of the new tooltip text + int32_t FormatTextForTooltip(const OpenRCT2String& message) + { + utf8 tempBuffer[CommonTextBufferSize]; + format_string(tempBuffer, sizeof(tempBuffer), message.str, message.args.Data()); + + OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() }; + formattedMessage.args.Add(tempBuffer); + format_string(_tooltipText, sizeof(_tooltipText), formattedMessage.str, formattedMessage.args.Data()); + + auto textWidth = gfx_get_string_width_new_lined(_tooltipText, FontStyle::Small); + textWidth = std::min(textWidth, 196); + + int32_t numLines; + textWidth = gfx_wrap_string(_tooltipText, textWidth + 1, FontStyle::Small, &numLines); + _tooltipNumLines = numLines; + return textWidth; + } +}; void WindowTooltipReset(const ScreenCoordsXY& screenCoords) { @@ -48,64 +132,20 @@ void WindowTooltipReset(const ScreenCoordsXY& screenCoords) input_set_flag(INPUT_FLAG_4, false); } -// Returns the width of the new tooltip text -static int32_t FormatTextForTooltip(const OpenRCT2String& message) -{ - utf8 tempBuffer[sizeof(gCommonStringFormatBuffer)]; - format_string(tempBuffer, sizeof(tempBuffer), message.str, message.args.Data()); - - OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() }; - formattedMessage.args.Add(tempBuffer); - format_string(_tooltipText, sizeof(_tooltipText), formattedMessage.str, formattedMessage.args.Data()); - - auto textWidth = gfx_get_string_width_new_lined(_tooltipText, FontSpriteBase::SMALL); - textWidth = std::min(textWidth, 196); - - int32_t numLines; - textWidth = gfx_wrap_string(_tooltipText, textWidth + 1, FontSpriteBase::SMALL, &numLines); - _tooltipNumLines = numLines; - return textWidth; -} - void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) { auto* w = window_find_by_class(WindowClass::Error); if (w != nullptr) return; - int32_t textWidth = FormatTextForTooltip(message); - int32_t width = textWidth + 3; - int32_t height = ((_tooltipNumLines + 1) * font_get_line_height(FontSpriteBase::SMALL)) + 4; - window_tooltip_widgets[WIDX_BACKGROUND].right = width; - window_tooltip_widgets[WIDX_BACKGROUND].bottom = height; - - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); - screenCoords.x = std::clamp(screenCoords.x - (width / 2), 0, screenWidth - width); - - // TODO The cursor size will be relative to the window DPI. - // The amount to offset the y should be adjusted. - - int32_t max_y = screenHeight - height; - screenCoords.y += 26; // Normally, we'd display the tooltip 26 lower - if (screenCoords.y > max_y) - // If y is too large, the tooltip could be forced below the cursor if we'd just clamped y, - // so we'll subtract a bit more - screenCoords.y -= height + 40; - screenCoords.y = std::clamp(screenCoords.y, 22, max_y); - - w = WindowCreate( - screenCoords, width, height, &window_tooltip_events, WindowClass::Tooltip, WF_TRANSPARENT | WF_STICK_TO_FRONT); - w->widgets = window_tooltip_widgets; - - reset_tooltip_not_shown(); + auto tooltipWindow = std::make_unique(message, screenCoords); + auto windowPos = tooltipWindow->windowPos; + auto width = tooltipWindow->width; + auto height = tooltipWindow->height; + WindowCreate(std::move(tooltipWindow), WindowClass::Tooltip, windowPos, width, height, WF_TRANSPARENT | WF_STICK_TO_FRONT); } -/** - * - * rct2: 0x006EA10D - */ -void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCords) +void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { if (widgetWindow == nullptr || widgetIndex == -1) return; @@ -142,58 +182,12 @@ void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const return; } - WindowTooltipShow(result, screenCords); + WindowTooltipShow(result, screenCoords); } -/** - * - * rct2: 0x006E98C6 - */ void WindowTooltipClose() { window_close_by_class(WindowClass::Tooltip); gTooltipTimeout = 0; gTooltipWidget.window_classification = WindowClass::Null; } - -/** - * - * rct2: 0x006EA580 - */ -static void WindowTooltipUpdate(rct_window* w) -{ - reset_tooltip_not_shown(); -} - -/** - * - * rct2: 0x006EA41D - */ -static void WindowTooltipPaint(rct_window* w, rct_drawpixelinfo* dpi) -{ - int32_t left = w->windowPos.x; - int32_t top = w->windowPos.y; - int32_t right = w->windowPos.x + w->width - 1; - int32_t bottom = w->windowPos.y + w->height - 1; - - // Background - gfx_filter_rect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45); - gfx_filter_rect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange); - - // Sides - gfx_filter_rect(dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); - gfx_filter_rect(dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); - gfx_filter_rect(dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3); - gfx_filter_rect(dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3); - - // Corners - gfx_filter_pixel(dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3); - gfx_filter_pixel(dpi, { right - 1, top + 1 }, FilterPaletteID::PaletteDarken3); - gfx_filter_pixel(dpi, { left + 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); - gfx_filter_pixel(dpi, { right - 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); - - // Text - left = w->windowPos.x + ((w->width + 1) / 2) - 1; - top = w->windowPos.y + 1; - draw_string_centred_raw(dpi, { left, top }, _tooltipNumLines, _tooltipText, FontSpriteBase::SMALL); -} diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 7111b3d7a4..026010de8d 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -338,7 +338,7 @@ static int16_t _unkF64F0A; rct_window* WindowTopToolbarOpen() { rct_window* window = WindowCreate( - ScreenCoordsXY(0, 0), context_get_width(), TOP_TOOLBAR_HEIGHT + 1, &window_top_toolbar_events, WindowClass::TopToolbar, + ScreenCoordsXY(0, 0), ContextGetWidth(), TOP_TOOLBAR_HEIGHT + 1, &window_top_toolbar_events, WindowClass::TopToolbar, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); window->widgets = window_top_toolbar_widgets; @@ -385,35 +385,35 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex) if (!tool_set(*w, WIDX_SCENERY, Tool::Arrow)) { input_set_flag(INPUT_FLAG_6, true); - context_open_window(WindowClass::Scenery); + ContextOpenWindow(WindowClass::Scenery); } break; case WIDX_PATH: ToggleFootpathWindow(); break; case WIDX_CONSTRUCT_RIDE: - context_open_window(WindowClass::ConstructRide); + ContextOpenWindow(WindowClass::ConstructRide); break; case WIDX_RIDES: - context_open_window(WindowClass::RideList); + ContextOpenWindow(WindowClass::RideList); break; case WIDX_PARK: - context_open_window(WindowClass::ParkInformation); + ContextOpenWindow(WindowClass::ParkInformation); break; case WIDX_STAFF: - context_open_window(WindowClass::StaffList); + ContextOpenWindow(WindowClass::StaffList); break; case WIDX_GUESTS: - context_open_window(WindowClass::GuestList); + ContextOpenWindow(WindowClass::GuestList); break; case WIDX_FINANCES: - context_open_window(WindowClass::Finances); + ContextOpenWindow(WindowClass::Finances); break; case WIDX_RESEARCH: - context_open_window(WindowClass::Research); + ContextOpenWindow(WindowClass::Research); break; case WIDX_NEWS: - context_open_window(WindowClass::RecentNews); + ContextOpenWindow(WindowClass::RecentNews); break; case WIDX_MUTE: OpenRCT2::Audio::ToggleAllSounds(); @@ -425,7 +425,7 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex) } else { - context_show_error(STR_CHAT_UNAVAILABLE, STR_NONE, {}); + ContextShowError(STR_CHAT_UNAVAILABLE, STR_NONE, {}); } break; } @@ -575,7 +575,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int { auto intent = Intent(WindowClass::ScenarioSelect); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(WindowTopToolbarScenarioselectCallback)); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case DDIDX_LOAD_GAME: @@ -594,7 +594,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); intent.putExtra(INTENT_EXTRA_PATH, gScenarioName); - context_open_intent(&intent); + ContextOpenIntent(&intent); } else { @@ -603,10 +603,10 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int } break; case DDIDX_ABOUT: - context_open_window(WindowClass::About); + ContextOpenWindow(WindowClass::About); break; case DDIDX_OPTIONS: - context_open_window(WindowClass::Options); + ContextOpenWindow(WindowClass::Options); break; case DDIDX_SCREENSHOT: gScreenshotCountdown = 10; @@ -624,7 +624,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int } break; case DDIDX_UPDATE_AVAILABLE: - context_open_window_view(WV_NEW_VERSION_INFO); + ContextOpenWindowView(WV_NEW_VERSION_INFO); break; case DDIDX_QUIT_TO_MENU: { @@ -635,7 +635,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int break; } case DDIDX_EXIT_OPENRCT2: - context_quit(); + ContextQuit(); break; } break; @@ -696,27 +696,27 @@ static void WindowTopToolbarInvalidate(rct_window* w) window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::TrnBtn; window_top_toolbar_widgets[WIDX_FASTFORWARD].type = WindowWidgetType::TrnBtn; window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::TrnBtn; - window_top_toolbar_widgets[WIDX_DEBUG].type = gConfigGeneral.debugging_tools ? WindowWidgetType::TrnBtn - : WindowWidgetType::Empty; + window_top_toolbar_widgets[WIDX_DEBUG].type = gConfigGeneral.DebuggingTools ? WindowWidgetType::TrnBtn + : WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::TrnBtn; window_top_toolbar_widgets[WIDX_NETWORK].type = WindowWidgetType::TrnBtn; - if (!gConfigInterface.toolbar_show_mute) + if (!gConfigInterface.ToolbarShowMute) window_top_toolbar_widgets[WIDX_MUTE].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_chat) + if (!gConfigInterface.ToolbarShowChat) window_top_toolbar_widgets[WIDX_CHAT].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_research) + if (!gConfigInterface.ToolbarShowResearch) window_top_toolbar_widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_cheats) + if (!gConfigInterface.ToolbarShowCheats) window_top_toolbar_widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_news) + if (!gConfigInterface.ToolbarShowNews) window_top_toolbar_widgets[WIDX_NEWS].type = WindowWidgetType::Empty; - if (!gConfigInterface.toolbar_show_zoom) + if (!gConfigInterface.ToolbarShowZoom) { window_top_toolbar_widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; window_top_toolbar_widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; @@ -727,7 +727,7 @@ static void WindowTopToolbarInvalidate(rct_window* w) window_top_toolbar_widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; } - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.toolbar_show_finances) + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.ToolbarShowFinances) window_top_toolbar_widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; if (gScreenFlags & SCREEN_FLAGS_EDITOR) @@ -803,7 +803,7 @@ static void WindowTopToolbarInvalidate(rct_window* w) } // Align right hand side toolbar buttons - int32_t screenWidth = context_get_width(); + int32_t screenWidth = ContextGetWidth(); firstAlignment = 1; x = std::max(640, screenWidth); for (size_t i = 0; i < std::size(right_aligned_widgets_order); ++i) @@ -826,14 +826,14 @@ static void WindowTopToolbarInvalidate(rct_window* w) // Footpath button pressed down if (window_find_by_class(WindowClass::Footpath) == nullptr) - w->pressed_widgets &= ~(1ULL << WIDX_PATH); + w->pressed_widgets &= ~(1uLL << WIDX_PATH); else - w->pressed_widgets |= (1ULL << WIDX_PATH); + w->pressed_widgets |= (1uLL << WIDX_PATH); if (gGamePaused & GAME_PAUSED_NORMAL) - w->pressed_widgets |= (1ULL << WIDX_PAUSE); + w->pressed_widgets |= (1uLL << WIDX_PAUSE); else - w->pressed_widgets &= ~(1ULL << WIDX_PAUSE); + w->pressed_widgets &= ~(1uLL << WIDX_PAUSE); if (!OpenRCT2::Audio::gGameSoundsOff) window_top_toolbar_widgets[WIDX_MUTE].image = IMAGE_TYPE_REMAP | SPR_G2_TOOLBAR_MUTE; @@ -864,15 +864,15 @@ static void WindowTopToolbarInvalidate(rct_window* w) if (mainWindow->viewport->zoom == ZoomLevel::min()) { - w->disabled_widgets |= (1ULL << WIDX_ZOOM_IN); + w->disabled_widgets |= (1uLL << WIDX_ZOOM_IN); } else if (mainWindow->viewport->zoom >= ZoomLevel::max()) { - w->disabled_widgets |= (1ULL << WIDX_ZOOM_OUT); + w->disabled_widgets |= (1uLL << WIDX_ZOOM_OUT); } else { - w->disabled_widgets &= ~((1ULL << WIDX_ZOOM_IN) | (1ULL << WIDX_ZOOM_OUT)); + w->disabled_widgets &= ~((1uLL << WIDX_ZOOM_IN) | (1uLL << WIDX_ZOOM_OUT)); } } @@ -1074,7 +1074,7 @@ static void RepaintSceneryToolDown(const ScreenCoordsXY& windowPos, WidgetIndex auto banner = info.Element->AsBanner()->GetBanner(); if (banner != nullptr) { - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { auto repaintScenery = BannerSetColourAction( @@ -1103,7 +1103,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd { SmallSceneryElement* sceneryElement = info.Element->AsSmallScenery(); auto entryIndex = sceneryElement->GetEntryIndex(); - auto* sceneryEntry = get_small_scenery_entry(entryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(entryIndex); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1116,7 +1116,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd case ViewportInteractionItem::Wall: { auto entryIndex = info.Element->AsWall()->GetEntryIndex(); - auto* sceneryEntry = get_wall_entry(entryIndex); + auto* sceneryEntry = GetWallEntry(entryIndex); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1128,7 +1128,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd case ViewportInteractionItem::LargeScenery: { auto entryIndex = info.Element->AsLargeScenery()->GetEntryIndex(); - auto* sceneryEntry = get_large_scenery_entry(entryIndex); + auto* sceneryEntry = GetLargeSceneryEntry(entryIndex); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1143,7 +1143,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd auto banner = info.Element->AsBanner()->GetBanner(); if (banner != nullptr) { - auto sceneryEntry = get_banner_entry(banner->type); + auto sceneryEntry = GetBannerEntry(banner->type); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1155,7 +1155,7 @@ static void SceneryEyedropperToolDown(const ScreenCoordsXY& windowPos, WidgetInd case ViewportInteractionItem::FootpathItem: { auto entryIndex = info.Element->AsPath()->GetAdditionEntryIndex(); - auto* pathBitEntry = get_footpath_item_entry(entryIndex); + auto* pathBitEntry = GetFootpathItemEntry(entryIndex); if (pathBitEntry != nullptr) { WindowScenerySetSelectedItem( @@ -1256,7 +1256,7 @@ static void Sub6E1F34SmallScenery( uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); bool can_raise_item = false; - const auto* sceneryEntry = get_small_scenery_entry(sceneryIndex); + const auto* sceneryEntry = GetSmallSceneryEntry(sceneryIndex); if (sceneryEntry == nullptr) { gridPos.SetNull(); @@ -1292,7 +1292,7 @@ static void Sub6E1F34SmallScenery( // If SHIFT pressed if (gSceneryShiftPressed) { - auto* surfaceElement = map_get_surface_element_at(gridPos); + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1344,9 +1344,9 @@ static void Sub6E1F34SmallScenery( rotation -= get_current_rotation(); rotation &= 0x3; - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outQuadrant = quadrant ^ 2; @@ -1375,7 +1375,7 @@ static void Sub6E1F34SmallScenery( // If SHIFT pressed if (gSceneryShiftPressed) { - auto surfaceElement = map_get_surface_element_at(gridPos); + auto surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1428,9 +1428,9 @@ static void Sub6E1F34SmallScenery( rotation -= get_current_rotation(); rotation &= 0x3; - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outQuadrant = 0; @@ -1462,9 +1462,9 @@ static void Sub6E1F34PathItem( return; } - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outZ = info.Element->GetBaseZ(); @@ -1484,7 +1484,7 @@ static void Sub6E1F34Wall( auto screenPos = sourceScreenPos; uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); - auto* wallEntry = get_wall_entry(sceneryIndex); + auto* wallEntry = GetWallEntry(sceneryIndex); if (wallEntry != nullptr) { maxPossibleHeight -= wallEntry->height; @@ -1510,7 +1510,7 @@ static void Sub6E1F34Wall( // If SHIFT pressed if (gSceneryShiftPressed) { - auto* surfaceElement = map_get_surface_element_at(gridPos); + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1551,9 +1551,9 @@ static void Sub6E1F34Wall( if (gridPos.IsNull()) return; - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outEdges = edge; @@ -1573,7 +1573,7 @@ static void Sub6E1F34LargeScenery( auto screenPos = sourceScreenPos; uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); - auto* sceneryEntry = get_large_scenery_entry(sceneryIndex); + auto* sceneryEntry = GetLargeSceneryEntry(sceneryIndex); if (sceneryEntry) { int16_t maxClearZ = 0; @@ -1601,7 +1601,7 @@ static void Sub6E1F34LargeScenery( // If SHIFT pressed if (gSceneryShiftPressed) { - auto* surfaceElement = map_get_surface_element_at(gridPos); + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); if (surfaceElement == nullptr) { @@ -1650,9 +1650,9 @@ static void Sub6E1F34LargeScenery( rotation -= get_current_rotation(); rotation &= 0x3; - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outDirection = rotation; @@ -1692,15 +1692,15 @@ static void Sub6E1F34Banner( if (info.Element->AsPath()->IsSloped()) { - if (rotation != direction_reverse(info.Element->AsPath()->GetSlopeDirection())) + if (rotation != DirectionReverse(info.Element->AsPath()->GetSlopeDirection())) { z += (2 * COORDS_Z_STEP); } } - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outDirection = rotation; @@ -1713,7 +1713,7 @@ static void Sub6E1F34Banner( */ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct_window* w, WidgetIndex widgetIndex) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); if (gWindowSceneryPaintEnabled & 1) { RepaintSceneryToolDown(windowPos, widgetIndex); @@ -1768,7 +1768,7 @@ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct for (int32_t q = 0; q < quantity; q++) { int32_t zCoordinate = gSceneryPlaceZ; - auto* sceneryEntry = get_small_scenery_entry(selectedScenery); + auto* sceneryEntry = GetSmallSceneryEntry(selectedScenery); int16_t cur_grid_x = gridPos.x; int16_t cur_grid_y = gridPos.y; @@ -1999,7 +1999,7 @@ static void WindowTopToolbarSceneryToolDown(const ScreenCoordsXY& windowPos, rct { auto data = result->GetData(); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - context_open_detail_window(WD_BANNER, data.bannerId.ToUnderlying()); + ContextOpenDetailWindow(WD_BANNER, data.bannerId.ToUnderlying()); } }); GameActions::Execute(&bannerPlaceAction); @@ -2012,7 +2012,7 @@ static uint8_t TopToolbarToolUpdateLandPaint(const ScreenCoordsXY& screenPos) { uint8_t state_changed = 0; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; auto mapTile = screen_get_map_xy(screenPos, nullptr); @@ -2074,7 +2074,7 @@ static uint8_t TopToolbarToolUpdateLandPaint(const ScreenCoordsXY& screenPos) state_changed++; } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); return state_changed; } @@ -2105,7 +2105,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) { const bool mapCtrlPressed = InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z); - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (gCurrentToolId == Tool::UpDownArrow) { @@ -2194,7 +2194,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) state_changed++; } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (!state_changed) return; @@ -2320,7 +2320,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) state_changed++; } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (!state_changed) return; @@ -2341,7 +2341,7 @@ static void TopToolbarToolUpdateLand(const ScreenCoordsXY& screenPos) */ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos) { - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (gCurrentToolId == Tool::UpDownArrow) { @@ -2436,7 +2436,7 @@ static void TopToolbarToolUpdateWater(const ScreenCoordsXY& screenPos) state_changed++; } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); if (!state_changed) return; @@ -2469,7 +2469,7 @@ static money64 TryPlaceGhostSmallScenery( CoordsXYZD loc, uint8_t quadrant, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e252b auto smallSceneryPlaceAction = SmallSceneryPlaceAction( @@ -2504,7 +2504,7 @@ static money64 TryPlaceGhostSmallScenery( static money64 TryPlaceGhostPathAddition(CoordsXYZ loc, ObjectEntryIndex entryIndex) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e265b auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction(loc, entryIndex + 1); @@ -2528,7 +2528,7 @@ static money64 TryPlaceGhostWall( CoordsXYZ loc, uint8_t edge, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e26b0 auto wallPlaceAction = WallPlaceAction(entryIndex, loc, edge, primaryColour, secondaryColour, tertiaryColour); @@ -2554,7 +2554,7 @@ static money64 TryPlaceGhostWall( static money64 TryPlaceGhostLargeScenery( CoordsXYZD loc, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e25a7 auto sceneryPlaceAction = LargeSceneryPlaceAction(loc, entryIndex, primaryColour, secondaryColour, tertiaryColour); @@ -2585,7 +2585,7 @@ static money64 TryPlaceGhostLargeScenery( static money64 TryPlaceGhostBanner(CoordsXYZD loc, ObjectEntryIndex entryIndex) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); // 6e2612 auto primaryColour = gWindowSceneryPrimaryColour; @@ -2608,12 +2608,12 @@ static money64 TryPlaceGhostBanner(CoordsXYZD loc, ObjectEntryIndex entryIndex) */ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) { - map_invalidate_selection_rect(); - map_invalidate_map_selection_tiles(); + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - virtual_floor_invalidate(); + VirtualFloorInvalidate(); } gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; @@ -2627,7 +2627,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) const auto selection = WindowSceneryGetTabSelection(); if (selection.IsUndefined()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2645,7 +2645,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2671,7 +2671,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) gMapSelectPositionB.y = mapTile.y; } - auto* sceneryEntry = get_small_scenery_entry(selection.EntryIndex); + auto* sceneryEntry = GetSmallSceneryEntry(selection.EntryIndex); gMapSelectType = MAP_SELECT_TYPE_FULL; if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) @@ -2679,7 +2679,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) gMapSelectType = MAP_SELECT_TYPE_QUARTER_0 + (quadrant ^ 2); } - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E @@ -2689,7 +2689,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); _unkF64F0E = quadrant; _unkF64F0A = gSceneryPlaceZ; @@ -2723,7 +2723,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2734,7 +2734,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) gMapSelectPositionB.y = mapTile.y; gMapSelectType = MAP_SELECT_TYPE_FULL; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z) @@ -2742,7 +2742,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); cost = TryPlaceGhostPathAddition({ mapTile, z }, selection.EntryIndex); @@ -2758,7 +2758,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2769,7 +2769,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) gMapSelectPositionB.y = mapTile.y; gMapSelectType = MAP_SELECT_TYPE_EDGE_0 + edge; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition @@ -2778,7 +2778,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); gSceneryGhostWallRotation = edge; _unkF64F0A = gSceneryPlaceZ; @@ -2813,11 +2813,11 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } - auto* sceneryEntry = get_large_scenery_entry(selection.EntryIndex); + auto* sceneryEntry = GetLargeSceneryEntry(selection.EntryIndex); gMapSelectionTiles.clear(); for (rct_large_scenery_tile* tile = sceneryEntry->tiles; @@ -2833,7 +2833,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) } gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition && gSceneryPlaceZ == _unkF64F0A @@ -2843,7 +2843,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); gSceneryPlaceObject.SceneryType = SCENERY_TYPE_LARGE; gSceneryPlaceObject.EntryIndex = selection.EntryIndex; @@ -2880,7 +2880,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (mapTile.IsNull()) { - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); return; } @@ -2891,7 +2891,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) gMapSelectPositionB.y = mapTile.y; gMapSelectType = MAP_SELECT_TYPE_FULL; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); // If no change in ghost placement if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition && z == gSceneryGhostPosition.z @@ -2900,7 +2900,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) return; } - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); cost = TryPlaceGhostBanner({ mapTile, z, direction }, selection.EntryIndex); @@ -3235,17 +3235,17 @@ static void WindowTopToolbarToolUp(rct_window* w, WidgetIndex widgetIndex, const switch (widgetIndex) { case WIDX_LAND: - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gCurrentToolId = Tool::DigDown; break; case WIDX_WATER: - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gCurrentToolId = Tool::WaterDown; break; case WIDX_CLEAR_SCENERY: - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gCurrentToolId = Tool::Crosshair; break; @@ -3333,13 +3333,13 @@ static void TopToolbarMapMenuDropdown(int16_t dropdownIndex) switch (dropdownIndex) { case 0: - context_open_window(WindowClass::Map); + ContextOpenWindow(WindowClass::Map); break; case 1: - context_open_window(WindowClass::Viewport); + ContextOpenWindow(WindowClass::Viewport); break; case 2: - context_open_window(WindowClass::Mapgen); + ContextOpenWindow(WindowClass::Mapgen); break; } } @@ -3372,7 +3372,7 @@ static void TopToolbarInitFastforwardMenu(rct_window* w, rct_widget* widget) gDropdownItems[1].Format = STR_TOGGLE_OPTION; gDropdownItems[2].Format = STR_TOGGLE_OPTION; gDropdownItems[3].Format = STR_TOGGLE_OPTION; - if (gConfigGeneral.debugging_tools) + if (gConfigGeneral.DebuggingTools) { gDropdownItems[4].Format = STR_EMPTY; gDropdownItems[5].Format = STR_TOGGLE_OPTION; @@ -3399,7 +3399,7 @@ static void TopToolbarInitFastforwardMenu(rct_window* w, rct_widget* widget) Dropdown::SetChecked(5, true); } - if (gConfigGeneral.debugging_tools) + if (gConfigGeneral.DebuggingTools) { gDropdownDefaultIndex = (gGameSpeed == 8 ? 0 : gGameSpeed); } @@ -3519,23 +3519,23 @@ static void TopToolbarCheatsMenuDropdown(int16_t dropdownIndex) switch (dropdownIndex) { case DDIDX_CHEATS: - context_open_window(WindowClass::Cheats); + ContextOpenWindow(WindowClass::Cheats); break; case DDIDX_TILE_INSPECTOR: - context_open_window(WindowClass::TileInspector); + ContextOpenWindow(WindowClass::TileInspector); break; case DDIDX_OBJECT_SELECTION: window_close_all(); - context_open_window(WindowClass::EditorObjectSelection); + ContextOpenWindow(WindowClass::EditorObjectSelection); break; case DDIDX_INVENTIONS_LIST: - context_open_window(WindowClass::EditorInventionList); + ContextOpenWindow(WindowClass::EditorInventionList); break; case DDIDX_SCENARIO_OPTIONS: - context_open_window(WindowClass::EditorScenarioOptions); + ContextOpenWindow(WindowClass::EditorScenarioOptions); break; case DDIDX_OBJECTIVE_OPTIONS: - context_open_window(WindowClass::EditorObjectiveOptions); + ContextOpenWindow(WindowClass::EditorObjectiveOptions); break; case DDIDX_ENABLE_SANDBOX_MODE: CheatsSet(CheatType::SandboxMode, !gCheatsSandboxMode); @@ -3593,7 +3593,7 @@ static void TopToolbarDebugMenuDropdown(int16_t dropdownIndex) case DDIDX_DEBUG_PAINT: if (window_find_by_class(WindowClass::DebugPaint) == nullptr) { - context_open_window(WindowClass::DebugPaint); + ContextOpenWindow(WindowClass::DebugPaint); } else { @@ -3612,7 +3612,7 @@ static void TopToolbarNetworkMenuDropdown(int16_t dropdownIndex) switch (dropdownIndex) { case DDIDX_MULTIPLAYER: - context_open_window(WindowClass::Multiplayer); + ContextOpenWindow(WindowClass::Multiplayer); break; case DDIDX_MULTIPLAYER_RECONNECT: network_reconnect(); @@ -3665,7 +3665,7 @@ static void TopToolbarInitViewMenu(rct_window* w, rct_widget* widget) rct_viewport* mainViewport = window_get_main()->viewport; if (mainViewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) Dropdown::SetChecked(DDIDX_UNDERGROUND_INSIDE, true); - if (gConfigGeneral.transparent_water) + if (gConfigGeneral.TransparentWater) Dropdown::SetChecked(DDIDX_TRANSPARENT_WATER, true); if (mainViewport->flags & VIEWPORT_FLAG_HIDE_BASE) Dropdown::SetChecked(DDIDX_HIDE_BASE, true); @@ -3722,8 +3722,8 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex) w->viewport->flags ^= VIEWPORT_FLAG_UNDERGROUND_INSIDE; break; case DDIDX_TRANSPARENT_WATER: - gConfigGeneral.transparent_water ^= 1; - config_save_default(); + gConfigGeneral.TransparentWater ^= 1; + ConfigSaveDefault(); break; case DDIDX_HIDE_BASE: w->viewport->flags ^= VIEWPORT_FLAG_HIDE_BASE; @@ -3767,7 +3767,7 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex) case DDIDX_VIEW_CLIPPING: if (window_find_by_class(WindowClass::ViewClipping) == nullptr) { - context_open_window(WindowClass::ViewClipping); + ContextOpenWindow(WindowClass::ViewClipping); } else { @@ -3779,7 +3779,7 @@ static void TopToolbarViewMenuDropdown(int16_t dropdownIndex) w->viewport->flags ^= VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES; break; case DDIDX_TRANSPARENCY: - context_open_window(WindowClass::Transparency); + ContextOpenWindow(WindowClass::Transparency); break; default: return; @@ -3796,7 +3796,7 @@ static void ToggleFootpathWindow() { if (window_find_by_class(WindowClass::Footpath) == nullptr) { - context_open_window(WindowClass::Footpath); + ContextOpenWindow(WindowClass::Footpath); } else { @@ -3822,7 +3822,7 @@ static void ToggleLandWindow(rct_window* topToolbar, WidgetIndex widgetIndex) show_gridlines(); tool_set(*topToolbar, widgetIndex, Tool::DigDown); input_set_flag(INPUT_FLAG_6, true); - context_open_window(WindowClass::Land); + ContextOpenWindow(WindowClass::Land); } } @@ -3842,7 +3842,7 @@ static void ToggleClearSceneryWindow(rct_window* topToolbar, WidgetIndex widgetI show_gridlines(); tool_set(*topToolbar, widgetIndex, Tool::Crosshair); input_set_flag(INPUT_FLAG_6, true); - context_open_window(WindowClass::ClearScenery); + ContextOpenWindow(WindowClass::ClearScenery); } } @@ -3863,7 +3863,7 @@ static void ToggleWaterWindow(rct_window* topToolbar, WidgetIndex widgetIndex) show_gridlines(); tool_set(*topToolbar, widgetIndex, Tool::WaterDown); input_set_flag(INPUT_FLAG_6, true); - context_open_window(WindowClass::Water); + ContextOpenWindow(WindowClass::Water); } } diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 4ec5f22ff1..eece1badd5 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -54,38 +54,35 @@ static rct_widget window_track_delete_prompt_widgets[] = { #pragma endregion -#pragma region Events - -static void WindowTrackManageClose(rct_window *w); -static void WindowTrackManageMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowTrackManageTextinput(rct_window *w, WidgetIndex widgetIndex, char *text); -static void WindowTrackManagePaint(rct_window *w, rct_drawpixelinfo *dpi); - -static void WindowTrackDeletePromptMouseup(rct_window *w, WidgetIndex widgetIndex); -static void WindowTrackDeletePromptPaint(rct_window *w, rct_drawpixelinfo *dpi); - -// 0x009940EC -static WindowEventList window_track_manage_events([](auto& events) +class TrackDesignManageWindow final : public Window { - events.close = &WindowTrackManageClose; - events.mouse_up = &WindowTrackManageMouseup; - events.text_input = &WindowTrackManageTextinput; - events.paint = &WindowTrackManagePaint; -}); + private: + TrackDesignFileRef* _trackDesignFileReference{nullptr}; -// 0x0099415C -static WindowEventList window_track_delete_prompt_events([](auto& events) + public: + TrackDesignManageWindow(TrackDesignFileRef* tdFileRef) : _trackDesignFileReference(tdFileRef){} + + void OnOpen() override; + void OnClose() override; + void OnMouseUp(WidgetIndex widgetIndex) override; + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override; + void OnDraw(rct_drawpixelinfo& dpi) override; +}; + +class TrackDeletePromptWindow final : public Window { - events.mouse_up = &WindowTrackDeletePromptMouseup; - events.paint = &WindowTrackDeletePromptPaint; -}); -// clang-format on + private: + TrackDesignFileRef* _trackDesignFileReference{nullptr}; -#pragma endregion + public: + TrackDeletePromptWindow(TrackDesignFileRef* tdFileRef) : _trackDesignFileReference(tdFileRef){} -static TrackDesignFileRef* _trackDesignFileReference; + void OnOpen() override; + void OnMouseUp(WidgetIndex widgetIndex) override; + void OnDraw(rct_drawpixelinfo& dpi) override; +}; -static void WindowTrackDeletePromptOpen(); +static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef); static void WindowTrackDesignListReloadTracks(); /** @@ -95,28 +92,27 @@ static void WindowTrackDesignListReloadTracks(); rct_window* WindowTrackManageOpen(TrackDesignFileRef* tdFileRef) { window_close_by_class(WindowClass::ManageTrackDesign); + auto trackDesignManageWindow = std::make_unique(tdFileRef); + auto* window = WindowCreate( + std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); - rct_window* w = WindowCreateCentred( - WW, WH, &window_track_manage_events, WindowClass::ManageTrackDesign, WF_STICK_TO_FRONT | WF_TRANSPARENT); - w->widgets = window_track_manage_widgets; - WindowInitScrollWidgets(*w); + return window; +} - rct_window* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList); +void TrackDesignManageWindow::OnOpen() +{ + widgets = window_track_manage_widgets; + WindowInitScrollWidgets(*this); + + auto* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList); if (trackDesignListWindow != nullptr) { trackDesignListWindow->track_list.track_list_being_updated = true; } - - _trackDesignFileReference = tdFileRef; - - return w; } -/** - * - * rct2: 0x006D364C - */ -static void WindowTrackManageClose(rct_window* w) +void TrackDesignManageWindow::OnClose() { rct_window* trackDesignListWindow = window_find_by_class(WindowClass::TrackDesignList); if (trackDesignListWindow != nullptr) @@ -125,133 +121,116 @@ static void WindowTrackManageClose(rct_window* w) } } -/** - * - * rct2: 0x006D3523 - */ -static void WindowTrackManageMouseup(rct_window* w, WidgetIndex widgetIndex) +void TrackDesignManageWindow::OnMouseUp(WidgetIndex widgetIndex) { switch (widgetIndex) { case WIDX_CLOSE: window_close_by_class(WindowClass::TrackDeletePrompt); - window_close(*w); + Close(); break; case WIDX_RENAME: WindowTextInputRawOpen( - w, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {}, + this, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {}, _trackDesignFileReference->name.c_str(), TrackDesignNameMaxLength); break; case WIDX_DELETE: - WindowTrackDeletePromptOpen(); + WindowTrackDeletePromptOpen(_trackDesignFileReference); break; } } -/** - * - * rct2: 0x006D3523 - */ -static void WindowTrackManageTextinput(rct_window* w, WidgetIndex widgetIndex, char* text) +void TrackDesignManageWindow::OnTextInput(WidgetIndex widgetIndex, std::string_view text) { - if (widgetIndex != WIDX_RENAME || str_is_null_or_empty(text)) + if (widgetIndex != WIDX_RENAME) { return; } - - if (str_is_null_or_empty(text)) + else if (text.empty()) { - context_show_error(STR_CANT_RENAME_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NONE, {}); + return; + } + else if (!Platform::IsFilenameValid(text)) + { + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NEW_NAME_CONTAINS_INVALID_CHARACTERS, {}); return; } - if (!Platform::IsFilenameValid(text)) - { - context_show_error(STR_CANT_RENAME_TRACK_DESIGN, STR_NEW_NAME_CONTAINS_INVALID_CHARACTERS, {}); - return; - } - - if (track_repository_rename(_trackDesignFileReference->path, text)) + if (track_repository_rename(_trackDesignFileReference->path, std::string(text))) { window_close_by_class(WindowClass::TrackDeletePrompt); - window_close(*w); + Close(); WindowTrackDesignListReloadTracks(); } else { - context_show_error(STR_CANT_RENAME_TRACK_DESIGN, STR_ANOTHER_FILE_EXISTS_WITH_NAME_OR_FILE_IS_WRITE_PROTECTED, {}); + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_ANOTHER_FILE_EXISTS_WITH_NAME_OR_FILE_IS_WRITE_PROTECTED, {}); } } -/** - * - * rct2: 0x006D3523 - */ -static void WindowTrackManagePaint(rct_window* w, rct_drawpixelinfo* dpi) +void TrackDesignManageWindow::OnDraw(rct_drawpixelinfo& dpi) { Formatter::Common().Add(_trackDesignFileReference->name.c_str()); - WindowDrawWidgets(*w, dpi); + DrawWidgets(dpi); } /** * * rct2: 0x006D35CD */ -static void WindowTrackDeletePromptOpen() +static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef) { window_close_by_class(WindowClass::TrackDeletePrompt); - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); - rct_window* w = WindowCreate( - 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, WindowClass::TrackDeletePrompt, - WF_STICK_TO_FRONT); - w->widgets = window_track_delete_prompt_widgets; - WindowInitScrollWidgets(*w); - w->flags |= WF_TRANSPARENT; + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + auto trackDeletePromptWindow = std::make_unique(tdFileRef); + WindowCreate( + std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, ScreenCoordsXY( + std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), WW_DELETE_PROMPT, WH_DELETE_PROMPT, + WF_STICK_TO_FRONT | WF_TRANSPARENT); } -/** - * - * rct2: 0x006D3823 - */ -static void WindowTrackDeletePromptMouseup(rct_window* w, WidgetIndex widgetIndex) +void TrackDeletePromptWindow::OnOpen() +{ + widgets = window_track_delete_prompt_widgets; + WindowInitScrollWidgets(*this); +} + +void TrackDeletePromptWindow::OnMouseUp(WidgetIndex widgetIndex) { switch (widgetIndex) { case WIDX_CLOSE: case WIDX_PROMPT_CANCEL: - window_close(*w); + Close(); break; case WIDX_PROMPT_DELETE: - window_close(*w); - if (track_repository_delete(_trackDesignFileReference->path)) + // tdPath has to be saved before window is closed, as that would blank it out. + auto tdPath = _trackDesignFileReference->path; + Close(); + if (track_repository_delete(tdPath)) { window_close_by_class(WindowClass::ManageTrackDesign); WindowTrackDesignListReloadTracks(); } else { - context_show_error(STR_CANT_DELETE_TRACK_DESIGN, STR_FILE_IS_WRITE_PROTECTED_OR_LOCKED, {}); + ContextShowError(STR_CANT_DELETE_TRACK_DESIGN, STR_FILE_IS_WRITE_PROTECTED_OR_LOCKED, {}); } break; } } -/** - * - * rct2: 0x006D37EE - */ -static void WindowTrackDeletePromptPaint(rct_window* w, rct_drawpixelinfo* dpi) +void TrackDeletePromptWindow::OnDraw(rct_drawpixelinfo& dpi) { - WindowDrawWidgets(*w, dpi); + DrawWidgets(dpi); auto ft = Formatter(); ft.Add(_trackDesignFileReference->name.c_str()); DrawTextWrapped( - dpi, { w->windowPos.x + (WW_DELETE_PROMPT / 2), w->windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), + &dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE }); } diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index c3300a8efd..9c4d508e94 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -93,7 +93,7 @@ public: { ClearProvisional(); viewport_set_visibility(0); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; hide_gridlines(); @@ -129,7 +129,7 @@ public: auto intent = Intent(WindowClass::TrackDesignList); intent.putExtra(INTENT_EXTRA_RIDE_TYPE, _window_track_list_item.Type); intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, _window_track_list_item.EntryIndex); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } } @@ -146,7 +146,7 @@ public: TrackDesignState tds{}; int16_t mapZ; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -209,7 +209,7 @@ public: void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { ClearProvisional(); - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; @@ -241,7 +241,7 @@ public: { auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, rideId.ToUnderlying()); - context_open_intent(&intent); + ContextOpenIntent(&intent); auto wnd = window_find_by_class(WindowClass::TrackDesignPlace); window_close(*wnd); } @@ -402,7 +402,7 @@ private: int32_t GetBaseZ(const CoordsXY& loc) { - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) return 0; diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index da6a955191..a75d13c76b 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -123,7 +123,7 @@ private: // 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, {}); + ContextShowError(STR_CANT_BUILD_THIS_HERE, STR_TRACK_LOAD_FAILED_ERROR, {}); return; } @@ -138,19 +138,19 @@ private: { auto intent = Intent(WindowClass::ManageTrackDesign); intent.putExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); - context_open_intent(&intent); + ContextOpenIntent(&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, {}); + ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); } auto intent = Intent(WindowClass::TrackDesignPlace); intent.putExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } @@ -276,7 +276,7 @@ public: Close(); if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { - context_open_window(WindowClass::ConstructRide); + ContextOpenWindow(WindowClass::ConstructRide); } break; case WIDX_FILTER_STRING: @@ -385,29 +385,29 @@ public: if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) || selected_list_item != 0) { - pressed_widgets |= 1ULL << WIDX_TRACK_PREVIEW; - disabled_widgets &= ~(1ULL << WIDX_TRACK_PREVIEW); + 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); + pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); } else { - pressed_widgets |= (1ULL << WIDX_TOGGLE_SCENERY); + pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); } } else { - pressed_widgets &= ~(1ULL << WIDX_TRACK_PREVIEW); - disabled_widgets |= (1ULL << WIDX_TRACK_PREVIEW); + 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; + const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? (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 @@ -461,11 +461,11 @@ public: u8string path = _trackDesigns[trackIndex].path; // Show track file path (in debug mode) - if (gConfigGeneral.debugging_tools) + if (gConfigGeneral.DebuggingTools) { utf8 pathBuffer[MAX_PATH]; const utf8* pathPtr = pathBuffer; - shorten_path(pathBuffer, sizeof(pathBuffer), path.c_str(), width, FontSpriteBase::MEDIUM); + shorten_path(pathBuffer, sizeof(pathBuffer), path.c_str(), width, FontStyle::Medium); auto ft = Formatter(); ft.Add(pathPtr); DrawTextBasic( @@ -749,8 +749,8 @@ rct_window* WindowTrackListOpen(const RideSelection item) ScreenCoordsXY screenPos{}; if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); screenPos = { screenWidth / 2 - 300, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; } else diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 0620b1b01a..7c18f37fa5 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -234,13 +234,13 @@ private: void SaveInConfig(uint32_t wflags) { - gConfigGeneral.invisible_rides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES; - gConfigGeneral.invisible_vehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES; - gConfigGeneral.invisible_scenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY; - gConfigGeneral.invisible_trees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION; - gConfigGeneral.invisible_paths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS; - gConfigGeneral.invisible_supports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS; - config_save_default(); + gConfigGeneral.InvisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES; + gConfigGeneral.InvisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES; + gConfigGeneral.InvisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY; + gConfigGeneral.InvisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION; + gConfigGeneral.InvisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS; + gConfigGeneral.InvisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS; + ConfigSaveDefault(); } }; diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 725869e301..b94ce460eb 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -203,9 +203,9 @@ public: if (mapCoords.has_value()) { gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - map_invalidate_tile_full(gMapSelectPositionA); + MapInvalidateTileFull(gMapSelectPositionA); gMapSelectPositionA = gMapSelectPositionB = mapCoords.value(); - map_invalidate_tile_full(mapCoords.value()); + MapInvalidateTileFull(mapCoords.value()); gMapSelectType = MAP_SELECT_TYPE_FULL; } } @@ -232,14 +232,14 @@ public: auto mapCoords = screen_pos_to_map_pos(screenCoords, &direction); if (mapCoords) { - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectPositionA.x = std::min(_selectionStart.x, mapCoords->x); gMapSelectPositionB.x = std::max(_selectionStart.x, mapCoords->x); gMapSelectPositionA.y = std::min(_selectionStart.y, mapCoords->y); gMapSelectPositionB.y = std::max(_selectionStart.y, mapCoords->y); gMapSelectType = MAP_SELECT_TYPE_FULL; - map_invalidate_selection_rect(); + MapInvalidateSelectionRect(); } } @@ -264,11 +264,11 @@ public: if (IsActive()) { - this->pressed_widgets |= 1ULL << WIDX_CLIP_SELECTOR; + this->pressed_widgets |= 1uLL << WIDX_CLIP_SELECTOR; } else { - this->pressed_widgets &= ~(1ULL << WIDX_CLIP_SELECTOR); + this->pressed_widgets &= ~(1uLL << WIDX_CLIP_SELECTOR); } } @@ -298,7 +298,7 @@ public: case DisplayType::DisplayUnits: { // Print the value in the configured height label type: - if (gConfigGeneral.show_height_as_units) + if (gConfigGeneral.ShowHeightAsUnits) { // Height label is Units. auto ft = Formatter(); @@ -311,7 +311,7 @@ public: { // Height label is Real Values. // Print the value in the configured measurement units. - switch (gConfigGeneral.measurement_format) + switch (gConfigGeneral.MeasurementFormat) { case MeasurementFormat::Metric: case MeasurementFormat::SI: @@ -344,7 +344,7 @@ public: void OnOpen() override { this->widgets = window_view_clipping_widgets; - this->hold_down_widgets = (1ULL << WIDX_CLIP_HEIGHT_INCREASE) | (1UL << WIDX_CLIP_HEIGHT_DECREASE); + this->hold_down_widgets = (1uLL << WIDX_CLIP_HEIGHT_INCREASE) | (1uL << WIDX_CLIP_HEIGHT_DECREASE); WindowInitScrollWidgets(*this); _clipHeightDisplayType = DisplayType::DisplayUnits; diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index ebb68ee6e4..8441c2eaab 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -144,7 +144,7 @@ public: { 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) }); + window_scroll_to_location(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); } break; } @@ -161,8 +161,8 @@ public: void OnResize() override { - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); max_width = (screenWidth * 4) / 5; max_height = (screenHeight * 4) / 5; @@ -177,13 +177,7 @@ public: { 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; + ResizeFrameWithPage(); widgets[WIDX_ZOOM_IN].left = width - 27; widgets[WIDX_ZOOM_IN].right = width - 2; widgets[WIDX_ZOOM_OUT].left = width - 27; @@ -199,9 +193,9 @@ public: // Set disabled widgets disabled_widgets = 0; if (viewport != nullptr && viewport->zoom == ZoomLevel::min()) - disabled_widgets |= 1ULL << WIDX_ZOOM_IN; + disabled_widgets |= 1uLL << WIDX_ZOOM_IN; if (viewport != nullptr && viewport->zoom >= ZoomLevel::max()) - disabled_widgets |= 1ULL << WIDX_ZOOM_OUT; + disabled_widgets |= 1uLL << WIDX_ZOOM_OUT; if (viewport != nullptr) { @@ -216,8 +210,8 @@ public: rct_window* WindowViewportOpen() { - int32_t screenWidth = context_get_width(); - int32_t screenHeight = context_get_height(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); int32_t width = (screenWidth / 2); int32_t height = (screenHeight / 2); diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 55b7a3fc33..032aaea2a2 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -46,7 +46,7 @@ public: void OnOpen() override { widgets = window_water_widgets; - hold_down_widgets = (1ULL << WIDX_INCREMENT) | (1ULL << WIDX_DECREMENT); + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); WindowInitScrollWidgets(*this); window_push_others_below(*this); @@ -187,5 +187,5 @@ private: rct_window* WindowWaterOpen() { - return WindowFocusOrCreate(WindowClass::Water, ScreenCoordsXY(context_get_width() - WW, 29), WW, WH, 0); + return WindowFocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 068afc7bd3..a33e6b91c5 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -79,6 +79,7 @@ rct_window* WindowAssetPacksOpen(); // WC_FINANCES rct_window* WindowFinancesOpen(); rct_window* WindowFinancesResearchOpen(); +rct_window* WindowFinancesMarketingOpen(); // WC_PARK_INFORMATION rct_window* WindowParkAwardsOpen(); @@ -146,7 +147,7 @@ void WindowMapTooltipUpdateVisibility(); rct_window* WindowMazeConstructionOpen(); void WindowMazeConstructionUpdatePressedWidgets(); -rct_window* WindowNetworkStatusOpen(const char* text, close_callback onClose); +rct_window* WindowNetworkStatusOpen(const std::string& text, close_callback onClose); rct_window* WindowNetworkStatusOpenPassword(); void WindowNetworkStatusClose(); diff --git a/src/openrct2-win/openrct2-win.cpp b/src/openrct2-win/openrct2-win.cpp index 018617bdfc..ea586c4f00 100644 --- a/src/openrct2-win/openrct2-win.cpp +++ b/src/openrct2-win/openrct2-win.cpp @@ -40,8 +40,10 @@ int wmain(int argc, wchar_t** argvW, [[maybe_unused]] wchar_t* envp) std::vector argv; std::transform( argvStrings.begin(), argvStrings.end(), std::back_inserter(argv), [](const auto& string) { return string.c_str(); }); - auto exitCode = NormalisedMain(argc, argv.data()); - return exitCode; + + // Ensure that argv[argc] == nullptr, as mandated by the standard + argv.push_back(nullptr); + return NormalisedMain(argc, argv.data()); } static std::vector GetCommandLineArgs(int argc, wchar_t** argvW) diff --git a/src/openrct2/AssetPackManager.cpp b/src/openrct2/AssetPackManager.cpp index 833b790ba1..9a5a9556b1 100644 --- a/src/openrct2/AssetPackManager.cpp +++ b/src/openrct2/AssetPackManager.cpp @@ -67,12 +67,20 @@ void AssetPackManager::Scan() auto context = GetContext(); auto env = context->GetPlatformEnvironment(); - auto assetPackDirectory = fs::u8path(env->GetDirectoryPath(DIRBASE::USER, DIRID::ASSET_PACK)); - Platform::EnsureDirectoryExists(assetPackDirectory.u8string()); + auto openrct2Dir = fs::u8path(env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::ASSET_PACK)); + Scan(openrct2Dir); + + auto userDirectory = fs::u8path(env->GetDirectoryPath(DIRBASE::USER, DIRID::ASSET_PACK)); + Platform::EnsureDirectoryExists(userDirectory.u8string()); + Scan(userDirectory); +} + +void AssetPackManager::Scan(const fs::path& directory) +{ // Recursively scan for .parkap files std::error_code ec; - for (const fs::directory_entry& entry : fs::recursive_directory_iterator(assetPackDirectory, ec)) + for (const fs::directory_entry& entry : fs::recursive_directory_iterator(directory, ec)) { if (!entry.is_directory()) { @@ -152,7 +160,7 @@ void AssetPackManager::LoadEnabledAssetPacks() { // Re-order asset packs std::vector> newAssetPacks; - EnumerateCommaSeparatedList(gConfigGeneral.asset_pack_order, [&](std::string_view id) { + EnumerateCommaSeparatedList(gConfigGeneral.AssetPackOrder, [&](std::string_view id) { auto index = GetAssetPackIndex(id); if (index != std::numeric_limits::max()) { @@ -169,7 +177,7 @@ void AssetPackManager::LoadEnabledAssetPacks() _assetPacks = std::move(newAssetPacks); // Set which asset packs are enabled - EnumerateCommaSeparatedList(gConfigGeneral.enabled_asset_packs, [&](std::string_view id) { + EnumerateCommaSeparatedList(gConfigGeneral.EnabledAssetPacks, [&](std::string_view id) { auto assetPack = GetAssetPack(id); if (assetPack != nullptr) { @@ -196,7 +204,7 @@ void AssetPackManager::SaveEnabledAssetPacks() orderList.pop_back(); if (enabledList.size() > 0) enabledList.pop_back(); - gConfigGeneral.asset_pack_order = orderList; - gConfigGeneral.enabled_asset_packs = enabledList; - config_save_default(); + gConfigGeneral.AssetPackOrder = orderList; + gConfigGeneral.EnabledAssetPacks = enabledList; + ConfigSaveDefault(); } diff --git a/src/openrct2/AssetPackManager.h b/src/openrct2/AssetPackManager.h index f345cf68b5..c33344025d 100644 --- a/src/openrct2/AssetPackManager.h +++ b/src/openrct2/AssetPackManager.h @@ -36,6 +36,7 @@ namespace OpenRCT2 size_t GetAssetPackIndex(std::string_view id); void Scan(); + void Scan(const fs::path& directory); void Reload(); void Swap(size_t index, size_t otherIndex); diff --git a/src/openrct2/CmdlineSprite.cpp b/src/openrct2/CmdlineSprite.cpp index 75debc1c60..9575fbb585 100644 --- a/src/openrct2/CmdlineSprite.cpp +++ b/src/openrct2/CmdlineSprite.cpp @@ -346,7 +346,7 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc) fprintf(stderr, "Could not export\n"); return -1; } - fprintf(stdout, "{ \"x\": %u, \"y\": %u }\n", spriteHeader.x_offset, spriteHeader.y_offset); + fprintf(stdout, "{ \"x\": %d, \"y\": %d }\n", spriteHeader.x_offset, spriteHeader.y_offset); return 1; } diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 04b265e6e9..cba0101f67 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -199,7 +199,7 @@ namespace OpenRCT2 gfx_unload_g2(); gfx_unload_g1(); Audio::Close(); - config_release(); + ConfigRelease(); Instance = nullptr; } @@ -324,7 +324,7 @@ namespace OpenRCT2 void Quit() override { gSavePromptMode = PromptMode::Quit; - context_open_window(WindowClass::SavePrompt); + ContextOpenWindow(WindowClass::SavePrompt); } bool Initialise() final override @@ -337,20 +337,20 @@ namespace OpenRCT2 crash_init(); - if (String::Equals(gConfigGeneral.last_run_version, OPENRCT2_VERSION)) + if (String::Equals(gConfigGeneral.LastRunVersion, OPENRCT2_VERSION)) { gOpenRCT2ShowChangelog = false; } else { gOpenRCT2ShowChangelog = true; - gConfigGeneral.last_run_version = OPENRCT2_VERSION; - config_save_default(); + gConfigGeneral.LastRunVersion = OPENRCT2_VERSION; + ConfigSaveDefault(); } try { - _localisationService->OpenLanguage(gConfigGeneral.language); + _localisationService->OpenLanguage(gConfigGeneral.Language); } catch (const std::exception& e) { @@ -459,7 +459,7 @@ namespace OpenRCT2 Init(); PopulateDevices(); InitRideSoundsAndInfo(); - gGameSoundsOff = !gConfigSound.master_sound_enabled; + gGameSoundsOff = !gConfigSound.MasterSoundEnabled; } chat_init(); @@ -494,7 +494,7 @@ namespace OpenRCT2 { assert(_drawingEngine == nullptr); - _drawingEngineType = gConfigGeneral.drawing_engine; + _drawingEngineType = gConfigGeneral.DrawingEngine; auto drawingEngineFactory = _uiContext->GetDrawingEngineFactory(); auto drawingEngine = drawingEngineFactory->Create(_drawingEngineType, _uiContext); @@ -512,8 +512,8 @@ namespace OpenRCT2 log_error("Unable to create drawing engine. Falling back to software."); // Fallback to software - gConfigGeneral.drawing_engine = DrawingEngine::Software; - config_save_default(); + gConfigGeneral.DrawingEngine = DrawingEngine::Software; + ConfigSaveDefault(); drawing_engine_init(); } } @@ -522,7 +522,7 @@ namespace OpenRCT2 try { drawingEngine->Initialise(); - drawingEngine->SetVSync(gConfigGeneral.use_vsync); + drawingEngine->SetVSync(gConfigGeneral.UseVSync); _drawingEngine = std::move(drawingEngine); } catch (const std::exception& ex) @@ -540,8 +540,8 @@ namespace OpenRCT2 log_error("Unable to initialise drawing engine. Falling back to software."); // Fallback to software - gConfigGeneral.drawing_engine = DrawingEngine::Software; - config_save_default(); + gConfigGeneral.DrawingEngine = DrawingEngine::Software; + ConfigSaveDefault(); drawing_engine_init(); } } @@ -650,7 +650,7 @@ namespace OpenRCT2 gCurrentLoadedPath = path; gFirstTimeSaving = true; game_fix_save_vars(); - AutoCreateMapAnimations(); + MapAnimationAutoCreate(); EntityTweener::Get().Reset(); gScreenAge = 0; gLastAutoSaveUpdate = AUTOSAVE_PAUSE; @@ -690,7 +690,7 @@ namespace OpenRCT2 } // 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); + peep_update_names(gConfigGeneral.ShowRealNamesOfGuests); #ifndef DISABLE_NETWORK if (sendMap) { @@ -708,8 +708,8 @@ namespace OpenRCT2 { auto windowManager = _uiContext->GetWindowManager(); auto ft = Formatter(); - ft.Add(result.MinVersion); ft.Add(result.TargetVersion); + ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); windowManager->ShowError(STR_WARNING_PARK_VERSION_TITLE, STR_WARNING_PARK_VERSION_MESSAGE, ft); } else if (HasObjectsThatUseFallbackImages()) @@ -769,9 +769,19 @@ namespace OpenRCT2 } else*/ { - ft.Add(e.MinVersion); - ft.Add(e.TargetVersion); - windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE, ft); + if (e.MinVersion == e.TargetVersion) + { + ft.Add(e.TargetVersion); + ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE_2, ft); + } + else + { + ft.Add(e.TargetVersion); + ft.Add(e.MinVersion); + ft.Add(OpenRCT2::PARK_FILE_CURRENT_VERSION); + windowManager->ShowError(STR_ERROR_PARK_VERSION_TITLE, STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE, ft); + } } } catch (const std::exception& e) @@ -812,19 +822,19 @@ namespace OpenRCT2 if (gCustomRCT2DataPath.empty()) { // Check install directory - if (gConfigGeneral.rct2_path.empty() || !Platform::OriginalGameDataExists(gConfigGeneral.rct2_path)) + if (gConfigGeneral.RCT2Path.empty() || !Platform::OriginalGameDataExists(gConfigGeneral.RCT2Path)) { log_verbose( - "install directory does not exist or invalid directory selected, %s", gConfigGeneral.rct2_path.c_str()); - if (!config_find_or_browse_install_directory()) + "install directory does not exist or invalid directory selected, %s", gConfigGeneral.RCT2Path.c_str()); + if (!ConfigFindOrBrowseInstallDirectory()) { - auto path = config_get_default_path(); + auto path = ConfigGetDefaultPath(); Console::Error::WriteLine( "An RCT2 install directory must be specified! Please edit \"game_path\" in %s.\n", path.c_str()); return std::string(); } } - result = gConfigGeneral.rct2_path; + result = gConfigGeneral.RCT2Path; } else { @@ -872,7 +882,7 @@ namespace OpenRCT2 } else { - if ((gOpenRCT2StartupAction == StartupAction::Title) && gConfigGeneral.play_intro) + if ((gOpenRCT2StartupAction == StartupAction::Title) && gConfigGeneral.PlayIntro) { gOpenRCT2StartupAction = StartupAction::Intro; } @@ -936,17 +946,17 @@ namespace OpenRCT2 { if (gNetworkStartPort == 0) { - gNetworkStartPort = gConfigNetwork.default_port; + gNetworkStartPort = gConfigNetwork.DefaultPort; } if (gNetworkStartAddress.empty()) { - gNetworkStartAddress = gConfigNetwork.listen_address; + gNetworkStartAddress = gConfigNetwork.ListenAddress; } if (gCustomPassword.empty()) { - _network.SetPassword(gConfigNetwork.default_password.c_str()); + _network.SetPassword(gConfigNetwork.DefaultPassword.c_str()); } else { @@ -981,7 +991,7 @@ namespace OpenRCT2 { if (gNetworkStartPort == 0) { - gNetworkStartPort = gConfigNetwork.default_port; + gNetworkStartPort = gConfigNetwork.DefaultPort; } _network.BeginClient(gNetworkStartHost, gNetworkStartPort); } @@ -1004,7 +1014,7 @@ namespace OpenRCT2 { if (!ShouldDraw()) return false; - if (!gConfigGeneral.uncap_fps) + if (!gConfigGeneral.UncapFPS) return false; if (gGameSpeed > 4) return false; @@ -1355,17 +1365,12 @@ namespace OpenRCT2 } // namespace OpenRCT2 -void context_init() +void ContextInit() { GetContext()->GetUiContext()->GetWindowManager()->Init(); } -bool context_load_park_from_file(const utf8* path) -{ - return GetContext()->LoadParkFromFile(path); -} - -bool context_load_park_from_stream(void* stream) +bool ContextLoadParkFromStream(void* stream) { return GetContext()->LoadParkFromStream(static_cast(stream), ""); } @@ -1380,170 +1385,170 @@ void openrct2_finish() GetContext()->Finish(); } -void context_setcurrentcursor(CursorID cursor) +void ContextSetCurrentCursor(CursorID cursor) { GetContext()->GetUiContext()->SetCursor(cursor); } -void context_update_cursor_scale() +void ContextUpdateCursorScale() { - GetContext()->GetUiContext()->SetCursorScale(static_cast(std::round(gConfigGeneral.window_scale))); + GetContext()->GetUiContext()->SetCursorScale(static_cast(std::round(gConfigGeneral.WindowScale))); } -void context_hide_cursor() +void ContextHideCursor() { GetContext()->GetUiContext()->SetCursorVisible(false); } -void context_show_cursor() +void ContextShowCursor() { GetContext()->GetUiContext()->SetCursorVisible(true); } -ScreenCoordsXY context_get_cursor_position() +ScreenCoordsXY ContextGetCursorPosition() { return GetContext()->GetUiContext()->GetCursorPosition(); } -ScreenCoordsXY context_get_cursor_position_scaled() +ScreenCoordsXY ContextGetCursorPositionScaled() { - auto cursorCoords = context_get_cursor_position(); + auto cursorCoords = ContextGetCursorPosition(); // Compensate for window scaling. - return { static_cast(std::ceil(cursorCoords.x / gConfigGeneral.window_scale)), - static_cast(std::ceil(cursorCoords.y / gConfigGeneral.window_scale)) }; + return { static_cast(std::ceil(cursorCoords.x / gConfigGeneral.WindowScale)), + static_cast(std::ceil(cursorCoords.y / gConfigGeneral.WindowScale)) }; } -void context_set_cursor_position(const ScreenCoordsXY& cursorPosition) +void ContextSetCursorPosition(const ScreenCoordsXY& cursorPosition) { GetContext()->GetUiContext()->SetCursorPosition(cursorPosition); } -const CursorState* context_get_cursor_state() +const CursorState* ContextGetCursorState() { return GetContext()->GetUiContext()->GetCursorState(); } -const uint8_t* context_get_keys_state() +const uint8_t* ContextGetKeysState() { return GetContext()->GetUiContext()->GetKeysState(); } -const uint8_t* context_get_keys_pressed() +const uint8_t* ContextGetKeysPressed() { return GetContext()->GetUiContext()->GetKeysPressed(); } -TextInputSession* context_start_text_input(utf8* buffer, size_t maxLength) +TextInputSession* ContextStartTextInput(utf8* buffer, size_t maxLength) { return GetContext()->GetUiContext()->StartTextInput(buffer, maxLength); } -void context_stop_text_input() +void ContextStopTextInput() { GetContext()->GetUiContext()->StopTextInput(); } -bool context_is_input_active() +bool ContextIsInputActive() { return GetContext()->GetUiContext()->IsTextInputActive(); } -void context_trigger_resize() +void ContextTriggerResize() { return GetContext()->GetUiContext()->TriggerResize(); } -void context_set_fullscreen_mode(int32_t mode) +void ContextSetFullscreenMode(int32_t mode) { return GetContext()->GetUiContext()->SetFullscreenMode(static_cast(mode)); } -void context_recreate_window() +void ContextRecreateWindow() { GetContext()->GetUiContext()->RecreateWindow(); } -int32_t context_get_width() +int32_t ContextGetWidth() { return GetContext()->GetUiContext()->GetWidth(); } -int32_t context_get_height() +int32_t ContextGetHeight() { return GetContext()->GetUiContext()->GetHeight(); } -bool context_has_focus() +bool ContextHasFocus() { return GetContext()->GetUiContext()->HasFocus(); } -void context_set_cursor_trap(bool value) +void ContextSetCursorTrap(bool value) { GetContext()->GetUiContext()->SetCursorTrap(value); } -rct_window* context_open_window(WindowClass wc) +rct_window* ContextOpenWindow(WindowClass wc) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); return windowManager->OpenWindow(wc); } -rct_window* context_open_window_view(uint8_t wc) +rct_window* ContextOpenWindowView(uint8_t wc) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); return windowManager->OpenView(wc); } -rct_window* context_open_detail_window(uint8_t type, int32_t id) +rct_window* ContextOpenDetailWindow(uint8_t type, int32_t id) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); return windowManager->OpenDetails(type, id); } -rct_window* context_open_intent(Intent* intent) +rct_window* ContextOpenIntent(Intent* intent) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); return windowManager->OpenIntent(intent); } -void context_broadcast_intent(Intent* intent) +void ContextBroadcastIntent(Intent* intent) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->BroadcastIntent(*intent); } -void context_force_close_window_by_class(WindowClass windowClass) +void ContextForceCloseWindowByClass(WindowClass windowClass) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->ForceClose(windowClass); } -rct_window* context_show_error(StringId title, StringId message, const Formatter& args) +rct_window* ContextShowError(StringId title, StringId message, const Formatter& args) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); return windowManager->ShowError(title, message, args); } -void context_update_map_tooltip() +void ContextUpdateMapTooltip() { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->UpdateMapTooltip(); } -void context_handle_input() +void ContextHandleInput() { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->HandleInput(); } -void context_input_handle_keyboard(bool isTitle) +void ContextInputHandleKeyboard(bool isTitle) { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->HandleKeyboard(isTitle); } -void context_quit() +void ContextQuit() { GetContext()->Quit(); } diff --git a/src/openrct2/Context.h b/src/openrct2/Context.h index 5611e66962..10115fa00a 100644 --- a/src/openrct2/Context.h +++ b/src/openrct2/Context.h @@ -189,39 +189,38 @@ namespace constexpr float GAME_MIN_TIME_SCALE = 0.1f; constexpr float GAME_MAX_TIME_SCALE = 5.0f; -void context_init(); -void context_setcurrentcursor(CursorID cursor); -void context_update_cursor_scale(); -void context_hide_cursor(); -void context_show_cursor(); -ScreenCoordsXY context_get_cursor_position(); -ScreenCoordsXY context_get_cursor_position_scaled(); -void context_set_cursor_position(const ScreenCoordsXY& cursorPosition); -const CursorState* context_get_cursor_state(); -const uint8_t* context_get_keys_state(); -const uint8_t* context_get_keys_pressed(); -TextInputSession* context_start_text_input(utf8* buffer, size_t maxLength); -void context_stop_text_input(); -bool context_is_input_active(); -void context_trigger_resize(); -void context_set_fullscreen_mode(int32_t mode); -void context_recreate_window(); -int32_t context_get_width(); -int32_t context_get_height(); -bool context_has_focus(); -void context_set_cursor_trap(bool value); -rct_window* context_open_window(WindowClass wc); -rct_window* context_open_detail_window(uint8_t type, int32_t id); -rct_window* context_open_window_view(uint8_t view); -rct_window* context_show_error(StringId title, StringId message, const class Formatter& args); -rct_window* context_open_intent(Intent* intent); -void context_broadcast_intent(Intent* intent); -void context_force_close_window_by_class(WindowClass wc); -void context_update_map_tooltip(); -void context_handle_input(); -void context_input_handle_keyboard(bool isTitle); -void context_quit(); -bool context_load_park_from_file(const utf8* path); -bool context_load_park_from_stream(void* stream); +void ContextInit(); +void ContextSetCurrentCursor(CursorID cursor); +void ContextUpdateCursorScale(); +void ContextHideCursor(); +void ContextShowCursor(); +ScreenCoordsXY ContextGetCursorPosition(); +ScreenCoordsXY ContextGetCursorPositionScaled(); +void ContextSetCursorPosition(const ScreenCoordsXY& cursorPosition); +const CursorState* ContextGetCursorState(); +const uint8_t* ContextGetKeysState(); +const uint8_t* ContextGetKeysPressed(); +TextInputSession* ContextStartTextInput(utf8* buffer, size_t maxLength); +void ContextStopTextInput(); +bool ContextIsInputActive(); +void ContextTriggerResize(); +void ContextSetFullscreenMode(int32_t mode); +void ContextRecreateWindow(); +int32_t ContextGetWidth(); +int32_t ContextGetHeight(); +bool ContextHasFocus(); +void ContextSetCursorTrap(bool value); +rct_window* ContextOpenWindow(WindowClass wc); +rct_window* ContextOpenDetailWindow(uint8_t type, int32_t id); +rct_window* ContextOpenWindowView(uint8_t view); +rct_window* ContextShowError(StringId title, StringId message, const class Formatter& args); +rct_window* ContextOpenIntent(Intent* intent); +void ContextBroadcastIntent(Intent* intent); +void ContextForceCloseWindowByClass(WindowClass wc); +void ContextUpdateMapTooltip(); +void ContextHandleInput(); +void ContextInputHandleKeyboard(bool isTitle); +void ContextQuit(); +bool ContextLoadParkFromStream(void* stream); bool ContextOpenCommonFileDialog(utf8* outFilename, OpenRCT2::Ui::FileDialogDesc& desc, size_t outSize); u8string ContextOpenCommonFileDialog(OpenRCT2::Ui::FileDialogDesc& desc); diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 84e96c6024..371857da07 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -61,10 +61,8 @@ namespace Editor static void ConvertSaveToScenarioCallback(int32_t result, const utf8* path); static void SetAllLandOwned(); - static bool LoadLandscapeFromSV4(const char* path); - static bool LoadLandscapeFromSC4(const char* path); static void FinaliseMainView(); - static bool ReadS6(const char* path); + static bool ReadS4OrS6(const char* path); static bool ReadPark(const char* path); static void ClearMapForEditing(bool fromSave); @@ -93,9 +91,9 @@ namespace Editor static rct_window* OpenEditorWindows() { - auto* main = context_open_window(WindowClass::MainWindow); - context_open_window(WindowClass::TopToolbar); - context_open_window_view(WV_EDITOR_BOTTOM_TOOLBAR); + auto* main = ContextOpenWindow(WindowClass::MainWindow); + ContextOpenWindow(WindowClass::TopToolbar); + ContextOpenWindowView(WV_EDITOR_BOTTOM_TOOLBAR); return main; } @@ -130,7 +128,7 @@ namespace Editor auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(ConvertSaveToScenarioCallback)); - context_open_intent(&intent); + ContextOpenIntent(&intent); } static void ConvertSaveToScenarioCallback(int32_t result, const utf8* path) @@ -140,7 +138,7 @@ namespace Editor return; } - if (!context_load_park_from_file(path)) + if (!GetContext()->LoadParkFromFile(path)) { return; } @@ -230,11 +228,9 @@ namespace Editor { case FileExtension::SC6: case FileExtension::SV6: - return ReadS6(path); case FileExtension::SC4: - return LoadLandscapeFromSC4(path); case FileExtension::SV4: - return LoadLandscapeFromSV4(path); + return ReadS4OrS6(path); case FileExtension::PARK: return ReadPark(path); default: @@ -242,57 +238,8 @@ namespace Editor } } - /** - * - * rct2: 0x006A2B02 - */ - static bool LoadLandscapeFromSV4(const char* path) + static void AfterLoadCleanup(bool loadedFromSave) { - load_from_sv4(path); - ClearMapForEditing(true); - - gEditorStep = EditorStep::LandscapeEditor; - gScreenAge = 0; - gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; - viewport_init_all(); - OpenEditorWindows(); - FinaliseMainView(); - return true; - } - - static bool LoadLandscapeFromSC4(const char* path) - { - load_from_sc4(path); - ClearMapForEditing(false); - - gEditorStep = EditorStep::LandscapeEditor; - gScreenAge = 0; - gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; - viewport_init_all(); - OpenEditorWindows(); - FinaliseMainView(); - return true; - } - - /** - * - * rct2: 0x006758FE - */ - static bool ReadS6(const char* path) - { - auto extensionS = Path::GetExtension(path); - const char* extension = extensionS.c_str(); - auto loadedFromSave = false; - if (_stricmp(extension, ".sc6") == 0) - { - load_from_sc6(path); - } - else if (_stricmp(extension, ".sv6") == 0 || _stricmp(extension, ".sv7") == 0) - { - load_from_sv6(path); - loadedFromSave = true; - } - ClearMapForEditing(loadedFromSave); gEditorStep = EditorStep::LandscapeEditor; @@ -301,6 +248,27 @@ namespace Editor viewport_init_all(); OpenEditorWindows(); FinaliseMainView(); + } + + /** + * + * rct2: 0x006758FE + */ + static bool ReadS4OrS6(const char* path) + { + auto extensionS = Path::GetExtension(path); + const char* extension = extensionS.c_str(); + auto loadedFromSave = false; + const auto loadSuccess = GetContext()->LoadParkFromFile(path); + if (!loadSuccess) + return false; + + if (_stricmp(extension, ".sv4") == 0 || _stricmp(extension, ".sv6") == 0 || _stricmp(extension, ".sv7") == 0) + { + loadedFromSave = true; + } + + AfterLoadCleanup(loadedFromSave); return true; } @@ -315,13 +283,7 @@ namespace Editor objManager.LoadObjects(loadResult.RequiredObjects); importer->Import(); - ClearMapForEditing(true); - gEditorStep = EditorStep::LandscapeEditor; - gScreenAge = 0; - gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR; - viewport_init_all(); - OpenEditorWindows(); - FinaliseMainView(); + AfterLoadCleanup(true); return true; } catch (const std::exception&) @@ -332,7 +294,7 @@ namespace Editor static void ClearMapForEditing(bool fromSave) { - map_remove_all_rides(); + MapRemoveAllRides(); UnlinkAllRideBanners(); ride_init_all(); @@ -415,7 +377,7 @@ namespace Editor object_manager_unload_all_objects(); } - context_open_window(WindowClass::EditorObjectSelection); + ContextOpenWindow(WindowClass::EditorObjectSelection); break; case EditorStep::InventionsListSetUp: if (window_find_by_class(WindowClass::EditorInventionList) != nullptr) @@ -423,7 +385,7 @@ namespace Editor return; } - context_open_window(WindowClass::EditorInventionList); + ContextOpenWindow(WindowClass::EditorInventionList); break; case EditorStep::OptionsSelection: if (window_find_by_class(WindowClass::EditorScenarioOptions) != nullptr) @@ -431,7 +393,7 @@ namespace Editor return; } - context_open_window(WindowClass::EditorScenarioOptions); + ContextOpenWindow(WindowClass::EditorScenarioOptions); break; case EditorStep::ObjectiveSelection: if (window_find_by_class(WindowClass::EditorObjectiveOptions) != nullptr) @@ -439,7 +401,7 @@ namespace Editor return; } - context_open_window(WindowClass::EditorObjectiveOptions); + ContextOpenWindow(WindowClass::EditorObjectiveOptions); break; case EditorStep::LandscapeEditor: case EditorStep::SaveScenario: @@ -456,7 +418,7 @@ namespace Editor windowManager->SetMainView(gSavedView, gSavedViewZoom, gSavedViewRotation); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES)); @@ -530,7 +492,7 @@ namespace Editor */ ResultWithMessage CheckPark() { - int32_t parkSize = park_calculate_size(); + int32_t parkSize = ParkCalculateSize(); if (parkSize == 0) { return { false, STR_PARK_MUST_OWN_SOME_LAND }; @@ -543,9 +505,9 @@ namespace Editor for (const auto& parkEntrance : gParkEntrances) { - int32_t direction = direction_reverse(parkEntrance.direction); + int32_t direction = DirectionReverse(parkEntrance.direction); - switch (footpath_is_connected_to_map_edge(parkEntrance, direction, 0)) + switch (FootpathIsConnectedToMapEdge(parkEntrance, direction, 0)) { case FOOTPATH_SEARCH_NOT_FOUND: return { false, STR_PARK_ENTRANCE_WRONG_DIRECTION_OR_NO_PATH }; @@ -554,7 +516,7 @@ namespace Editor return { false, STR_PARK_ENTRANCE_PATH_INCOMPLETE_OR_COMPLEX }; case FOOTPATH_SEARCH_SUCCESS: // Run the search again and unown the path - footpath_is_connected_to_map_edge(parkEntrance, direction, (1 << 5)); + FootpathIsConnectedToMapEdge(parkEntrance, direction, (1 << 5)); break; } } diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 2dfca1167b..b6b31b3395 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -141,7 +141,7 @@ void setup_in_use_selection_flags() } tile_element_iterator iter; - tile_element_iterator_begin(&iter); + TileElementIteratorBegin(&iter); do { ObjectEntryIndex type; @@ -230,7 +230,7 @@ void setup_in_use_selection_flags() break; } } - } while (tile_element_iterator_next(&iter)); + } while (TileElementIteratorNext(&iter)); for (auto& ride : GetRideManager()) { @@ -491,7 +491,7 @@ void finish_object_selection() else { set_all_scenery_items_invented(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); gEditorStep = EditorStep::LandscapeEditor; gfx_invalidate_screen(); } @@ -686,7 +686,7 @@ int32_t editor_remove_unused_objects() editor_object_flags_free(); auto intent = Intent(INTENT_ACTION_REFRESH_SCENERY); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); return numUnselectedObjects; } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 0e9891048a..a3c70d1546 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -102,7 +102,7 @@ void game_reset_speed() void game_increase_game_speed() { - gGameSpeed = std::min(gConfigGeneral.debugging_tools ? 5 : 4, gGameSpeed + 1); + gGameSpeed = std::min(gConfigGeneral.DebuggingTools ? 5 : 4, gGameSpeed + 1); if (gGameSpeed == 5) gGameSpeed = 8; window_invalidate_by_class(WindowClass::TopToolbar); @@ -122,10 +122,10 @@ void game_reduce_game_speed() */ void game_create_windows() { - context_open_window(WindowClass::MainWindow); - context_open_window(WindowClass::TopToolbar); - context_open_window(WindowClass::BottomToolbar); - window_resize_gui(context_get_width(), context_get_height()); + ContextOpenWindow(WindowClass::MainWindow); + ContextOpenWindow(WindowClass::TopToolbar); + ContextOpenWindow(WindowClass::BottomToolbar); + window_resize_gui(ContextGetWidth(), ContextGetHeight()); } enum @@ -204,7 +204,7 @@ void update_palette_effects() // Animate the water/lava/chain movement palette uint32_t shade = 0; - if (gConfigGeneral.render_weather_gloom) + if (gConfigGeneral.RenderWeatherGloom) { auto paletteId = ClimateGetWeatherGloomPaletteId(gClimateCurrent); if (paletteId != FilterPaletteID::PaletteNull) @@ -327,7 +327,7 @@ static void load_landscape() { auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE); - context_open_intent(&intent); + ContextOpenIntent(&intent); } void rct2_to_utf8_self(char* buffer, size_t length) @@ -413,7 +413,7 @@ void game_fix_save_vars() { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto* surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto* surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) { @@ -450,9 +450,11 @@ void game_fix_save_vars() fix_invalid_vehicle_sprite_sizes(); // Fix gParkEntrance locations for which the tile_element no longer exists - fix_park_entrance_locations(); + ParkEntranceFixLocations(); UpdateConsolidatedPatrolAreas(); + + MapCountRemainingLandRights(); } void game_load_init() @@ -482,10 +484,10 @@ void game_load_init() } ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); gWindowUpdateTicks = 0; @@ -494,7 +496,7 @@ void game_load_init() if (!gOpenRCT2Headless) { intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); window_update_all(); } @@ -593,7 +595,7 @@ void save_game_cmd(u8string_view name /* = {} */) void save_game_with_name(u8string_view name) { log_verbose("Saving to %s", u8string(name).c_str()); - if (scenario_save(name, gConfigGeneral.save_plugin_data ? 1 : 0)) + if (scenario_save(name, gConfigGeneral.SavePluginData ? 1 : 0)) { log_verbose("Saved to %s", u8string(name).c_str()); gCurrentLoadedPath = name; @@ -616,7 +618,7 @@ std::unique_ptr create_save_game_as_intent() void save_game_as() { auto intent = create_save_game_as_intent(); - context_open_intent(intent.get()); + ContextOpenIntent(intent.get()); } static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processLandscapeFolder) @@ -699,7 +701,7 @@ void game_autosave() timeName, sizeof(timeName), "autosave_%04u-%02u-%02u_%02u-%02u-%02u%s", currentDate.year, currentDate.month, currentDate.day, currentTime.hour, currentTime.minute, currentTime.second, fileExtension); - int32_t autosavesToKeep = gConfigGeneral.autosave_amount; + int32_t autosavesToKeep = gConfigGeneral.AutosaveAmount; limit_autosave_count(autosavesToKeep - 1, (gScreenFlags & SCREEN_FLAGS_EDITOR)); auto env = GetContext()->GetPlatformEnvironment(); @@ -726,7 +728,7 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8 game_notify_map_change(); game_unload_scripts(); window_close_by_class(WindowClass::EditorObjectSelection); - context_load_park_from_file(path); + GetContext()->LoadParkFromFile(path); game_load_scripts(); game_notify_map_changed(); gIsAutosaveLoaded = gIsAutosave; @@ -756,7 +758,7 @@ void game_load_or_quit_no_save_prompt() auto intent = Intent(WindowClass::Loadsave); intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(game_load_or_quit_no_save_prompt_callback)); - context_open_intent(&intent); + ContextOpenIntent(&intent); } break; } diff --git a/src/openrct2/Game.h b/src/openrct2/Game.h index d06a98b27d..3634a63a53 100644 --- a/src/openrct2/Game.h +++ b/src/openrct2/Game.h @@ -158,7 +158,6 @@ void reset_all_sprite_quadrant_placements(); void update_palette_effects(); void game_load_or_quit_no_save_prompt(); -void load_from_sv6(const char* path); void game_load_init(); void game_load_scripts(); void game_unload_scripts(); diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 6ead131575..9efe08eae6 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -63,7 +63,7 @@ void GameState::InitAll(const TileCoordsXY& mapSize) gInMapInitCode = true; gCurrentTicks = 0; - map_init(mapSize); + MapInit(mapSize); _park->Initialise(); finance_init(); BannerInit(); @@ -78,11 +78,11 @@ void GameState::InitAll(const TileCoordsXY& mapSize) gNextGuestNumber = 1; - context_init(); - scenery_set_default_placement_configuration(); + ContextInit(); + ScenerySetDefaultPlacementConfiguration(); auto intent = Intent(INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); load_palette(); @@ -141,7 +141,7 @@ void GameState::Tick() } bool isPaused = game_is_paused(); - if (network_get_mode() == NETWORK_MODE_SERVER && gConfigNetwork.pause_server_if_no_clients) + if (network_get_mode() == NETWORK_MODE_SERVER && gConfigNetwork.PauseServerIfNoClients) { // If we are headless we always have 1 player (host), pause if no one else is around. if (gOpenRCT2Headless && network_get_num_players() == 1) @@ -173,7 +173,7 @@ void GameState::Tick() // Update the animation list. Note this does not // increment the map animation. - map_animation_invalidate_all(); + MapAnimationInvalidateAll(); // Post-tick network update network_process_pending(); @@ -228,9 +228,9 @@ void GameState::Tick() gWindowMapFlashingFlags |= MapFlashingFlags::FlashStaff; gWindowMapFlashingFlags &= ~MapFlashingFlags::StaffListOpen; - context_update_map_tooltip(); + ContextUpdateMapTooltip(); - context_handle_input(); + ContextHandleInput(); } // Always perform autosave check, even when paused @@ -321,16 +321,16 @@ void GameState::UpdateLogic(LogicTimings* timings) report_time(LogicTimePart::Scenario); ClimateUpdate(); report_time(LogicTimePart::Climate); - map_update_tiles(); + MapUpdateTiles(); report_time(LogicTimePart::MapTiles); // Temporarily remove provisional paths to prevent peep from interacting with them - map_remove_provisional_elements(); + MapRemoveProvisionalElements(); report_time(LogicTimePart::MapStashProvisionalElements); - map_update_path_wide_flags(); + MapUpdatePathWideFlags(); report_time(LogicTimePart::MapPathWideFlags); peep_update_all(); report_time(LogicTimePart::Peep); - map_restore_provisional_elements(); + MapRestoreProvisionalElements(); report_time(LogicTimePart::MapRestoreProvisionalElements); vehicle_update_all(); report_time(LogicTimePart::Vehicle); @@ -354,7 +354,7 @@ void GameState::UpdateLogic(LogicTimings* timings) News::UpdateCurrentItem(); report_time(LogicTimePart::News); - map_animation_invalidate_all(); + MapAnimationInvalidateAll(); report_time(LogicTimePart::MapAnimation); vehicle_sounds_update(); peep_update_crowd_noise(); diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index a455e42c33..22c7b06f8e 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -294,7 +294,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, PathfindGoal.y); COMPARE_FIELD(Peep, PathfindGoal.z); COMPARE_FIELD(Peep, PathfindGoal.direction); - for (int i = 0; i < 4; i++) + for (std::size_t i = 0; i < spriteCmp.PathfindHistory.size(); i++) { COMPARE_FIELD(Peep, PathfindHistory[i].x); COMPARE_FIELD(Peep, PathfindHistory[i].y); @@ -349,7 +349,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Guest, RejoinQueueTimeout); COMPARE_FIELD(Guest, PreviousRide); COMPARE_FIELD(Guest, PreviousRideTimeOut); - for (int i = 0; i < PEEP_MAX_THOUGHTS; i++) + for (std::size_t i = 0; i < PEEP_MAX_THOUGHTS; i++) { COMPARE_FIELD(Guest, Thoughts[i].type); COMPARE_FIELD(Guest, Thoughts[i].item); @@ -412,11 +412,11 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Vehicle, SwingSpeed); COMPARE_FIELD(Vehicle, status); COMPARE_FIELD(Vehicle, sub_state); - for (int i = 0; i < 32; i++) + for (std::size_t i = 0; i < sizeof(Vehicle::peep) / sizeof(*Vehicle::peep); i++) { COMPARE_FIELD(Vehicle, peep[i]); } - for (int i = 0; i < 32; i++) + for (std::size_t i = 0; i < sizeof(Vehicle::peep_tshirt_colours) / sizeof(*Vehicle::peep_tshirt_colours); i++) { COMPARE_FIELD(Vehicle, peep_tshirt_colours[i]); } @@ -437,7 +437,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Vehicle, powered_acceleration); COMPARE_FIELD(Vehicle, CollisionDetectionTimer); COMPARE_FIELD(Vehicle, animation_frame); - for (int i = 0; i < 2; i++) + for (std::size_t i = 0; i < sizeof(Vehicle::pad_C6) / sizeof(*Vehicle::pad_C6); i++) { COMPARE_FIELD(Vehicle, pad_C6[i]); } @@ -489,7 +489,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots { COMPARE_FIELD(VehicleCrashParticle, frame); COMPARE_FIELD(VehicleCrashParticle, time_to_live); - for (int i = 0; i < 2; i++) + for (std::size_t i = 0; i < sizeof(VehicleCrashParticle::colour) / sizeof(*VehicleCrashParticle::colour); i++) { COMPARE_FIELD(VehicleCrashParticle, colour[i]); } diff --git a/src/openrct2/Input.cpp b/src/openrct2/Input.cpp index edd7df1a98..2a0178abbd 100644 --- a/src/openrct2/Input.cpp +++ b/src/openrct2/Input.cpp @@ -29,7 +29,7 @@ widget_ref gCurrentToolWidget; */ void title_handle_keyboard_input() { - context_input_handle_keyboard(true); + ContextInputHandleKeyboard(true); } /** @@ -38,7 +38,7 @@ void title_handle_keyboard_input() */ void game_handle_keyboard_input() { - context_input_handle_keyboard(false); + ContextInputHandleKeyboard(false); } void input_set_flag(INPUT_FLAGS flag, bool on) diff --git a/src/openrct2/Intro.cpp b/src/openrct2/Intro.cpp index 91901489b3..15b472fca1 100644 --- a/src/openrct2/Intro.cpp +++ b/src/openrct2/Intro.cpp @@ -69,7 +69,7 @@ void intro_update() _introStateCounter += 5; // Check if logo is off the screen...ish - if (_introStateCounter > context_get_height() - 120) + if (_introStateCounter > ContextGetHeight() - 120) { _introStateCounter = -116; gIntroState = IntroState::DeveloperBegin; @@ -86,7 +86,7 @@ void intro_update() _introStateCounter += 5; // Check if logo is almost scrolled to the bottom - if (!_chainLiftFinished && _introStateCounter >= context_get_height() + 40 - 421) + if (!_chainLiftFinished && _introStateCounter >= ContextGetHeight() + 40 - 421) { _chainLiftFinished = true; @@ -102,7 +102,7 @@ void intro_update() } // Check if logo is off the screen...ish - if (_introStateCounter >= context_get_height() + 40) + if (_introStateCounter >= ContextGetHeight() + 40) { // Stop the track friction sound if (_soundChannel != nullptr) @@ -170,7 +170,7 @@ void intro_update() void intro_draw(rct_drawpixelinfo* dpi) { - int32_t screenWidth = context_get_width(); + int32_t screenWidth = ContextGetWidth(); switch (gIntroState) { @@ -242,7 +242,7 @@ void intro_draw(rct_drawpixelinfo* dpi) static void screen_intro_process_mouse_input() { - if (context_get_cursor_state()->any == CURSOR_PRESSED) + if (ContextGetCursorState()->any == CURSOR_PRESSED) { screen_intro_skip_part(); } @@ -254,7 +254,7 @@ static void screen_intro_process_mouse_input() */ static void screen_intro_process_keyboard_input() { - const uint8_t* keys = context_get_keys_state(); + const uint8_t* keys = ContextGetKeysState(); for (int i = 0; i < 256; i++) { if (keys[i] != 0) @@ -282,7 +282,7 @@ static void screen_intro_skip_part() static void screen_intro_draw_logo(rct_drawpixelinfo* dpi) { - int32_t screenWidth = context_get_width(); + int32_t screenWidth = ContextGetWidth(); int32_t imageWidth = 640; int32_t imageX = (screenWidth - imageWidth) / 2; diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 19384b3e89..1121446726 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -205,18 +205,18 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() // Now load the config so we can get the RCT1 and RCT2 paths auto configPath = env->GetFilePath(PATHID::CONFIG); - config_set_defaults(); - if (!config_open(configPath)) + ConfigSetDefaults(); + if (!ConfigOpen(configPath)) { - config_save(configPath); + ConfigSave(configPath); } if (gCustomRCT1DataPath.empty()) { - env->SetBasePath(DIRBASE::RCT1, gConfigGeneral.rct1_path); + env->SetBasePath(DIRBASE::RCT1, gConfigGeneral.RCT1Path); } if (gCustomRCT2DataPath.empty()) { - env->SetBasePath(DIRBASE::RCT2, gConfigGeneral.rct2_path); + env->SetBasePath(DIRBASE::RCT2, gConfigGeneral.RCT2Path); } // Log base paths diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index d607cd984b..f9a52e09d5 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -655,7 +655,7 @@ namespace OpenRCT2 { serialiser << _guestGenerationProbability; serialiser << _suggestedGuestMaximum; - serialiser << gConfigGeneral.show_real_names_of_guests; + serialiser << gConfigGeneral.ShowRealNamesOfGuests; // To make this a little bit less volatile against updates // we reserve some space for future additions. diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp index a75b8936d7..703d11079f 100644 --- a/src/openrct2/Version.cpp +++ b/src/openrct2/Version.cpp @@ -61,7 +61,7 @@ NewVersionInfo get_latest_version() NewVersionInfo verinfo{ tag, "", "", "" }; #ifndef DISABLE_HTTP auto now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); - auto then = gConfigGeneral.last_version_check_time; + auto then = gConfigGeneral.LastVersionCheckTime; if (then < now - 24 * 60 * 60) { Http::Request request; @@ -88,8 +88,8 @@ NewVersionInfo get_latest_version() verinfo.changelog = Json::GetString(root["body"]); verinfo.url = Json::GetString(root["html_url"]); - gConfigGeneral.last_version_check_time = now; - config_save_default(); + gConfigGeneral.LastVersionCheckTime = now; + ConfigSaveDefault(); } #endif return verinfo; diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 2b2da2c620..f834c9c824 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -73,13 +73,13 @@ GameActions::Result BannerPlaceAction::Query() const GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS); } - if (!map_can_build_at(_loc)) + if (!MapCanBuildAt(_loc)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } auto baseHeight = _loc.z + PATH_HEIGHT_STEP; - BannerElement* existingBannerElement = map_get_banner_element_at({ _loc.x, _loc.y, baseHeight }, _loc.direction); + BannerElement* existingBannerElement = MapGetBannerElementAt({ _loc.x, _loc.y, baseHeight }, _loc.direction); if (existingBannerElement != nullptr) { return GameActions::Result( @@ -93,7 +93,7 @@ GameActions::Result BannerPlaceAction::Query() const GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME); } - auto* bannerEntry = get_banner_entry(_bannerType); + auto* bannerEntry = GetBannerEntry(_bannerType); if (bannerEntry == nullptr) { log_error("Invalid banner object type. bannerType = ", _bannerType); @@ -120,7 +120,7 @@ GameActions::Result BannerPlaceAction::Execute() const GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } - auto* bannerEntry = get_banner_entry(_bannerType); + auto* bannerEntry = GetBannerEntry(_bannerType); if (bannerEntry == nullptr) { log_error("Invalid banner object type. bannerType = ", _bannerType); @@ -151,8 +151,8 @@ GameActions::Result BannerPlaceAction::Execute() const bannerElement->SetIndex(banner->id); bannerElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); - map_invalidate_tile_full(_loc); - map_animation_create(MAP_ANIMATION_TYPE_BANNER, CoordsXYZ{ _loc, bannerElement->GetBaseZ() }); + MapInvalidateTileFull(_loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_BANNER, CoordsXYZ{ _loc, bannerElement->GetBaseZ() }); res.Cost = bannerEntry->price; return res; diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index cf6235e9b1..7b8a794275 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -49,7 +49,7 @@ GameActions::Result BannerRemoveAction::Query() const res.Position.z = _loc.z; res.ErrorTitle = STR_CANT_REMOVE_THIS; - if (!LocationValid(_loc) || !map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 })) + if (!LocationValid(_loc) || !MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 })) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -75,7 +75,7 @@ GameActions::Result BannerRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry != nullptr) { res.Cost = -((bannerEntry->price * 3) / 4); @@ -114,14 +114,14 @@ GameActions::Result BannerRemoveAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry != nullptr) { res.Cost = -((bannerEntry->price * 3) / 4); } reinterpret_cast(bannerElement)->RemoveBannerEntry(); - map_invalidate_tile_zoom1({ _loc, _loc.z, _loc.z + 32 }); + MapInvalidateTileZoom1({ _loc, _loc.z, _loc.z + 32 }); bannerElement->Remove(); return res; diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 56a60f91d6..9bf9ada550 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -70,12 +70,12 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } - if (!map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 })) + if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 })) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - auto bannerElement = map_get_banner_element_at(_loc, _loc.direction); + auto bannerElement = MapGetBannerElementAt(_loc, _loc.direction); if (bannerElement == nullptr) { @@ -95,10 +95,10 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const { auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); intent.putExtra(INTENT_EXTRA_BANNER_INDEX, index); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); banner->colour = _primaryColour; - map_invalidate_tile_zoom1({ _loc, _loc.z, _loc.z + 32 }); + MapInvalidateTileZoom1({ _loc, _loc.z, _loc.z + 32 }); } return res; diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index 28513af6ee..f2c9b85040 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -66,7 +66,7 @@ GameActions::Result BannerSetNameAction::Execute() const auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); intent.putExtra(INTENT_EXTRA_BANNER_INDEX, _bannerIndex); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); scrolling_text_invalidate(); gfx_invalidate_screen(); diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index a9e700df1e..8e38985423 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -55,7 +55,7 @@ GameActions::Result BannerSetStyleAction::Query() const res.Expenditure = ExpenditureType::Landscaping; auto location = banner->position.ToCoordsXY().ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; TileElement* tileElement = BannerGetTileElement(_bannerIndex); @@ -109,7 +109,7 @@ GameActions::Result BannerSetStyleAction::Execute() const res.Expenditure = ExpenditureType::Landscaping; auto location = banner->position.ToCoordsXY().ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; TileElement* tileElement = BannerGetTileElement(_bannerIndex); @@ -153,7 +153,7 @@ GameActions::Result BannerSetStyleAction::Execute() const auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); intent.putExtra(INTENT_EXTRA_BANNER_INDEX, _bannerIndex); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); return res; } diff --git a/src/openrct2/actions/ChangeMapSizeAction.cpp b/src/openrct2/actions/ChangeMapSizeAction.cpp index 4f6b816a41..72a5943514 100644 --- a/src/openrct2/actions/ChangeMapSizeAction.cpp +++ b/src/openrct2/actions/ChangeMapSizeAction.cpp @@ -51,25 +51,25 @@ GameActions::Result ChangeMapSizeAction::Execute() const while (_targetSize.x > gMapSize.x) { gMapSize.x++; - map_extend_boundary_surface_x(); + MapExtendBoundarySurfaceX(); } while (_targetSize.y > gMapSize.y) { gMapSize.y++; - map_extend_boundary_surface_y(); + MapExtendBoundarySurfaceY(); } // Shrink map if (_targetSize.x < gMapSize.x || _targetSize.y < gMapSize.y) { gMapSize = _targetSize; - map_remove_out_of_range_elements(); + MapRemoveOutOfRangeElements(); } auto* ctx = OpenRCT2::GetContext(); auto uiContext = ctx->GetUiContext(); auto* windowManager = uiContext->GetWindowManager(); - park_calculate_size(); + ParkCalculateSize(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_MAP)); gfx_invalidate_screen(); diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index c73479cb6e..07512a7eff 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -55,7 +55,7 @@ GameActions::Result ClearAction::CreateResult() const auto x = (_range.GetLeft() + _range.GetRight()) / 2 + 16; auto y = (_range.GetTop() + _range.GetBottom()) / 2 + 16; - auto z = tile_element_height({ x, y }); + auto z = TileElementHeight({ x, y }); result.Position = CoordsXYZ(x, y, z); return result; @@ -116,7 +116,7 @@ money32 ClearAction::ClearSceneryFromTile(const CoordsXY& tilePos, bool executin do { tileEdited = false; - tileElement = map_get_first_element_at(tilePos); + tileElement = MapGetFirstElementAt(tilePos); if (tileElement == nullptr) return totalCost; do @@ -211,7 +211,7 @@ void ClearAction::ResetClearLargeSceneryFlag() { for (int32_t x = 0; x < gMapSize.x; x++) { - auto tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + auto tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); do { if (tileElement == nullptr) @@ -227,5 +227,5 @@ void ClearAction::ResetClearLargeSceneryFlag() bool ClearAction::MapCanClearAt(const CoordsXY& location) { - return (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode || map_is_location_owned_or_has_rights(location); + return (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode || MapIsLocationOwnedOrHasRights(location); } diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 6d2f3df94e..8f32f94b1d 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -55,7 +55,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } @@ -70,7 +70,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_HIGH); } - auto tileElement = map_get_footpath_element(_loc); + auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { log_error("Could not find path element."); @@ -93,7 +93,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const if (_pathItemType != 0) { - auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); + auto* pathBitEntry = GetFootpathItemEntry(_pathItemType - 1); if (pathBitEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -145,7 +145,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const res.Position = _loc; res.Expenditure = ExpenditureType::Landscaping; - auto tileElement = map_get_footpath_element(_loc); + auto tileElement = MapGetFootpathElement(_loc); auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) @@ -163,7 +163,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const if (_pathItemType != 0) { - auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); + auto* pathBitEntry = GetFootpathItemEntry(_pathItemType - 1); if (pathBitEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -178,7 +178,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const } else { - footpath_interrupt_peeps(_loc); + FootpathInterruptPeeps(_loc); } if ((_pathItemType != 0 && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) @@ -191,12 +191,12 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const pathElement->SetIsBroken(false); if (_pathItemType != 0) { - auto* pathBitEntry = get_footpath_item_entry(_pathItemType - 1); + auto* pathBitEntry = GetFootpathItemEntry(_pathItemType - 1); if (pathBitEntry != nullptr && pathBitEntry->flags & PATH_BIT_FLAG_IS_BIN) { pathElement->SetAdditionStatus(255); } } - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); return res; } diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 2e7e7b11f1..669dda1d84 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -49,7 +49,7 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -64,7 +64,7 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_TOO_HIGH); } - auto tileElement = map_get_footpath_element(_loc); + auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { log_warning("Could not find path element."); @@ -91,12 +91,12 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const GameActions::Result FootpathAdditionRemoveAction::Execute() const { - auto tileElement = map_get_footpath_element(_loc); + auto tileElement = MapGetFootpathElement(_loc); auto pathElement = tileElement->AsPath(); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_interrupt_peeps(_loc); + FootpathInterruptPeeps(_loc); } if (pathElement == nullptr) @@ -106,7 +106,7 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const } pathElement->SetAddition(0); - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); auto res = GameActions::Result(); res.Position = _loc; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 9eec506edc..646db9de7e 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -71,12 +71,12 @@ GameActions::Result FootpathPlaceAction::Query() const gFootpathGroundFlags = 0; - if (!LocationValid(_loc) || map_is_edge(_loc)) + if (!LocationValid(_loc) || MapIsEdge(_loc)) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK); } @@ -96,13 +96,13 @@ GameActions::Result FootpathPlaceAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_TOO_HIGH); } - if (_direction != INVALID_DIRECTION && !direction_valid(_direction)) + if (_direction != INVALID_DIRECTION && !DirectionValid(_direction)) { log_error("Direction invalid. direction = %u", _direction); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); } - footpath_provisional_remove(); + FootpathProvisionalRemove(); auto tileElement = map_get_footpath_element_slope(_loc, _slope); if (tileElement == nullptr) { @@ -120,7 +120,7 @@ GameActions::Result FootpathPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_interrupt_peeps(_loc); + FootpathInterruptPeeps(_loc); } gFootpathGroundFlags = 0; @@ -135,10 +135,10 @@ GameActions::Result FootpathPlaceAction::Execute() const // It is possible, let's remove walls between the old and new piece of path auto zLow = _loc.z; auto zHigh = zLow + PATH_CLEARANCE; - wall_remove_intersecting_walls( + WallRemoveIntersectingWalls( { _loc, zLow, zHigh + ((_slope & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) ? 16 : 0) }, - direction_reverse(_direction)); - wall_remove_intersecting_walls( + DirectionReverse(_direction)); + WallRemoveIntersectingWalls( { _loc.x - CoordsDirectionDelta[_direction].x, _loc.y - CoordsDirectionDelta[_direction].y, zLow, zHigh }, _direction); } @@ -218,11 +218,11 @@ GameActions::Result FootpathPlaceAction::ElementUpdateExecute(PathElement* pathE res.Cost += 6.00_GBP; } - footpath_queue_chain_reset(); + FootpathQueueChainReset(); if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN)) { - footpath_remove_edges_at(_loc, reinterpret_cast(pathElement)); + FootpathRemoveEdgesAt(_loc, reinterpret_cast(pathElement)); } if (_constructFlags & PathConstructFlag::IsLegacyPathObject) @@ -284,7 +284,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result zHigh += PATH_HEIGHT_STEP; } - auto entranceElement = map_get_park_entrance_element_at(_loc, false); + auto entranceElement = MapGetParkEntranceElementAt(_loc, false); // Make sure the entrance part is the middle if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0) { @@ -318,7 +318,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); @@ -339,7 +339,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul if (!(GetFlags() & (GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_GHOST))) { - footpath_remove_litter(_loc); + FootpathRemoveLitter(_loc); } res.Cost = 12.00_GBP; @@ -353,7 +353,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul zHigh += PATH_HEIGHT_STEP; } - auto entranceElement = map_get_park_entrance_element_at(_loc, false); + auto entranceElement = MapGetParkEntranceElementAt(_loc, false); // Make sure the entrance part is the middle if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0) { @@ -381,7 +381,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul const auto clearanceData = canBuild.GetData(); gFootpathGroundFlags = clearanceData.GroundFlags; - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); @@ -401,7 +401,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul { entranceElement->SetSurfaceEntryIndex(_type); } - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); } } else @@ -428,11 +428,11 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul pathElement->SetIsBroken(false); pathElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); - footpath_queue_chain_reset(); + FootpathQueueChainReset(); if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN)) { - footpath_remove_edges_at(_loc, pathElement->as()); + FootpathRemoveEdgesAt(_loc, pathElement->as()); } if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { @@ -489,10 +489,10 @@ void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) cons { auto direction = pathElement->GetSlopeDirection(); int32_t z = pathElement->GetBaseZ(); - wall_remove_intersecting_walls({ _loc, z, z + (6 * COORDS_Z_STEP) }, direction_reverse(direction)); - wall_remove_intersecting_walls({ _loc, z, z + (6 * COORDS_Z_STEP) }, direction); + WallRemoveIntersectingWalls({ _loc, z, z + (6 * COORDS_Z_STEP) }, DirectionReverse(direction)); + WallRemoveIntersectingWalls({ _loc, z, z + (6 * COORDS_Z_STEP) }, direction); // Removing walls may have made the pointer invalid, so find it again - auto tileElement = map_get_footpath_element(CoordsXYZ(_loc, z)); + auto tileElement = MapGetFootpathElement(CoordsXYZ(_loc, z)); if (tileElement == nullptr) { log_error("Something went wrong. Could not refind footpath."); @@ -502,10 +502,10 @@ void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) cons } if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN)) - footpath_connect_edges(_loc, reinterpret_cast(pathElement), GetFlags()); + FootpathConnectEdges(_loc, reinterpret_cast(pathElement), GetFlags()); - footpath_update_queue_chains(); - map_invalidate_tile_full(_loc); + FootpathUpdateQueueChains(); + MapInvalidateTileFull(_loc); } PathElement* FootpathPlaceAction::map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope) const diff --git a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp index f4290356d1..a862b36774 100644 --- a/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp +++ b/src/openrct2/actions/FootpathPlaceFromTrackAction.cpp @@ -57,13 +57,13 @@ GameActions::Result FootpathPlaceFromTrackAction::Query() const gFootpathGroundFlags = 0; - if (!LocationValid(_loc) || map_is_edge(_loc)) + if (!LocationValid(_loc) || MapIsEdge(_loc)) { return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -93,7 +93,7 @@ GameActions::Result FootpathPlaceFromTrackAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_interrupt_peeps(_loc); + FootpathInterruptPeeps(_loc); } gFootpathGroundFlags = 0; @@ -126,7 +126,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertQuery(GameActions zHigh += PATH_HEIGHT_STEP; } - auto entranceElement = map_get_park_entrance_element_at(_loc, false); + auto entranceElement = MapGetParkEntranceElementAt(_loc, false); // Make sure the entrance part is the middle if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0) { @@ -160,7 +160,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertQuery(GameActions GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result( @@ -182,7 +182,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio if (!(GetFlags() & (GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_GHOST))) { - footpath_remove_litter(_loc); + FootpathRemoveLitter(_loc); } res.Cost = 12.00_GBP; @@ -196,7 +196,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio zHigh += PATH_HEIGHT_STEP; } - auto entranceElement = map_get_park_entrance_element_at(_loc, false); + auto entranceElement = MapGetParkEntranceElementAt(_loc, false); // Make sure the entrance part is the middle if (entranceElement != nullptr && (entranceElement->GetSequenceIndex()) == 0) { @@ -224,7 +224,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio const auto clearanceData = canBuild.GetData(); gFootpathGroundFlags = clearanceData.GroundFlags; - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { return GameActions::Result( @@ -245,7 +245,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio { entranceElement->SetSurfaceEntryIndex(_type); } - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); } } else @@ -274,7 +274,7 @@ GameActions::Result FootpathPlaceFromTrackAction::ElementInsertExecute(GameActio pathElement->SetCorners(0); pathElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); } // Prevent the place sound from being spammed diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index e809db1838..1b67596c5d 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -56,7 +56,7 @@ GameActions::Result FootpathRemoveAction::Query() const GameActions::Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result( GameActions::Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -82,23 +82,23 @@ GameActions::Result FootpathRemoveAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_interrupt_peeps(_loc); - footpath_remove_litter(_loc); + FootpathInterruptPeeps(_loc); + FootpathRemoveLitter(_loc); } TileElement* footpathElement = GetFootpathElement(); if (footpathElement != nullptr) { - footpath_queue_chain_reset(); + FootpathQueueChainReset(); auto bannerRes = RemoveBannersAtElement(_loc, footpathElement); if (bannerRes.Error == GameActions::Status::Ok) { res.Cost += bannerRes.Cost; } - footpath_remove_edges_at(_loc, footpathElement); - map_invalidate_tile_full(_loc); - tile_element_remove(footpathElement); - footpath_update_queue_chains(); + FootpathRemoveEdgesAt(_loc, footpathElement); + MapInvalidateTileFull(_loc); + TileElementRemove(footpathElement); + FootpathUpdateQueueChains(); // Remove the spawn point (if there is one in the current tile) gPeepSpawns.erase( @@ -125,7 +125,7 @@ TileElement* FootpathRemoveAction::GetFootpathElement() const { bool getGhostPath = GetFlags() & GAME_COMMAND_FLAG_GHOST; - TileElement* tileElement = map_get_footpath_element(_loc); + TileElement* tileElement = MapGetFootpathElement(_loc); TileElement* footpathElement = nullptr; if (tileElement != nullptr) { diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 6323e028cf..86e8e3eb8b 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -133,7 +133,7 @@ namespace GameActions case GameCommand::PlaceLargeScenery: case GameCommand::PlaceBanner: case GameCommand::PlaceScenery: - scenery_remove_ghost_tool_placement(); + SceneryRemoveGhostToolPlacement(); break; default: break; @@ -471,7 +471,7 @@ const char* GameAction::GetName() const bool GameAction::LocationValid(const CoordsXY& coords) const { - auto result = map_is_location_valid(coords); + auto result = MapIsLocationValid(coords); if (!result) return false; #ifdef ENABLE_SCRIPTING diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 26627b3213..f7c051d6c7 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -97,7 +97,7 @@ GameActions::Result GuestSetNameAction::Execute() const gfx_invalidate_screen(); auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); auto res = GameActions::Result(); res.Position = guest->GetLocation(); diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index aa3015cc3f..18cdeb657d 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -74,7 +74,7 @@ GameActions::Result LandBuyRightsAction::QueryExecute(bool isExecuting) const CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16, (validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 }; - centre.z = tile_element_height(centre); + centre.z = TileElementHeight(centre); res.Position = centre; res.Expenditure = ExpenditureType::LandPurchase; @@ -95,7 +95,7 @@ GameActions::Result LandBuyRightsAction::QueryExecute(bool isExecuting) const } if (isExecuting) { - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); } return res; } @@ -108,7 +108,7 @@ GameActions::Result LandBuyRightsAction::map_buy_land_rights_for_tile(const Coor return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } - SurfaceElement* surfaceElement = map_get_surface_element_at(loc); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { log_error("Could not find surface. x = %d, y = %d", loc.x, loc.y); @@ -133,7 +133,7 @@ GameActions::Result LandBuyRightsAction::map_buy_land_rights_for_tile(const Coor if (isExecuting) { surfaceElement->SetOwnership(OWNERSHIP_OWNED); - update_park_fences_around_tile(loc); + ParkUpdateFencesAroundTile(loc); } res.Cost = gLandPrice; return res; @@ -155,7 +155,7 @@ GameActions::Result LandBuyRightsAction::map_buy_land_rights_for_tile(const Coor { surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); uint16_t baseZ = surfaceElement->GetBaseZ(); - map_invalidate_tile({ loc, baseZ, baseZ + 16 }); + MapInvalidateTile({ loc, baseZ, baseZ + 16 }); } res.Cost = gConstructionRightsPrice; return res; diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 3781cee0bd..0d80033d9a 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -64,15 +64,15 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const auto validRange = ClampRangeWithinMap(_range); - res.Position = { _coords.x, _coords.y, tile_element_height(_coords) }; + res.Position = { _coords.x, _coords.y, TileElementHeight(_coords) }; res.Expenditure = ExpenditureType::Landscaping; if (isExecuting) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, TileElementHeight(_coords) }); } - uint8_t maxHeight = map_get_highest_land_height(validRange); + uint8_t maxHeight = MapGetHighestLandHeight(validRange); bool withinOwnership = false; for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += COORDS_XY_STEP) @@ -81,13 +81,13 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const { if (!LocationValid({ x, y })) continue; - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ x, y })) + if (!MapIsLocationInPark(CoordsXY{ x, y })) { continue; } diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 21ad54fd94..6384a6b809 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -65,15 +65,15 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const auto validRange = ClampRangeWithinMap(_range); - res.Position = { _coords.x, _coords.y, tile_element_height(_coords) }; + res.Position = { _coords.x, _coords.y, TileElementHeight(_coords) }; res.Expenditure = ExpenditureType::Landscaping; if (isExecuting) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, tile_element_height(_coords) }); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { _coords.x, _coords.y, TileElementHeight(_coords) }); } - uint8_t minHeight = map_get_lowest_land_height(validRange); + uint8_t minHeight = MapGetLowestLandHeight(validRange); bool withinOwnership = false; for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += COORDS_XY_STEP) @@ -82,13 +82,13 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const { if (!LocationValid({ x, y })) continue; - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ x, y })) + if (!MapIsLocationInPark(CoordsXY{ x, y })) { continue; } diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 587e69c919..d016538d78 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -52,15 +52,15 @@ GameActions::Result LandSetHeightAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY, STR_NONE); } - StringId errorTitle = CheckParameters(); - if (errorTitle != STR_NONE) + StringId errorMessage = CheckParameters(); + if (errorMessage != STR_NONE) { - return GameActions::Result(GameActions::Status::Disallowed, errorTitle, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, errorMessage); } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(_coords)) + if (!MapIsLocationInPark(_coords)) { return GameActions::Result(GameActions::Status::Disallowed, STR_LAND_NOT_OWNED_BY_PARK, STR_NONE); } @@ -86,21 +86,21 @@ GameActions::Result LandSetHeightAction::Query() const // Check for ride support limits if (!gCheatsDisableSupportLimits) { - errorTitle = CheckRideSupports(); - if (errorTitle != STR_NONE) + errorMessage = CheckRideSupports(); + if (errorMessage != STR_NONE) { - return GameActions::Result(GameActions::Status::Disallowed, errorTitle, STR_NONE); + return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, errorMessage); } } - auto* surfaceElement = map_get_surface_element_at(_coords); + auto* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) return GameActions::Result(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. auto oldCoords = CoordsXYZ{ _coords, surfaceElement->GetBaseZ() }; - auto* pathElement = map_get_footpath_element(oldCoords); + auto* pathElement = MapGetFootpathElement(oldCoords); if (pathElement != nullptr && pathElement->AsPath()->IsLevelCrossing(oldCoords)) { return GameActions::Result(GameActions::Status::Disallowed, STR_REMOVE_LEVEL_CROSSING_FIRST, STR_NONE); @@ -144,17 +144,17 @@ GameActions::Result LandSetHeightAction::Query() const GameActions::Result LandSetHeightAction::Execute() const { money32 cost = 0.00_GBP; - auto surfaceHeight = tile_element_height(_coords); - footpath_remove_litter({ _coords, surfaceHeight }); + auto surfaceHeight = TileElementHeight(_coords); + FootpathRemoveLitter({ _coords, surfaceHeight }); if (!gCheatsDisableClearanceChecks) { - wall_remove_at({ _coords, _height * 8 - 16, _height * 8 + 32 }); + WallRemoveAt({ _coords, _height * 8 - 16, _height * 8 + 32 }); cost += GetSmallSceneryRemovalCost(); SmallSceneryRemoval(); } - auto* surfaceElement = map_get_surface_element_at(_coords); + auto* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -246,7 +246,7 @@ money32 LandSetHeightAction::GetSmallSceneryRemovalCost() const void LandSetHeightAction::SmallSceneryRemoval() const { - TileElement* tileElement = map_get_first_element_at(_coords); + TileElement* tileElement = MapGetFirstElementAt(_coords); do { if (tileElement == nullptr) @@ -257,7 +257,7 @@ void LandSetHeightAction::SmallSceneryRemoval() const continue; if (_height + 4 < tileElement->base_height) continue; - tile_element_remove(tileElement--); + TileElementRemove(tileElement--); } while (!(tileElement++)->IsLastForTile()); } @@ -319,8 +319,8 @@ money32 LandSetHeightAction::GetSurfaceHeightChangeCost(SurfaceElement* surfaceE money32 cost{ 0 }; for (Direction i : ALL_DIRECTIONS) { - int32_t cornerHeight = tile_element_get_corner_height(surfaceElement, i); - cornerHeight -= map_get_corner_height(_height, _style & TILE_ELEMENT_SURFACE_SLOPE_MASK, i); + int32_t cornerHeight = TileElementGetCornerHeight(surfaceElement, i); + cornerHeight -= MapGetCornerHeight(_height, _style & TILE_ELEMENT_SURFACE_SLOPE_MASK, i); cost += 2.50_GBP * abs(cornerHeight); } return cost; @@ -337,7 +337,7 @@ void LandSetHeightAction::SetSurfaceHeight(TileElement* surfaceElement) const surfaceElement->AsSurface()->SetWaterHeight(0); } - map_invalidate_tile_full(_coords); + MapInvalidateTileFull(_coords); } int32_t LandSetHeightAction::map_set_land_height_clear_func( diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index e63f11082a..81947a3771 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -70,7 +70,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const auto validRange = ClampRangeWithinMap(_range.Normalise()); CoordsXYZ centre{ (validRange.GetLeft() + validRange.GetRight()) / 2 + 16, (validRange.GetTop() + validRange.GetBottom()) / 2 + 16, 0 }; - centre.z = tile_element_height(centre); + centre.z = TileElementHeight(centre); res.Position = centre; res.Expenditure = ExpenditureType::LandPurchase; @@ -97,7 +97,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const if (isExecuting) { - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, centre); } return res; @@ -105,7 +105,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const { - SurfaceElement* surfaceElement = map_get_surface_element_at(loc); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { log_error("Could not find surface. x = %d, y = %d", loc.x, loc.y); @@ -120,7 +120,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor { surfaceElement->SetOwnership( surfaceElement->GetOwnership() & ~(OWNERSHIP_OWNED | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)); - update_park_fences_around_tile(loc); + ParkUpdateFencesAroundTile(loc); } return res; case LandSetRightSetting::UnownConstructionRights: @@ -128,7 +128,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor { surfaceElement->SetOwnership(surfaceElement->GetOwnership() & ~OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); uint16_t baseZ = surfaceElement->GetBaseZ(); - map_invalidate_tile({ loc, baseZ, baseZ + 16 }); + MapInvalidateTile({ loc, baseZ, baseZ + 16 }); } return res; case LandSetRightSetting::SetForSale: @@ -136,7 +136,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor { surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_AVAILABLE); uint16_t baseZ = surfaceElement->GetBaseZ(); - map_invalidate_tile({ loc, baseZ, baseZ + 16 }); + MapInvalidateTile({ loc, baseZ, baseZ + 16 }); } return res; case LandSetRightSetting::SetConstructionRightsForSale: @@ -144,7 +144,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor { surfaceElement->SetOwnership(surfaceElement->GetOwnership() | OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE); uint16_t baseZ = surfaceElement->GetBaseZ(); - map_invalidate_tile({ loc, baseZ, baseZ + 16 }); + MapInvalidateTile({ loc, baseZ, baseZ + 16 }); } return res; case LandSetRightSetting::SetOwnershipWithChecks: @@ -189,7 +189,7 @@ GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const Coor gPeepSpawns.end()); } surfaceElement->SetOwnership(_ownership); - update_park_fences_around_tile(loc); + ParkUpdateFencesAroundTile(loc); gMapLandRightsUpdateSuccess = true; } return res; diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 0cfcc36d89..b9a6fef4cb 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -99,27 +99,27 @@ money32 LandSmoothAction::SmoothLandRowByEdge( { return 0; } - auto surfaceElement = map_get_surface_element_at(loc); - auto nextSurfaceElement = map_get_surface_element_at(CoordsXY{ loc.x + stepX, loc.y + stepY }); + auto surfaceElement = MapGetSurfaceElementAt(loc); + auto nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ loc.x + stepX, loc.y + stepY }); if (surfaceElement == nullptr || nextSurfaceElement == nullptr) { return 0; } - if (tile_element_get_corner_height(surfaceElement, checkDirection1) != expectedLandHeight1 + landChangePerTile) + if (TileElementGetCornerHeight(surfaceElement, checkDirection1) != expectedLandHeight1 + landChangePerTile) { shouldContinue &= ~0x1; } - if (tile_element_get_corner_height(surfaceElement, checkDirection2) != expectedLandHeight2 + landChangePerTile) + if (TileElementGetCornerHeight(surfaceElement, checkDirection2) != expectedLandHeight2 + landChangePerTile) { shouldContinue &= ~0x2; } - if (tile_element_get_corner_height(surfaceElement, checkDirection1) - != tile_element_get_corner_height(nextSurfaceElement, direction1)) + if (TileElementGetCornerHeight(surfaceElement, checkDirection1) + != TileElementGetCornerHeight(nextSurfaceElement, direction1)) { shouldContinue &= ~0x1; } - if (tile_element_get_corner_height(surfaceElement, checkDirection2) - != tile_element_get_corner_height(nextSurfaceElement, direction2)) + if (TileElementGetCornerHeight(surfaceElement, checkDirection2) + != TileElementGetCornerHeight(nextSurfaceElement, direction2)) { shouldContinue &= ~0x2; } @@ -138,30 +138,30 @@ money32 LandSmoothAction::SmoothLandRowByEdge( else { surfaceElement = nextSurfaceElement; - nextSurfaceElement = map_get_surface_element_at(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); + nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); if (nextSurfaceElement == nullptr) { shouldContinue &= ~0x3; } - if (tile_element_get_corner_height(surfaceElement, direction1) + landChangePerTile - != tile_element_get_corner_height(surfaceElement, checkDirection1)) + if (TileElementGetCornerHeight(surfaceElement, direction1) + landChangePerTile + != TileElementGetCornerHeight(surfaceElement, checkDirection1)) { shouldContinue &= ~0x1; } - if (tile_element_get_corner_height(surfaceElement, direction2) + landChangePerTile - != tile_element_get_corner_height(surfaceElement, checkDirection2)) + if (TileElementGetCornerHeight(surfaceElement, direction2) + landChangePerTile + != TileElementGetCornerHeight(surfaceElement, checkDirection2)) { shouldContinue &= ~0x2; } if ((shouldContinue & 0x1) - && tile_element_get_corner_height(surfaceElement, checkDirection1) - != tile_element_get_corner_height(nextSurfaceElement, direction1)) + && TileElementGetCornerHeight(surfaceElement, checkDirection1) + != TileElementGetCornerHeight(nextSurfaceElement, direction1)) { shouldContinue &= ~0x1; } if ((shouldContinue & 0x2) - && tile_element_get_corner_height(surfaceElement, checkDirection2) - != tile_element_get_corner_height(nextSurfaceElement, direction2)) + && TileElementGetCornerHeight(surfaceElement, checkDirection2) + != TileElementGetCornerHeight(nextSurfaceElement, direction2)) { shouldContinue &= ~0x2; } @@ -184,8 +184,8 @@ money32 LandSmoothAction::SmoothLandRowByEdge( } } if ((shouldContinue & 0x8) - && map_get_corner_height(surfaceElement->base_height, oldSlope, direction2) - == map_get_corner_height(targetBaseZ, slope, direction2)) + && MapGetCornerHeight(surfaceElement->base_height, oldSlope, direction2) + == MapGetCornerHeight(targetBaseZ, slope, direction2)) { slope = tile_element_lower_styles[direction2][slope]; if (slope & SURFACE_STYLE_FLAG_RAISE_OR_LOWER_BASE_HEIGHT) @@ -207,8 +207,8 @@ money32 LandSmoothAction::SmoothLandRowByEdge( } } if ((shouldContinue & 0x8) - && map_get_corner_height(surfaceElement->base_height, oldSlope, direction2) - == map_get_corner_height(targetBaseZ, slope, direction2)) + && MapGetCornerHeight(surfaceElement->base_height, oldSlope, direction2) + == MapGetCornerHeight(targetBaseZ, slope, direction2)) { slope = tile_element_raise_styles[direction2][slope]; if (slope & SURFACE_STYLE_FLAG_RAISE_OR_LOWER_BASE_HEIGHT) @@ -251,18 +251,17 @@ money32 LandSmoothAction::SmoothLandRowByCorner( { return 0; } - auto surfaceElement = map_get_surface_element_at(loc); - auto nextSurfaceElement = map_get_surface_element_at(CoordsXY{ loc.x + stepX, loc.y + stepY }); + auto surfaceElement = MapGetSurfaceElementAt(loc); + auto nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ loc.x + stepX, loc.y + stepY }); if (surfaceElement == nullptr || nextSurfaceElement == nullptr) { return 0; } - if (tile_element_get_corner_height(surfaceElement, checkDirection) != expectedLandHeight + (_isLowering ? 2 : -2)) + if (TileElementGetCornerHeight(surfaceElement, checkDirection) != expectedLandHeight + (_isLowering ? 2 : -2)) { return 0; } - if (tile_element_get_corner_height(surfaceElement, checkDirection) - != tile_element_get_corner_height(nextSurfaceElement, direction)) + if (TileElementGetCornerHeight(surfaceElement, checkDirection) != TileElementGetCornerHeight(nextSurfaceElement, direction)) { return 0; } @@ -281,19 +280,19 @@ money32 LandSmoothAction::SmoothLandRowByCorner( else { surfaceElement = nextSurfaceElement; - nextSurfaceElement = map_get_surface_element_at(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); + nextSurfaceElement = MapGetSurfaceElementAt(CoordsXY{ nextLoc.x + stepX, nextLoc.y + stepY }); if (nextSurfaceElement == nullptr) { shouldContinue = false; } - if (tile_element_get_corner_height(surfaceElement, direction) + landChangePerTile - != tile_element_get_corner_height(surfaceElement, checkDirection)) + if (TileElementGetCornerHeight(surfaceElement, direction) + landChangePerTile + != TileElementGetCornerHeight(surfaceElement, checkDirection)) { shouldContinue = false; } if (shouldContinue - && tile_element_get_corner_height(surfaceElement, checkDirection) - != tile_element_get_corner_height(nextSurfaceElement, direction)) + && TileElementGetCornerHeight(surfaceElement, checkDirection) + != TileElementGetCornerHeight(nextSurfaceElement, direction)) { shouldContinue = false; } @@ -330,7 +329,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const auto b = std::clamp(normRange.GetBottom(), 0, MAXIMUM_TILE_START_XY); auto validRange = MapRange{ l, t, r, b }; - int32_t centreZ = tile_element_height(_coords); + int32_t centreZ = TileElementHeight(_coords); auto res = GameActions::Result(); res.ErrorTitle = _ErrorTitles[_isLowering ? 0 : 1]; @@ -342,46 +341,46 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const { case MAP_SELECT_TYPE_FULL: { - uint8_t minHeight = heightOffset + map_get_lowest_land_height(validRange); - uint8_t maxHeight = heightOffset + map_get_highest_land_height(validRange); + uint8_t minHeight = heightOffset + MapGetLowestLandHeight(validRange); + uint8_t maxHeight = heightOffset + MapGetHighestLandHeight(validRange); // Smooth the 4 corners { // top-left - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 2)), minHeight, maxHeight); + static_cast(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2); } } { // bottom-left - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetBottom() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetBottom() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 3)), minHeight, maxHeight); + static_cast(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetBottom() }, z, -32, 32, 1, 3); } } { // bottom-right - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetRight(), validRange.GetBottom() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetBottom() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 0)), minHeight, maxHeight); + static_cast(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetRight(), validRange.GetBottom() }, z, 32, 32, 2, 0); } } { // top-right - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetRight(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), validRange.GetTop() }); if (surfaceElement != nullptr) { int32_t z = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 1)), minHeight, maxHeight); + static_cast(TileElementGetCornerHeight(surfaceElement, 1)), minHeight, maxHeight); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetRight(), validRange.GetTop() }, z, 32, -32, 3, 1); } @@ -391,46 +390,38 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const int32_t z1, z2; for (int32_t y = validRange.GetTop(); y <= validRange.GetBottom(); y += COORDS_XY_STEP) { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), y }); if (surfaceElement != nullptr) { - z1 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 3)), minHeight, maxHeight); - z2 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 2)), minHeight, maxHeight); + z1 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight); + z2 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge(isExecuting, { validRange.GetLeft(), y }, z1, z2, -32, 0, 0, 1, 3, 2); } - surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetRight(), y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetRight(), y }); if (surfaceElement != nullptr) { - z1 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 1)), minHeight, maxHeight); - z2 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 0)), minHeight, maxHeight); + z1 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 1)), minHeight, maxHeight); + z2 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge(isExecuting, { validRange.GetRight(), y }, z1, z2, 32, 0, 2, 3, 1, 0); } } for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += COORDS_XY_STEP) { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetTop() }); if (surfaceElement != nullptr) { - z1 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 1)), minHeight, maxHeight); - z2 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 2)), minHeight, maxHeight); + z1 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 1)), minHeight, maxHeight); + z2 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 2)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge(isExecuting, { x, validRange.GetTop() }, z1, z2, 0, -32, 0, 3, 1, 2); } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, validRange.GetBottom() }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, validRange.GetBottom() }); if (surfaceElement != nullptr) { - z1 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 0)), minHeight, maxHeight); - z2 = std::clamp( - static_cast(tile_element_get_corner_height(surfaceElement, 3)), minHeight, maxHeight); + z1 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 0)), minHeight, maxHeight); + z2 = std::clamp(static_cast(TileElementGetCornerHeight(surfaceElement, 3)), minHeight, maxHeight); res.Cost += SmoothLandRowByEdge(isExecuting, { x, validRange.GetBottom() }, z1, z2, 0, 32, 1, 2, 0, 3); } } @@ -441,7 +432,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const case MAP_SELECT_TYPE_CORNER_2: case MAP_SELECT_TYPE_CORNER_3: { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement == nullptr) break; uint8_t newBaseZ = surfaceElement->base_height; @@ -463,67 +454,67 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const } // Smooth the corners - int32_t z = map_get_corner_height(newBaseZ, newSlope, 2); + int32_t z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2); - z = map_get_corner_height(newBaseZ, newSlope, 0); + z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 32, 2, 0); - z = map_get_corner_height(newBaseZ, newSlope, 3); + z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 32, 1, 3); - z = map_get_corner_height(newBaseZ, newSlope, 1); + z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, -32, 3, 1); // Smooth the edges switch (selectionType) { case MAP_SELECT_TYPE_CORNER_0: - z = map_get_corner_height(newBaseZ, newSlope, 0); + z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 3, 0); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 1, 0); - z = map_get_corner_height(newBaseZ, newSlope, 3); + z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 0, 3); - z = map_get_corner_height(newBaseZ, newSlope, 1); + z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 0, 1); break; case MAP_SELECT_TYPE_CORNER_1: - z = map_get_corner_height(newBaseZ, newSlope, 1); + z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 2, 1); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 0, 1); - z = map_get_corner_height(newBaseZ, newSlope, 2); + z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 1, 2); - z = map_get_corner_height(newBaseZ, newSlope, 0); + z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 1, 0); break; case MAP_SELECT_TYPE_CORNER_2: - z = map_get_corner_height(newBaseZ, newSlope, 2); + z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 1, 2); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 3, 2); - z = map_get_corner_height(newBaseZ, newSlope, 1); + z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 2, 1); - z = map_get_corner_height(newBaseZ, newSlope, 3); + z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 2, 3); break; case MAP_SELECT_TYPE_CORNER_3: - z = map_get_corner_height(newBaseZ, newSlope, 3); + z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 0, 0, 3); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, 32, 2, 3); - z = map_get_corner_height(newBaseZ, newSlope, 0); + z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 0, 3, 0); - z = map_get_corner_height(newBaseZ, newSlope, 2); + z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 0, -32, 3, 2); break; @@ -537,7 +528,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const { // TODO: Handle smoothing by edge // Get the two corners to raise - auto surfaceElement = map_get_surface_element_at(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement == nullptr) break; uint8_t newBaseZ = surfaceElement->base_height; @@ -576,10 +567,10 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const uint8_t c2 = cornerIndices[edge][1]; uint8_t c3 = cornerIndices[edge][2]; uint8_t c4 = cornerIndices[edge][3]; - uint8_t z1 = map_get_corner_height(newBaseZ, newSlope, c1); - uint8_t z2 = map_get_corner_height(newBaseZ, newSlope, c2); - uint8_t z3 = map_get_corner_height(newBaseZ, newSlope, c3); - uint8_t z4 = map_get_corner_height(newBaseZ, newSlope, c4); + uint8_t z1 = MapGetCornerHeight(newBaseZ, newSlope, c1); + uint8_t z2 = MapGetCornerHeight(newBaseZ, newSlope, c2); + uint8_t z3 = MapGetCornerHeight(newBaseZ, newSlope, c3); + uint8_t z4 = MapGetCornerHeight(newBaseZ, newSlope, c4); // Smooth the edge at the top of the new slope res.Cost += SmoothLandRowByEdge( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z1, z2, stepOffsets[edge].x, stepOffsets[edge].y, @@ -596,13 +587,13 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const res.Cost += SmoothLandRowByCorner( isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z2, stepOffsets[edge].y, -stepOffsets[edge].x, c1, c2); - int32_t z = map_get_corner_height(newBaseZ, newSlope, 2); + int32_t z = MapGetCornerHeight(newBaseZ, newSlope, 2); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, -32, 0, 2); - z = map_get_corner_height(newBaseZ, newSlope, 0); + z = MapGetCornerHeight(newBaseZ, newSlope, 0); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, 32, 2, 0); - z = map_get_corner_height(newBaseZ, newSlope, 3); + z = MapGetCornerHeight(newBaseZ, newSlope, 3); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, -32, 32, 1, 3); - z = map_get_corner_height(newBaseZ, newSlope, 1); + z = MapGetCornerHeight(newBaseZ, newSlope, 1); res.Cost += SmoothLandRowByCorner(isExecuting, { validRange.GetLeft(), validRange.GetTop() }, z, 32, -32, 3, 1); break; } diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index f6ed4347f3..cbec898e32 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -56,7 +56,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const auto res = GameActions::Result(); res.ErrorTitle = STR_CANT_POSITION_THIS_HERE; res.Expenditure = ExpenditureType::Landscaping; - int16_t surfaceHeight = tile_element_height(_loc); + int16_t surfaceHeight = TileElementHeight(_loc); res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; res.Position.z = surfaceHeight; @@ -79,7 +79,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } - auto* sceneryEntry = get_large_scenery_entry(_sceneryType); + auto* sceneryEntry = GetLargeSceneryEntry(_sceneryType); if (sceneryEntry == nullptr) { log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); @@ -148,12 +148,12 @@ GameActions::Result LargeSceneryPlaceAction::Query() const resultData.GroundFlags = tempSceneryGroundFlags; - if (!LocationValid(curTile) || map_is_edge(curTile)) + if (!LocationValid(curTile) || MapIsEdge(curTile)) { return GameActions::Result(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) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationOwned({ curTile, zLow }) && !gCheatsSandboxMode) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -182,7 +182,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const res.ErrorTitle = STR_CANT_POSITION_THIS_HERE; res.Expenditure = ExpenditureType::Landscaping; - int16_t surfaceHeight = tile_element_height(_loc); + int16_t surfaceHeight = TileElementHeight(_loc); res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; res.Position.z = surfaceHeight; @@ -191,7 +191,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const money32 supportsCost = 0; - auto* sceneryEntry = get_large_scenery_entry(_sceneryType); + auto* sceneryEntry = GetLargeSceneryEntry(_sceneryType); if (sceneryEntry == nullptr) { log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); @@ -274,10 +274,10 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_remove_litter({ curTile, zLow }); + FootpathRemoveLitter({ curTile, zLow }); if (!gCheatsDisableClearanceChecks) { - wall_remove_at({ curTile, zLow, zHigh }); + WallRemoveAt({ curTile, zLow, zHigh }); } } @@ -292,8 +292,8 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const newSceneryElement->SetBannerIndex(banner->id); } - map_animation_create(MAP_ANIMATION_TYPE_LARGE_SCENERY, { curTile, zLow }); - map_invalidate_tile_full(curTile); + MapAnimationCreate(MAP_ANIMATION_TYPE_LARGE_SCENERY, { curTile, zLow }); + MapInvalidateTileFull(curTile); if (tileNum == 0) { @@ -346,12 +346,12 @@ int16_t LargeSceneryPlaceAction::GetMaxSurfaceHeight(rct_large_scenery_tile* til curTile.x += _loc.x; curTile.y += _loc.y; - if (!map_is_location_valid(curTile)) + if (!MapIsLocationValid(curTile)) { continue; } - auto* surfaceElement = map_get_surface_element_at(curTile); + auto* surfaceElement = MapGetSurfaceElementAt(curTile); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 3eb4e44c6a..d41c1979d9 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -54,7 +54,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const const uint32_t flags = GetFlags(); - int32_t z = tile_element_height(_loc); + int32_t z = TileElementHeight(_loc); res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; res.Position.z = z; @@ -93,7 +93,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_owned({ currentTile.x, currentTile.y, currentTile.z })) + if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z })) { return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -125,7 +125,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const { auto res = GameActions::Result(); - int32_t z = tile_element_height(_loc); + int32_t z = TileElementHeight(_loc); res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; res.Position.z = z; @@ -165,7 +165,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_owned({ currentTile.x, currentTile.y, currentTile.z })) + if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z })) { return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -174,8 +174,8 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const auto* sceneryElement = FindLargeSceneryElement(currentTile, i); if (sceneryElement != nullptr) { - map_invalidate_tile_full(currentTile); - tile_element_remove(sceneryElement); + MapInvalidateTileFull(currentTile); + TileElementRemove(sceneryElement); } else { diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 3f0e408276..c2c1263373 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -52,7 +52,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) res.Expenditure = ExpenditureType::Landscaping; res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; - res.Position.z = tile_element_height(_loc); + res.Position.z = TileElementHeight(_loc); res.ErrorTitle = STR_CANT_REPAINT_THIS; auto mapSizeMax = GetMapSizeMaxXY(); @@ -80,7 +80,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } - auto largeElement = map_get_large_scenery_segment(_loc, _tileIndex); + auto largeElement = MapGetLargeScenerySegment(_loc, _tileIndex); if (largeElement == nullptr) { @@ -119,7 +119,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_owned(currentTile)) + if (!MapIsLocationOwned(currentTile)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -130,7 +130,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - auto tileElement = map_get_large_scenery_segment({ currentTile.x, currentTile.y, _loc.z, _loc.direction }, i); + auto tileElement = MapGetLargeScenerySegment({ currentTile.x, currentTile.y, _loc.z, _loc.direction }, i); if (tileElement == nullptr) { @@ -145,7 +145,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) tileElement->SetSecondaryColour(_secondaryColour); tileElement->SetTertiaryColour(_tertiaryColour); - map_invalidate_tile_full(currentTile); + MapInvalidateTileFull(currentTile); } } return res; diff --git a/src/openrct2/actions/LoadOrQuitAction.cpp b/src/openrct2/actions/LoadOrQuitAction.cpp index 82a0f1ee0e..8409f164fd 100644 --- a/src/openrct2/actions/LoadOrQuitAction.cpp +++ b/src/openrct2/actions/LoadOrQuitAction.cpp @@ -42,7 +42,7 @@ GameActions::Result LoadOrQuitAction::Execute() const { case LoadOrQuitModes::OpenSavePrompt: gSavePromptMode = _savePromptMode; - context_open_window(WindowClass::SavePrompt); + ContextOpenWindow(WindowClass::SavePrompt); break; case LoadOrQuitModes::CloseSavePrompt: window_close_by_class(WindowClass::SavePrompt); diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 854111d54e..1cee40a0d1 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -50,7 +50,7 @@ GameActions::Result MazePlaceTrackAction::Query() const return res; } - if (!LocationValid(_loc) || (!map_is_location_owned(_loc) && !gCheatsSandboxMode)) + if (!LocationValid(_loc) || (!MapIsLocationOwned(_loc) && !gCheatsSandboxMode)) { res.Error = GameActions::Status::NotOwned; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; @@ -63,7 +63,7 @@ GameActions::Result MazePlaceTrackAction::Query() const res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED; return res; } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { res.Error = GameActions::Status::Unknown; @@ -144,8 +144,8 @@ GameActions::Result MazePlaceTrackAction::Execute() const uint32_t flags = GetFlags(); if (!(flags & GAME_COMMAND_FLAG_GHOST)) { - footpath_remove_litter(_loc); - wall_remove_at({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); + FootpathRemoveLitter(_loc); + WallRemoveAt({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); } auto baseHeight = _loc.z; @@ -174,7 +174,7 @@ GameActions::Result MazePlaceTrackAction::Execute() const trackElement->SetMazeEntry(_mazeEntry); trackElement->SetGhost(flags & GAME_COMMAND_FLAG_GHOST); - map_invalidate_tile_full(startLoc); + MapInvalidateTileFull(startLoc); ride->maze_tiles++; ride->GetStation().SetBaseZ(trackElement->GetBaseZ()); diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index b8682df250..3af8b440ec 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -61,7 +61,7 @@ GameActions::Result MazeSetTrackAction::Query() const return res; } - if (!LocationValid(_loc) || (!map_is_location_owned(_loc) && !gCheatsSandboxMode)) + if (!LocationValid(_loc) || (!MapIsLocationOwned(_loc) && !gCheatsSandboxMode)) { res.Error = GameActions::Status::NotOwned; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; @@ -74,7 +74,7 @@ GameActions::Result MazeSetTrackAction::Query() const res.ErrorMessage = STR_TILE_ELEMENT_LIMIT_REACHED; return res; } - auto surfaceElement = map_get_surface_element_at(_loc); + auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { res.Error = GameActions::Status::Unknown; @@ -100,7 +100,7 @@ GameActions::Result MazeSetTrackAction::Query() const } } - TileElement* tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex); + TileElement* tileElement = MapGetTrackElementAtOfTypeFromRide(_loc, TrackElemType::Maze, _rideIndex); if (tileElement == nullptr) { if (_mode != GC_SET_MAZE_TRACK_BUILD) @@ -166,11 +166,11 @@ GameActions::Result MazeSetTrackAction::Execute() const uint32_t flags = GetFlags(); if (!(flags & GAME_COMMAND_FLAG_GHOST)) { - footpath_remove_litter(_loc); - wall_remove_at({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); + FootpathRemoveLitter(_loc); + WallRemoveAt({ _loc.ToTileStart(), _loc.z, _loc.z + 32 }); } - auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex); + auto tileElement = MapGetTrackElementAtOfTypeFromRide(_loc, TrackElemType::Maze, _rideIndex); if (tileElement == nullptr) { res.Cost = MazeCalculateCost(0, *ride, _loc); @@ -189,7 +189,7 @@ GameActions::Result MazeSetTrackAction::Execute() const tileElement = trackElement->as(); - map_invalidate_tile_full(startLoc); + MapInvalidateTileFull(startLoc); ride->maze_tiles++; ride->GetStation().SetBaseZ(tileElement->GetBaseZ()); @@ -219,7 +219,7 @@ GameActions::Result MazeSetTrackAction::Execute() const { auto previousElementLoc = CoordsXY{ _loc }.ToTileStart() - CoordsDirectionDelta[_loc.direction]; - TileElement* previousTileElement = map_get_track_element_at_of_type_from_ride( + TileElement* previousTileElement = MapGetTrackElementAtOfTypeFromRide( { previousElementLoc, _loc.z }, TrackElemType::Maze, _rideIndex); if (previousTileElement != nullptr) @@ -245,10 +245,9 @@ GameActions::Result MazeSetTrackAction::Execute() const auto previousSegment = CoordsXY{ _loc.x - CoordsDirectionDelta[_loc.direction].x / 2, _loc.y - CoordsDirectionDelta[_loc.direction].y / 2 }; - tileElement = map_get_track_element_at_of_type_from_ride( - { previousSegment, _loc.z }, TrackElemType::Maze, _rideIndex); + tileElement = MapGetTrackElementAtOfTypeFromRide({ previousSegment, _loc.z }, TrackElemType::Maze, _rideIndex); - map_invalidate_tile_full(previousSegment.ToTileStart()); + MapInvalidateTileFull(previousSegment.ToTileStart()); if (tileElement == nullptr) { log_error("No surface found"); @@ -273,7 +272,7 @@ GameActions::Result MazeSetTrackAction::Execute() const uint32_t direction1 = byte_993D0C[segmentBit]; auto nextElementLoc = previousSegment.ToTileStart() + CoordsDirectionDelta[direction1]; - TileElement* tmp_tileElement = map_get_track_element_at_of_type_from_ride( + TileElement* tmp_tileElement = MapGetTrackElementAtOfTypeFromRide( { nextElementLoc, _loc.z }, TrackElemType::Maze, _rideIndex); if (tmp_tileElement != nullptr) @@ -288,11 +287,11 @@ GameActions::Result MazeSetTrackAction::Execute() const break; } - map_invalidate_tile({ _loc.ToTileStart(), tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ _loc.ToTileStart(), tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); if ((tileElement->AsTrack()->GetMazeEntry() & 0x8888) == 0x8888) { - tile_element_remove(tileElement); + TileElementRemove(tileElement); ride->ValidateStations(); ride->maze_tiles--; } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index b712205925..37991f9adc 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -43,7 +43,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const res.Position = _loc; res.ErrorTitle = STR_CANT_REMOVE_THIS; - auto entranceIndex = park_entrance_get_index(_loc); + auto entranceIndex = ParkEntranceGetIndex(_loc); if (!LocationValid(_loc) || entranceIndex == -1) { log_error("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); @@ -59,7 +59,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const res.Position = _loc; res.ErrorTitle = STR_CANT_REMOVE_THIS; - auto entranceIndex = park_entrance_get_index(_loc); + auto entranceIndex = ParkEntranceGetIndex(_loc); if (entranceIndex == -1) { log_error("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); @@ -85,13 +85,13 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const void ParkEntranceRemoveAction::ParkEntranceRemoveSegment(const CoordsXYZ& loc) const { - auto entranceElement = map_get_park_entrance_element_at(loc, true); + auto entranceElement = MapGetParkEntranceElementAt(loc, true); if (entranceElement == nullptr) { return; } - map_invalidate_tile({ loc, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ() }); + MapInvalidateTile({ loc, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ() }); entranceElement->Remove(); - update_park_fences({ loc.x, loc.y }); + ParkUpdateFences({ loc.x, loc.y }); } diff --git a/src/openrct2/actions/PlaceParkEntranceAction.cpp b/src/openrct2/actions/PlaceParkEntranceAction.cpp index 778e852942..7c9dfdc807 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.cpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.cpp @@ -93,7 +93,7 @@ GameActions::Result PlaceParkEntranceAction::Query() const } // Check that entrance element does not already exist at this location - EntranceElement* entranceElement = map_get_park_entrance_element_at(entranceLoc, false); + EntranceElement* entranceElement = MapGetParkEntranceElementAt(entranceLoc, false); if (entranceElement != nullptr) { return GameActions::Result(GameActions::Status::ItemAlreadyPlaced, STR_CANT_BUILD_THIS_HERE, STR_NONE); @@ -131,7 +131,7 @@ GameActions::Result PlaceParkEntranceAction::Execute() const if (!(flags & GAME_COMMAND_FLAG_GHOST)) { - SurfaceElement* surfaceElement = map_get_surface_element_at(entranceLoc); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(entranceLoc); if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); @@ -157,20 +157,20 @@ GameActions::Result PlaceParkEntranceAction::Execute() const if (!entranceElement->IsGhost()) { - footpath_connect_edges(entranceLoc, entranceElement->as(), GAME_COMMAND_FLAG_APPLY); + FootpathConnectEdges(entranceLoc, entranceElement->as(), GAME_COMMAND_FLAG_APPLY); } - update_park_fences(entranceLoc); - update_park_fences({ entranceLoc.x - COORDS_XY_STEP, entranceLoc.y }); - update_park_fences({ entranceLoc.x + COORDS_XY_STEP, entranceLoc.y }); - update_park_fences({ entranceLoc.x, entranceLoc.y - COORDS_XY_STEP }); - update_park_fences({ entranceLoc.x, entranceLoc.y + COORDS_XY_STEP }); + ParkUpdateFences(entranceLoc); + ParkUpdateFences({ entranceLoc.x - COORDS_XY_STEP, entranceLoc.y }); + ParkUpdateFences({ entranceLoc.x + COORDS_XY_STEP, entranceLoc.y }); + ParkUpdateFences({ entranceLoc.x, entranceLoc.y - COORDS_XY_STEP }); + ParkUpdateFences({ entranceLoc.x, entranceLoc.y + COORDS_XY_STEP }); - map_invalidate_tile({ entranceLoc, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ() }); + MapInvalidateTile({ entranceLoc, entranceElement->GetBaseZ(), entranceElement->GetClearanceZ() }); if (index == 0) { - map_animation_create(MAP_ANIMATION_TYPE_PARK_ENTRANCE, { entranceLoc, zLow }); + MapAnimationCreate(MAP_ANIMATION_TYPE_PARK_ENTRANCE, { entranceLoc, zLow }); } } diff --git a/src/openrct2/actions/PlacePeepSpawnAction.cpp b/src/openrct2/actions/PlacePeepSpawnAction.cpp index a69627b1b8..a90b004e9c 100644 --- a/src/openrct2/actions/PlacePeepSpawnAction.cpp +++ b/src/openrct2/actions/PlacePeepSpawnAction.cpp @@ -55,7 +55,7 @@ GameActions::Result PlacePeepSpawnAction::Query() const } // Verify footpath exists at location, and retrieve coordinates - auto pathElement = map_get_path_element_at(TileCoordsXYZ{ _location }); + auto pathElement = MapGetPathElementAt(TileCoordsXYZ{ _location }); if (pathElement == nullptr) { return GameActions::Result( @@ -63,7 +63,7 @@ GameActions::Result PlacePeepSpawnAction::Query() const } // Verify location is unowned - auto surfaceMapElement = map_get_surface_element_at(_location); + auto surfaceMapElement = MapGetSurfaceElementAt(_location); if (surfaceMapElement == nullptr) { return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); @@ -108,7 +108,7 @@ GameActions::Result PlacePeepSpawnAction::Execute() const if (foundSpawn != std::end(gPeepSpawns)) { gPeepSpawns.erase(foundSpawn); - map_invalidate_tile_full(spawn); + MapInvalidateTileFull(spawn); return res; } } @@ -118,14 +118,14 @@ GameActions::Result PlacePeepSpawnAction::Execute() const { PeepSpawn oldestSpawn = *gPeepSpawns.begin(); gPeepSpawns.erase(gPeepSpawns.begin()); - map_invalidate_tile_full(oldestSpawn); + MapInvalidateTileFull(oldestSpawn); } // Set peep spawn gPeepSpawns.push_back(spawn); // Invalidate tile - map_invalidate_tile_full(_location); + MapInvalidateTileFull(_location); return res; } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 780c9cd7a2..d5b434bf7f 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -216,7 +216,7 @@ GameActions::Result RideCreateAction::Execute() const if (rideEntry->shop_item[0] == ShopItem::None) { - if (!park_ride_prices_unlocked()) + if (!ParkRidePricesUnlocked()) { ride->price[0] = 0; } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 244b95bc7e..0c5a2fe371 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -150,7 +150,7 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride* ride) const if (!ride->overall_view.IsNull()) { auto xy = ride->overall_view.ToTileCentre(); - res.Position = { xy, tile_element_height(xy) }; + res.Position = { xy, TileElementHeight(xy) }; } ride->Delete(); @@ -206,7 +206,7 @@ money32 RideDemolishAction::DemolishTracks() const while (!lastForTileReached) { offset++; - auto* tileElement = map_get_first_element_at(tileCoords) + offset; + auto* tileElement = MapGetFirstElementAt(tileCoords) + offset; if (tileElement == nullptr) break; @@ -229,7 +229,7 @@ money32 RideDemolishAction::DemolishTracks() const auto removRes = GameActions::ExecuteNested(&trackRemoveAction); if (removRes.Error != GameActions::Status::Ok) { - tile_element_remove(tileElement); + TileElementRemove(tileElement); } else { @@ -281,7 +281,7 @@ GameActions::Result RideDemolishAction::RefurbishRide(Ride* ride) const if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; } window_close_by_number(WindowClass::DemolishRidePrompt, _rideIndex.ToUnderlying()); diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 45965ab296..fef741ca27 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -92,7 +92,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const } auto z = ride->GetStation(_stationNum).GetBaseZ(); - if (!LocationValid(_loc) || (!gCheatsSandboxMode && !map_is_location_owned({ _loc, z }))) + if (!LocationValid(_loc) || (!gCheatsSandboxMode && !MapIsLocationOwned({ _loc, z }))) { return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } @@ -164,8 +164,8 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const auto z = station.GetBaseZ(); if (!(GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_remove_litter({ _loc, z }); - wall_remove_at_z({ _loc, z }); + FootpathRemoveLitter({ _loc, z }); + WallRemoveAtZ({ _loc, z }); } auto clear_z = z + (_isExit ? RideExitHeight : RideEntranceHeight); @@ -202,20 +202,20 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const station.LastPeepInQueue = EntityId::GetNull(); station.QueueLength = 0; - map_animation_create(MAP_ANIMATION_TYPE_RIDE_ENTRANCE, { _loc, z }); + MapAnimationCreate(MAP_ANIMATION_TYPE_RIDE_ENTRANCE, { _loc, z }); } - footpath_queue_chain_reset(); + FootpathQueueChainReset(); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - maze_entrance_hedge_removal({ _loc, entranceElement->as() }); + MazeEntranceHedgeRemoval({ _loc, entranceElement->as() }); } - footpath_connect_edges(_loc, entranceElement->as(), GetFlags()); - footpath_update_queue_chains(); + FootpathConnectEdges(_loc, entranceElement->as(), GetFlags()); + FootpathUpdateQueueChains(); - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); return res; } @@ -225,7 +225,7 @@ GameActions::Result RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ const auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; - if (!gCheatsSandboxMode && !map_is_location_owned(loc)) + if (!gCheatsSandboxMode && !MapIsLocationOwned(loc)) { return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } @@ -254,7 +254,7 @@ GameActions::Result RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ return GameActions::Result(GameActions::Status::Disallowed, errorTitle, STR_TOO_HIGH); } auto res = GameActions::Result(); - res.Position = { loc.ToTileCentre(), tile_element_height(loc) }; + res.Position = { loc.ToTileCentre(), TileElementHeight(loc) }; res.Expenditure = ExpenditureType::RideConstruction; res.Cost += canBuild.Cost; return res; diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index f58540ea21..1825b59787 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -48,13 +48,8 @@ void RideEntranceExitRemoveAction::Serialise(DataSerialiser& stream) static TileElement* FindEntranceElement( const CoordsXY& loc, RideId rideIndex, StationIndex stationNum, int32_t entranceType, uint32_t flags) { - const bool isGhost = flags & GAME_COMMAND_FLAG_GHOST; for (auto* entranceElement : TileElementsView(loc)) { - // If we are removing ghost elements - if (isGhost && entranceElement->IsGhost() == false) - continue; - if (entranceElement->GetRideIndex() != rideIndex) continue; @@ -96,7 +91,12 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const auto* entranceElement = FindEntranceElement( _loc, _rideIndex, _stationNum, _isExit ? ENTRANCE_TYPE_RIDE_EXIT : ENTRANCE_TYPE_RIDE_ENTRANCE, GetFlags()); - if (entranceElement == nullptr) + // If we are trying to remove a ghost and the element we found is real, return an error, but don't log a warning + if (entranceElement != nullptr && (GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(entranceElement->IsGhost())) + { + return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); + } + else if (entranceElement == nullptr) { log_warning( "Track Element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(), @@ -127,7 +127,12 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const auto* entranceElement = FindEntranceElement( _loc, _rideIndex, _stationNum, _isExit ? ENTRANCE_TYPE_RIDE_EXIT : ENTRANCE_TYPE_RIDE_ENTRANCE, GetFlags()); - if (entranceElement == nullptr) + // If we are trying to remove a ghost and the element we found is real, return an error, but don't log a warning + if (entranceElement != nullptr && isGhost && !(entranceElement->IsGhost())) + { + return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); + } + else if (entranceElement == nullptr) { log_warning( "Track Element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(), @@ -138,13 +143,13 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const auto res = GameActions::Result(); res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; - res.Position.z = tile_element_height(res.Position); + res.Position.z = TileElementHeight(res.Position); - footpath_queue_chain_reset(); - maze_entrance_hedge_replacement({ _loc, entranceElement }); - footpath_remove_edges_at(_loc, entranceElement); + FootpathQueueChainReset(); + MazeEntranceHedgeReplacement({ _loc, entranceElement }); + FootpathRemoveEdgesAt(_loc, entranceElement); - tile_element_remove(entranceElement); + TileElementRemove(entranceElement); auto& station = ride->GetStation(_stationNum); if (_isExit) @@ -156,8 +161,8 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const station.Entrance.SetNull(); } - footpath_update_queue_chains(); + FootpathUpdateQueueChains(); - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); return res; } diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index b1e518cd9f..4a0b9dc45d 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -148,7 +148,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; } return res; diff --git a/src/openrct2/actions/RideSetColourSchemeAction.cpp b/src/openrct2/actions/RideSetColourSchemeAction.cpp index b7ecf3ec0f..dcf5548404 100644 --- a/src/openrct2/actions/RideSetColourSchemeAction.cpp +++ b/src/openrct2/actions/RideSetColourSchemeAction.cpp @@ -54,6 +54,22 @@ GameActions::Result RideSetColourSchemeAction::Query() const return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_LAND_NOT_OWNED_BY_PARK); } + // Find the relevant track piece, prefer sequence 0 (logic copied from GetTrackElementOriginAndApplyChanges) + auto trackElement = MapGetTrackElementAtOfTypeSeq(_loc, _trackType, 0); + if (trackElement == nullptr) + { + trackElement = MapGetTrackElementAtOfType(_loc, _trackType); + if (trackElement == nullptr) + { + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS); + } + } + if (_newColourScheme >= OpenRCT2::Limits::NumColourSchemes) + { + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER); + } return GameActions::Result(); } diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 5af06adc09..6090e18a9d 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -92,7 +92,7 @@ GameActions::Result RideSetNameAction::Execute() const auto res = GameActions::Result(); auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; return res; } diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index d907d29429..ca36271e63 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -90,7 +90,7 @@ GameActions::Result RideSetPriceAction::Execute() const if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; } ShopItem shopItem; diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index c69e4507b6..7d3f991dbf 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -234,7 +234,7 @@ GameActions::Result RideSetSettingAction::Execute() const if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; } window_invalidate_by_number(WindowClass::Ride, _rideIndex.ToUnderlying()); return res; @@ -242,7 +242,7 @@ GameActions::Result RideSetSettingAction::Execute() const bool RideSetSettingAction::ride_is_mode_valid(Ride* ride) const { - return ride->GetRideTypeDescriptor().RideModes & (1ULL << _value); + return ride->GetRideTypeDescriptor().RideModes & (1uLL << _value); } bool RideSetSettingAction::ride_is_valid_lift_hill_speed(Ride* ride) const diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 01295a7134..a71e22bc3a 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -137,7 +137,7 @@ GameActions::Result RideSetStatusAction::Execute() const if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(location) }; + res.Position = { location, TileElementHeight(location) }; } switch (_status) diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 8734d3dc23..1ed84e90c4 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -197,12 +197,12 @@ GameActions::Result RideSetVehicleAction::Execute() const if (!ride->overall_view.IsNull()) { auto location = ride->overall_view.ToTileCentre(); - res.Position = { location, tile_element_height(res.Position) }; + res.Position = { location, TileElementHeight(res.Position) }; } auto intent = Intent(INTENT_ACTION_RIDE_PAINT_RESET_VEHICLE); intent.putExtra(INTENT_EXTRA_RIDE_ID, _rideIndex.ToUnderlying()); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); gfx_invalidate_screen(); return res; diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 9de82d6987..a6f337a561 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -207,13 +207,13 @@ GameActions::Result SetCheatAction::Execute() const gCheatsNeverendingMarketing = _param1 != 0; break; case CheatType::OpenClosePark: - ParkSetOpen(!park_is_open()); + ParkSetOpen(!ParkIsOpen()); break; case CheatType::HaveFun: gScenarioObjective.Type = OBJECTIVE_HAVE_FUN; break; case CheatType::SetForcedParkRating: - set_forced_park_rating(_param1); + ParkSetForcedRating(_param1); break; case CheatType::AllowArbitraryRideTypeChanges: gCheatsAllowArbitraryRideTypeChanges = _param1 != 0; @@ -250,7 +250,7 @@ GameActions::Result SetCheatAction::Execute() const if (network_get_mode() == NETWORK_MODE_NONE) { - config_save_default(); + ConfigSaveDefault(); } window_invalidate_by_class(WindowClass::Cheats); @@ -361,7 +361,7 @@ void SetCheatAction::SetGrassLength(int32_t length) const { for (int32_t x = 0; x < gMapSize.x; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; @@ -380,14 +380,14 @@ void SetCheatAction::WaterPlants() const { tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() == TileElementType::SmallScenery) { it.element->AsSmallScenery()->SetAge(0); } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); gfx_invalidate_screen(); } @@ -396,7 +396,7 @@ void SetCheatAction::FixVandalism() const { tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() != TileElementType::Path) @@ -406,7 +406,7 @@ void SetCheatAction::FixVandalism() const continue; it.element->AsPath()->SetIsBroken(false); - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); gfx_invalidate_screen(); } @@ -419,7 +419,7 @@ void SetCheatAction::RemoveLitter() const } tile_element_iterator it{}; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() != TileElementType::Path) @@ -433,7 +433,7 @@ void SetCheatAction::RemoveLitter() const if (pathBitEntry != nullptr && pathBitEntry->flags & PATH_BIT_FLAG_IS_BIN) path->SetAdditionStatus(0xFF); - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); gfx_invalidate_screen(); } @@ -690,7 +690,7 @@ void SetCheatAction::OwnAllLand() const { for (coords.x = min.x; coords.x <= max.x; coords.x += COORDS_XY_STEP) { - auto* surfaceElement = map_get_surface_element_at(coords); + auto* surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) continue; @@ -699,14 +699,14 @@ void SetCheatAction::OwnAllLand() const continue; int32_t baseZ = surfaceElement->GetBaseZ(); - int32_t destOwnership = check_max_allowable_land_rights_for_tile({ coords, baseZ }); + int32_t destOwnership = CheckMaxAllowableLandRightsForTile({ coords, baseZ }); // only own tiles that were not set to 0 if (destOwnership != OWNERSHIP_UNOWNED) { surfaceElement->SetOwnership(destOwnership); - update_park_fences_around_tile(coords); - map_invalidate_tile({ coords, baseZ, baseZ + 16 }); + ParkUpdateFencesAroundTile(coords); + MapInvalidateTile({ coords, baseZ, baseZ + 16 }); } } } @@ -714,17 +714,17 @@ void SetCheatAction::OwnAllLand() const // Completely unown peep spawn points for (const auto& spawn : gPeepSpawns) { - auto* surfaceElement = map_get_surface_element_at(spawn); + auto* surfaceElement = MapGetSurfaceElementAt(spawn); if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); - update_park_fences_around_tile(spawn); + ParkUpdateFencesAroundTile(spawn); uint16_t baseZ = surfaceElement->GetBaseZ(); - map_invalidate_tile({ spawn, baseZ, baseZ + 16 }); + MapInvalidateTile({ spawn, baseZ, baseZ + 16 }); } } - map_count_remaining_land_rights(); + MapCountRemainingLandRights(); } void SetCheatAction::ParkSetOpen(bool isOpen) const diff --git a/src/openrct2/actions/SetParkEntranceFeeAction.cpp b/src/openrct2/actions/SetParkEntranceFeeAction.cpp index 521a762f5c..81de841a04 100644 --- a/src/openrct2/actions/SetParkEntranceFeeAction.cpp +++ b/src/openrct2/actions/SetParkEntranceFeeAction.cpp @@ -40,7 +40,7 @@ void SetParkEntranceFeeAction::Serialise(DataSerialiser& stream) GameActions::Result SetParkEntranceFeeAction::Query() const { bool noMoney = (gParkFlags & PARK_FLAGS_NO_MONEY) != 0; - bool forceFreeEntry = !park_entry_price_unlocked(); + bool forceFreeEntry = !ParkEntranceFeeUnlocked(); if (noMoney || forceFreeEntry) { return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_NONE); diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 6c62b21d45..f35643b13a 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -88,7 +88,7 @@ GameActions::Result SignSetStyleAction::Execute() const if (_isLarge) { TileElement* tileElement = BannerGetTileElement(_bannerIndex); - if (!map_large_scenery_sign_set_colour( + if (!MapLargeScenerySignSetColour( { coords, tileElement->GetBaseZ(), tileElement->GetDirection() }, tileElement->AsLargeScenery()->GetSequenceIndex(), _mainColour, _textColour)) { @@ -101,12 +101,12 @@ GameActions::Result SignSetStyleAction::Execute() const wallElement->SetPrimaryColour(_mainColour); wallElement->SetSecondaryColour(_textColour); - map_invalidate_tile({ coords, wallElement->GetBaseZ(), wallElement->GetClearanceZ() }); + MapInvalidateTile({ coords, wallElement->GetBaseZ(), wallElement->GetClearanceZ() }); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); intent.putExtra(INTENT_EXTRA_BANNER_INDEX, _bannerIndex); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); return GameActions::Result(); } diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index e7295a71b5..371e246d66 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -74,8 +74,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const { supportsRequired = true; } - int32_t landHeight = tile_element_height(_loc); - int16_t waterHeight = tile_element_water_height(_loc); + int32_t landHeight = TileElementHeight(_loc); + int16_t waterHeight = TileElementWaterHeight(_loc); int32_t surfaceHeight = landHeight; // If on water @@ -111,7 +111,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } - auto* sceneryEntry = get_small_scenery_entry(_sceneryType); + auto* sceneryEntry = GetSmallSceneryEntry(_sceneryType); if (sceneryEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -138,8 +138,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const loc2.x += SceneryQuadrantOffsets[quadrant & 3].x; loc2.y += SceneryQuadrantOffsets[quadrant & 3].y; } - landHeight = tile_element_height(loc2); - waterHeight = tile_element_water_height(loc2); + landHeight = TileElementHeight(loc2); + waterHeight = TileElementWaterHeight(loc2); surfaceHeight = landHeight; // If on water @@ -159,12 +159,12 @@ GameActions::Result SmallSceneryPlaceAction::Query() const } if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode - && !map_is_location_owned({ _loc.x, _loc.y, targetHeight })) + && !MapIsLocationOwned({ _loc.x, _loc.y, targetHeight })) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement != nullptr && !gCheatsDisableClearanceChecks && surfaceElement->GetWaterHeight() > 0) { @@ -283,8 +283,8 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const { supportsRequired = true; } - int32_t landHeight = tile_element_height(_loc); - int16_t waterHeight = tile_element_water_height(_loc); + int32_t landHeight = TileElementHeight(_loc); + int16_t waterHeight = TileElementWaterHeight(_loc); int32_t surfaceHeight = landHeight; // If on water @@ -303,7 +303,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const res.Position.z = surfaceHeight; } - auto* sceneryEntry = get_small_scenery_entry(_sceneryType); + auto* sceneryEntry = GetSmallSceneryEntry(_sceneryType); if (sceneryEntry == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); @@ -332,8 +332,8 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const x2 += SceneryQuadrantOffsets[quadrant & 3].x; y2 += SceneryQuadrantOffsets[quadrant & 3].y; } - landHeight = tile_element_height({ x2, y2 }); - waterHeight = tile_element_water_height({ x2, y2 }); + landHeight = TileElementHeight({ x2, y2 }); + waterHeight = TileElementWaterHeight({ x2, y2 }); surfaceHeight = landHeight; // If on water @@ -350,10 +350,10 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_remove_litter({ _loc, targetHeight }); + FootpathRemoveLitter({ _loc, targetHeight }); if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS))) { - wall_remove_at({ _loc, targetHeight, targetHeight + sceneryEntry->height }); + WallRemoveAt({ _loc, targetHeight, targetHeight + sceneryEntry->height }); } } @@ -433,10 +433,10 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const 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); + MapInvalidateTileFull(_loc); if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) { - map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, CoordsXYZ{ _loc, sceneryElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_SMALL_SCENERY, CoordsXYZ{ _loc, sceneryElement->GetBaseZ() }); } return res; diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index 33e5922cce..d6f8511625 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -61,7 +61,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - auto* entry = get_small_scenery_entry(_sceneryType); + auto* entry = GetSmallSceneryEntry(_sceneryType); if (entry == nullptr) { return GameActions::Result( @@ -87,7 +87,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const } // Check if the land is owned - if (!map_is_location_owned(_loc)) + if (!MapIsLocationOwned(_loc)) { res.Error = GameActions::Status::NoClearance; res.ErrorTitle = STR_CANT_REMOVE_THIS; @@ -110,7 +110,7 @@ GameActions::Result SmallSceneryRemoveAction::Execute() const { GameActions::Result res = GameActions::Result(); - auto* entry = get_small_scenery_entry(_sceneryType); + auto* entry = GetSmallSceneryEntry(_sceneryType); if (entry == nullptr) { return GameActions::Result( @@ -128,10 +128,10 @@ GameActions::Result SmallSceneryRemoveAction::Execute() const GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } - res.Position.z = tile_element_height(res.Position); + res.Position.z = TileElementHeight(res.Position); - map_invalidate_tile_full(_loc); - tile_element_remove(tileElement); + MapInvalidateTileFull(_loc); + TileElementRemove(tileElement); return res; } diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index cb0224d360..c9ae6c08f2 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -75,13 +75,13 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting) if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_owned(_loc)) + if (!MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } } - auto sceneryElement = map_get_small_scenery_element_at(_loc, _sceneryType, _quadrant); + auto sceneryElement = MapGetSmallSceneryElementAt(_loc, _sceneryType, _quadrant); if (sceneryElement == nullptr) { @@ -100,7 +100,7 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting) sceneryElement->SetSecondaryColour(_secondaryColour); sceneryElement->SetTertiaryColour(_tertiaryColour); - map_invalidate_tile_full(_loc); + MapInvalidateTileFull(_loc); } return res; diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 77195f7f20..dfeddc6b05 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -231,7 +231,7 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const if (guest->State == PeepState::Walking) { // Check the walking guest's tile. Only count them if they're on a path tile. - guest_tile = map_get_path_element_at(TileCoordsXYZ{ guest->NextLoc }); + guest_tile = MapGetPathElementAt(TileCoordsXYZ{ guest->NextLoc }); if (guest_tile != nullptr) ++count; } @@ -249,7 +249,7 @@ void StaffHireNewAction::AutoPositionNewStaff(Peep* newPeep) const { if (guest->State == PeepState::Walking) { - guest_tile = map_get_path_element_at(TileCoordsXYZ{ guest->NextLoc }); + guest_tile = MapGetPathElementAt(TileCoordsXYZ{ guest->NextLoc }); if (guest_tile != nullptr) { if (rand == 0) diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 35599fcdf2..779e665331 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -99,7 +99,7 @@ GameActions::Result StaffSetCostumeAction::Execute() const window_invalidate_by_number(WindowClass::Peep, _spriteIndex); auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); auto res = GameActions::Result(); res.Position = staff->GetLocation(); diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index 920d84298b..b5b99cff63 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -79,7 +79,7 @@ GameActions::Result StaffSetNameAction::Execute() const gfx_invalidate_screen(); auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); auto res = GameActions::Result(); res.Position = staff->GetLocation(); diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index d5674b355a..d8d4fbd425 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -65,7 +65,7 @@ GameActions::Result StaffSetOrdersAction::Execute() const window_invalidate_by_number(WindowClass::Peep, _spriteIndex); auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); auto res = GameActions::Result(); res.Position = staff->GetLocation(); diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index c24313ff22..a764583be2 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -52,7 +52,7 @@ GameActions::Result StaffSetPatrolAreaAction::Execute() const static void InvalidatePatrolTiles(const MapRange& range) { - map_invalidate_region(range.Point1, range.Point2); + MapInvalidateRegion(range.Point1, range.Point2); } GameActions::Result StaffSetPatrolAreaAction::QueryExecute(bool executing) const diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index fc93489b12..b40081c95a 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -78,7 +78,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16; auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16; - auto heightMid = tile_element_height({ xMid, yMid }); + auto heightMid = TileElementHeight({ xMid, yMid }); res.Position.x = xMid; res.Position.y = yMid; @@ -104,11 +104,11 @@ GameActions::Result SurfaceSetStyleAction::Query() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(coords)) + if (!MapIsLocationInPark(coords)) continue; } - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) { continue; @@ -154,7 +154,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const auto validRange = ClampRangeWithinMap(_range.Normalise()); auto xMid = (validRange.GetLeft() + validRange.GetRight()) / 2 + 16; auto yMid = (validRange.GetTop() + validRange.GetBottom()) / 2 + 16; - auto heightMid = tile_element_height({ xMid, yMid }); + auto heightMid = TileElementHeight({ xMid, yMid }); res.Position.x = xMid; res.Position.y = yMid; @@ -172,11 +172,11 @@ GameActions::Result SurfaceSetStyleAction::Execute() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(coords)) + if (!MapIsLocationInPark(coords)) continue; } - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) { continue; @@ -197,8 +197,8 @@ GameActions::Result SurfaceSetStyleAction::Execute() const surfaceElement->SetSurfaceStyle(_surfaceStyle); - map_invalidate_tile_full(coords); - footpath_remove_litter({ coords, tile_element_height(coords) }); + MapInvalidateTileFull(coords); + FootpathRemoveLitter({ coords, TileElementHeight(coords) }); } } } @@ -212,14 +212,14 @@ GameActions::Result SurfaceSetStyleAction::Execute() const edgeCost += 100; surfaceElement->SetEdgeStyle(_edgeStyle); - map_invalidate_tile_full(coords); + MapInvalidateTileFull(coords); } } if (surfaceElement->CanGrassGrow() && (surfaceElement->GetGrassLength() & 7) != GRASS_LENGTH_CLEAR_0) { surfaceElement->SetGrassLength(GRASS_LENGTH_CLEAR_0); - map_invalidate_tile_full(coords); + MapInvalidateTileFull(coords); } } } diff --git a/src/openrct2/actions/TileModifyAction.cpp b/src/openrct2/actions/TileModifyAction.cpp index 6c11df3be3..ba2a8a0cac 100644 --- a/src/openrct2/actions/TileModifyAction.cpp +++ b/src/openrct2/actions/TileModifyAction.cpp @@ -217,7 +217,7 @@ GameActions::Result TileModifyAction::QueryExecute(bool isExecuting) const res.Position.x = _loc.x; res.Position.y = _loc.y; - res.Position.z = tile_element_height(_loc); + res.Position.z = TileElementHeight(_loc); return res; } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 202100bae9..5697e2d90e 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -82,7 +82,7 @@ GameActions::Result TrackPlaceAction::Query() const GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } - if (!direction_valid(_origin.direction)) + if (!DirectionValid(_origin.direction)) { log_warning("Invalid direction for track placement, direction = %d", _origin.direction); return GameActions::Result( @@ -171,7 +171,7 @@ GameActions::Result TrackPlaceAction::Query() const auto rotatedTrack = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(_origin.direction), 0 }; auto tileCoords = CoordsXYZ{ _origin.x, _origin.y, _origin.z } + rotatedTrack; - if (!LocationValid(tileCoords) || (!map_is_location_owned(tileCoords) && !gCheatsSandboxMode)) + if (!LocationValid(tileCoords) || (!MapIsLocationOwned(tileCoords) && !gCheatsSandboxMode)) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -261,7 +261,7 @@ GameActions::Result TrackPlaceAction::Query() const // When building a level crossing, remove any pre-existing path furniture. if (crossingMode == CREATE_CROSSING_MODE_TRACK_OVER_PATH) { - auto footpathElement = map_get_footpath_element(mapLoc); + auto footpathElement = MapGetFootpathElement(mapLoc); if (footpathElement != nullptr && footpathElement->AsPath()->HasAddition()) { footpathElement->AsPath()->SetAddition(0); @@ -307,7 +307,7 @@ GameActions::Result TrackPlaceAction::Query() const if ((rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) && !_trackDesignDrawingPreview) { - auto surfaceElement = map_get_surface_element_at(mapLoc); + auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { return GameActions::Result( @@ -355,7 +355,7 @@ GameActions::Result TrackPlaceAction::Query() const } // 6c5648 12 push - auto surfaceElement = map_get_surface_element_at(mapLoc); + auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); @@ -478,10 +478,10 @@ GameActions::Result TrackPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gCheatsDisableClearanceChecks) { - footpath_remove_litter(mapLoc); + FootpathRemoveLitter(mapLoc); if (rideTypeFlags & RIDE_TYPE_FLAG_TRACK_NO_WALLS) { - wall_remove_at(mapLocWithClearance); + WallRemoveAt(mapLocWithClearance); } else { @@ -493,7 +493,7 @@ GameActions::Result TrackPlaceAction::Execute() const { if (intersectingDirections & (1 << i)) { - wall_remove_intersecting_walls(mapLocWithClearance, i); + WallRemoveIntersectingWalls(mapLocWithClearance, i); } } } @@ -511,7 +511,7 @@ GameActions::Result TrackPlaceAction::Execute() const resultData.GroundFlags = mapGroundFlags; // 6c5648 12 push - auto surfaceElement = map_get_surface_element_at(mapLoc); + auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); @@ -614,16 +614,16 @@ GameActions::Result TrackPlaceAction::Execute() const switch (_trackType) { case TrackElemType::Waterfall: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_WATERFALL, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); break; case TrackElemType::Rapids: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_RAPIDS, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); break; case TrackElemType::Whirlpool: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); break; case TrackElemType::SpinningTunnel: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, CoordsXYZ{ mapLoc, trackElement->GetBaseZ() }); break; } if (TrackTypeHasSpeedSetting(_trackType)) @@ -662,8 +662,8 @@ GameActions::Result TrackPlaceAction::Execute() const int32_t tempDirection = (_origin.direction + chosenDirection) & 3; tempLoc.x += CoordsDirectionDelta[tempDirection].x; tempLoc.y += CoordsDirectionDelta[tempDirection].y; - tempDirection = direction_reverse(tempDirection); - wall_remove_intersecting_walls({ tempLoc, baseZ, clearanceZ }, tempDirection & 3); + tempDirection = DirectionReverse(tempDirection); + WallRemoveIntersectingWalls({ tempLoc, baseZ, clearanceZ }, tempDirection & 3); } } } @@ -686,7 +686,7 @@ GameActions::Result TrackPlaceAction::Execute() const if (rideTypeFlags & RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER) { - auto* waterSurfaceElement = map_get_surface_element_at(mapLoc); + auto* waterSurfaceElement = MapGetSurfaceElementAt(mapLoc); if (waterSurfaceElement != nullptr) { waterSurfaceElement->SetHasTrackThatNeedsWater(true); @@ -696,9 +696,9 @@ GameActions::Result TrackPlaceAction::Execute() const if (!gCheatsDisableClearanceChecks || !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - footpath_connect_edges(mapLoc, tileElement, GetFlags()); + FootpathConnectEdges(mapLoc, tileElement, GetFlags()); } - map_invalidate_tile_full(mapLoc); + MapInvalidateTileFull(mapLoc); } money64 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice; diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 42263c2ab6..2e1a6840c0 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -68,7 +68,7 @@ GameActions::Result TrackRemoveAction::Query() const bool found = false; bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; - TileElement* tileElement = map_get_first_element_at(_origin); + TileElement* tileElement = MapGetFirstElementAt(_origin); do { @@ -137,8 +137,13 @@ GameActions::Result TrackRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } const auto& ted = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = ted.Block; - trackBlock += tileElement->AsTrack()->GetSequenceIndex(); + auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex(); + const rct_preview_track* trackBlock = ted.GetBlockForSequence(sequenceIndex); + if (trackBlock == nullptr) + { + log_warning("Track block %d not found for track type %d.", sequenceIndex, trackType); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + } auto startLoc = _origin; startLoc.direction = tileElement->GetDirection(); @@ -164,10 +169,10 @@ GameActions::Result TrackRemoveAction::Query() const return GameActions::Result( GameActions::Status::NotOwned, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - map_invalidate_tile_full(mapLoc); + MapInvalidateTileFull(mapLoc); found = false; - tileElement = map_get_first_element_at(mapLoc); + tileElement = MapGetFirstElementAt(mapLoc); do { if (tileElement == nullptr) @@ -214,7 +219,7 @@ GameActions::Result TrackRemoveAction::Query() const } } - auto* surfaceElement = map_get_surface_element_at(mapLoc); + auto* surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); @@ -264,7 +269,7 @@ GameActions::Result TrackRemoveAction::Execute() const bool found = false; bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; - TileElement* tileElement = map_get_first_element_at(_origin); + TileElement* tileElement = MapGetFirstElementAt(_origin); do { @@ -321,8 +326,13 @@ GameActions::Result TrackRemoveAction::Execute() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } const auto& ted = GetTrackElementDescriptor(trackType); - const rct_preview_track* trackBlock = ted.Block; - trackBlock += tileElement->AsTrack()->GetSequenceIndex(); + auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex(); + const rct_preview_track* trackBlock = ted.GetBlockForSequence(sequenceIndex); + if (trackBlock == nullptr) + { + log_warning("Track block %d not found for track type %d.", sequenceIndex, trackType); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + } auto startLoc = _origin; startLoc.direction = tileElement->GetDirection(); @@ -343,10 +353,10 @@ GameActions::Result TrackRemoveAction::Execute() const rotatedTrackLoc = CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(startLoc.direction), trackBlock->z }; auto mapLoc = CoordsXYZ{ startLoc.x, startLoc.y, startLoc.z } + rotatedTrackLoc; - map_invalidate_tile_full(mapLoc); + MapInvalidateTileFull(mapLoc); found = false; - tileElement = map_get_first_element_at(mapLoc); + tileElement = MapGetFirstElementAt(mapLoc); do { if (tileElement == nullptr) @@ -393,7 +403,7 @@ GameActions::Result TrackRemoveAction::Execute() const } } - auto* surfaceElement = map_get_surface_element_at(mapLoc); + auto* surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { log_warning("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); @@ -429,12 +439,12 @@ GameActions::Result TrackRemoveAction::Execute() const } invalidate_test_results(ride); - footpath_queue_chain_reset(); + FootpathQueueChainReset(); if (!gCheatsDisableClearanceChecks || !(tileElement->IsGhost())) { - footpath_remove_edges_at(mapLoc, tileElement); + FootpathRemoveEdgesAt(mapLoc, tileElement); } - tile_element_remove(tileElement); + TileElementRemove(tileElement); ride->ValidateStations(); if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index fb43cc500f..b6dfed02bb 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -60,7 +60,7 @@ GameActions::Result TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting) con return GameActions::Result(GameActions::Status::NotOwned, STR_NONE, STR_NONE); } - TileElement* tileElement = map_get_track_element_at_of_type(_loc, _trackType); + TileElement* tileElement = MapGetTrackElementAtOfType(_loc, _trackType); if (tileElement == nullptr) { log_warning("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y); diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index ded2af65f1..9eb392ca9d 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -70,7 +70,7 @@ GameActions::Result WallPlaceAction::Query() const if (_loc.z == 0) { - res.Position.z = tile_element_height(res.Position); + res.Position.z = TileElementHeight(res.Position); } if (!LocationValid(_loc)) @@ -83,12 +83,12 @@ GameActions::Result WallPlaceAction::Query() const { if (_loc.z == 0) { - if (!map_is_location_in_park(_loc)) + if (!MapIsLocationInPark(_loc)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } } - else if (!map_is_location_owned(_loc)) + else if (!MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_BUILD_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } @@ -108,7 +108,7 @@ GameActions::Result WallPlaceAction::Query() const auto targetHeight = _loc.z; if (targetHeight == 0) { - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -125,7 +125,7 @@ GameActions::Result WallPlaceAction::Query() const } } - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -215,7 +215,7 @@ GameActions::Result WallPlaceAction::Query() const } } - auto* wallEntry = get_wall_entry(_wallType); + auto* wallEntry = GetWallEntry(_wallType); if (wallEntry == nullptr) { @@ -280,14 +280,14 @@ GameActions::Result WallPlaceAction::Execute() const if (res.Position.z == 0) { - res.Position.z = tile_element_height(res.Position); + res.Position.z = TileElementHeight(res.Position); } uint8_t edgeSlope = 0; auto targetHeight = _loc.z; if (targetHeight == 0) { - auto* surfaceElement = map_get_surface_element_at(_loc); + auto* surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { log_error("Surface element not found at %d, %d.", _loc.x, _loc.y); @@ -305,7 +305,7 @@ GameActions::Result WallPlaceAction::Execute() const } auto targetLoc = CoordsXYZ(_loc, targetHeight); - auto* wallEntry = get_wall_entry(_wallType); + auto* wallEntry = GetWallEntry(_wallType); if (wallEntry == nullptr) { @@ -381,8 +381,8 @@ GameActions::Result WallPlaceAction::Execute() const wallElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST); - map_animation_create(MAP_ANIMATION_TYPE_WALL, targetLoc); - map_invalidate_tile_zoom1({ _loc, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 }); + MapAnimationCreate(MAP_ANIMATION_TYPE_WALL, targetLoc); + MapInvalidateTileZoom1({ _loc, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 }); res.Cost = wallEntry->price; @@ -444,10 +444,10 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( { if (!(ted.Coordinates.rotation_begin & 4)) { - direction = direction_reverse(trackElement->GetDirection()); + direction = DirectionReverse(trackElement->GetDirection()); if (direction == _edge) { - const rct_preview_track* trackBlock = &ted.Block[sequence]; + const rct_preview_track* trackBlock = ted.GetBlockForSequence(sequence); z = ted.Coordinates.z_begin; z = trackElement->base_height + ((z - trackBlock->z) * 8); if (z == z0) @@ -482,7 +482,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - trackBlock = &ted.Block[sequence]; + trackBlock = ted.GetBlockForSequence(sequence); z = ted.Coordinates.z_end; z = trackElement->base_height + ((z - trackBlock->z) * 8); return z == z0; @@ -496,12 +496,12 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( WallSceneryEntry* wall, int32_t z0, int32_t z1, bool* wallAcrossTrack) const { *wallAcrossTrack = false; - if (map_is_location_at_edge(_loc)) + if (MapIsLocationAtEdge(_loc)) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - TileElement* tileElement = map_get_first_element_at(_loc); + TileElement* tileElement = MapGetFirstElementAt(_loc); do { if (tileElement == nullptr) diff --git a/src/openrct2/actions/WallRemoveAction.cpp b/src/openrct2/actions/WallRemoveAction.cpp index 947e96e157..168afe49ef 100644 --- a/src/openrct2/actions/WallRemoveAction.cpp +++ b/src/openrct2/actions/WallRemoveAction.cpp @@ -51,7 +51,7 @@ GameActions::Result WallRemoveAction::Query() const } const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; - if (!isGhost && !(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !map_is_location_owned(_loc)) + if (!isGhost && !(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } @@ -84,11 +84,11 @@ GameActions::Result WallRemoveAction::Execute() const res.Position.x = _loc.x + 16; res.Position.y = _loc.y + 16; - res.Position.z = tile_element_height(res.Position); + res.Position.z = TileElementHeight(res.Position); wallElement->RemoveBannerEntry(); - map_invalidate_tile_zoom1({ _loc, wallElement->GetBaseZ(), (wallElement->GetBaseZ()) + 72 }); - tile_element_remove(wallElement); + MapInvalidateTileZoom1({ _loc, wallElement->GetBaseZ(), (wallElement->GetBaseZ()) + 72 }); + TileElementRemove(wallElement); return res; } diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 298ebe9fe1..656bd932cc 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -56,12 +56,12 @@ GameActions::Result WallSetColourAction::Query() const return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_in_park(_loc) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationInPark(_loc) && !gCheatsSandboxMode) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } - auto wallElement = map_get_wall_element_at(_loc); + auto wallElement = MapGetWallElementAt(_loc); if (wallElement == nullptr) { log_error( @@ -113,7 +113,7 @@ GameActions::Result WallSetColourAction::Execute() const res.Position.z = _loc.z; res.Expenditure = ExpenditureType::Landscaping; - auto wallElement = map_get_wall_element_at(_loc); + auto wallElement = MapGetWallElementAt(_loc); if (wallElement == nullptr) { log_error( @@ -140,7 +140,7 @@ GameActions::Result WallSetColourAction::Execute() const { wallElement->SetTertiaryColour(_tertiaryColour); } - map_invalidate_tile_zoom1({ _loc, _loc.z, _loc.z + 72 }); + MapInvalidateTileZoom1({ _loc, _loc.z, _loc.z + 72 }); return res; } diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 35fce61f97..b2f70f583f 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -48,8 +48,8 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const auto validRange = ClampRangeWithinMap(_range); res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16; res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16; - int16_t z = tile_element_height(res.Position); - int16_t waterHeight = tile_element_water_height(res.Position); + int16_t z = TileElementHeight(res.Position); + int16_t waterHeight = TileElementWaterHeight(res.Position); if (waterHeight != 0) { z = waterHeight; @@ -67,13 +67,13 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const if (!LocationValid({ x, y })) continue; - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ x, y })) + if (!MapIsLocationInPark(CoordsXY{ x, y })) { continue; } @@ -132,13 +132,13 @@ uint8_t WaterLowerAction::GetLowestHeight(const MapRange& validRange) const { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ x, y })) + if (!MapIsLocationInPark(CoordsXY{ x, y })) { continue; } } - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 8b5a3bbe11..74779abaa8 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -48,8 +48,8 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const auto validRange = ClampRangeWithinMap(_range); res.Position.x = ((validRange.GetLeft() + validRange.GetRight()) / 2) + 16; res.Position.y = ((validRange.GetTop() + validRange.GetBottom()) / 2) + 16; - int32_t z = tile_element_height(res.Position); - int16_t waterHeight = tile_element_water_height(res.Position); + int32_t z = TileElementHeight(res.Position); + int16_t waterHeight = TileElementWaterHeight(res.Position); if (waterHeight != 0) { z = waterHeight; @@ -67,13 +67,13 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const if (!LocationValid({ x, y })) continue; - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ x, y })) + if (!MapIsLocationInPark(CoordsXY{ x, y })) { continue; } @@ -138,13 +138,13 @@ uint16_t WaterRaiseAction::GetHighestHeight(const MapRange& validRange) const { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ x, y })) + if (!MapIsLocationInPark(CoordsXY{ x, y })) { continue; } } - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement == nullptr) continue; diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index d236f5dd2a..8b0490b15f 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -58,13 +58,13 @@ GameActions::Result WaterSetHeightAction::Query() const if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(_coords)) + if (!MapIsLocationInPark(_coords)) { return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK); } } - SurfaceElement* surfaceElement = map_get_surface_element_at(_coords); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) { log_error("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); @@ -104,12 +104,12 @@ GameActions::Result WaterSetHeightAction::Execute() const res.Expenditure = ExpenditureType::Landscaping; res.Position = { _coords, _height * COORDS_Z_STEP }; - int32_t surfaceHeight = tile_element_height(_coords); - footpath_remove_litter({ _coords, surfaceHeight }); + int32_t surfaceHeight = TileElementHeight(_coords); + FootpathRemoveLitter({ _coords, surfaceHeight }); if (!gCheatsDisableClearanceChecks) - wall_remove_at_z({ _coords, surfaceHeight }); + WallRemoveAtZ({ _coords, surfaceHeight }); - SurfaceElement* surfaceElement = map_get_surface_element_at(_coords); + SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) { log_error("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); @@ -124,7 +124,7 @@ GameActions::Result WaterSetHeightAction::Execute() const { surfaceElement->SetWaterHeight(0); } - map_invalidate_tile_full(_coords); + MapInvalidateTileFull(_coords); res.Cost = 250; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 645946fdbc..63430a8305 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -50,6 +50,7 @@ namespace OpenRCT2::Audio static std::vector _audioDevices; static int32_t _currentAudioDevice = -1; static ObjectEntryIndex _soundsAudioObjectEntryIndex = OBJECT_ENTRY_INDEX_NULL; + static ObjectEntryIndex _soundsAdditionalAudioObjectEntryIndex = OBJECT_ENTRY_INDEX_NULL; static ObjectEntryIndex _titleAudioObjectEntryIndex = OBJECT_ENTRY_INDEX_NULL; bool gGameSoundsOff = false; @@ -65,7 +66,7 @@ namespace OpenRCT2::Audio return false; if (gGameSoundsOff) return false; - if (!gConfigSound.sound_enabled) + if (!gConfigSound.SoundEnabled) return false; if (gOpenRCT2Headless) return false; @@ -75,19 +76,19 @@ namespace OpenRCT2::Audio void Init() { auto audioContext = GetContext()->GetAudioContext(); - if (gConfigSound.device.empty()) + if (gConfigSound.Device.empty()) { audioContext->SetOutputDevice(""); _currentAudioDevice = 0; } else { - audioContext->SetOutputDevice(gConfigSound.device); + audioContext->SetOutputDevice(gConfigSound.Device); PopulateDevices(); for (int32_t i = 0; i < GetDeviceCount(); i++) { - if (_audioDevices[i] == gConfigSound.device) + if (_audioDevices[i] == gConfigSound.Device) { _currentAudioDevice = i; } @@ -123,6 +124,9 @@ namespace OpenRCT2::Audio } } + objManager.LoadObject(AudioObjectIdentifiers::OpenRCT2Additional); + _soundsAdditionalAudioObjectEntryIndex = objManager.GetLoadedObjectEntryIndex( + AudioObjectIdentifiers::OpenRCT2Additional); objManager.LoadObject(AudioObjectIdentifiers::Rct2Circus); } @@ -163,14 +167,14 @@ namespace OpenRCT2::Audio params.volume = 0; params.pan = 0; - auto element = map_get_surface_element_at(location); + auto element = MapGetSurfaceElementAt(location); if (element != nullptr && (element->GetBaseZ()) - 5 > location.z) { volumeDown = 10; } uint8_t rotation = get_current_rotation(); - auto pos2 = translate_3d_to_2d_with_z(rotation, location); + auto pos2 = Translate3DTo2DWithZ(rotation, location); rct_viewport* viewport = nullptr; while ((viewport = window_get_previous_viewport(viewport)) != nullptr) @@ -195,12 +199,23 @@ namespace OpenRCT2::Audio return params; } - AudioObject* GetBaseAudioObject() + static std::tuple GetAudioObjectAndSampleIndex(SoundId id) { auto& objManager = GetContext()->GetObjectManager(); - auto* baseAudioObject = static_cast( - objManager.GetLoadedObject(ObjectType::Audio, _soundsAudioObjectEntryIndex)); - return baseAudioObject; + AudioObject* audioObject{}; + uint32_t sampleIndex = EnumValue(id); + if (id >= SoundId::LiftRMC) + { + audioObject = static_cast( + objManager.GetLoadedObject(ObjectType::Audio, _soundsAdditionalAudioObjectEntryIndex)); + sampleIndex -= EnumValue(SoundId::LiftRMC); + } + else + { + audioObject = static_cast( + objManager.GetLoadedObject(ObjectType::Audio, _soundsAudioObjectEntryIndex)); + } + return std::make_tuple(audioObject, sampleIndex); } static void Play(IAudioSource* audioSource, int32_t volume, int32_t pan) @@ -222,13 +237,13 @@ namespace OpenRCT2::Audio return; // Get sound from base object - auto* baseAudioObject = GetBaseAudioObject(); + auto [baseAudioObject, sampleIndex] = GetAudioObjectAndSampleIndex(soundId); if (baseAudioObject != nullptr) { - auto params = GetParametersFromLocation(baseAudioObject, EnumValue(soundId), loc); + auto params = GetParametersFromLocation(baseAudioObject, sampleIndex, loc); if (params.in_range) { - auto source = baseAudioObject->GetSample(EnumValue(soundId)); + auto source = baseAudioObject->GetSample(sampleIndex); if (source != nullptr) { Play(source, params.volume, params.pan); @@ -243,10 +258,10 @@ namespace OpenRCT2::Audio return; // Get sound from base object - auto* baseAudioObject = GetBaseAudioObject(); + auto [baseAudioObject, sampleIndex] = GetAudioObjectAndSampleIndex(soundId); if (baseAudioObject != nullptr) { - auto source = baseAudioObject->GetSample(EnumValue(soundId)); + auto source = baseAudioObject->GetSample(sampleIndex); if (source != nullptr) { Play(source, volume, pan); @@ -256,7 +271,7 @@ namespace OpenRCT2::Audio static ObjectEntryDescriptor GetTitleMusicDescriptor() { - switch (gConfigSound.title_music) + switch (gConfigSound.TitleMusic) { default: return {}; @@ -365,7 +380,7 @@ namespace OpenRCT2::Audio } _currentAudioDevice = device; - config_save_default(); + ConfigSaveDefault(); } void Close() @@ -379,8 +394,8 @@ namespace OpenRCT2::Audio void ToggleAllSounds() { - gConfigSound.master_sound_enabled = !gConfigSound.master_sound_enabled; - if (gConfigSound.master_sound_enabled) + gConfigSound.MasterSoundEnabled = !gConfigSound.MasterSoundEnabled; + if (gConfigSound.MasterSoundEnabled) { Resume(); PlayTitleMusic(); @@ -440,10 +455,10 @@ namespace OpenRCT2::Audio SoundId id, bool loop, int32_t volume, float pan, double rate, bool forget) { // Get sound from base object - auto baseAudioObject = GetBaseAudioObject(); + auto [baseAudioObject, sampleIndex] = GetAudioObjectAndSampleIndex(id); if (baseAudioObject != nullptr) { - auto source = baseAudioObject->GetSample(EnumValue(id)); + auto source = baseAudioObject->GetSample(sampleIndex); if (source != nullptr) { return CreateAudioChannel(source, MixerGroup::Sound, loop, volume, pan, rate, forget); diff --git a/src/openrct2/audio/audio.h b/src/openrct2/audio/audio.h index 560bfeefc8..fa3e8c527f 100644 --- a/src/openrct2/audio/audio.h +++ b/src/openrct2/audio/audio.h @@ -127,6 +127,8 @@ namespace OpenRCT2::Audio DoorClose, Portcullis, CrowdAmbience, + LiftRMC, + TrackFrictionRMC, NoScream = 254, Null = 255 }; @@ -140,6 +142,7 @@ namespace OpenRCT2::Audio constexpr std::string_view Rct2cBase = "rct2.audio.base.rctc"; constexpr std::string_view Rct2Title = "rct2.audio.title"; constexpr std::string_view Rct2Circus = "rct2.audio.circus"; + constexpr std::string_view OpenRCT2Additional = "openrct2.audio.additional"; } // namespace AudioObjectIdentifiers extern bool gGameSoundsOff; diff --git a/src/openrct2/cmdline/BenchSpriteSort.cpp b/src/openrct2/cmdline/BenchSpriteSort.cpp index aabc4fd67e..6f5f02008e 100644 --- a/src/openrct2/cmdline/BenchSpriteSort.cpp +++ b/src/openrct2/cmdline/BenchSpriteSort.cpp @@ -43,25 +43,25 @@ static void fixup_pointers(std::vector& s) auto& quadrants = s[i].Session.Quadrants; for (size_t j = 0; j < entries.size(); j++) { - if (entries[j].AsBasic()->next_quadrant_ps == reinterpret_cast(-1)) + if (entries[j].AsBasic()->next_quadrant_ps == reinterpret_cast(-1)) { entries[j].AsBasic()->next_quadrant_ps = nullptr; } else { - auto nextQuadrantPs = reinterpret_cast(entries[j].AsBasic()->next_quadrant_ps) / sizeof(paint_entry); + auto nextQuadrantPs = reinterpret_cast(entries[j].AsBasic()->next_quadrant_ps) / sizeof(PaintEntry); entries[j].AsBasic()->next_quadrant_ps = s[i].Entries[nextQuadrantPs].AsBasic(); } } for (size_t j = 0; j < std::size(quadrants); j++) { - if (quadrants[j] == reinterpret_cast(-1)) + if (quadrants[j] == reinterpret_cast(-1)) { quadrants[j] = nullptr; } else { - auto ps = reinterpret_cast(quadrants[j]) / sizeof(paint_entry); + auto ps = reinterpret_cast(quadrants[j]) / sizeof(PaintEntry); quadrants[j] = entries[ps].AsBasic(); } } @@ -103,8 +103,8 @@ static std::vector extract_paint_session(std::string_view viewport.flags = 0; auto customXY = TileCoordsXY(gMapSize.x / 2, gMapSize.y / 2).ToCoordsXY().ToTileCentre(); - auto customXYZ = CoordsXYZ(customXY, tile_element_height(customXY)); - auto screenXY = translate_3d_to_2d_with_z(0, customXYZ); + auto customXYZ = CoordsXYZ(customXY, TileElementHeight(customXY)); + auto screenXY = Translate3DTo2DWithZ(0, customXYZ); viewport.viewPos = { screenXY.x - (viewport.view_width / 2), screenXY.y - (viewport.view_height / 2) }; viewport.zoom = ZoomLevel{ 0 }; @@ -160,11 +160,11 @@ static int cmdline_for_bench_sprite_sort(int argc, const char** argv) std::vector sessions(1); for (auto& ps : sessions[0].Entries) { - ps.AsBasic()->next_quadrant_ps = reinterpret_cast(-1); + ps.AsBasic()->next_quadrant_ps = reinterpret_cast(-1); } for (auto& quad : sessions[0].Session.Quadrants) { - quad = reinterpret_cast(-1); + quad = reinterpret_cast(-1); } benchmark::RegisterBenchmark("baseline", BM_paint_session_arrange, sessions); } diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index c3cd736e5f..d38e06c653 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -368,10 +368,10 @@ static exitcode_t HandleCommandSetRCT2(CommandLineArgEnumerator* enumerator) // Update RCT2 path in config auto env = OpenRCT2::CreatePlatformEnvironment(); auto configPath = env->GetFilePath(OpenRCT2::PATHID::CONFIG); - config_set_defaults(); - config_open(configPath); - gConfigGeneral.rct2_path = path; - if (config_save(configPath)) + ConfigSetDefaults(); + ConfigOpen(configPath); + gConfigGeneral.RCT2Path = path; + if (ConfigSave(configPath)) { Console::WriteFormat("Updating RCT2 path to '%s'.", path.c_str()); Console::WriteLine(); @@ -397,7 +397,7 @@ static exitcode_t HandleCommandScanObjects([[maybe_unused]] CommandLineArgEnumer auto context = OpenRCT2::CreateContext(); auto env = context->GetPlatformEnvironment(); auto objectRepository = CreateObjectRepository(env); - objectRepository->Construct(gConfigGeneral.language); + objectRepository->Construct(gConfigGeneral.Language); return EXITCODE_OK; } diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 6e90ace5e2..f8fd4c840c 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -138,95 +138,94 @@ namespace Config if (reader->ReadSection("general")) { auto model = &gConfigGeneral; - model->always_show_gridlines = reader->GetBoolean("always_show_gridlines", false); - model->autosave_frequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES); - model->autosave_amount = reader->GetInt32("autosave_amount", DEFAULT_NUM_AUTOSAVES_TO_KEEP); - model->confirmation_prompt = reader->GetBoolean("confirmation_prompt", false); - model->currency_format = reader->GetEnum( + model->AlwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false); + model->AutosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES); + model->AutosaveAmount = reader->GetInt32("autosave_amount", DEFAULT_NUM_AUTOSAVES_TO_KEEP); + model->ConfirmationPrompt = reader->GetBoolean("confirmation_prompt", false); + model->CurrencyFormat = reader->GetEnum( "currency_format", Platform::GetLocaleCurrency(), Enum_Currency); - model->custom_currency_rate = reader->GetInt32("custom_currency_rate", 10); - model->custom_currency_affix = reader->GetEnum( + model->CustomCurrencyRate = reader->GetInt32("custom_currency_rate", 10); + model->CustomCurrencyAffix = reader->GetEnum( "custom_currency_affix", CurrencyAffix::Suffix, Enum_CurrencySymbolAffix); - model->custom_currency_symbol = reader->GetCString("custom_currency_symbol", "Ctm"); - model->edge_scrolling = reader->GetBoolean("edge_scrolling", true); - model->edge_scrolling_speed = reader->GetInt32("edge_scrolling_speed", 12); - model->fullscreen_mode = reader->GetInt32("fullscreen_mode", 0); - model->fullscreen_height = reader->GetInt32("fullscreen_height", -1); - model->fullscreen_width = reader->GetInt32("fullscreen_width", -1); - model->rct1_path = reader->GetString("rct1_path", ""); - model->rct2_path = reader->GetString("game_path", ""); - model->landscape_smoothing = reader->GetBoolean("landscape_smoothing", true); - model->language = reader->GetEnum("language", Platform::GetLocaleLanguage(), Enum_LanguageEnum); - model->measurement_format = reader->GetEnum( + model->CustomCurrencySymbol = reader->GetCString("custom_currency_symbol", "Ctm"); + model->EdgeScrolling = reader->GetBoolean("edge_scrolling", true); + model->EdgeScrollingSpeed = reader->GetInt32("edge_scrolling_speed", 12); + model->FullscreenMode = reader->GetInt32("fullscreen_mode", 0); + model->FullscreenHeight = reader->GetInt32("fullscreen_height", -1); + model->FullscreenWidth = reader->GetInt32("fullscreen_width", -1); + model->RCT1Path = reader->GetString("rct1_path", ""); + model->RCT2Path = reader->GetString("game_path", ""); + model->LandscapeSmoothing = reader->GetBoolean("landscape_smoothing", true); + model->Language = reader->GetEnum("language", Platform::GetLocaleLanguage(), Enum_LanguageEnum); + model->MeasurementFormat = reader->GetEnum( "measurement_format", Platform::GetLocaleMeasurementFormat(), Enum_MeasurementFormat); - model->play_intro = reader->GetBoolean("play_intro", false); - model->save_plugin_data = reader->GetBoolean("save_plugin_data", true); - model->debugging_tools = reader->GetBoolean("debugging_tools", false); - model->show_height_as_units = reader->GetBoolean("show_height_as_units", false); - model->temperature_format = reader->GetEnum( + model->PlayIntro = reader->GetBoolean("play_intro", false); + model->SavePluginData = reader->GetBoolean("save_plugin_data", true); + model->DebuggingTools = reader->GetBoolean("debugging_tools", false); + model->ShowHeightAsUnits = reader->GetBoolean("show_height_as_units", false); + model->TemperatureFormat = reader->GetEnum( "temperature_format", Platform::GetLocaleTemperatureFormat(), Enum_Temperature); - model->window_height = reader->GetInt32("window_height", -1); - model->window_snap_proximity = reader->GetInt32("window_snap_proximity", 5); - model->window_width = reader->GetInt32("window_width", -1); - model->default_display = reader->GetInt32("default_display", 0); - model->drawing_engine = reader->GetEnum( + model->WindowHeight = reader->GetInt32("window_height", -1); + model->WindowSnapProximity = reader->GetInt32("window_snap_proximity", 5); + model->WindowWidth = reader->GetInt32("window_width", -1); + model->DefaultDisplay = reader->GetInt32("default_display", 0); + model->DrawingEngine = reader->GetEnum( "drawing_engine", DrawingEngine::Software, Enum_DrawingEngine); - model->uncap_fps = reader->GetBoolean("uncap_fps", false); - model->use_vsync = reader->GetBoolean("use_vsync", true); - model->virtual_floor_style = reader->GetEnum( + model->UncapFPS = reader->GetBoolean("uncap_fps", false); + model->UseVSync = reader->GetBoolean("use_vsync", true); + model->VirtualFloorStyle = reader->GetEnum( "virtual_floor_style", VirtualFloorStyles::Glassy, Enum_VirtualFloorStyle); - model->date_format = reader->GetEnum("date_format", Platform::GetLocaleDateFormat(), Enum_DateFormat); - model->auto_staff_placement = reader->GetBoolean("auto_staff", true); - model->handymen_mow_default = reader->GetBoolean("handymen_mow_default", false); - model->default_inspection_interval = reader->GetInt32("default_inspection_interval", 2); - model->last_run_version = reader->GetString("last_run_version", ""); - model->invert_viewport_drag = reader->GetBoolean("invert_viewport_drag", false); - model->load_save_sort = reader->GetEnum("load_save_sort", Sort::NameAscending, Enum_Sort); - model->minimize_fullscreen_focus_loss = reader->GetBoolean("minimize_fullscreen_focus_loss", true); - model->disable_screensaver = reader->GetBoolean("disable_screensaver", true); + model->DateFormat = reader->GetEnum("date_format", Platform::GetLocaleDateFormat(), Enum_DateFormat); + model->AutoStaffPlacement = reader->GetBoolean("auto_staff", true); + model->HandymenMowByDefault = reader->GetBoolean("handymen_mow_default", false); + model->DefaultInspectionInterval = reader->GetInt32("default_inspection_interval", 2); + model->LastRunVersion = reader->GetString("last_run_version", ""); + model->InvertViewportDrag = reader->GetBoolean("invert_viewport_drag", false); + model->LoadSaveSort = reader->GetEnum("load_save_sort", Sort::NameAscending, Enum_Sort); + model->MinimizeFullscreenFocusLoss = reader->GetBoolean("minimize_fullscreen_focus_loss", true); + model->DisableScreensaver = reader->GetBoolean("disable_screensaver", true); // Default config setting is false until the games canvas can be separated from the effect - model->day_night_cycle = reader->GetBoolean("day_night_cycle", false); - const bool isHardware = model->drawing_engine != DrawingEngine::Software; - model->enable_light_fx = isHardware && reader->GetBoolean("enable_light_fx", false); - model->enable_light_fx_for_vehicles = isHardware && reader->GetBoolean("enable_light_fx_for_vehicles", false); - model->upper_case_banners = reader->GetBoolean("upper_case_banners", false); - model->disable_lightning_effect = reader->GetBoolean("disable_lightning_effect", false); - model->allow_loading_with_incorrect_checksum = reader->GetBoolean("allow_loading_with_incorrect_checksum", true); - model->steam_overlay_pause = reader->GetBoolean("steam_overlay_pause", true); - model->window_scale = reader->GetFloat("window_scale", Platform::GetDefaultScale()); - model->show_fps = reader->GetBoolean("show_fps", false); - model->multithreading = reader->GetBoolean("multi_threading", false); - model->trap_cursor = reader->GetBoolean("trap_cursor", false); - model->auto_open_shops = reader->GetBoolean("auto_open_shops", false); - model->scenario_select_mode = reader->GetInt32("scenario_select_mode", SCENARIO_SELECT_MODE_ORIGIN); - model->scenario_unlocking_enabled = reader->GetBoolean("scenario_unlocking_enabled", true); - model->scenario_hide_mega_park = reader->GetBoolean("scenario_hide_mega_park", true); - model->last_save_game_directory = reader->GetString("last_game_directory", ""); - model->last_save_landscape_directory = reader->GetString("last_landscape_directory", ""); - model->last_save_scenario_directory = reader->GetString("last_scenario_directory", ""); - model->last_save_track_directory = reader->GetString("last_track_directory", ""); - model->use_native_browse_dialog = reader->GetBoolean("use_native_browse_dialog", false); - model->window_limit = reader->GetInt32("window_limit", WINDOW_LIMIT_MAX); - model->zoom_to_cursor = reader->GetBoolean("zoom_to_cursor", true); - model->render_weather_effects = reader->GetBoolean("render_weather_effects", true); - model->render_weather_gloom = reader->GetBoolean("render_weather_gloom", true); - model->show_guest_purchases = reader->GetBoolean("show_guest_purchases", false); - model->show_real_names_of_guests = reader->GetBoolean("show_real_names_of_guests", true); - model->allow_early_completion = reader->GetBoolean("allow_early_completion", false); - model->asset_pack_order = reader->GetString("asset_pack_order", ""); - model->enabled_asset_packs = reader->GetString("enabled_asset_packs", ""); - model->transparent_screenshot = reader->GetBoolean("transparent_screenshot", true); - model->transparent_water = reader->GetBoolean("transparent_water", true); + model->DayNightCycle = reader->GetBoolean("day_night_cycle", false); + const bool isHardware = model->DrawingEngine != DrawingEngine::Software; + model->EnableLightFx = isHardware && reader->GetBoolean("enable_light_fx", false); + model->EnableLightFxForVehicles = isHardware && reader->GetBoolean("enable_light_fx_for_vehicles", false); + model->UpperCaseBanners = reader->GetBoolean("upper_case_banners", false); + model->DisableLightningEffect = reader->GetBoolean("disable_lightning_effect", false); + model->SteamOverlayPause = reader->GetBoolean("steam_overlay_pause", true); + model->WindowScale = reader->GetFloat("window_scale", Platform::GetDefaultScale()); + model->ShowFPS = reader->GetBoolean("show_fps", false); + model->MultiThreading = reader->GetBoolean("multi_threading", false); + model->TrapCursor = reader->GetBoolean("trap_cursor", false); + model->AutoOpenShops = reader->GetBoolean("auto_open_shops", false); + model->ScenarioSelectMode = reader->GetInt32("scenario_select_mode", SCENARIO_SELECT_MODE_ORIGIN); + model->ScenarioUnlockingEnabled = reader->GetBoolean("scenario_unlocking_enabled", true); + model->ScenarioHideMegaPark = reader->GetBoolean("scenario_hide_mega_park", true); + model->LastSaveGameDirectory = reader->GetString("last_game_directory", ""); + model->LastSaveLandscapeDirectory = reader->GetString("last_landscape_directory", ""); + model->LastSaveScenarioDirectory = reader->GetString("last_scenario_directory", ""); + model->LastSaveTrackDirectory = reader->GetString("last_track_directory", ""); + model->UseNativeBrowseDialog = reader->GetBoolean("use_native_browse_dialog", false); + model->WindowLimit = reader->GetInt32("window_limit", WINDOW_LIMIT_MAX); + model->ZoomToCursor = reader->GetBoolean("zoom_to_cursor", true); + model->RenderWeatherEffects = reader->GetBoolean("render_weather_effects", true); + model->RenderWeatherGloom = reader->GetBoolean("render_weather_gloom", true); + model->ShowGuestPurchases = reader->GetBoolean("show_guest_purchases", false); + model->ShowRealNamesOfGuests = reader->GetBoolean("show_real_names_of_guests", true); + model->AllowEarlyCompletion = reader->GetBoolean("allow_early_completion", false); + model->AssetPackOrder = reader->GetString("asset_pack_order", ""); + model->EnabledAssetPacks = reader->GetString("enabled_asset_packs", ""); + model->TransparentScreenshot = reader->GetBoolean("transparent_screenshot", true); + model->TransparentWater = reader->GetBoolean("transparent_water", true); - model->invisible_rides = reader->GetBoolean("invisible_rides", false); - model->invisible_vehicles = reader->GetBoolean("invisible_vehicles", false); - model->invisible_trees = reader->GetBoolean("invisible_trees", false); - model->invisible_scenery = reader->GetBoolean("invisible_scenery", false); - model->invisible_paths = reader->GetBoolean("invisible_paths", false); - model->invisible_supports = reader->GetBoolean("invisible_supports", true); + model->InvisibleRides = reader->GetBoolean("invisible_rides", false); + model->InvisibleVehicles = reader->GetBoolean("invisible_vehicles", false); + model->InvisibleTrees = reader->GetBoolean("invisible_trees", false); + model->InvisibleScenery = reader->GetBoolean("invisible_scenery", false); + model->InvisiblePaths = reader->GetBoolean("invisible_paths", false); + model->InvisibleSupports = reader->GetBoolean("invisible_supports", true); - model->last_version_check_time = reader->GetInt64("last_version_check_time", 0); + model->LastVersionCheckTime = reader->GetInt64("last_version_check_time", 0); } } @@ -234,84 +233,83 @@ namespace Config { auto model = &gConfigGeneral; writer->WriteSection("general"); - writer->WriteBoolean("always_show_gridlines", model->always_show_gridlines); - writer->WriteInt32("autosave", model->autosave_frequency); - writer->WriteInt32("autosave_amount", model->autosave_amount); - writer->WriteBoolean("confirmation_prompt", model->confirmation_prompt); - writer->WriteEnum("currency_format", model->currency_format, Enum_Currency); - writer->WriteInt32("custom_currency_rate", model->custom_currency_rate); - writer->WriteEnum("custom_currency_affix", model->custom_currency_affix, Enum_CurrencySymbolAffix); - writer->WriteString("custom_currency_symbol", model->custom_currency_symbol); - writer->WriteBoolean("edge_scrolling", model->edge_scrolling); - writer->WriteInt32("edge_scrolling_speed", model->edge_scrolling_speed); - writer->WriteInt32("fullscreen_mode", model->fullscreen_mode); - writer->WriteInt32("fullscreen_height", model->fullscreen_height); - writer->WriteInt32("fullscreen_width", model->fullscreen_width); - writer->WriteString("rct1_path", model->rct1_path); - writer->WriteString("game_path", model->rct2_path); - writer->WriteBoolean("landscape_smoothing", model->landscape_smoothing); - writer->WriteEnum("language", model->language, Enum_LanguageEnum); - writer->WriteEnum("measurement_format", model->measurement_format, Enum_MeasurementFormat); - writer->WriteBoolean("play_intro", model->play_intro); - writer->WriteBoolean("save_plugin_data", model->save_plugin_data); - writer->WriteBoolean("debugging_tools", model->debugging_tools); - writer->WriteBoolean("show_height_as_units", model->show_height_as_units); - writer->WriteEnum("temperature_format", model->temperature_format, Enum_Temperature); - writer->WriteInt32("window_height", model->window_height); - writer->WriteInt32("window_snap_proximity", model->window_snap_proximity); - writer->WriteInt32("window_width", model->window_width); - writer->WriteInt32("default_display", model->default_display); - writer->WriteEnum("drawing_engine", model->drawing_engine, Enum_DrawingEngine); - writer->WriteBoolean("uncap_fps", model->uncap_fps); - writer->WriteBoolean("use_vsync", model->use_vsync); - writer->WriteEnum("date_format", model->date_format, Enum_DateFormat); - writer->WriteBoolean("auto_staff", model->auto_staff_placement); - writer->WriteBoolean("handymen_mow_default", model->handymen_mow_default); - writer->WriteInt32("default_inspection_interval", model->default_inspection_interval); - writer->WriteString("last_run_version", model->last_run_version); - writer->WriteBoolean("invert_viewport_drag", model->invert_viewport_drag); - writer->WriteEnum("load_save_sort", model->load_save_sort, Enum_Sort); - writer->WriteBoolean("minimize_fullscreen_focus_loss", model->minimize_fullscreen_focus_loss); - writer->WriteBoolean("disable_screensaver", model->disable_screensaver); - writer->WriteBoolean("day_night_cycle", model->day_night_cycle); - writer->WriteBoolean("enable_light_fx", model->enable_light_fx); - writer->WriteBoolean("enable_light_fx_for_vehicles", model->enable_light_fx_for_vehicles); - writer->WriteBoolean("upper_case_banners", model->upper_case_banners); - writer->WriteBoolean("disable_lightning_effect", model->disable_lightning_effect); - writer->WriteBoolean("allow_loading_with_incorrect_checksum", model->allow_loading_with_incorrect_checksum); - writer->WriteBoolean("steam_overlay_pause", model->steam_overlay_pause); - writer->WriteFloat("window_scale", model->window_scale); - writer->WriteBoolean("show_fps", model->show_fps); - writer->WriteBoolean("multi_threading", model->multithreading); - writer->WriteBoolean("trap_cursor", model->trap_cursor); - writer->WriteBoolean("auto_open_shops", model->auto_open_shops); - writer->WriteInt32("scenario_select_mode", model->scenario_select_mode); - writer->WriteBoolean("scenario_unlocking_enabled", model->scenario_unlocking_enabled); - writer->WriteBoolean("scenario_hide_mega_park", model->scenario_hide_mega_park); - writer->WriteString("last_game_directory", model->last_save_game_directory); - writer->WriteString("last_landscape_directory", model->last_save_landscape_directory); - writer->WriteString("last_scenario_directory", model->last_save_scenario_directory); - writer->WriteString("last_track_directory", model->last_save_track_directory); - writer->WriteBoolean("use_native_browse_dialog", model->use_native_browse_dialog); - writer->WriteInt32("window_limit", model->window_limit); - writer->WriteBoolean("zoom_to_cursor", model->zoom_to_cursor); - writer->WriteBoolean("render_weather_effects", model->render_weather_effects); - writer->WriteBoolean("render_weather_gloom", model->render_weather_gloom); - writer->WriteBoolean("show_guest_purchases", model->show_guest_purchases); - writer->WriteBoolean("show_real_names_of_guests", model->show_real_names_of_guests); - writer->WriteBoolean("allow_early_completion", model->allow_early_completion); - writer->WriteString("asset_pack_order", model->asset_pack_order); - writer->WriteString("enabled_asset_packs", model->enabled_asset_packs); - writer->WriteEnum("virtual_floor_style", model->virtual_floor_style, Enum_VirtualFloorStyle); - writer->WriteBoolean("transparent_screenshot", model->transparent_screenshot); - writer->WriteBoolean("transparent_water", model->transparent_water); - writer->WriteBoolean("invisible_rides", model->invisible_rides); - writer->WriteBoolean("invisible_vehicles", model->invisible_vehicles); - writer->WriteBoolean("invisible_trees", model->invisible_trees); - writer->WriteBoolean("invisible_scenery", model->invisible_scenery); - writer->WriteBoolean("invisible_paths", model->invisible_paths); - writer->WriteBoolean("invisible_supports", model->invisible_supports); - writer->WriteInt64("last_version_check_time", model->last_version_check_time); + writer->WriteBoolean("always_show_gridlines", model->AlwaysShowGridlines); + writer->WriteInt32("autosave", model->AutosaveFrequency); + writer->WriteInt32("autosave_amount", model->AutosaveAmount); + writer->WriteBoolean("confirmation_prompt", model->ConfirmationPrompt); + writer->WriteEnum("currency_format", model->CurrencyFormat, Enum_Currency); + writer->WriteInt32("custom_currency_rate", model->CustomCurrencyRate); + writer->WriteEnum("custom_currency_affix", model->CustomCurrencyAffix, Enum_CurrencySymbolAffix); + writer->WriteString("custom_currency_symbol", model->CustomCurrencySymbol); + writer->WriteBoolean("edge_scrolling", model->EdgeScrolling); + writer->WriteInt32("edge_scrolling_speed", model->EdgeScrollingSpeed); + writer->WriteInt32("fullscreen_mode", model->FullscreenMode); + writer->WriteInt32("fullscreen_height", model->FullscreenHeight); + writer->WriteInt32("fullscreen_width", model->FullscreenWidth); + writer->WriteString("rct1_path", model->RCT1Path); + writer->WriteString("game_path", model->RCT2Path); + writer->WriteBoolean("landscape_smoothing", model->LandscapeSmoothing); + writer->WriteEnum("language", model->Language, Enum_LanguageEnum); + writer->WriteEnum("measurement_format", model->MeasurementFormat, Enum_MeasurementFormat); + writer->WriteBoolean("play_intro", model->PlayIntro); + writer->WriteBoolean("save_plugin_data", model->SavePluginData); + writer->WriteBoolean("debugging_tools", model->DebuggingTools); + writer->WriteBoolean("show_height_as_units", model->ShowHeightAsUnits); + writer->WriteEnum("temperature_format", model->TemperatureFormat, Enum_Temperature); + writer->WriteInt32("window_height", model->WindowHeight); + writer->WriteInt32("window_snap_proximity", model->WindowSnapProximity); + writer->WriteInt32("window_width", model->WindowWidth); + writer->WriteInt32("default_display", model->DefaultDisplay); + writer->WriteEnum("drawing_engine", model->DrawingEngine, Enum_DrawingEngine); + writer->WriteBoolean("uncap_fps", model->UncapFPS); + writer->WriteBoolean("use_vsync", model->UseVSync); + writer->WriteEnum("date_format", model->DateFormat, Enum_DateFormat); + writer->WriteBoolean("auto_staff", model->AutoStaffPlacement); + writer->WriteBoolean("handymen_mow_default", model->HandymenMowByDefault); + writer->WriteInt32("default_inspection_interval", model->DefaultInspectionInterval); + writer->WriteString("last_run_version", model->LastRunVersion); + writer->WriteBoolean("invert_viewport_drag", model->InvertViewportDrag); + writer->WriteEnum("load_save_sort", model->LoadSaveSort, Enum_Sort); + writer->WriteBoolean("minimize_fullscreen_focus_loss", model->MinimizeFullscreenFocusLoss); + writer->WriteBoolean("disable_screensaver", model->DisableScreensaver); + writer->WriteBoolean("day_night_cycle", model->DayNightCycle); + writer->WriteBoolean("enable_light_fx", model->EnableLightFx); + writer->WriteBoolean("enable_light_fx_for_vehicles", model->EnableLightFxForVehicles); + writer->WriteBoolean("upper_case_banners", model->UpperCaseBanners); + writer->WriteBoolean("disable_lightning_effect", model->DisableLightningEffect); + writer->WriteBoolean("steam_overlay_pause", model->SteamOverlayPause); + writer->WriteFloat("window_scale", model->WindowScale); + writer->WriteBoolean("show_fps", model->ShowFPS); + writer->WriteBoolean("multi_threading", model->MultiThreading); + writer->WriteBoolean("trap_cursor", model->TrapCursor); + writer->WriteBoolean("auto_open_shops", model->AutoOpenShops); + writer->WriteInt32("scenario_select_mode", model->ScenarioSelectMode); + writer->WriteBoolean("scenario_unlocking_enabled", model->ScenarioUnlockingEnabled); + writer->WriteBoolean("scenario_hide_mega_park", model->ScenarioHideMegaPark); + writer->WriteString("last_game_directory", model->LastSaveGameDirectory); + writer->WriteString("last_landscape_directory", model->LastSaveLandscapeDirectory); + writer->WriteString("last_scenario_directory", model->LastSaveScenarioDirectory); + writer->WriteString("last_track_directory", model->LastSaveTrackDirectory); + writer->WriteBoolean("use_native_browse_dialog", model->UseNativeBrowseDialog); + writer->WriteInt32("window_limit", model->WindowLimit); + writer->WriteBoolean("zoom_to_cursor", model->ZoomToCursor); + writer->WriteBoolean("render_weather_effects", model->RenderWeatherEffects); + writer->WriteBoolean("render_weather_gloom", model->RenderWeatherGloom); + writer->WriteBoolean("show_guest_purchases", model->ShowGuestPurchases); + writer->WriteBoolean("show_real_names_of_guests", model->ShowRealNamesOfGuests); + writer->WriteBoolean("allow_early_completion", model->AllowEarlyCompletion); + writer->WriteString("asset_pack_order", model->AssetPackOrder); + writer->WriteString("enabled_asset_packs", model->EnabledAssetPacks); + writer->WriteEnum("virtual_floor_style", model->VirtualFloorStyle, Enum_VirtualFloorStyle); + writer->WriteBoolean("transparent_screenshot", model->TransparentScreenshot); + writer->WriteBoolean("transparent_water", model->TransparentWater); + writer->WriteBoolean("invisible_rides", model->InvisibleRides); + writer->WriteBoolean("invisible_vehicles", model->InvisibleVehicles); + writer->WriteBoolean("invisible_trees", model->InvisibleTrees); + writer->WriteBoolean("invisible_scenery", model->InvisibleScenery); + writer->WriteBoolean("invisible_paths", model->InvisiblePaths); + writer->WriteBoolean("invisible_supports", model->InvisibleSupports); + writer->WriteInt64("last_version_check_time", model->LastVersionCheckTime); } static void ReadInterface(IIniReader* reader) @@ -319,20 +317,20 @@ namespace Config if (reader->ReadSection("interface")) { auto model = &gConfigInterface; - model->toolbar_show_finances = reader->GetBoolean("toolbar_show_finances", true); - model->toolbar_show_research = reader->GetBoolean("toolbar_show_research", true); - model->toolbar_show_cheats = reader->GetBoolean("toolbar_show_cheats", false); - model->toolbar_show_news = reader->GetBoolean("toolbar_show_news", false); - model->toolbar_show_mute = reader->GetBoolean("toolbar_show_mute", false); - model->toolbar_show_chat = reader->GetBoolean("toolbar_show_chat", false); - model->toolbar_show_zoom = reader->GetBoolean("toolbar_show_zoom", true); - model->console_small_font = reader->GetBoolean("console_small_font", false); - model->current_theme_preset = reader->GetCString("current_theme", "*RCT2"); - model->current_title_sequence_preset = reader->GetCString("current_title_sequence", "*OPENRCT2"); - model->random_title_sequence = reader->GetBoolean("random_title_sequence", false); - model->object_selection_filter_flags = reader->GetInt32("object_selection_filter_flags", 0x3FFF); - model->scenarioselect_last_tab = reader->GetInt32("scenarioselect_last_tab", 0); - model->list_ride_vehicles_separately = reader->GetBoolean("list_ride_vehicles_separately", false); + model->ToolbarShowFinances = reader->GetBoolean("toolbar_show_finances", true); + model->ToolbarShowResearch = reader->GetBoolean("toolbar_show_research", true); + model->ToolbarShowCheats = reader->GetBoolean("toolbar_show_cheats", false); + model->ToolbarShowNews = reader->GetBoolean("toolbar_show_news", false); + model->ToolbarShowMute = reader->GetBoolean("toolbar_show_mute", false); + model->ToolbarShowChat = reader->GetBoolean("toolbar_show_chat", false); + model->ToolbarShowZoom = reader->GetBoolean("toolbar_show_zoom", true); + model->ConsoleSmallFont = reader->GetBoolean("console_small_font", false); + model->CurrentThemePreset = reader->GetCString("current_theme", "*RCT2"); + model->CurrentTitleSequencePreset = reader->GetCString("current_title_sequence", "*OPENRCT2"); + model->RandomTitleSequence = reader->GetBoolean("random_title_sequence", false); + model->ObjectSelectionFilterFlags = reader->GetInt32("object_selection_filter_flags", 0x3FFF); + model->ScenarioselectLastTab = reader->GetInt32("scenarioselect_last_tab", 0); + model->ListRideVehiclesSeparately = reader->GetBoolean("list_ride_vehicles_separately", false); } } @@ -340,20 +338,20 @@ namespace Config { auto model = &gConfigInterface; writer->WriteSection("interface"); - writer->WriteBoolean("toolbar_show_finances", model->toolbar_show_finances); - writer->WriteBoolean("toolbar_show_research", model->toolbar_show_research); - writer->WriteBoolean("toolbar_show_cheats", model->toolbar_show_cheats); - writer->WriteBoolean("toolbar_show_news", model->toolbar_show_news); - writer->WriteBoolean("toolbar_show_mute", model->toolbar_show_mute); - writer->WriteBoolean("toolbar_show_chat", model->toolbar_show_chat); - writer->WriteBoolean("toolbar_show_zoom", model->toolbar_show_zoom); - writer->WriteBoolean("console_small_font", model->console_small_font); - writer->WriteString("current_theme", model->current_theme_preset); - writer->WriteString("current_title_sequence", model->current_title_sequence_preset); - writer->WriteBoolean("random_title_sequence", model->random_title_sequence); - writer->WriteInt32("object_selection_filter_flags", model->object_selection_filter_flags); - writer->WriteInt32("scenarioselect_last_tab", model->scenarioselect_last_tab); - writer->WriteBoolean("list_ride_vehicles_separately", model->list_ride_vehicles_separately); + writer->WriteBoolean("toolbar_show_finances", model->ToolbarShowFinances); + writer->WriteBoolean("toolbar_show_research", model->ToolbarShowResearch); + writer->WriteBoolean("toolbar_show_cheats", model->ToolbarShowCheats); + writer->WriteBoolean("toolbar_show_news", model->ToolbarShowNews); + writer->WriteBoolean("toolbar_show_mute", model->ToolbarShowMute); + writer->WriteBoolean("toolbar_show_chat", model->ToolbarShowChat); + writer->WriteBoolean("toolbar_show_zoom", model->ToolbarShowZoom); + writer->WriteBoolean("console_small_font", model->ConsoleSmallFont); + writer->WriteString("current_theme", model->CurrentThemePreset); + writer->WriteString("current_title_sequence", model->CurrentTitleSequencePreset); + writer->WriteBoolean("random_title_sequence", model->RandomTitleSequence); + writer->WriteInt32("object_selection_filter_flags", model->ObjectSelectionFilterFlags); + writer->WriteInt32("scenarioselect_last_tab", model->ScenarioselectLastTab); + writer->WriteBoolean("list_ride_vehicles_separately", model->ListRideVehiclesSeparately); } static void ReadSound(IIniReader* reader) @@ -361,14 +359,14 @@ namespace Config if (reader->ReadSection("sound")) { auto model = &gConfigSound; - model->device = reader->GetString("audio_device", ""); - model->master_sound_enabled = reader->GetBoolean("master_sound", true); - model->master_volume = reader->GetInt32("master_volume", 100); - model->title_music = static_cast(reader->GetInt32("title_music", EnumValue(TitleMusicKind::Rct2))); - model->sound_enabled = reader->GetBoolean("sound", true); - model->sound_volume = reader->GetInt32("sound_volume", 100); - model->ride_music_enabled = reader->GetBoolean("ride_music", true); - model->ride_music_volume = reader->GetInt32("ride_music_volume", 100); + model->Device = reader->GetString("audio_device", ""); + model->MasterSoundEnabled = reader->GetBoolean("master_sound", true); + model->MasterVolume = reader->GetInt32("master_volume", 100); + model->TitleMusic = static_cast(reader->GetInt32("title_music", EnumValue(TitleMusicKind::Rct2))); + model->SoundEnabled = reader->GetBoolean("sound", true); + model->SoundVolume = reader->GetInt32("sound_volume", 100); + model->RideMusicEnabled = reader->GetBoolean("ride_music", true); + model->AudioFocus = reader->GetInt32("ride_music_volume", 100); model->audio_focus = reader->GetBoolean("audio_focus", false); } } @@ -377,14 +375,14 @@ namespace Config { auto model = &gConfigSound; writer->WriteSection("sound"); - writer->WriteString("audio_device", model->device); - writer->WriteBoolean("master_sound", model->master_sound_enabled); - writer->WriteInt32("master_volume", model->master_volume); - writer->WriteInt32("title_music", EnumValue(model->title_music)); - writer->WriteBoolean("sound", model->sound_enabled); - writer->WriteInt32("sound_volume", model->sound_volume); - writer->WriteBoolean("ride_music", model->ride_music_enabled); - writer->WriteInt32("ride_music_volume", model->ride_music_volume); + writer->WriteString("audio_device", model->Device); + writer->WriteBoolean("master_sound", model->MasterSoundEnabled); + writer->WriteInt32("master_volume", model->MasterVolume); + writer->WriteInt32("title_music", EnumValue(model->TitleMusic)); + writer->WriteBoolean("sound", model->SoundEnabled); + writer->WriteInt32("sound_volume", model->SoundVolume); + writer->WriteBoolean("ride_music", model->RideMusicEnabled); + writer->WriteInt32("ride_music_volume", model->AudioFocus); writer->WriteBoolean("audio_focus", model->audio_focus); } @@ -409,26 +407,26 @@ namespace Config playerName = String::Trim(playerName); auto model = &gConfigNetwork; - model->player_name = std::move(playerName); - model->default_port = reader->GetInt32("default_port", NETWORK_DEFAULT_PORT); - model->listen_address = reader->GetString("listen_address", ""); - model->default_password = reader->GetString("default_password", ""); - model->stay_connected = reader->GetBoolean("stay_connected", true); - model->advertise = reader->GetBoolean("advertise", true); - model->advertise_address = reader->GetString("advertise_address", ""); - model->maxplayers = reader->GetInt32("maxplayers", 16); - model->server_name = reader->GetString("server_name", "Server"); - model->server_description = reader->GetString("server_description", ""); - model->server_greeting = reader->GetString("server_greeting", ""); - model->master_server_url = reader->GetString("master_server_url", ""); - model->provider_name = reader->GetString("provider_name", ""); - model->provider_email = reader->GetString("provider_email", ""); - model->provider_website = reader->GetString("provider_website", ""); - model->known_keys_only = reader->GetBoolean("known_keys_only", false); - model->log_chat = reader->GetBoolean("log_chat", false); - model->log_server_actions = reader->GetBoolean("log_server_actions", false); - model->pause_server_if_no_clients = reader->GetBoolean("pause_server_if_no_clients", false); - model->desync_debugging = reader->GetBoolean("desync_debugging", false); + model->PlayerName = std::move(playerName); + model->DefaultPort = reader->GetInt32("default_port", NETWORK_DEFAULT_PORT); + model->ListenAddress = reader->GetString("listen_address", ""); + model->DefaultPassword = reader->GetString("default_password", ""); + model->StayConnected = reader->GetBoolean("stay_connected", true); + model->Advertise = reader->GetBoolean("advertise", true); + model->AdvertiseAddress = reader->GetString("advertise_address", ""); + model->Maxplayers = reader->GetInt32("maxplayers", 16); + model->ServerName = reader->GetString("server_name", "Server"); + model->ServerDescription = reader->GetString("server_description", ""); + model->ServerGreeting = reader->GetString("server_greeting", ""); + model->MasterServerUrl = reader->GetString("master_server_url", ""); + model->ProviderName = reader->GetString("provider_name", ""); + model->ProviderEmail = reader->GetString("provider_email", ""); + model->ProviderWebsite = reader->GetString("provider_website", ""); + model->KnownKeysOnly = reader->GetBoolean("known_keys_only", false); + model->LogChat = reader->GetBoolean("log_chat", false); + model->LogServerActions = reader->GetBoolean("log_server_actions", false); + model->PauseServerIfNoClients = reader->GetBoolean("pause_server_if_no_clients", false); + model->DesyncDebugging = reader->GetBoolean("desync_debugging", false); } } @@ -436,26 +434,26 @@ namespace Config { auto model = &gConfigNetwork; writer->WriteSection("network"); - writer->WriteString("player_name", model->player_name); - writer->WriteInt32("default_port", model->default_port); - writer->WriteString("listen_address", model->listen_address); - writer->WriteString("default_password", model->default_password); - writer->WriteBoolean("stay_connected", model->stay_connected); - writer->WriteBoolean("advertise", model->advertise); - writer->WriteString("advertise_address", model->advertise_address); - writer->WriteInt32("maxplayers", model->maxplayers); - writer->WriteString("server_name", model->server_name); - writer->WriteString("server_description", model->server_description); - writer->WriteString("server_greeting", model->server_greeting); - writer->WriteString("master_server_url", model->master_server_url); - writer->WriteString("provider_name", model->provider_name); - writer->WriteString("provider_email", model->provider_email); - writer->WriteString("provider_website", model->provider_website); - writer->WriteBoolean("known_keys_only", model->known_keys_only); - writer->WriteBoolean("log_chat", model->log_chat); - writer->WriteBoolean("log_server_actions", model->log_server_actions); - writer->WriteBoolean("pause_server_if_no_clients", model->pause_server_if_no_clients); - writer->WriteBoolean("desync_debugging", model->desync_debugging); + writer->WriteString("player_name", model->PlayerName); + writer->WriteInt32("default_port", model->DefaultPort); + writer->WriteString("listen_address", model->ListenAddress); + writer->WriteString("default_password", model->DefaultPassword); + writer->WriteBoolean("stay_connected", model->StayConnected); + writer->WriteBoolean("advertise", model->Advertise); + writer->WriteString("advertise_address", model->AdvertiseAddress); + writer->WriteInt32("maxplayers", model->Maxplayers); + writer->WriteString("server_name", model->ServerName); + writer->WriteString("server_description", model->ServerDescription); + writer->WriteString("server_greeting", model->ServerGreeting); + writer->WriteString("master_server_url", model->MasterServerUrl); + writer->WriteString("provider_name", model->ProviderName); + writer->WriteString("provider_email", model->ProviderEmail); + writer->WriteString("provider_website", model->ProviderWebsite); + writer->WriteBoolean("known_keys_only", model->KnownKeysOnly); + writer->WriteBoolean("log_chat", model->LogChat); + writer->WriteBoolean("log_server_actions", model->LogServerActions); + writer->WriteBoolean("pause_server_if_no_clients", model->PauseServerIfNoClients); + writer->WriteBoolean("desync_debugging", model->DesyncDebugging); } static void ReadNotifications(IIniReader* reader) @@ -463,24 +461,24 @@ namespace Config if (reader->ReadSection("notifications")) { auto model = &gConfigNotifications; - model->park_award = reader->GetBoolean("park_award", true); - model->park_marketing_campaign_finished = reader->GetBoolean("park_marketing_campaign_finished", true); - model->park_warnings = reader->GetBoolean("park_warnings", true); - model->park_rating_warnings = reader->GetBoolean("park_rating_warnings", true); - model->ride_broken_down = reader->GetBoolean("ride_broken_down", true); - model->ride_crashed = reader->GetBoolean("ride_crashed", true); - model->ride_casualties = reader->GetBoolean("ride_casualties", true); - model->ride_warnings = reader->GetBoolean("ride_warnings", true); - model->ride_researched = reader->GetBoolean("ride_researched", true); - model->ride_stalled_vehicles = reader->GetBoolean("ride_stalled_vehicles", true); - model->guest_warnings = reader->GetBoolean("guest_warnings", true); - model->guest_left_park = reader->GetBoolean("guest_left_park", true); - model->guest_queuing_for_ride = reader->GetBoolean("guest_queuing_for_ride", true); - model->guest_on_ride = reader->GetBoolean("guest_on_ride", true); - model->guest_left_ride = reader->GetBoolean("guest_left_ride", true); - model->guest_bought_item = reader->GetBoolean("guest_bought_item", true); - model->guest_used_facility = reader->GetBoolean("guest_used_facility", true); - model->guest_died = reader->GetBoolean("guest_died", true); + model->ParkAward = reader->GetBoolean("park_award", true); + model->ParkMarketingCampaignFinished = reader->GetBoolean("park_marketing_campaign_finished", true); + model->ParkWarnings = reader->GetBoolean("park_warnings", true); + model->ParkRatingWarnings = reader->GetBoolean("park_rating_warnings", true); + model->RideBrokenDown = reader->GetBoolean("ride_broken_down", true); + model->RideCrashed = reader->GetBoolean("ride_crashed", true); + model->RideCasualties = reader->GetBoolean("ride_casualties", true); + model->RideWarnings = reader->GetBoolean("ride_warnings", true); + model->RideResearched = reader->GetBoolean("ride_researched", true); + model->RideStalledVehicles = reader->GetBoolean("ride_stalled_vehicles", true); + model->GuestWarnings = reader->GetBoolean("guest_warnings", true); + model->GuestLeftPark = reader->GetBoolean("guest_left_park", true); + model->GuestQueuingForRide = reader->GetBoolean("guest_queuing_for_ride", true); + model->GuestOnRide = reader->GetBoolean("guest_on_ride", true); + model->GuestLeftRide = reader->GetBoolean("guest_left_ride", true); + model->GuestBoughtItem = reader->GetBoolean("guest_bought_item", true); + model->GuestUsedFacility = reader->GetBoolean("guest_used_facility", true); + model->GuestDied = reader->GetBoolean("guest_died", true); } } @@ -488,24 +486,24 @@ namespace Config { auto model = &gConfigNotifications; writer->WriteSection("notifications"); - writer->WriteBoolean("park_award", model->park_award); - writer->WriteBoolean("park_marketing_campaign_finished", model->park_marketing_campaign_finished); - writer->WriteBoolean("park_warnings", model->park_warnings); - writer->WriteBoolean("park_rating_warnings", model->park_rating_warnings); - writer->WriteBoolean("ride_broken_down", model->ride_broken_down); - writer->WriteBoolean("ride_crashed", model->ride_crashed); - writer->WriteBoolean("ride_casualties", model->ride_casualties); - writer->WriteBoolean("ride_warnings", model->ride_warnings); - writer->WriteBoolean("ride_researched", model->ride_researched); - writer->WriteBoolean("ride_stalled_vehicles", model->ride_stalled_vehicles); - writer->WriteBoolean("guest_warnings", model->guest_warnings); - writer->WriteBoolean("guest_left_park", model->guest_left_park); - writer->WriteBoolean("guest_queuing_for_ride", model->guest_queuing_for_ride); - writer->WriteBoolean("guest_on_ride", model->guest_on_ride); - writer->WriteBoolean("guest_left_ride", model->guest_left_ride); - writer->WriteBoolean("guest_bought_item", model->guest_bought_item); - writer->WriteBoolean("guest_used_facility", model->guest_used_facility); - writer->WriteBoolean("guest_died", model->guest_died); + writer->WriteBoolean("park_award", model->ParkAward); + writer->WriteBoolean("park_marketing_campaign_finished", model->ParkMarketingCampaignFinished); + writer->WriteBoolean("park_warnings", model->ParkWarnings); + writer->WriteBoolean("park_rating_warnings", model->ParkRatingWarnings); + writer->WriteBoolean("ride_broken_down", model->RideBrokenDown); + writer->WriteBoolean("ride_crashed", model->RideCrashed); + writer->WriteBoolean("ride_casualties", model->RideCasualties); + writer->WriteBoolean("ride_warnings", model->RideWarnings); + writer->WriteBoolean("ride_researched", model->RideResearched); + writer->WriteBoolean("ride_stalled_vehicles", model->RideStalledVehicles); + writer->WriteBoolean("guest_warnings", model->GuestWarnings); + writer->WriteBoolean("guest_left_park", model->GuestLeftPark); + writer->WriteBoolean("guest_queuing_for_ride", model->GuestQueuingForRide); + writer->WriteBoolean("guest_on_ride", model->GuestOnRide); + writer->WriteBoolean("guest_left_ride", model->GuestLeftRide); + writer->WriteBoolean("guest_bought_item", model->GuestBoughtItem); + writer->WriteBoolean("guest_used_facility", model->GuestUsedFacility); + writer->WriteBoolean("guest_died", model->GuestDied); } static void ReadFont(IIniReader* reader) @@ -513,20 +511,20 @@ namespace Config if (reader->ReadSection("font")) { auto model = &gConfigFonts; - model->file_name = reader->GetCString("file_name", nullptr); - model->font_name = reader->GetCString("font_name", nullptr); - model->x_offset = reader->GetInt32("x_offset", false); - model->y_offset = reader->GetInt32("y_offset", true); - model->size_tiny = reader->GetInt32("size_tiny", true); - model->size_small = reader->GetInt32("size_small", false); - model->size_medium = reader->GetInt32("size_medium", false); - model->size_big = reader->GetInt32("size_big", false); - model->height_tiny = reader->GetInt32("height_tiny", false); - model->height_small = reader->GetInt32("height_small", false); - model->height_medium = reader->GetInt32("height_medium", false); - model->height_big = reader->GetInt32("height_big", false); - model->enable_hinting = reader->GetBoolean("enable_hinting", true); - model->hinting_threshold = reader->GetInt32("hinting_threshold", false); + model->FileName = reader->GetCString("file_name", nullptr); + model->FontName = reader->GetCString("font_name", nullptr); + model->OffsetX = reader->GetInt32("x_offset", false); + model->OffsetY = reader->GetInt32("y_offset", true); + model->SizeTiny = reader->GetInt32("size_tiny", true); + model->SizeSmall = reader->GetInt32("size_small", false); + model->SizeMedium = reader->GetInt32("size_medium", false); + model->SizeBig = reader->GetInt32("size_big", false); + model->HeightTiny = reader->GetInt32("height_tiny", false); + model->HeightSmall = reader->GetInt32("height_small", false); + model->HeightMedium = reader->GetInt32("height_medium", false); + model->HeightBig = reader->GetInt32("height_big", false); + model->EnableHinting = reader->GetBoolean("enable_hinting", true); + model->HintingThreshold = reader->GetInt32("hinting_threshold", false); } } @@ -534,20 +532,20 @@ namespace Config { auto model = &gConfigFonts; writer->WriteSection("font"); - writer->WriteString("file_name", model->file_name); - writer->WriteString("font_name", model->font_name); - writer->WriteInt32("x_offset", model->x_offset); - writer->WriteInt32("y_offset", model->y_offset); - writer->WriteInt32("size_tiny", model->size_tiny); - writer->WriteInt32("size_small", model->size_small); - writer->WriteInt32("size_medium", model->size_medium); - writer->WriteInt32("size_big", model->size_big); - writer->WriteInt32("height_tiny", model->height_tiny); - writer->WriteInt32("height_small", model->height_small); - writer->WriteInt32("height_medium", model->height_medium); - writer->WriteInt32("height_big", model->height_big); - writer->WriteBoolean("enable_hinting", model->enable_hinting); - writer->WriteInt32("hinting_threshold", model->hinting_threshold); + writer->WriteString("file_name", model->FileName); + writer->WriteString("font_name", model->FontName); + writer->WriteInt32("x_offset", model->OffsetX); + writer->WriteInt32("y_offset", model->OffsetY); + writer->WriteInt32("size_tiny", model->SizeTiny); + writer->WriteInt32("size_small", model->SizeSmall); + writer->WriteInt32("size_medium", model->SizeMedium); + writer->WriteInt32("size_big", model->SizeBig); + writer->WriteInt32("height_tiny", model->HeightTiny); + writer->WriteInt32("height_small", model->HeightSmall); + writer->WriteInt32("height_medium", model->HeightMedium); + writer->WriteInt32("height_big", model->HeightBig); + writer->WriteBoolean("enable_hinting", model->EnableHinting); + writer->WriteInt32("hinting_threshold", model->HintingThreshold); } static void ReadPlugin(IIniReader* reader) @@ -555,8 +553,8 @@ namespace Config if (reader->ReadSection("plugin")) { auto model = &gConfigPlugin; - model->enable_hot_reloading = reader->GetBoolean("enable_hot_reloading", false); - model->allowed_hosts = reader->GetString("allowed_hosts", ""); + model->EnableHotReloading = reader->GetBoolean("enable_hot_reloading", false); + model->AllowedHosts = reader->GetString("allowed_hosts", ""); } } @@ -564,8 +562,8 @@ namespace Config { auto model = &gConfigPlugin; writer->WriteSection("plugin"); - writer->WriteBoolean("enable_hot_reloading", model->enable_hot_reloading); - writer->WriteString("allowed_hosts", model->allowed_hosts); + writer->WriteBoolean("enable_hot_reloading", model->EnableHotReloading); + writer->WriteString("allowed_hosts", model->AllowedHosts); } static bool SetDefaults() @@ -775,20 +773,20 @@ NotificationConfiguration gConfigNotifications; FontConfiguration gConfigFonts; PluginConfiguration gConfigPlugin; -void config_set_defaults() +void ConfigSetDefaults() { - config_release(); + ConfigRelease(); Config::SetDefaults(); } -bool config_open(u8string_view path) +bool ConfigOpen(u8string_view path) { if (!File::Exists(path)) { return false; } - config_release(); + ConfigRelease(); auto result = Config::ReadFile(path); if (result) { @@ -797,38 +795,38 @@ bool config_open(u8string_view path) return result; } -bool config_save(u8string_view path) +bool ConfigSave(u8string_view path) { return Config::WriteFile(path); } -void config_release() +void ConfigRelease() { - SafeFree(gConfigGeneral.custom_currency_symbol); - SafeFree(gConfigInterface.current_theme_preset); - SafeFree(gConfigInterface.current_title_sequence_preset); - SafeFree(gConfigFonts.file_name); - SafeFree(gConfigFonts.font_name); + SafeFree(gConfigGeneral.CustomCurrencySymbol); + SafeFree(gConfigInterface.CurrentThemePreset); + SafeFree(gConfigInterface.CurrentTitleSequencePreset); + SafeFree(gConfigFonts.FileName); + SafeFree(gConfigFonts.FontName); } -u8string config_get_default_path() +u8string ConfigGetDefaultPath() { auto env = GetContext()->GetPlatformEnvironment(); return Path::Combine(env->GetDirectoryPath(DIRBASE::USER), u8"config.ini"); } -bool config_save_default() +bool ConfigSaveDefault() { - auto path = config_get_default_path(); - return config_save(path); + auto path = ConfigGetDefaultPath(); + return ConfigSave(path); } -bool config_find_or_browse_install_directory() +bool ConfigFindOrBrowseInstallDirectory() { std::string path = Config::FindRCT2Path(); if (!path.empty()) { - gConfigGeneral.rct2_path = path; + gConfigGeneral.RCT2Path = path; } else { @@ -919,7 +917,7 @@ bool config_find_or_browse_install_directory() { return false; } - gConfigGeneral.rct2_path = installPath; + gConfigGeneral.RCT2Path = installPath; if (Platform::OriginalGameDataExists(installPath)) { @@ -939,7 +937,7 @@ bool config_find_or_browse_install_directory() std::string rct1Path = Config::FindRCT1Path(); if (!rct1Path.empty()) { - gConfigGeneral.rct1_path = std::move(rct1Path); + gConfigGeneral.RCT1Path = std::move(rct1Path); } return true; diff --git a/src/openrct2/config/Config.h b/src/openrct2/config/Config.h index f1cfdfd7ac..618b6d8470 100644 --- a/src/openrct2/config/Config.h +++ b/src/openrct2/config/Config.h @@ -27,198 +27,197 @@ enum class TitleMusicKind : int32_t; struct GeneralConfiguration { // Paths - u8string rct1_path; - u8string rct2_path; + u8string RCT1Path; + u8string RCT2Path; // Display - int32_t default_display; - int32_t window_width; - int32_t window_height; - int32_t fullscreen_mode; - int32_t fullscreen_width; - int32_t fullscreen_height; - float window_scale; - DrawingEngine drawing_engine; - bool uncap_fps; - bool use_vsync; - bool show_fps; - bool multithreading; - bool minimize_fullscreen_focus_loss; - bool disable_screensaver; + int32_t DefaultDisplay; + int32_t WindowWidth; + int32_t WindowHeight; + int32_t FullscreenMode; + int32_t FullscreenWidth; + int32_t FullscreenHeight; + float WindowScale; + ::DrawingEngine DrawingEngine; + bool UncapFPS; + bool UseVSync; + bool ShowFPS; + bool MultiThreading; + bool MinimizeFullscreenFocusLoss; + bool DisableScreensaver; // Map rendering - bool landscape_smoothing; - bool always_show_gridlines; - VirtualFloorStyles virtual_floor_style; - bool day_night_cycle; - bool enable_light_fx; - bool enable_light_fx_for_vehicles; - bool upper_case_banners; - bool render_weather_effects; - bool render_weather_gloom; - bool disable_lightning_effect; - bool show_guest_purchases; - bool transparent_screenshot; - bool transparent_water; + bool LandscapeSmoothing; + bool AlwaysShowGridlines; + VirtualFloorStyles VirtualFloorStyle; + bool DayNightCycle; + bool EnableLightFx; + bool EnableLightFxForVehicles; + bool UpperCaseBanners; + bool RenderWeatherEffects; + bool RenderWeatherGloom; + bool DisableLightningEffect; + bool ShowGuestPurchases; + bool TransparentScreenshot; + bool TransparentWater; - bool invisible_rides; - bool invisible_vehicles; - bool invisible_trees; - bool invisible_scenery; - bool invisible_paths; - bool invisible_supports; + bool InvisibleRides; + bool InvisibleVehicles; + bool InvisibleTrees; + bool InvisibleScenery; + bool InvisiblePaths; + bool InvisibleSupports; // Localisation - int32_t language; - MeasurementFormat measurement_format; - TemperatureUnit temperature_format; - bool show_height_as_units; - int32_t date_format; - CurrencyType currency_format; - int32_t custom_currency_rate; - CurrencyAffix custom_currency_affix; - utf8* custom_currency_symbol; + int32_t Language; + ::MeasurementFormat MeasurementFormat; + TemperatureUnit TemperatureFormat; + bool ShowHeightAsUnits; + int32_t DateFormat; + CurrencyType CurrencyFormat; + int32_t CustomCurrencyRate; + CurrencyAffix CustomCurrencyAffix; + utf8* CustomCurrencySymbol; // Controls - bool edge_scrolling; - int32_t edge_scrolling_speed; - bool trap_cursor; - bool invert_viewport_drag; - bool zoom_to_cursor; + bool EdgeScrolling; + int32_t EdgeScrollingSpeed; + bool TrapCursor; + bool InvertViewportDrag; + bool ZoomToCursor; // Miscellaneous - bool play_intro; - int32_t window_snap_proximity; - bool allow_loading_with_incorrect_checksum; - bool save_plugin_data; - bool debugging_tools; - int32_t autosave_frequency; - int32_t autosave_amount; - bool auto_staff_placement; - bool handymen_mow_default; - bool auto_open_shops; - int32_t default_inspection_interval; - int32_t window_limit; - int32_t scenario_select_mode; - bool scenario_unlocking_enabled; - bool scenario_hide_mega_park; - bool steam_overlay_pause; - bool show_real_names_of_guests; - bool allow_early_completion; - u8string asset_pack_order; - u8string enabled_asset_packs; + bool PlayIntro; + int32_t WindowSnapProximity; + bool SavePluginData; + bool DebuggingTools; + int32_t AutosaveFrequency; + int32_t AutosaveAmount; + bool AutoStaffPlacement; + bool HandymenMowByDefault; + bool AutoOpenShops; + int32_t DefaultInspectionInterval; + int32_t WindowLimit; + int32_t ScenarioSelectMode; + bool ScenarioUnlockingEnabled; + bool ScenarioHideMegaPark; + bool SteamOverlayPause; + bool ShowRealNamesOfGuests; + bool AllowEarlyCompletion; + u8string AssetPackOrder; + u8string EnabledAssetPacks; // Loading and saving - bool confirmation_prompt; - Sort load_save_sort; - u8string last_save_game_directory; - u8string last_save_landscape_directory; - u8string last_save_scenario_directory; - u8string last_save_track_directory; - u8string last_run_version; - bool use_native_browse_dialog; - int64_t last_version_check_time; + bool ConfirmationPrompt; + Sort LoadSaveSort; + u8string LastSaveGameDirectory; + u8string LastSaveLandscapeDirectory; + u8string LastSaveScenarioDirectory; + u8string LastSaveTrackDirectory; + u8string LastRunVersion; + bool UseNativeBrowseDialog; + int64_t LastVersionCheckTime; }; struct InterfaceConfiguration { - bool toolbar_show_finances; - bool toolbar_show_research; - bool toolbar_show_cheats; - bool toolbar_show_news; - bool toolbar_show_mute; - bool toolbar_show_chat; - bool toolbar_show_zoom; - bool console_small_font; - bool random_title_sequence; - utf8* current_theme_preset; - utf8* current_title_sequence_preset; - int32_t object_selection_filter_flags; - int32_t scenarioselect_last_tab; - bool list_ride_vehicles_separately; + bool ToolbarShowFinances; + bool ToolbarShowResearch; + bool ToolbarShowCheats; + bool ToolbarShowNews; + bool ToolbarShowMute; + bool ToolbarShowChat; + bool ToolbarShowZoom; + bool ConsoleSmallFont; + bool RandomTitleSequence; + utf8* CurrentThemePreset; + utf8* CurrentTitleSequencePreset; + int32_t ObjectSelectionFilterFlags; + int32_t ScenarioselectLastTab; + bool ListRideVehiclesSeparately; }; struct SoundConfiguration { - std::string device; - bool master_sound_enabled; - uint8_t master_volume; - TitleMusicKind title_music; - bool sound_enabled; - uint8_t sound_volume; - bool ride_music_enabled; - uint8_t ride_music_volume; + std::string Device; + bool MasterSoundEnabled; + uint8_t MasterVolume; + TitleMusicKind TitleMusic; + bool SoundEnabled; + uint8_t SoundVolume; + bool RideMusicEnabled; + uint8_t AudioFocus; bool audio_focus; }; struct NetworkConfiguration { - std::string player_name; - int32_t default_port; - std::string listen_address; - std::string default_password; - bool stay_connected; - bool advertise; - std::string advertise_address; - int32_t maxplayers; - std::string server_name; - std::string server_description; - std::string server_greeting; - std::string master_server_url; - std::string provider_name; - std::string provider_email; - std::string provider_website; - bool known_keys_only; - bool log_chat; - bool log_server_actions; - bool pause_server_if_no_clients; - bool desync_debugging; + std::string PlayerName; + int32_t DefaultPort; + std::string ListenAddress; + std::string DefaultPassword; + bool StayConnected; + bool Advertise; + std::string AdvertiseAddress; + int32_t Maxplayers; + std::string ServerName; + std::string ServerDescription; + std::string ServerGreeting; + std::string MasterServerUrl; + std::string ProviderName; + std::string ProviderEmail; + std::string ProviderWebsite; + bool KnownKeysOnly; + bool LogChat; + bool LogServerActions; + bool PauseServerIfNoClients; + bool DesyncDebugging; }; struct NotificationConfiguration { - bool park_award; - bool park_marketing_campaign_finished; - bool park_warnings; - bool park_rating_warnings; - bool ride_broken_down; - bool ride_crashed; - bool ride_casualties; - bool ride_warnings; - bool ride_researched; - bool ride_stalled_vehicles; - bool guest_warnings; - bool guest_left_park; - bool guest_queuing_for_ride; - bool guest_on_ride; - bool guest_left_ride; - bool guest_bought_item; - bool guest_used_facility; - bool guest_died; + bool ParkAward; + bool ParkMarketingCampaignFinished; + bool ParkWarnings; + bool ParkRatingWarnings; + bool RideBrokenDown; + bool RideCrashed; + bool RideCasualties; + bool RideWarnings; + bool RideResearched; + bool RideStalledVehicles; + bool GuestWarnings; + bool GuestLeftPark; + bool GuestQueuingForRide; + bool GuestOnRide; + bool GuestLeftRide; + bool GuestBoughtItem; + bool GuestUsedFacility; + bool GuestDied; }; struct FontConfiguration { - utf8* file_name; - utf8* font_name; - int32_t x_offset; - int32_t y_offset; - int32_t size_tiny; - int32_t size_small; - int32_t size_medium; - int32_t size_big; - int32_t height_tiny; - int32_t height_small; - int32_t height_medium; - int32_t height_big; - bool enable_hinting; - int32_t hinting_threshold; + utf8* FileName; + utf8* FontName; + int32_t OffsetX; + int32_t OffsetY; + int32_t SizeTiny; + int32_t SizeSmall; + int32_t SizeMedium; + int32_t SizeBig; + int32_t HeightTiny; + int32_t HeightSmall; + int32_t HeightMedium; + int32_t HeightBig; + bool EnableHinting; + int32_t HintingThreshold; }; struct PluginConfiguration { - bool enable_hot_reloading; - std::string allowed_hosts; + bool EnableHotReloading; + std::string AllowedHosts; }; enum class Sort : int32_t @@ -265,13 +264,13 @@ extern NotificationConfiguration gConfigNotifications; extern FontConfiguration gConfigFonts; extern PluginConfiguration gConfigPlugin; -bool config_open(u8string_view path); -bool config_save(u8string_view path); -u8string config_get_default_path(); -void config_set_defaults(); -void config_release(); -bool config_save_default(); -bool config_find_or_browse_install_directory(); +bool ConfigOpen(u8string_view path); +bool ConfigSave(u8string_view path); +u8string ConfigGetDefaultPath(); +void ConfigSetDefaults(); +void ConfigRelease(); +bool ConfigSaveDefault(); +bool ConfigFindOrBrowseInstallDirectory(); bool RCT1DataPresentAtLocation(u8string_view path); std::string FindCsg1datAtLocation(u8string_view path); diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index df91368b39..d12b9d44c0 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -455,13 +455,13 @@ template<> struct DataSerializerTraits_t stream->WriteValue(tileElement.base_height); stream->WriteValue(tileElement.clearance_height); stream->WriteValue(tileElement.owner); - for (int i = 0; i < 3; ++i) + for (auto v : tileElement.pad_05) { - stream->WriteValue(tileElement.pad_05[i]); + stream->WriteValue(v); } - for (int i = 0; i < 8; ++i) + for (auto v : tileElement.pad_08) { - stream->WriteValue(tileElement.pad_08[i]); + stream->WriteValue(v); } } static void decode(OpenRCT2::IStream* stream, TileElement& tileElement) @@ -471,13 +471,13 @@ template<> struct DataSerializerTraits_t tileElement.base_height = stream->ReadValue(); tileElement.clearance_height = stream->ReadValue(); tileElement.owner = stream->ReadValue(); - for (int i = 0; i < 3; ++i) + for (auto& v : tileElement.pad_05) { - tileElement.pad_05[i] = stream->ReadValue(); + v = stream->ReadValue(); } - for (int i = 0; i < 8; ++i) + for (auto& v : tileElement.pad_08) { - tileElement.pad_08[i] = stream->ReadValue(); + v = stream->ReadValue(); } } static void log(OpenRCT2::IStream* stream, const TileElement& tileElement) diff --git a/src/openrct2/core/FileScanner.cpp b/src/openrct2/core/FileScanner.cpp index 37c03acb43..e700714153 100644 --- a/src/openrct2/core/FileScanner.cpp +++ b/src/openrct2/core/FileScanner.cpp @@ -254,8 +254,8 @@ private: else { result.Type = DIRECTORY_CHILD_TYPE::DC_FILE; - result.Size = (static_cast(child->nFileSizeHigh) << 32ULL) | static_cast(child->nFileSizeLow); - result.LastModified = (static_cast(child->ftLastWriteTime.dwHighDateTime) << 32ULL) + result.Size = (static_cast(child->nFileSizeHigh) << 32uLL) | static_cast(child->nFileSizeLow); + result.LastModified = (static_cast(child->ftLastWriteTime.dwHighDateTime) << 32uLL) | static_cast(child->ftLastWriteTime.dwLowDateTime); } return result; diff --git a/src/openrct2/core/FileWatcher.cpp b/src/openrct2/core/FileWatcher.cpp index 7943d103ed..c38a0263cb 100644 --- a/src/openrct2/core/FileWatcher.cpp +++ b/src/openrct2/core/FileWatcher.cpp @@ -20,6 +20,7 @@ # include #endif +#include "../core/Path.hpp" #include "../core/String.hpp" #include "FileSystem.hpp" #include "FileWatcher.h" @@ -81,20 +82,20 @@ FileWatcher::WatchDescriptor::~WatchDescriptor() } #endif -FileWatcher::FileWatcher(const std::string& directoryPath) +FileWatcher::FileWatcher(u8string_view directoryPath) { #ifdef _WIN32 - _path = directoryPath; - _directoryHandle = CreateFileA( - directoryPath.c_str(), FILE_LIST_DIRECTORY, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, - nullptr); + _path = fs::u8path(directoryPath); + _directoryHandle = CreateFileW( + String::ToWideChar(directoryPath).c_str(), FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr); if (_directoryHandle == INVALID_HANDLE_VALUE) { - throw std::runtime_error("Unable to open directory '" + directoryPath + "'"); + throw std::runtime_error("Unable to open directory '" + u8string(directoryPath) + "'"); } #elif defined(__linux__) _fileDesc.Initialise(); - _watchDescs.emplace_back(_fileDesc.Fd, directoryPath); + _watchDescs.emplace_back(_fileDesc.Fd, u8string(directoryPath)); for (auto& p : fs::recursive_directory_iterator(directoryPath)) { if (p.status().type() == fs::file_type::directory) @@ -105,21 +106,22 @@ FileWatcher::FileWatcher(const std::string& directoryPath) #else throw std::runtime_error("FileWatcher not supported on this platform."); #endif - _watchThread = std::thread(std::bind(&FileWatcher::WatchDirectory, this)); + _watchThread = std::thread(&FileWatcher::WatchDirectory, this); } FileWatcher::~FileWatcher() { #ifdef _WIN32 CancelIoEx(_directoryHandle, nullptr); + _watchThread.join(); CloseHandle(_directoryHandle); #elif defined(__linux__) _finished = true; + _watchThread.join(); _fileDesc.Close(); #else return; #endif - _watchThread.join(); } void FileWatcher::WatchDirectory() @@ -131,8 +133,7 @@ void FileWatcher::WatchDirectory() _directoryHandle, eventData.data(), static_cast(eventData.size()), TRUE, FILE_NOTIFY_CHANGE_LAST_WRITE, &bytesReturned, nullptr, nullptr)) { - auto onFileChanged = OnFileChanged; - if (onFileChanged) + if (bytesReturned != 0 && OnFileChanged) { FILE_NOTIFY_INFORMATION* notifyInfo; size_t offset = 0; @@ -141,10 +142,9 @@ void FileWatcher::WatchDirectory() notifyInfo = reinterpret_cast(eventData.data() + offset); offset += notifyInfo->NextEntryOffset; - std::wstring fileNameW(notifyInfo->FileName, notifyInfo->FileNameLength / sizeof(wchar_t)); - auto fileName = String::ToUtf8(fileNameW); - auto path = fs::path(_path) / fs::path(fileName); - onFileChanged(path.u8string()); + std::wstring_view fileNameW(notifyInfo->FileName, notifyInfo->FileNameLength / sizeof(wchar_t)); + auto path = _path / fs::path(fileNameW); + OnFileChanged(path.u8string()); } while (notifyInfo->NextEntryOffset != 0); } } @@ -175,9 +175,7 @@ void FileWatcher::WatchDirectory() [wd](const WatchDescriptor& watchDesc) { return wd == watchDesc.Wd; }); if (findResult != _watchDescs.end()) { - auto directory = findResult->Path; - auto path = fs::path(directory) / fs::path(e->name); - onFileChanged(path); + onFileChanged(Path::Combine(findResult->Path, e->name)); } } offset += sizeof(inotify_event) + e->len; diff --git a/src/openrct2/core/FileWatcher.h b/src/openrct2/core/FileWatcher.h index 17f1e9f3c1..8fcc0f5a2c 100644 --- a/src/openrct2/core/FileWatcher.h +++ b/src/openrct2/core/FileWatcher.h @@ -9,12 +9,16 @@ #pragma once +#include "String.hpp" + #include #include #include #include #ifdef _WIN32 +# include "FileSystem.hpp" + typedef void* HANDLE; #endif @@ -26,7 +30,7 @@ class FileWatcher private: std::thread _watchThread; #if defined(_WIN32) - std::string _path; + fs::path _path; HANDLE _directoryHandle{}; #elif defined(__linux__) struct FileDescriptor @@ -53,9 +57,9 @@ private: #endif public: - std::function OnFileChanged; + std::function OnFileChanged; - FileWatcher(const std::string& directoryPath); + FileWatcher(u8string_view directoryPath); ~FileWatcher(); private: diff --git a/src/openrct2/core/Guard.cpp b/src/openrct2/core/Guard.cpp index 8a48f0f1ea..fdeefaf688 100644 --- a/src/openrct2/core/Guard.cpp +++ b/src/openrct2/core/Guard.cpp @@ -48,7 +48,7 @@ namespace Guard static std::optional _lastAssertMessage = std::nullopt; #ifdef _WIN32 - [[nodiscard]] static std::string CreateDialogAssertMessage(std::string_view); + [[nodiscard]] static std::wstring CreateDialogAssertMessage(std::string_view); static void ForceCrash(); #endif @@ -104,7 +104,8 @@ namespace Guard { // Show message box if we are not building for testing auto buffer = CreateDialogAssertMessage(formattedMessage); - int32_t result = MessageBoxA(nullptr, buffer.c_str(), OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); + int32_t result = MessageBoxW( + nullptr, buffer.c_str(), L"" OPENRCT2_NAME, MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION); if (result == IDABORT) { ForceCrash(); @@ -134,19 +135,19 @@ namespace Guard } #ifdef _WIN32 - [[nodiscard]] static std::string CreateDialogAssertMessage(std::string_view formattedMessage) + [[nodiscard]] static std::wstring CreateDialogAssertMessage(std::string_view formattedMessage) { StringBuilder sb; sb.Append(ASSERTION_MESSAGE); - sb.Append("\r\n\r\n"); + sb.Append("\n\n"); sb.Append("Version: "); sb.Append(gVersionInfoFull); if (!formattedMessage.empty()) { - sb.Append("\r\n"); + sb.Append("\n"); sb.Append(formattedMessage); } - return sb.GetStdString(); + return String::ToWideChar({ sb.GetBuffer(), sb.GetLength() }); } static void ForceCrash() diff --git a/src/openrct2/core/JobPool.cpp b/src/openrct2/core/JobPool.cpp index 0de50a504c..ad848dccff 100644 --- a/src/openrct2/core/JobPool.cpp +++ b/src/openrct2/core/JobPool.cpp @@ -92,6 +92,7 @@ void JobPool::Join(std::function reportFn) size_t JobPool::CountPending() { + unique_lock lock(_mutex); return _pending.size(); } diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index c4cc083271..f063af8d34 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -324,14 +324,14 @@ bool gfx_load_csg() { log_verbose("gfx_load_csg()"); - if (gConfigGeneral.rct1_path.empty()) + if (gConfigGeneral.RCT1Path.empty()) { log_verbose(" unable to load CSG, RCT1 path not set"); return false; } - auto pathHeaderPath = FindCsg1idatAtLocation(gConfigGeneral.rct1_path); - auto pathDataPath = FindCsg1datAtLocation(gConfigGeneral.rct1_path); + auto pathHeaderPath = FindCsg1idatAtLocation(gConfigGeneral.RCT1Path); + auto pathDataPath = FindCsg1datAtLocation(gConfigGeneral.RCT1Path); try { auto fileHeader = FileStream(pathHeaderPath, FILE_MODE_OPEN); @@ -444,7 +444,7 @@ static std::optional FASTCALL gfx_draw_sprite_get_palette(ImageId im return paletteMap; } -void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId& imageId, const ScreenCoordsXY& spriteCoords) +void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords) { if (imageId.HasValue()) { @@ -467,7 +467,7 @@ void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId& im * y (dx) */ void FASTCALL gfx_draw_sprite_palette_set_software( - rct_drawpixelinfo* dpi, const ImageId& imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap) + rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap) { int32_t x = coords.x; int32_t y = coords.y; @@ -639,7 +639,7 @@ void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& * rct2: 0x00681DE2 */ void FASTCALL gfx_draw_sprite_raw_masked_software( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId& maskImage, const ImageId& colourImage) + rct_drawpixelinfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId maskImage, const ImageId colourImage) { int32_t left, top, right, bottom, width, height; auto imgMask = gfx_get_g1_element(maskImage); @@ -692,7 +692,7 @@ void FASTCALL gfx_draw_sprite_raw_masked_software( mask_fn(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap); } -const rct_g1_element* gfx_get_g1_element(const ImageId& imageId) +const rct_g1_element* gfx_get_g1_element(const ImageId imageId) { return gfx_get_g1_element(imageId.GetIndex()); } @@ -815,18 +815,6 @@ bool is_csg_loaded() return _csgLoaded; } -rct_size16 FASTCALL gfx_get_sprite_size(uint32_t image_id) -{ - const rct_g1_element* g1 = gfx_get_g1_element(image_id & 0X7FFFF); - rct_size16 size = {}; - if (g1 != nullptr) - { - size.width = g1->width; - size.height = g1->height; - } - return size; -} - size_t g1_calculate_data_size(const rct_g1_element* g1) { if (g1->flags & G1_FLAG_PALETTE) diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 919aa18658..b5c79288b8 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -40,13 +40,13 @@ enum : uint32_t TEXT_DRAW_FLAG_NO_DRAW = 1u << 31 }; -static int32_t ttf_get_string_width(std::string_view text, FontSpriteBase fontSpriteBase, bool noFormatting); +static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle, bool noFormatting); /** * * rct2: 0x006C23B1 */ -int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fontSpriteBase) +int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyle) { thread_local std::string buffer; buffer.clear(); @@ -57,7 +57,7 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fon { if (token.kind == FormatToken::Newline || token.kind == FormatToken::NewlineSmall) { - auto width = gfx_get_string_width(buffer, fontSpriteBase); + auto width = gfx_get_string_width(buffer, fontStyle); if (!maxWidth.has_value() || maxWidth.value() > width) { maxWidth = width; @@ -71,7 +71,7 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fon } if (!maxWidth.has_value()) { - maxWidth = gfx_get_string_width(buffer, fontSpriteBase); + maxWidth = gfx_get_string_width(buffer, fontStyle); } return maxWidth.value(); } @@ -82,14 +82,14 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fon * rct2: 0x006C2321 * buffer (esi) */ -int32_t gfx_get_string_width(std::string_view text, FontSpriteBase fontSpriteBase) +int32_t gfx_get_string_width(std::string_view text, FontStyle fontStyle) { - return ttf_get_string_width(text, fontSpriteBase, false); + return ttf_get_string_width(text, fontStyle, false); } -int32_t gfx_get_string_width_no_formatting(std::string_view text, FontSpriteBase fontSpriteBase) +int32_t gfx_get_string_width_no_formatting(std::string_view text, FontStyle fontStyle) { - return ttf_get_string_width(text, fontSpriteBase, true); + return ttf_get_string_width(text, fontStyle, true); } /** @@ -99,7 +99,7 @@ int32_t gfx_get_string_width_no_formatting(std::string_view text, FontSpriteBase * buffer (esi) * width (edi) */ -int32_t gfx_clip_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase) +int32_t gfx_clip_string(utf8* text, int32_t width, FontStyle fontStyle) { if (width < 6) { @@ -108,7 +108,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase } // If width of the full string is less than allowed width then we don't need to clip - auto clippedWidth = gfx_get_string_width(text, fontSpriteBase); + auto clippedWidth = gfx_get_string_width(text, fontStyle); if (clippedWidth <= width) { return clippedWidth; @@ -130,7 +130,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase // Add the ellipsis before checking the width buffer.append("..."); - auto currentWidth = gfx_get_string_width(buffer, fontSpriteBase); + auto currentWidth = gfx_get_string_width(buffer, fontStyle); if (currentWidth < width) { bestLength = buffer.size(); @@ -158,7 +158,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase buffer.append(cb); } } - return gfx_get_string_width(text, fontSpriteBase); + return gfx_get_string_width(text, fontStyle); } /** @@ -174,7 +174,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase * num_lines (edi) - out * font_height (ebx) - out */ -int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase, int32_t* outNumLines) +int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t* outNumLines) { constexpr size_t NULL_INDEX = std::numeric_limits::max(); thread_local std::string buffer; @@ -198,7 +198,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase utf8_write_codepoint(cb, codepoint); buffer.append(cb); - auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontSpriteBase); + auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle); if (lineWidth <= width || (splitIndex == NULL_INDEX && bestSplitIndex == NULL_INDEX)) { if (codepoint == ' ') @@ -222,7 +222,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase buffer.insert(buffer.begin() + splitIndex, '\0'); // Recalculate the line length after splitting - lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontSpriteBase); + lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle); maxWidth = std::max(maxWidth, lineWidth); numLines++; @@ -242,7 +242,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase { buffer.push_back('\0'); - auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontSpriteBase); + auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle); maxWidth = std::max(maxWidth, lineWidth); numLines++; @@ -257,7 +257,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase } { // Final line width calculation - auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontSpriteBase); + auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle); maxWidth = std::max(maxWidth, lineWidth); } @@ -272,10 +272,11 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontSpriteBase fontSpriteBase void gfx_draw_string_left_centred( rct_drawpixelinfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords) { - char* buffer = gCommonStringFormatBuffer; - format_string(buffer, 256, format, args); - int32_t height = string_get_height_raw(buffer, FontSpriteBase::MEDIUM); - gfx_draw_string(dpi, coords - ScreenCoordsXY{ 0, (height / 2) }, buffer, { colour }); + char buffer[CommonTextBufferSize]; + auto bufferPtr = buffer; + format_string(bufferPtr, sizeof(buffer), format, args); + int32_t height = string_get_height_raw(bufferPtr, FontStyle::Medium); + gfx_draw_string(dpi, coords - ScreenCoordsXY{ 0, (height / 2) }, bufferPtr, { colour }); } /** @@ -334,16 +335,16 @@ static void colour_char_window(uint8_t colour, const uint16_t* current_font_flag * dpi : edi */ void draw_string_centred_raw( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontSpriteBase fontSpriteBase) + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontStyle fontStyle) { ScreenCoordsXY screenCoords(dpi->x, dpi->y); - gfx_draw_string(dpi, screenCoords, "", { COLOUR_BLACK, fontSpriteBase }); + gfx_draw_string(dpi, screenCoords, "", { COLOUR_BLACK, fontStyle }); screenCoords = coords; for (int32_t i = 0; i <= numLines; i++) { - int32_t width = gfx_get_string_width(text, fontSpriteBase); - gfx_draw_string(dpi, screenCoords - ScreenCoordsXY{ width / 2, 0 }, text, { TEXT_COLOUR_254, fontSpriteBase }); + int32_t width = gfx_get_string_width(text, fontStyle); + gfx_draw_string(dpi, screenCoords - ScreenCoordsXY{ width / 2, 0 }, text, { TEXT_COLOUR_254, fontStyle }); const utf8* ch = text; const utf8* nextCh = nullptr; @@ -354,16 +355,16 @@ void draw_string_centred_raw( } text = const_cast(ch + 1); - screenCoords.y += font_get_line_height(fontSpriteBase); + screenCoords.y += font_get_line_height(fontStyle); } } -int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) +int32_t string_get_height_raw(std::string_view text, FontStyle fontStyle) { int32_t height = 0; - if (fontBase <= FontSpriteBase::MEDIUM) + if (fontStyle <= FontStyle::Medium) height += 10; - else if (fontBase == FontSpriteBase::TINY) + else if (fontStyle == FontStyle::Tiny) height += 6; FmtString fmt(text); @@ -372,13 +373,13 @@ int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) switch (token.kind) { case FormatToken::Newline: - if (fontBase == FontSpriteBase::SMALL || fontBase == FontSpriteBase::MEDIUM) + if (fontStyle == FontStyle::Small || fontStyle == FontStyle::Medium) { height += 10; break; } - if (fontBase == FontSpriteBase::TINY) + if (fontStyle == FontStyle::Tiny) { height += 6; break; @@ -386,13 +387,13 @@ int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) height += 18; break; case FormatToken::NewlineSmall: - if (fontBase == FontSpriteBase::SMALL || fontBase == FontSpriteBase::MEDIUM) + if (fontStyle == FontStyle::Small || fontStyle == FontStyle::Medium) { height += 5; break; } - if (fontBase == FontSpriteBase::TINY) + if (fontStyle == FontStyle::Tiny) { height += 3; break; @@ -400,13 +401,13 @@ int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase) height += 9; break; case FormatToken::FontTiny: - fontBase = FontSpriteBase::TINY; + fontStyle = FontStyle::Tiny; break; case FormatToken::FontMedium: - fontBase = FontSpriteBase::MEDIUM; + fontStyle = FontStyle::Medium; break; case FormatToken::FontSmall: - fontBase = FontSpriteBase::SMALL; + fontStyle = FontStyle::Small; break; default: break; @@ -439,8 +440,8 @@ void DrawNewsTicker( gfx_draw_string(dpi, screenCoords, "", { colour }); format_string(buffer, 256, format, args); - gfx_wrap_string(buffer, width, FontSpriteBase::SMALL, &numLines); - lineHeight = font_get_line_height(FontSpriteBase::SMALL); + gfx_wrap_string(buffer, width, FontStyle::Small, &numLines); + lineHeight = font_get_line_height(FontStyle::Small); int32_t numCharactersDrawn = 0; int32_t numCharactersToDraw = ticks; @@ -448,7 +449,7 @@ void DrawNewsTicker( lineY = coords.y - ((numLines * lineHeight) / 2); for (int32_t line = 0; line <= numLines; line++) { - int32_t halfWidth = gfx_get_string_width(buffer, FontSpriteBase::SMALL) / 2; + int32_t halfWidth = gfx_get_string_width(buffer, FontStyle::Small) / 2; FmtString fmt(buffer); for (const auto& token : fmt) @@ -474,7 +475,7 @@ void DrawNewsTicker( } screenCoords = { coords.x - halfWidth, lineY }; - gfx_draw_string(dpi, screenCoords, buffer, { TEXT_COLOUR_254, FontSpriteBase::SMALL }); + gfx_draw_string(dpi, screenCoords, buffer, { TEXT_COLOUR_254, FontStyle::Small }); if (numCharactersDrawn > numCharactersToDraw) { @@ -496,14 +497,14 @@ struct text_draw_info int32_t maxY; int32_t flags; uint8_t palette[8]; - FontSpriteBase font_sprite_base; + ::FontStyle FontStyle; const int8_t* y_offset; }; static void ttf_draw_character_sprite(rct_drawpixelinfo* dpi, int32_t codepoint, text_draw_info* info) { - int32_t characterWidth = font_sprite_get_codepoint_width(info->font_sprite_base, codepoint); - int32_t sprite = font_sprite_get_codepoint_sprite(info->font_sprite_base, codepoint); + int32_t characterWidth = font_sprite_get_codepoint_width(info->FontStyle, codepoint); + auto sprite = font_sprite_get_codepoint_sprite(info->FontStyle, codepoint); if (!(info->flags & TEXT_DRAW_FLAG_NO_DRAW)) { @@ -537,7 +538,7 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex if (!ttf_initialise()) return; - TTFFontDescriptor* fontDesc = ttf_get_font_from_sprite_base(info->font_sprite_base); + TTFFontDescriptor* fontDesc = ttf_get_font_from_sprite_base(info->FontStyle); if (fontDesc->font == nullptr) { ttf_draw_string_raw_sprite(dpi, text, info); @@ -666,7 +667,7 @@ static void ttf_draw_string_raw_ttf(rct_drawpixelinfo* dpi, std::string_view tex dst = dst_orig; src = src_orig; - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold > 0; + bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold > 0; for (int32_t yy = 0; yy < height; yy++) { for (int32_t xx = 0; xx < width; xx++) @@ -717,20 +718,20 @@ static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::tok break; case FormatToken::Newline: info->x = info->startX; - info->y += font_get_line_height(info->font_sprite_base); + info->y += font_get_line_height(info->FontStyle); break; case FormatToken::NewlineSmall: info->x = info->startX; - info->y += font_get_line_height_small(info->font_sprite_base); + info->y += font_get_line_height_small(info->FontStyle); break; case FormatToken::FontTiny: - info->font_sprite_base = FontSpriteBase::TINY; + info->FontStyle = FontStyle::Tiny; break; case FormatToken::FontSmall: - info->font_sprite_base = FontSpriteBase::SMALL; + info->FontStyle = FontStyle::Small; break; case FormatToken::FontMedium: - info->font_sprite_base = FontSpriteBase::MEDIUM; + info->FontStyle = FontStyle::Medium; break; case FormatToken::OutlineEnable: info->flags |= TEXT_DRAW_FLAG_OUTLINE; @@ -828,7 +829,7 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view else { CodepointView codepoints(text); - std::optional ttfRunIndex; + std::optional ttfRunIndex{}; for (auto it = codepoints.begin(); it != codepoints.end(); it++) { auto codepoint = *it; @@ -837,8 +838,18 @@ static void ttf_process_string_literal(rct_drawpixelinfo* dpi, std::string_view if (ttfRunIndex.has_value()) { // Draw the TTF run + // This error suppression abomination is here to suppress https://github.com/OpenRCT2/OpenRCT2/issues/17371. + // Additionally, we have to suppress the error for the error suppression... :'-( + // TODO: Re-evaluate somewhere in 2023. +# ifdef __MINGW32__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# endif auto len = it.GetIndex() - ttfRunIndex.value(); ttf_draw_string_raw_ttf(dpi, text.substr(ttfRunIndex.value(), len), info); +# ifdef __MINGW32__ +# pragma GCC diagnostic pop +# endif ttfRunIndex = std::nullopt; } @@ -907,17 +918,7 @@ static void ttf_process_initial_colour(int32_t colour, text_draw_info* info) { if (colour != TEXT_COLOUR_254 && colour != TEXT_COLOUR_255) { - info->flags &= ~(TEXT_DRAW_FLAG_INSET | TEXT_DRAW_FLAG_OUTLINE | TEXT_DRAW_FLAG_DARK | TEXT_DRAW_FLAG_EXTRA_DARK); - if (info->font_sprite_base == FontSpriteBase::MEDIUM_DARK - || info->font_sprite_base == FontSpriteBase::MEDIUM_EXTRA_DARK) - { - info->flags |= TEXT_DRAW_FLAG_DARK; - if (info->font_sprite_base == FontSpriteBase::MEDIUM_EXTRA_DARK) - { - info->flags |= TEXT_DRAW_FLAG_EXTRA_DARK; - } - info->font_sprite_base = FontSpriteBase::MEDIUM; - } + info->flags &= ~(TEXT_DRAW_FLAG_INSET | TEXT_DRAW_FLAG_OUTLINE); if (colour & COLOUR_FLAG_OUTLINE) { info->flags |= TEXT_DRAW_FLAG_OUTLINE; @@ -970,13 +971,13 @@ static void ttf_process_initial_colour(int32_t colour, text_draw_info* info) void ttf_draw_string( rct_drawpixelinfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting, - FontSpriteBase fontSpriteBase) + FontStyle fontStyle, TextDarkness darkness) { if (text == nullptr) return; text_draw_info info; - info.font_sprite_base = fontSpriteBase; + info.FontStyle = fontStyle; info.flags = 0; info.startX = coords.x; info.startY = coords.y; @@ -993,6 +994,15 @@ void ttf_draw_string( info.flags |= TEXT_DRAW_FLAG_NO_FORMATTING; } + if (darkness == TextDarkness::Dark) + { + info.flags |= TEXT_DRAW_FLAG_DARK; + } + else if (darkness == TextDarkness::ExtraDark) + { + info.flags |= (TEXT_DRAW_FLAG_DARK | TEXT_DRAW_FLAG_EXTRA_DARK); + } + std::memcpy(info.palette, gTextPalette, sizeof(info.palette)); ttf_process_initial_colour(colour, &info); ttf_process_string(dpi, text, &info); @@ -1001,10 +1011,10 @@ void ttf_draw_string( dpi->lastStringPos = { info.x, info.y }; } -static int32_t ttf_get_string_width(std::string_view text, FontSpriteBase fontSpriteBase, bool noFormatting) +static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle, bool noFormatting) { text_draw_info info; - info.font_sprite_base = fontSpriteBase; + info.FontStyle = fontStyle; info.flags = 0; info.startX = 0; info.startY = 0; @@ -1035,10 +1045,10 @@ static int32_t ttf_get_string_width(std::string_view text, FontSpriteBase fontSp */ void gfx_draw_string_with_y_offsets( rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, - bool forceSpriteFont, FontSpriteBase fontSpriteBase) + bool forceSpriteFont, FontStyle fontStyle) { text_draw_info info; - info.font_sprite_base = fontSpriteBase; + info.FontStyle = fontStyle; info.flags = 0; info.startX = coords.x; info.startY = coords.y; @@ -1061,12 +1071,12 @@ void gfx_draw_string_with_y_offsets( dpi->lastStringPos = { info.x, info.y }; } -void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontSpriteBase fontSpriteBase) +void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle) { size_t length = strlen(path); // Return full string if it fits - if (gfx_get_string_width(const_cast(path), fontSpriteBase) <= availableWidth) + if (gfx_get_string_width(const_cast(path), fontStyle) <= availableWidth) { safe_strcpy(buffer, path, bufferSize); return; @@ -1095,7 +1105,7 @@ void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t ava } while (path[begin] != *PATH_SEPARATOR && path[begin] != '/'); safe_strcpy(buffer + 3, path + begin, bufferSize - 3); - if (gfx_get_string_width(buffer, fontSpriteBase) <= availableWidth) + if (gfx_get_string_width(buffer, fontStyle) <= availableWidth) { return; } diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 8226cdde80..7c8e35c6a7 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -658,7 +658,7 @@ void load_palette() */ void gfx_invalidate_screen() { - gfx_set_dirty_blocks({ { 0, 0 }, { context_get_width(), context_get_height() } }); + gfx_set_dirty_blocks({ { 0, 0 }, { ContextGetWidth(), ContextGetHeight() } }); } /* @@ -843,7 +843,7 @@ void RefreshVideo(bool recreateWindow) { if (recreateWindow) { - context_recreate_window(); + ContextRecreateWindow(); } else { @@ -858,8 +858,8 @@ void RefreshVideo(bool recreateWindow) void ToggleWindowedMode() { - int32_t targetMode = gConfigGeneral.fullscreen_mode == 0 ? 2 : 0; - context_set_fullscreen_mode(targetMode); - gConfigGeneral.fullscreen_mode = targetMode; - config_save_default(); + int32_t targetMode = gConfigGeneral.FullscreenMode == 0 ? 2 : 0; + ContextSetFullscreenMode(targetMode); + gConfigGeneral.FullscreenMode = targetMode; + ConfigSaveDefault(); } diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index 932d57a501..7329d49be3 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -461,8 +461,6 @@ void FASTCALL BlitPixels(const uint8_t* src, uint8_t* dst, const PaletteMap& pal } } -#define SPRITE_ID_PALETTE_COLOUR_1(colourId) (IMAGE_TYPE_REMAP | ((colourId) << 19)) - #define PALETTE_TO_G1_OFFSET_COUNT 144 #define INSET_RECT_F_30 (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE) @@ -519,7 +517,7 @@ bool gfx_load_csg(); void gfx_unload_g1(); void gfx_unload_g2(); void gfx_unload_csg(); -const rct_g1_element* gfx_get_g1_element(const ImageId& imageId); +const rct_g1_element* gfx_get_g1_element(const ImageId imageId); const rct_g1_element* gfx_get_g1_element(ImageIndex image_id); void gfx_set_g1_element(ImageIndex imageId, const rct_g1_element* g1); std::optional GfxLoadGx(const std::vector& buffer); @@ -527,17 +525,17 @@ bool is_csg_loaded(); 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, const ImageId& image_id, const ScreenCoordsXY& coords); +void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId image_id, const ScreenCoordsXY& coords); void FASTCALL - gfx_draw_glyph(rct_drawpixelinfo* dpi, int32_t image_id, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); -void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, const ImageId& image, const ScreenCoordsXY& coords, uint8_t colour); + gfx_draw_glyph(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); +void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour); void FASTCALL gfx_draw_sprite_raw_masked( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const ImageId& maskImage, const ImageId& colourImage); -void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId& imageId, const ScreenCoordsXY& spriteCoords); + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage); +void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords); void FASTCALL gfx_draw_sprite_palette_set_software( - rct_drawpixelinfo* dpi, const ImageId& imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); + rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); void FASTCALL gfx_draw_sprite_raw_masked_software( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId& maskImage, const ImageId& colourImage); + rct_drawpixelinfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId maskImage, const ImageId colourImage); // string void gfx_draw_string(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {}); @@ -547,24 +545,24 @@ void gfx_draw_string_no_formatting( void gfx_draw_string_left_centred( rct_drawpixelinfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords); void draw_string_centred_raw( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontSpriteBase fontSpriteBase); + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontStyle fontStyle); void DrawNewsTicker( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, void* args, int32_t ticks); void gfx_draw_string_with_y_offsets( rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets, - bool forceSpriteFont, FontSpriteBase fontSpriteBase); + bool forceSpriteFont, FontStyle fontStyle); -int32_t gfx_wrap_string(char* buffer, int32_t width, FontSpriteBase fontSpriteBase, int32_t* num_lines); -int32_t gfx_get_string_width(std::string_view text, FontSpriteBase fontSpriteBase); -int32_t gfx_get_string_width_new_lined(std::string_view text, FontSpriteBase fontSpriteBase); -int32_t gfx_get_string_width_no_formatting(std::string_view text, FontSpriteBase fontSpriteBase); -int32_t string_get_height_raw(std::string_view text, FontSpriteBase fontBase); -int32_t gfx_clip_string(char* buffer, int32_t width, FontSpriteBase fontSpriteBase); -void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontSpriteBase fontSpriteBase); +int32_t gfx_wrap_string(char* buffer, int32_t width, FontStyle fontStyle, int32_t* num_lines); +int32_t gfx_get_string_width(std::string_view text, FontStyle fontStyle); +int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyle); +int32_t gfx_get_string_width_no_formatting(std::string_view text, FontStyle fontStyle); +int32_t string_get_height_raw(std::string_view text, FontStyle fontStyle); +int32_t gfx_clip_string(char* buffer, int32_t width, FontStyle fontStyle); +void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle); void ttf_draw_string( rct_drawpixelinfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting, - FontSpriteBase fontSpriteBase); + FontStyle fontStyle, TextDarkness darkness); // scrolling text void scrolling_text_initialise_bitmaps(); @@ -573,9 +571,8 @@ void scrolling_text_invalidate(); class Formatter; ImageId scrolling_text_setup( - struct paint_session& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour); + struct PaintSession& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour); -rct_size16 FASTCALL gfx_get_sprite_size(uint32_t image_id); size_t g1_calculate_data_size(const rct_g1_element* g1); void mask_scalar( diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index 432ee6d1c7..04dc86a7f7 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -13,6 +13,7 @@ #include "../localisation/Language.h" #include "../localisation/LocalisationService.h" #include "../sprites.h" +#include "../util/Util.h" #include "Drawing.h" #include "TTF.h" @@ -20,14 +21,14 @@ #include #include -static constexpr const int32_t SpriteFontLineHeight[FONT_SIZE_COUNT] = { +static constexpr const int32_t SpriteFontLineHeight[FontStyleCount] = { + 10, + 10, 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] = {}; +static uint8_t _spriteFontCharacterWidths[FontStyleCount][FONT_SPRITE_GLYPH_COUNT]; +static uint8_t _additionalSpriteFontCharacterWidth[FontStyleCount][SPR_G2_GLYPH_COUNT] = {}; #ifndef NO_TTF TTFFontSetDescriptor* gCurrentTTFFontSet; @@ -244,9 +245,9 @@ void font_sprite_initialise_characters() _biggestCodepointValue = std::max(_biggestCodepointValue, entry.first); } - for (int32_t fontSize = 0; fontSize < FONT_SIZE_COUNT; fontSize++) + for (const auto& fontStyle : FontStyles) { - int32_t glyphOffset = fontSize * FONT_SPRITE_GLYPH_COUNT; + int32_t glyphOffset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT; for (uint8_t glyphIndex = 0; glyphIndex < FONT_SPRITE_GLYPH_COUNT; glyphIndex++) { const rct_g1_element* g1 = gfx_get_g1_element(glyphIndex + SPR_CHAR_START + glyphOffset); @@ -256,13 +257,13 @@ void font_sprite_initialise_characters() width = g1->width + (2 * g1->x_offset) - 1; } - _spriteFontCharacterWidths[fontSize][glyphIndex] = static_cast(width); + _spriteFontCharacterWidths[EnumValue(fontStyle)][glyphIndex] = static_cast(width); } } - for (uint8_t fontSize : { FONT_SIZE_SMALL, FONT_SIZE_MEDIUM, FONT_SIZE_TINY }) + for (const auto& fontStyle : FontStyles) { - int32_t glyphOffset = fontSize * SPR_G2_GLYPH_COUNT; + int32_t glyphOffset = EnumValue(fontStyle) * SPR_G2_GLYPH_COUNT; for (int32_t glyphIndex = 0; glyphIndex < SPR_G2_GLYPH_COUNT; glyphIndex++) { const rct_g1_element* g1 = gfx_get_g1_element(glyphIndex + SPR_G2_CHAR_BEGIN + glyphOffset); @@ -272,7 +273,7 @@ void font_sprite_initialise_characters() width = g1->width + (2 * g1->x_offset) - 1; } - _additionalSpriteFontCharacterWidth[fontSize][glyphIndex] = static_cast(width); + _additionalSpriteFontCharacterWidth[EnumValue(fontStyle)][glyphIndex] = static_cast(width); } } @@ -296,15 +297,10 @@ int32_t font_sprite_get_codepoint_offset(int32_t codepoint) return codepoint - 32; } -int32_t font_sprite_get_codepoint_width(FontSpriteBase fontSpriteBase, int32_t codepoint) +int32_t font_sprite_get_codepoint_width(FontStyle fontStyle, int32_t codepoint) { - if (fontSpriteBase == FontSpriteBase::MEDIUM_DARK || fontSpriteBase == FontSpriteBase::MEDIUM_EXTRA_DARK) - { - fontSpriteBase = FontSpriteBase::MEDIUM; - } - int32_t glyphIndex = font_sprite_get_codepoint_offset(codepoint); - int32_t baseFontIndex = font_get_font_index_from_sprite_base(fontSpriteBase); + auto baseFontIndex = EnumValue(fontStyle); if (glyphIndex >= FONT_SPRITE_GLYPH_COUNT) { glyphIndex = (SPR_CHAR_START + glyphIndex) - SPR_G2_CHAR_BEGIN; @@ -325,49 +321,21 @@ int32_t font_sprite_get_codepoint_width(FontSpriteBase fontSpriteBase, int32_t c return _spriteFontCharacterWidths[baseFontIndex][glyphIndex]; } -int32_t font_sprite_get_codepoint_sprite(FontSpriteBase fontSpriteBase, int32_t codepoint) +ImageId font_sprite_get_codepoint_sprite(FontStyle fontStyle, int32_t codepoint) { - int32_t offset = static_cast(fontSpriteBase); + int32_t offset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT; auto codePointOffset = font_sprite_get_codepoint_offset(codepoint); if (codePointOffset > FONT_SPRITE_GLYPH_COUNT) { - offset = font_get_font_index_from_sprite_base(fontSpriteBase) * SPR_G2_GLYPH_COUNT; + offset = EnumValue(fontStyle) * SPR_G2_GLYPH_COUNT; } - return SPR_CHAR_START + (IMAGE_TYPE_REMAP | (offset + codePointOffset)); + return ImageId(SPR_CHAR_START + offset + codePointOffset, COLOUR_BLACK); } -int32_t font_get_font_index_from_sprite_base(FontSpriteBase spriteBase) +int32_t font_get_line_height(FontStyle fontStyle) { - switch (spriteBase) - { - case FontSpriteBase::TINY: - return FONT_SIZE_TINY; - case FontSpriteBase::SMALL: - return FONT_SIZE_SMALL; - default: - case FontSpriteBase::MEDIUM: - return FONT_SIZE_MEDIUM; - } -} - -int32_t font_get_size_from_sprite_base(FontSpriteBase spriteBase) -{ - switch (spriteBase) - { - case FontSpriteBase::TINY: - return 0; - case FontSpriteBase::SMALL: - return 1; - default: - case FontSpriteBase::MEDIUM: - return 2; - } -} - -int32_t font_get_line_height(FontSpriteBase fontSpriteBase) -{ - int32_t fontSize = font_get_size_from_sprite_base(fontSpriteBase); + auto fontSize = EnumValue(fontStyle); #ifndef NO_TTF if (LocalisationService_UseTrueTypeFont()) { @@ -377,9 +345,9 @@ int32_t font_get_line_height(FontSpriteBase fontSpriteBase) return SpriteFontLineHeight[fontSize]; } -int32_t font_get_line_height_small(FontSpriteBase fontSpriteBase) +int32_t font_get_line_height_small(FontStyle fontStyle) { - return font_get_line_height(fontSpriteBase) / 2; + return font_get_line_height(fontStyle) / 2; } bool font_supports_string_sprite(const utf8* text) @@ -409,11 +377,11 @@ bool font_supports_string_sprite(const utf8* text) return true; } -bool font_supports_string_ttf(const utf8* text, int32_t fontSize) +bool font_supports_string_ttf(const utf8* text, FontStyle fontStyle) { #ifndef NO_TTF const utf8* src = text; - const TTF_Font* font = gCurrentTTFFontSet->size[fontSize].font; + const TTF_Font* font = gCurrentTTFFontSet->size[EnumValue(fontStyle)].font; if (font == nullptr) { return false; @@ -434,11 +402,11 @@ bool font_supports_string_ttf(const utf8* text, int32_t fontSize) #endif // NO_TTF } -bool font_supports_string(const utf8* text, int32_t fontSize) +bool font_supports_string(const utf8* text, FontStyle fontStyle) { if (LocalisationService_UseTrueTypeFont()) { - return font_supports_string_ttf(text, fontSize); + return font_supports_string_ttf(text, fontStyle); } return font_supports_string_sprite(text); diff --git a/src/openrct2/drawing/Font.h b/src/openrct2/drawing/Font.h index 81ddcc8f55..e5e527334e 100644 --- a/src/openrct2/drawing/Font.h +++ b/src/openrct2/drawing/Font.h @@ -11,26 +11,21 @@ #include "../common.h" #include "../core/String.hpp" +#include "../drawing/ImageId.hpp" + +#include constexpr const uint16_t FONT_SPRITE_GLYPH_COUNT = 224; -enum +enum class FontStyle : uint8_t { - FONT_SIZE_TINY = 2, - FONT_SIZE_SMALL = 0, - FONT_SIZE_MEDIUM = 1, - FONT_SIZE_COUNT = 3 + Small = 0, + Medium = 1, + Tiny = 2, }; -enum class FontSpriteBase : int16_t -{ - MEDIUM_EXTRA_DARK = -2, - MEDIUM_DARK = -1, - - TINY = FONT_SIZE_TINY * FONT_SPRITE_GLYPH_COUNT, - SMALL = FONT_SIZE_SMALL * FONT_SPRITE_GLYPH_COUNT, - MEDIUM = FONT_SIZE_MEDIUM * FONT_SPRITE_GLYPH_COUNT, -}; +constexpr const uint8_t FontStyleCount = 3; +constexpr const std::array FontStyles = { FontStyle::Small, FontStyle::Medium, FontStyle::Tiny }; #ifndef NO_TTF @@ -50,7 +45,7 @@ struct TTFFontDescriptor struct TTFFontSetDescriptor { - TTFFontDescriptor size[FONT_SIZE_COUNT]; + TTFFontDescriptor size[FontStyleCount]; }; extern TTFFontSetDescriptor* gCurrentTTFFontSet; @@ -59,12 +54,10 @@ extern TTFFontSetDescriptor* gCurrentTTFFontSet; void font_sprite_initialise_characters(); int32_t font_sprite_get_codepoint_offset(int32_t codepoint); -int32_t font_sprite_get_codepoint_width(FontSpriteBase fontSpriteBase, int32_t codepoint); -int32_t font_sprite_get_codepoint_sprite(FontSpriteBase fontSpriteBase, int32_t codepoint); -int32_t font_get_font_index_from_sprite_base(FontSpriteBase spriteBase); -int32_t font_get_size_from_sprite_base(FontSpriteBase spriteBase); -int32_t font_get_line_height(FontSpriteBase fontSpriteBase); -int32_t font_get_line_height_small(FontSpriteBase fontSpriteBase); +int32_t font_sprite_get_codepoint_width(FontStyle fontStyle, int32_t codepoint); +ImageId font_sprite_get_codepoint_sprite(FontStyle fontStyle, int32_t codepoint); +int32_t font_get_line_height(FontStyle fontStyle); +int32_t font_get_line_height_small(FontStyle fontStyle); 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); +bool font_supports_string_ttf(const utf8* text, FontStyle fontStyle); +bool font_supports_string(const utf8* text, FontStyle fontStyle); diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index 20bb7d4fb6..ebffd179ec 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -26,15 +26,15 @@ namespace OpenRCT2::Drawing 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, const ImageId& image, int32_t x, int32_t y) abstract; + virtual void DrawSprite(rct_drawpixelinfo* dpi, const ImageId image, int32_t x, int32_t y) abstract; virtual void DrawSpriteRawMasked( - rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId& maskImage, const ImageId& colourImage) abstract; + rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) abstract; virtual void DrawSpriteSolid( - rct_drawpixelinfo* dpi, const ImageId& image, int32_t x, int32_t y, uint8_t colour) abstract; + rct_drawpixelinfo* dpi, const ImageId 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; + rct_drawpixelinfo* dpi, const ImageId 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, + rct_drawpixelinfo* dpi, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y) abstract; }; diff --git a/src/openrct2/drawing/Image.h b/src/openrct2/drawing/Image.h index 992b3b6d50..330f2ee602 100644 --- a/src/openrct2/drawing/Image.h +++ b/src/openrct2/drawing/Image.h @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2021 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 diff --git a/src/openrct2/drawing/ImageId.hpp b/src/openrct2/drawing/ImageId.hpp index 234be32a9b..fff3a95c1c 100644 --- a/src/openrct2/drawing/ImageId.hpp +++ b/src/openrct2/drawing/ImageId.hpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 @@ -94,20 +94,6 @@ public: return result; } - [[nodiscard]] static ImageId FromUInt32(uint32_t value, uint32_t tertiary) - { - if (!(value & FLAG_PRIMARY) && (value & FLAG_SECONDARY)) - { - auto result = ImageId::FromUInt32(value).WithTertiary(tertiary); - assert(result.ToUInt32() == value); - return result; - } - else - { - return ImageId::FromUInt32(value); - } - } - ImageId() = default; explicit constexpr ImageId(ImageIndex index) @@ -302,4 +288,4 @@ public: return result; } }; -static_assert(sizeof(ImageId) == 8); +static_assert(sizeof(ImageId) == 8, "The size of this struct is expected to fit in 64 bits for perfomance reasons. See #18555"); diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 3d6c223afe..05828bab77 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -131,12 +131,12 @@ void lightfx_set_available(bool available) bool lightfx_is_available() { - return _lightfxAvailable && gConfigGeneral.enable_light_fx != 0; + return _lightfxAvailable && gConfigGeneral.EnableLightFx != 0; } bool lightfx_for_vehicles_is_available() { - return lightfx_is_available() && gConfigGeneral.enable_light_fx_for_vehicles != 0; + return lightfx_is_available() && gConfigGeneral.EnableLightFxForVehicles != 0; } void lightfx_init() @@ -305,7 +305,7 @@ void lightfx_prepare_light_list() dpi.zoom_level = _current_view_zoom_front; dpi.width = 1; - paint_session* session = PaintSessionAlloc(&dpi, w->viewport->flags); + PaintSession* session = PaintSessionAlloc(&dpi, w->viewport->flags); PaintSessionGenerate(*session); PaintSessionArrange(*session); auto info = set_interaction_info_from_paint_session( @@ -647,7 +647,7 @@ static void LightfxAdd3DLight( continue; entry->Position = loc; - entry->ViewCoords = translate_3d_to_2d_with_z(get_current_rotation(), loc); + entry->ViewCoords = Translate3DTo2DWithZ(get_current_rotation(), loc); entry->Type = lightType; entry->LightIntensity = 0xFF; entry->LightHash = lightHash; @@ -661,7 +661,7 @@ static void LightfxAdd3DLight( LightListEntry* entry = &_LightListBack[LightListCurrentCountBack++]; entry->Position = loc; - entry->ViewCoords = translate_3d_to_2d_with_z(get_current_rotation(), loc); + entry->ViewCoords = Translate3DTo2DWithZ(get_current_rotation(), loc); entry->Type = lightType; entry->LightIntensity = 0xFF; entry->LightHash = lightHash; diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index 21062bf641..bddf3a1273 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -233,7 +233,7 @@ void gfx_draw_dashed_line( } } -void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId& imageId, const ScreenCoordsXY& coords) +void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords) { auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) @@ -243,7 +243,8 @@ void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId& imageId, co } } -void FASTCALL gfx_draw_glyph(rct_drawpixelinfo* dpi, int32_t image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap) +void FASTCALL + gfx_draw_glyph(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap) { auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) @@ -254,7 +255,7 @@ void FASTCALL gfx_draw_glyph(rct_drawpixelinfo* dpi, int32_t image, const Screen } void FASTCALL gfx_draw_sprite_raw_masked( - rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const ImageId& maskImage, const ImageId& colourImage) + rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage) { auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) @@ -264,7 +265,7 @@ void FASTCALL gfx_draw_sprite_raw_masked( } } -void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, const ImageId& image, const ScreenCoordsXY& coords, uint8_t colour) +void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour) { auto drawingEngine = dpi->DrawingEngine; if (drawingEngine != nullptr) diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 9c31ff5781..66fd82c1ff 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -47,7 +47,7 @@ static void scrolling_text_set_bitmap_for_sprite( static void scrolling_text_set_bitmap_for_ttf( std::string_view text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets, colour_t colour); -void scrolling_text_initialise_bitmaps() +static void ScrollingTextInitialiseCharacterBitmaps(uint32_t glyphStart, uint16_t offset, uint16_t count, bool isAntiAliased) { uint8_t drawingSurface[64]; rct_drawpixelinfo dpi; @@ -55,11 +55,10 @@ void scrolling_text_initialise_bitmaps() dpi.width = 8; dpi.height = 8; - for (int32_t i = 0; i < FONT_SPRITE_GLYPH_COUNT; i++) + for (int32_t i = 0; i < count; i++) { std::fill_n(drawingSurface, sizeof(drawingSurface), 0x00); - gfx_draw_sprite_software( - &dpi, ImageId::FromUInt32(SPR_CHAR_START + static_cast(FontSpriteBase::TINY) + i), { -1, 0 }); + gfx_draw_sprite_software(&dpi, ImageId(glyphStart + (EnumValue(FontStyle::Tiny) * count) + i), { -1, 0 }); for (int32_t x = 0; x < 8; x++) { @@ -68,37 +67,18 @@ void scrolling_text_initialise_bitmaps() { val >>= 1; uint8_t pixel = dpi.bits[x + y * 8]; - if (pixel == 1 || (gTinyFontAntiAliased && pixel == 2)) + if (pixel == 1 || (isAntiAliased && pixel == 2)) { val |= 0x80; } } - _characterBitmaps[i][x] = val; - } - } - - for (int32_t i = 0; i < SPR_G2_GLYPH_COUNT; i++) - { - std::fill_n(drawingSurface, sizeof(drawingSurface), 0x00); - gfx_draw_sprite_software( - &dpi, ImageId::FromUInt32(SPR_G2_CHAR_BEGIN + (FONT_SIZE_TINY * SPR_G2_GLYPH_COUNT) + i), { -1, 0 }); - - for (int32_t x = 0; x < 8; x++) - { - uint8_t val = 0; - for (int32_t y = 0; y < 8; y++) - { - val >>= 1; - uint8_t pixel = dpi.bits[x + y * 8]; - if (pixel == 1 || (gTinyFontAntiAliased && pixel == 2)) - { - val |= 0x80; - } - } - _characterBitmaps[FONT_SPRITE_GLYPH_COUNT + i][x] = val; + _characterBitmaps[offset + i][x] = val; } } +}; +static void ScrollingTextInitialiseScrollingText() +{ for (int32_t i = 0; i < OpenRCT2::MaxScrollingTextEntries; i++) { const int32_t imageId = SPR_SCROLLING_TEXT_START + i; @@ -122,6 +102,13 @@ void scrolling_text_initialise_bitmaps() } } +void scrolling_text_initialise_bitmaps() +{ + ScrollingTextInitialiseCharacterBitmaps(SPR_CHAR_START, 0, FONT_SPRITE_GLYPH_COUNT, gTinyFontAntiAliased); + ScrollingTextInitialiseCharacterBitmaps(SPR_G2_CHAR_BEGIN, FONT_SPRITE_GLYPH_COUNT, SPR_G2_GLYPH_COUNT, false); + ScrollingTextInitialiseScrollingText(); +} + static uint8_t* font_sprite_get_codepoint_bitmap(int32_t codepoint) { auto offset = font_sprite_get_codepoint_offset(codepoint); @@ -161,7 +148,7 @@ static int32_t scrolling_text_get_matching_or_oldest( static void scrolling_text_format(utf8* dst, size_t size, rct_draw_scroll_text* scrollText) { - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper(dst, size, scrollText->string_id, scrollText->string_args); } @@ -1447,7 +1434,7 @@ void scrolling_text_invalidate() } ImageId scrolling_text_setup( - paint_session& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour) + PaintSession& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour) { std::scoped_lock lock(_scrollingTextMutex); @@ -1510,7 +1497,7 @@ static void scrolling_text_set_bitmap_for_sprite( CodepointView codepoints(token.text); for (auto codepoint : codepoints) { - auto characterWidth = font_sprite_get_codepoint_width(FontSpriteBase::TINY, codepoint); + auto characterWidth = font_sprite_get_codepoint_width(FontStyle::Tiny, codepoint); auto characterBitmap = font_sprite_get_codepoint_bitmap(codepoint); for (; characterWidth != 0; characterWidth--, characterBitmap++) { @@ -1558,7 +1545,7 @@ static void scrolling_text_set_bitmap_for_ttf( std::string_view text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets, colour_t colour) { #ifndef NO_TTF - auto fontDesc = ttf_get_font_from_sprite_base(FontSpriteBase::TINY); + auto fontDesc = ttf_get_font_from_sprite_base(FontStyle::Tiny); if (fontDesc->font == nullptr) { scrolling_text_set_bitmap_for_sprite(text, scroll, bitmap, scrollPositionOffsets, colour); @@ -1603,7 +1590,7 @@ static void scrolling_text_set_bitmap_for_ttf( int32_t min_vpos = -fontDesc->offset_y; int32_t max_vpos = std::min(surface->h - 2, min_vpos + 7); - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold > 0; + bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold > 0; for (int32_t x = 0;; x++) { diff --git a/src/openrct2/drawing/TTF.cpp b/src/openrct2/drawing/TTF.cpp index ff439bd180..5b5403afdf 100644 --- a/src/openrct2/drawing/TTF.cpp +++ b/src/openrct2/drawing/TTF.cpp @@ -76,7 +76,7 @@ template class FontLockHelper public: FontLockHelper(T& mutex) : _mutex(mutex) - , _enabled(gConfigGeneral.multithreading) + , _enabled(gConfigGeneral.MultiThreading) { if (_enabled) _mutex.lock(); @@ -95,10 +95,10 @@ static void ttf_toggle_hinting(bool) return; } - for (int32_t i = 0; i < FONT_SIZE_COUNT; i++) + for (int32_t i = 0; i < FontStyleCount; i++) { TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]); - bool use_hinting = gConfigFonts.enable_hinting && fontDesc->hinting_threshold; + bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold; TTF_SetFontHinting(fontDesc->font, use_hinting ? 1 : 0); } @@ -121,7 +121,7 @@ bool ttf_initialise() return false; } - for (int32_t i = 0; i < FONT_SIZE_COUNT; i++) + for (int32_t i = 0; i < FontStyleCount; i++) { TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]); @@ -157,7 +157,7 @@ void ttf_dispose() ttf_surface_cache_dispose_all(); ttf_getwidth_cache_dispose_all(); - for (int32_t i = 0; i < FONT_SIZE_COUNT; i++) + for (int32_t i = 0; i < FontStyleCount; i++) { TTFFontDescriptor* fontDesc = &(gCurrentTTFFontSet->size[i]); if (fontDesc->font != nullptr) @@ -347,10 +347,10 @@ uint32_t ttf_getwidth_cache_get_or_add(TTF_Font* font, std::string_view text) return entry->width; } -TTFFontDescriptor* ttf_get_font_from_sprite_base(FontSpriteBase spriteBase) +TTFFontDescriptor* ttf_get_font_from_sprite_base(FontStyle fontStyle) { FontLockHelper lock(_mutex); - return &gCurrentTTFFontSet->size[font_get_size_from_sprite_base(spriteBase)]; + return &gCurrentTTFFontSet->size[EnumValue(fontStyle)]; } bool ttf_provides_glyph(const TTF_Font* font, codepoint_t codepoint) diff --git a/src/openrct2/drawing/TTF.h b/src/openrct2/drawing/TTF.h index 40c72148c4..cc59baac54 100644 --- a/src/openrct2/drawing/TTF.h +++ b/src/openrct2/drawing/TTF.h @@ -26,7 +26,7 @@ struct TTFSurface int32_t pitch; }; -TTFFontDescriptor* ttf_get_font_from_sprite_base(FontSpriteBase spriteBase); +TTFFontDescriptor* ttf_get_font_from_sprite_base(FontStyle fontStyle); void ttf_toggle_hinting(); TTFSurface* ttf_surface_cache_get_or_add(TTF_Font* font, std::string_view text); uint32_t ttf_getwidth_cache_get_or_add(TTF_Font* font, std::string_view text); diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 7ee8637ad1..13f58850a4 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -34,9 +34,9 @@ public: Buffer = source; Paint = paint; - MaxWidth = gfx_wrap_string(Buffer, width, paint.SpriteBase, &LineCount); + MaxWidth = gfx_wrap_string(Buffer, width, paint.FontStyle, &LineCount); LineCount += 1; - LineHeight = font_get_line_height(paint.SpriteBase); + LineHeight = font_get_line_height(paint.FontStyle); } void Draw(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords) @@ -84,8 +84,8 @@ public: static void DrawText( rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting) { - int32_t width = noFormatting ? gfx_get_string_width_no_formatting(text, paint.SpriteBase) - : gfx_get_string_width(text, paint.SpriteBase); + int32_t width = noFormatting ? gfx_get_string_width_no_formatting(text, paint.FontStyle) + : gfx_get_string_width(text, paint.FontStyle); auto alignedCoords = coords; switch (paint.Alignment) @@ -100,7 +100,7 @@ static void DrawText( break; } - ttf_draw_string(dpi, text, paint.Colour, alignedCoords, noFormatting, paint.SpriteBase); + ttf_draw_string(dpi, text, paint.Colour, alignedCoords, noFormatting, paint.FontStyle, paint.Darkness); if (paint.UnderlineText == TextUnderline::On) { @@ -150,7 +150,7 @@ void DrawTextEllipsised( { utf8 buffer[512]; format_string(buffer, sizeof(buffer), format, ft.Data()); - gfx_clip_string(buffer, width, textPaint.SpriteBase); + gfx_clip_string(buffer, width, textPaint.FontStyle); DrawText(dpi, coords, textPaint, buffer); } diff --git a/src/openrct2/drawing/Text.h b/src/openrct2/drawing/Text.h index 56ed92d062..2430a76823 100644 --- a/src/openrct2/drawing/Text.h +++ b/src/openrct2/drawing/Text.h @@ -30,20 +30,28 @@ enum class TextUnderline On, }; +enum class TextDarkness +{ + Regular = 0, + Dark = 1, + ExtraDark = 2, +}; + struct TextPaint { colour_t Colour = COLOUR_BLACK; - FontSpriteBase SpriteBase = FontSpriteBase::MEDIUM; + ::FontStyle FontStyle = FontStyle::Medium; TextUnderline UnderlineText = TextUnderline::Off; TextAlignment Alignment = TextAlignment::LEFT; + TextDarkness Darkness = TextDarkness::Regular; TextPaint() = default; TextPaint(colour_t colour) : Colour(colour) { } - TextPaint(FontSpriteBase spriteBase) - : SpriteBase(spriteBase) + TextPaint(::FontStyle fontStyle) + : FontStyle(fontStyle) { } TextPaint(TextUnderline underlineText) @@ -55,9 +63,9 @@ struct TextPaint { } - TextPaint(colour_t colour, FontSpriteBase spriteBase) + TextPaint(colour_t colour, ::FontStyle fontStyle) : Colour(colour) - , SpriteBase(spriteBase) + , FontStyle(fontStyle) { } TextPaint(colour_t colour, TextUnderline underlineText) @@ -71,13 +79,13 @@ struct TextPaint { } - TextPaint(FontSpriteBase spriteBase, TextUnderline underlineText) - : SpriteBase(spriteBase) + TextPaint(::FontStyle fontStyle, TextUnderline underlineText) + : FontStyle(fontStyle) , UnderlineText(underlineText) { } - TextPaint(FontSpriteBase spriteBase, TextAlignment alignment) - : SpriteBase(spriteBase) + TextPaint(::FontStyle fontStyle, TextAlignment alignment) + : FontStyle(fontStyle) , Alignment(alignment) { } @@ -87,38 +95,51 @@ struct TextPaint { } - TextPaint(colour_t colour, FontSpriteBase spriteBase, TextUnderline underlineText) + TextPaint(colour_t colour, ::FontStyle fontStyle, TextUnderline underlineText) : Colour(colour) - , SpriteBase(spriteBase) + , FontStyle(fontStyle) , UnderlineText(underlineText) { } - TextPaint(colour_t colour, FontSpriteBase spriteBase, TextAlignment alignment) + TextPaint(colour_t colour, ::FontStyle fontStyle, TextAlignment alignment) : Colour(colour) - , SpriteBase(spriteBase) + , FontStyle(fontStyle) , Alignment(alignment) { } + TextPaint(colour_t colour, ::FontStyle fontStyle, TextDarkness darkness) + : Colour(colour) + , FontStyle(fontStyle) + , Darkness(darkness) + { + } TextPaint(colour_t colour, TextUnderline underlineText, TextAlignment alignment) : Colour(colour) , UnderlineText(underlineText) , Alignment(alignment) { } - TextPaint(FontSpriteBase spriteBase, TextUnderline underlineText, TextAlignment alignment) - : SpriteBase(spriteBase) + TextPaint(::FontStyle fontStyle, TextUnderline underlineText, TextAlignment alignment) + : FontStyle(fontStyle) , UnderlineText(underlineText) , Alignment(alignment) { } - TextPaint(colour_t colour, FontSpriteBase spriteBase, TextUnderline underlineText, TextAlignment alignment) + TextPaint(colour_t colour, ::FontStyle fontStyle, TextUnderline underlineText, TextAlignment alignment) : Colour(colour) - , SpriteBase(spriteBase) + , FontStyle(fontStyle) , UnderlineText(underlineText) , Alignment(alignment) { } + TextPaint(colour_t colour, ::FontStyle fontStyle, TextAlignment alignment, TextDarkness darkness) + : Colour(colour) + , FontStyle(fontStyle) + , Alignment(alignment) + , Darkness(darkness) + { + } }; void DrawTextBasic(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, StringId format); diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index c784b1db73..89a48d51c0 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -53,7 +53,7 @@ const DrawWeatherFunc DrawSnowFunctions[] = { */ void DrawWeather(rct_drawpixelinfo* dpi, IWeatherDrawer* weatherDrawer) { - if (gConfigGeneral.render_weather_effects) + if (gConfigGeneral.RenderWeatherEffects) { uint32_t viewFlags = 0; diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 25bdbeabe2..c1fa3d18b2 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -123,7 +123,7 @@ X8DrawingEngine::X8DrawingEngine([[maybe_unused]] const std::shared_ptrGetWaterHeight() : 0; if (waterHeight == 0) { @@ -180,8 +180,8 @@ void Duck::UpdateSwim() else { Invalidate(); - int16_t landZ = tile_element_height({ x, y }); - int16_t waterZ = tile_element_water_height({ x, y }); + int16_t landZ = TileElementHeight({ x, y }); + int16_t waterZ = TileElementWaterHeight({ x, y }); if (z < landZ || waterZ == 0) { @@ -200,8 +200,8 @@ void Duck::UpdateSwim() int32_t direction = sprite_direction >> 3; auto destination = CoordsXYZ{ CoordsXY{ x, y } + DuckMoveOffset[direction], 0 }; - landZ = tile_element_height(destination); - waterZ = tile_element_water_height(destination); + landZ = TileElementHeight(destination); + waterZ = TileElementWaterHeight(destination); if (z > landZ && z == waterZ) { @@ -259,7 +259,7 @@ void Duck::UpdateFlyAway() int32_t direction = sprite_direction >> 3; auto destination = CoordsXYZ{ x + (DuckMoveOffset[direction].x * 2), y + (DuckMoveOffset[direction].y * 2), std::min(z + 2, 496) }; - if (map_is_location_valid(destination)) + if (MapIsLocationValid(destination)) { MoveTo(destination); } @@ -365,7 +365,7 @@ void Duck::Serialise(DataSerialiser& stream) stream << state; } -void Duck::Paint(paint_session& session, int32_t imageDirection) const +void Duck::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); diff --git a/src/openrct2/entity/Duck.h b/src/openrct2/entity/Duck.h index 57525e809d..36918a956c 100644 --- a/src/openrct2/entity/Duck.h +++ b/src/openrct2/entity/Duck.h @@ -13,7 +13,7 @@ class DataSerialiser; struct CoordsXY; -struct paint_session; +struct PaintSession; struct Duck : EntityBase { @@ -39,7 +39,7 @@ struct Duck : EntityBase bool IsFlying(); void Remove(); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; private: void UpdateFlyToWater(); diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index bd81c7db16..03456148a4 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -454,7 +454,7 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation) } auto loc = newLocation; - if (!map_is_location_valid(loc)) + if (!MapIsLocationValid(loc)) { loc.x = LOCATION_NULL; } @@ -476,7 +476,7 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation) void EntitySetCoordinates(const CoordsXYZ& entityPos, EntityBase* entity) { - auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), entityPos); + auto screenCoords = Translate3DTo2DWithZ(get_current_rotation(), entityPos); entity->SpriteRect = ScreenRect( screenCoords - ScreenCoordsXY{ entity->sprite_width, entity->sprite_height_negative }, diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index c0f785a675..8b29329002 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -15,6 +15,7 @@ #include "../profiling/Profiling.h" #include "../scenario/Scenario.h" #include "../world/Footpath.h" +#include "../world/Location.hpp" #include "../world/Map.h" #include "../world/Scenery.h" #include "EntityRegistry.h" @@ -93,7 +94,7 @@ void JumpingFountain::StartAnimation(const JumpingFountainType newType, const Co { case PATTERN::CYCLIC_SQUARES: // 0, 1, 2, 3 - for (int32_t i = 0; i < 4; i++) + for (int32_t i = 0; i < NumOrthogonalDirections; i++) { JumpingFountain::Create( newType, { newLoc + _fountainDirectionsPositive[i], newZ }, _fountainDirections[i], @@ -103,7 +104,7 @@ void JumpingFountain::StartAnimation(const JumpingFountainType newType, const Co case PATTERN::BOUNCING_PAIRS: // random [0, 2 or 1, 3] randomIndex = scenario_rand() & 1; - for (int32_t i = randomIndex; i < 4; i += 2) + for (int32_t i = randomIndex; i < NumOrthogonalDirections; i += 2) { JumpingFountain::Create( newType, { newLoc + _fountainDirectionsPositive[i], newZ }, _fountainDirections[i], @@ -250,7 +251,7 @@ bool JumpingFountain::IsJumpingFountain(const JumpingFountainType newType, const const int32_t pathBitFlagMask = newType == JumpingFountainType::Snow ? PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW : PATH_BIT_FLAG_JUMPING_FOUNTAIN_WATER; - TileElement* tileElement = map_get_first_element_at(newLoc); + TileElement* tileElement = MapGetFirstElementAt(newLoc); if (tileElement == nullptr) return false; do @@ -395,7 +396,7 @@ void JumpingFountain::Serialise(DataSerialiser& stream) stream << Iteration; } -void JumpingFountain::Paint(paint_session& session, int32_t imageDirection) const +void JumpingFountain::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); diff --git a/src/openrct2/entity/Fountain.h b/src/openrct2/entity/Fountain.h index 0a916803ec..1a516a05f4 100644 --- a/src/openrct2/entity/Fountain.h +++ b/src/openrct2/entity/Fountain.h @@ -35,7 +35,7 @@ struct JumpingFountain : EntityBase void Update(); static void StartAnimation(JumpingFountainType newType, const CoordsXY& newLoc, const TileElement* tileElement); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; private: JumpingFountainType GetType() const; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index c2df3e5a51..652e49dc96 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -46,6 +46,7 @@ #include "../world/Climate.h" #include "../world/Footpath.h" #include "../world/LargeScenery.h" +#include "../world/Location.hpp" #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" @@ -449,7 +450,7 @@ static bool IsValidLocation(const CoordsXYZ& coords) { if (coords.x != LOCATION_NULL) { - if (map_is_location_valid(coords)) + if (MapIsLocationValid(coords)) { return true; } @@ -1021,7 +1022,7 @@ void Guest::Tick128UpdateGuest(int32_t index) } } - if ((scenario_rand() & 0xFFFF) <= ((HasItem(ShopItem::Map)) ? 8192U : 2184U)) + if ((scenario_rand() & 0xFFFF) <= ((HasItem(ShopItem::Map)) ? 8192u : 2184u)) { PickRideToGoOn(); } @@ -1651,7 +1652,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, ShopItem shopItem, money32 price) auto ft = Formatter(); FormatNameTo(ft); ft.Add(GetShopItemDescriptor(shopItem).Naming.Indefinite); - if (gConfigNotifications.guest_bought_item) + if (gConfigNotifications.GuestBoughtItem) { News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_NOTIFICATION_BOUGHT_X, sprite_index, ft); } @@ -1885,7 +1886,7 @@ BitSet Guest::FindRidesToGoOn() for (int32_t tileY = cy - radius; tileY <= cy + radius; tileY += COORDS_XY_STEP) { auto location = CoordsXY{ tileX, tileY }; - if (!map_is_location_valid(location)) + if (!MapIsLocationValid(location)) continue; for (auto* trackElement : TileElementsView(location)) @@ -2046,34 +2047,13 @@ bool Guest::ShouldGoOnRide(Ride* ride, StationIndex entranceNum, bool atQueue, b return false; } } - - if (ClimateIsRaining() && !ShouldRideWhileRaining(*ride)) + else { - if (peepAtRide) - { - InsertNewThought(PeepThoughtType::NotWhileRaining, ride->id); - if (HappinessTarget >= 64) - { - HappinessTarget -= 8; - } - ride->UpdatePopularity(0); - } - ChoseNotToGoOnRide(ride, peepAtRide, true); - return false; - } - - if (!gCheatsIgnoreRideIntensity) - { - // Intensity calculations. Even though the max intensity can go up to 15, it's capped - // at 10.0 (before happiness calculations). A full happiness bar will increase the max - // intensity and decrease the min intensity by about 2.5. - ride_rating maxIntensity = std::min(Intensity.GetMaximum() * 100, 1000) + Happiness; - ride_rating minIntensity = (Intensity.GetMinimum() * 100) - Happiness; - if (ride->intensity < minIntensity) + if (ClimateIsRaining() && !ShouldRideWhileRaining(*ride)) { if (peepAtRide) { - InsertNewThought(PeepThoughtType::MoreThrilling, ride->id); + InsertNewThought(PeepThoughtType::NotWhileRaining, ride->id); if (HappinessTarget >= 64) { HappinessTarget -= 8; @@ -2083,35 +2063,62 @@ bool Guest::ShouldGoOnRide(Ride* ride, StationIndex entranceNum, bool atQueue, b ChoseNotToGoOnRide(ride, peepAtRide, true); return false; } - if (ride->intensity > maxIntensity) + // If it is raining and the ride provides shelter skip the + // ride intensity check and get me on a sheltered ride! + if (!ClimateIsRaining() || !ShouldRideWhileRaining(*ride)) { - peep_ride_is_too_intense(this, ride, peepAtRide); - return false; - } - - // Nausea calculations. - ride_rating maxNausea = NauseaMaximumThresholds[(EnumValue(NauseaTolerance) & 3)] + Happiness; - - if (ride->nausea > maxNausea) - { - if (peepAtRide) + if (!gCheatsIgnoreRideIntensity) { - InsertNewThought(PeepThoughtType::Sickening, ride->id); - if (HappinessTarget >= 64) + // Intensity calculations. Even though the max intensity can go up to 15, it's capped + // at 10.0 (before happiness calculations). A full happiness bar will increase the max + // intensity and decrease the min intensity by about 2.5. + ride_rating maxIntensity = std::min(Intensity.GetMaximum() * 100, 1000) + Happiness; + ride_rating minIntensity = (Intensity.GetMinimum() * 100) - Happiness; + if (ride->intensity < minIntensity) { - HappinessTarget -= 8; + if (peepAtRide) + { + InsertNewThought(PeepThoughtType::MoreThrilling, ride->id); + if (HappinessTarget >= 64) + { + HappinessTarget -= 8; + } + ride->UpdatePopularity(0); + } + ChoseNotToGoOnRide(ride, peepAtRide, true); + return false; + } + if (ride->intensity > maxIntensity) + { + peep_ride_is_too_intense(this, ride, peepAtRide); + return false; } - ride->UpdatePopularity(0); - } - ChoseNotToGoOnRide(ride, peepAtRide, true); - return false; - } - // Very nauseous peeps will only go on very gentle rides. - if (ride->nausea >= FIXED_2DP(1, 40) && Nausea > 160) - { - ChoseNotToGoOnRide(ride, peepAtRide, false); - return false; + // Nausea calculations. + ride_rating maxNausea = NauseaMaximumThresholds[(EnumValue(NauseaTolerance) & 3)] + Happiness; + + if (ride->nausea > maxNausea) + { + if (peepAtRide) + { + InsertNewThought(PeepThoughtType::Sickening, ride->id); + if (HappinessTarget >= 64) + { + HappinessTarget -= 8; + } + ride->UpdatePopularity(0); + } + ChoseNotToGoOnRide(ride, peepAtRide, true); + return false; + } + + // Very nauseous peeps will only go on very gentle rides. + if (ride->nausea >= FIXED_2DP(1, 40) && Nausea > 160) + { + ChoseNotToGoOnRide(ride, peepAtRide, false); + return false; + } + } } } } @@ -2296,7 +2303,7 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp finance_payment(-amount, expenditure); - if (gConfigGeneral.show_guest_purchases && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + if (gConfigGeneral.ShowGuestPurchases && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { // HACK Currently disabled for multiplayer due to limitation of all sprites // needing to be synchronised @@ -2903,7 +2910,7 @@ static bool peep_really_liked_ride(Guest* peep, Ride* ride) */ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre_y, int16_t centre_z) { - if ((tile_element_height({ centre_x, centre_y })) > centre_z) + if ((TileElementHeight({ centre_x, centre_y })) > centre_z) return PeepThoughtType::None; uint16_t num_scenery = 0; @@ -2924,6 +2931,11 @@ static PeepThoughtType peep_assess_surroundings(int16_t centre_x, int16_t centre { Ride* ride; + if (tileElement->IsGhost()) + { + continue; + } + switch (tileElement->GetType()) { case TileElementType::Path: @@ -3153,7 +3165,7 @@ template static void peep_head_for_nearest_ride(Guest* peep, bool co for (auto y = cy - searchRadius; y <= cy + searchRadius; y += COORDS_XY_STEP) { auto location = CoordsXY{ x, y }; - if (!map_is_location_valid(location)) + if (!MapIsLocationValid(location)) continue; for (auto* trackElement : TileElementsView(location)) @@ -3346,7 +3358,7 @@ void Guest::UpdateBuying() auto destination = CoordsXY{ 16, 16 } + NextLoc; SetDestination(destination); - PeepDirection = direction_reverse(PeepDirection); + PeepDirection = DirectionReverse(PeepDirection); SetState(PeepState::Walking); return; @@ -3563,7 +3575,7 @@ void PeepUpdateRideLeaveEntranceDefault(Guest* peep, Ride* ride, CoordsXYZD& ent auto ft = Formatter(); ride->FormatNameTo(ft); - if (gConfigNotifications.ride_warnings) + if (gConfigNotifications.RideWarnings) { News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, peep->CurrentRide.ToUnderlying(), ft); } @@ -3850,7 +3862,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) else msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X; - if (gConfigNotifications.guest_on_ride) + if (gConfigNotifications.GuestOnRide) { News::AddItemToQueue(News::ItemType::PeepOnRide, msg_string, sprite_index, ft); } @@ -4131,7 +4143,7 @@ void Guest::UpdateRideLeaveVehicle() CoordsXYZD platformLocation; platformLocation.z = station.GetBaseZ(); - platformLocation.direction = direction_reverse(exitLocation.direction); + platformLocation.direction = DirectionReverse(exitLocation.direction); if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL)) { @@ -4182,7 +4194,7 @@ void Guest::UpdateRideLeaveVehicle() specialDirection &= 3; if (vehicle->TrackSubposition == VehicleTrackSubposition::GoKartsRightLane) - specialDirection = direction_reverse(specialDirection); + specialDirection = DirectionReverse(specialDirection); } } @@ -4525,7 +4537,7 @@ void Guest::UpdateRideApproachExitWaypoints() Var37 |= 3; auto targetLoc = ride->GetStation(CurrentRideStation).Exit.ToCoordsXYZD().ToTileCentre(); - uint8_t exit_direction = direction_reverse(targetLoc.direction); + uint8_t exit_direction = DirectionReverse(targetLoc.direction); int16_t x_shift = DirectionOffsets[exit_direction].x; int16_t y_shift = DirectionOffsets[exit_direction].y; @@ -4758,8 +4770,8 @@ void Guest::UpdateRideLeaveSpiralSlide() auto targetLoc = ride->GetStation(CurrentRideStation).Exit.ToCoordsXYZD().ToTileCentre(); - int16_t xShift = DirectionOffsets[direction_reverse(targetLoc.direction)].x; - int16_t yShift = DirectionOffsets[direction_reverse(targetLoc.direction)].y; + int16_t xShift = DirectionOffsets[DirectionReverse(targetLoc.direction)].x; + int16_t yShift = DirectionOffsets[DirectionReverse(targetLoc.direction)].y; int16_t shiftMultiplier = 20; @@ -4826,7 +4838,7 @@ void Guest::UpdateRideMazePathfinding() auto stationBaseZ = ride->GetStation().GetBaseZ(); // Find the station track element - auto trackElement = map_get_track_element_at({ targetLoc, stationBaseZ }); + auto trackElement = MapGetTrackElementAt({ targetLoc, stationBaseZ }); if (trackElement == nullptr) { return; @@ -4836,8 +4848,8 @@ void Guest::UpdateRideMazePathfinding() // Var37 is 3, 7, 11 or 15 uint8_t hedges[4]{ 0xFF, 0xFF, 0xFF, 0xFF }; uint8_t openCount = 0; - uint8_t mazeReverseLastEdge = direction_reverse(MazeLastEdge); - for (uint8_t i = 0; i < 4; ++i) + uint8_t mazeReverseLastEdge = DirectionReverse(MazeLastEdge); + for (uint8_t i = 0; i < NumOrthogonalDirections; ++i) { if (!(mazeEntry & (1 << _MazeCurrentDirectionToOpenHedge[Var37 / 4][i])) && i != mazeReverseLastEdge) { @@ -4867,7 +4879,7 @@ void Guest::UpdateRideMazePathfinding() }; maze_type mazeType = maze_type::invalid; - auto tileElement = map_get_first_element_at(targetLoc); + auto tileElement = MapGetFirstElementAt(targetLoc); if (tileElement == nullptr) return; do @@ -4948,7 +4960,7 @@ void Guest::UpdateRideLeaveExit() FormatNameTo(ft); ride->FormatNameTo(ft); - if (gConfigNotifications.guest_left_ride) + if (gConfigNotifications.GuestLeftRide) { News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, sprite_index, ft); } @@ -4962,7 +4974,7 @@ void Guest::UpdateRideLeaveExit() // Find the station track element for (auto* pathElement : TileElementsView(targetLoc)) { - int16_t height = map_height_from_slope(targetLoc, pathElement->GetSlopeDirection(), pathElement->IsSloped()); + int16_t height = MapHeightFromSlope(targetLoc, pathElement->GetSlopeDirection(), pathElement->IsSloped()); height += pathElement->GetBaseZ(); int16_t z_diff = z - height; @@ -5060,7 +5072,7 @@ void Guest::UpdateRideShopLeave() return; } - //#11758 Previously SetState(PeepState::Walking) caused Peeps to double-back to exit point of shop + // #11758 Previously SetState(PeepState::Walking) caused Peeps to double-back to exit point of shop SetState(PeepState::Falling); auto ride = get_ride(CurrentRide); @@ -5284,9 +5296,11 @@ void Guest::UpdateWalking() } } - if (PathIsBlockedByVehicle()) + if (ShouldWaitForLevelCrossing()) { // Wait for vehicle to pass + UpdateWaitingAtCrossing(); + return; } @@ -5297,7 +5311,7 @@ void Guest::UpdateWalking() if (GetNextIsSurface()) { - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr) { @@ -5346,7 +5360,7 @@ void Guest::UpdateWalking() if (GetNextIsSurface() || GetNextIsSloped()) return; - TileElement* tileElement = map_get_first_element_at(NextLoc); + TileElement* tileElement = MapGetFirstElementAt(NextLoc); if (tileElement == nullptr) return; @@ -5439,6 +5453,44 @@ void Guest::UpdateWalking() } } +void Guest::UpdateWaitingAtCrossing() +{ + if (!IsActionInterruptable()) + { + UpdateAction(); + Invalidate(); + if (!IsActionWalking()) + return; + } + + Action = PeepActionType::Idle; + NextActionSpriteType = PeepActionSpriteType::WatchRide; + SwitchNextActionSpriteType(); + + if (HasFoodOrDrink()) + { + if ((scenario_rand() & 0xFFFF) <= 1310) + { + Action = PeepActionType::EatFood; + ActionFrame = 0; + ActionSpriteImageOffset = 0; + } + + UpdateCurrentActionSpriteType(); + + return; + } + + if ((scenario_rand() & 0xFFFF) <= 64) + { + Action = PeepActionType::Wave2; + ActionFrame = 0; + ActionSpriteImageOffset = 0; + } + + UpdateCurrentActionSpriteType(); +} + /** * * rct2: 0x69185D @@ -5587,7 +5639,7 @@ void Guest::UpdateEnteringPark() increment_guests_in_park(); decrement_guests_heading_for_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** @@ -5616,7 +5668,7 @@ void Guest::UpdateLeavingPark() DestinationTolerance = 5; decrement_guests_in_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); Var37 = 1; window_invalidate_by_class(WindowClass::GuestList); @@ -5789,7 +5841,7 @@ void Guest::UpdateUsingBin() for (uint8_t curContainer = 0; curContainer < 64; curContainer++) { - if (!(emptyContainers & (1ULL << curContainer))) + if (!(emptyContainers & (1uLL << curContainer))) continue; auto item = ShopItem(curContainer); @@ -5825,7 +5877,7 @@ void Guest::UpdateUsingBin() additionStatus |= spaceLeftInBin << selectedBin; foundElement->SetAdditionStatus(additionStatus); - map_invalidate_tile_zoom0({ NextLoc, foundElement->GetBaseZ(), foundElement->GetClearanceZ() }); + MapInvalidateTileZoom0({ NextLoc, foundElement->GetBaseZ(), foundElement->GetClearanceZ() }); StateReset(); break; } @@ -6122,7 +6174,7 @@ static void peep_update_walking_break_scenery(Guest* peep) tileElement->SetIsBroken(true); - map_invalidate_tile_zoom1({ peep->NextLoc, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 32 }); + MapInvalidateTileZoom1({ peep->NextLoc, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 32 }); peep->Angriness = 16; } @@ -6237,7 +6289,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi { TileElement* tileElement; - auto surfaceElement = map_get_surface_element_at(peep->NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(peep->NextLoc); tileElement = reinterpret_cast(surfaceElement); if (tileElement == nullptr) @@ -6271,12 +6323,12 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi uint16_t x = peep->NextLoc.x + CoordsDirectionDelta[edge].x; uint16_t y = peep->NextLoc.y + CoordsDirectionDelta[edge].y; - if (!map_is_location_valid({ x, y })) + if (!MapIsLocationValid({ x, y })) { return false; } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); tileElement = reinterpret_cast(surfaceElement); if (tileElement == nullptr) @@ -6295,7 +6347,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi } if (tileElement->GetType() != TileElementType::Wall) continue; - if (direction_reverse(tileElement->GetDirection()) != edge) + if (DirectionReverse(tileElement->GetDirection()) != edge) continue; auto wallEntry = tileElement->AsWall()->GetEntry(); if (wallEntry == nullptr || (wallEntry->flags2 & WALL_SCENERY_2_IS_OPAQUE)) @@ -6388,12 +6440,12 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi x += CoordsDirectionDelta[edge].x; y += CoordsDirectionDelta[edge].y; - if (!map_is_location_valid({ x, y })) + if (!MapIsLocationValid({ x, y })) { return false; } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // TODO: extract loop A tileElement = reinterpret_cast(surfaceElement); @@ -6414,7 +6466,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi } if (tileElement->GetType() != TileElementType::Wall) continue; - if (direction_reverse(tileElement->GetDirection()) != edge) + if (DirectionReverse(tileElement->GetDirection()) != edge) continue; auto wallEntry = tileElement->AsWall()->GetEntry(); if (wallEntry == nullptr || (wallEntry->flags2 & WALL_SCENERY_2_IS_OPAQUE)) @@ -6505,12 +6557,12 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi x += CoordsDirectionDelta[edge].x; y += CoordsDirectionDelta[edge].y; - if (!map_is_location_valid({ x, y })) + if (!MapIsLocationValid({ x, y })) { return false; } - surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // TODO: extract loop A tileElement = reinterpret_cast(surfaceElement); @@ -6530,7 +6582,7 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, RideId* rideToVi } if (tileElement->GetType() != TileElementType::Wall) continue; - if (direction_reverse(tileElement->GetDirection()) != edge) + if (DirectionReverse(tileElement->GetDirection()) != edge) continue; auto wallEntry = tileElement->AsWall()->GetEntry(); if (wallEntry == nullptr || (wallEntry->flags2 & WALL_SCENERY_2_IS_OPAQUE)) @@ -6694,9 +6746,9 @@ void Guest::UpdateSpriteType() if (ClimateIsRaining() && (HasItem(ShopItem::Umbrella)) && x != LOCATION_NULL) { CoordsXY loc = { x, y }; - if (map_is_location_valid(loc.ToTileStart())) + if (MapIsLocationValid(loc.ToTileStart())) { - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); while (true) { if (tileElement == nullptr) diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index 40c0eb3e95..ed98769b3f 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -382,6 +382,7 @@ private: void UpdateRide(); void UpdateOnRide(){}; // TODO void UpdateWalking(); + void UpdateWaitingAtCrossing(); void UpdateQueuing(); void UpdateSitting(); void UpdateEnteringPark(); diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index d8c74208b2..973d511a22 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -20,10 +20,10 @@ static bool isLocationLitterable(const CoordsXYZ& mapPos) { TileElement* tileElement; - if (!map_is_location_owned(mapPos)) + if (!MapIsLocationOwned(mapPos)) return false; - tileElement = map_get_first_element_at(mapPos); + tileElement = MapGetFirstElementAt(mapPos); if (tileElement == nullptr) return false; do @@ -35,7 +35,7 @@ static bool isLocationLitterable(const CoordsXYZ& mapPos) if (pathZ < mapPos.z || pathZ >= mapPos.z + PATH_CLEARANCE) continue; - return !tile_element_is_underground(tileElement); + return !TileElementIsUnderground(tileElement); } while (!(tileElement++)->IsLastForTile()); return false; } @@ -170,7 +170,7 @@ static constexpr const LitterSprite _litterSprites[] = { { SPR_LITTER_EMPTY_BOWL_BLUE, 0x3 }, }; -void Litter::Paint(paint_session& session, int32_t imageDirection) const +void Litter::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); @@ -188,5 +188,5 @@ void Litter::Paint(paint_session& session, int32_t imageDirection) const // 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, ImageId(image_id), { 0, 0, z }, { 5, 5, -1 }, { -4, -4, z + 4 }); + PaintAddImageAsParent(session, ImageId(image_id), { 0, 0, z }, { { -4, -4, z + 4 }, { 5, 5, -1 } }); } diff --git a/src/openrct2/entity/Litter.h b/src/openrct2/entity/Litter.h index 43040bd064..5ba13df9de 100644 --- a/src/openrct2/entity/Litter.h +++ b/src/openrct2/entity/Litter.h @@ -14,7 +14,7 @@ class DataSerialiser; struct CoordsXYZ; struct CoordsXYZD; -struct paint_session; +struct PaintSession; struct Litter : EntityBase { @@ -42,5 +42,5 @@ struct Litter : EntityBase void Serialise(DataSerialiser& stream); StringId GetName() const; uint32_t GetAge() const; - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index 4743768520..67778888b4 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -60,7 +60,7 @@ void MoneyEffect::CreateAt(money64 value, const CoordsXYZ& effectPos, bool verti auto [stringId, newValue] = moneyEffect->GetStringId(); char buffer[128]; format_string(buffer, 128, stringId, &newValue); - offsetX = -(gfx_get_string_width(buffer, FontSpriteBase::MEDIUM) / 2); + offsetX = -(gfx_get_string_width(buffer, FontStyle::Medium) / 2); } moneyEffect->OffsetX = offsetX; moneyEffect->Wiggle = 0; @@ -93,7 +93,7 @@ void MoneyEffect::Create(money64 value, const CoordsXYZ& loc) if (!mapPositionXY.has_value()) return; - offsetLoc = { mapPositionXY.value(), tile_element_height(*mapPositionXY) }; + offsetLoc = { mapPositionXY.value(), TileElementHeight(*mapPositionXY) }; } offsetLoc.z += 10; CreateAt(-value, offsetLoc, false); @@ -167,7 +167,7 @@ void MoneyEffect::Serialise(DataSerialiser& stream) stream << Wiggle; } -void MoneyEffect::Paint(paint_session& session, int32_t imageDirection) const +void MoneyEffect::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); diff --git a/src/openrct2/entity/MoneyEffect.h b/src/openrct2/entity/MoneyEffect.h index 316c33b8e8..c7a0738764 100644 --- a/src/openrct2/entity/MoneyEffect.h +++ b/src/openrct2/entity/MoneyEffect.h @@ -13,7 +13,7 @@ class DataSerialiser; struct CoordsXYZ; -struct paint_session; +struct PaintSession; struct MoneyEffect : EntityBase { @@ -32,5 +32,5 @@ struct MoneyEffect : EntityBase void Update(); std::pair GetStringId() const; void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index c98ffa5b9c..94db19ca2f 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -109,8 +109,8 @@ void VehicleCrashParticle::Update() velocity_z = vz & 0xFFFF; // Check collision with land / water - int16_t landZ = tile_element_height(newLoc); - int16_t waterZ = tile_element_water_height(newLoc); + int16_t landZ = TileElementHeight(newLoc); + int16_t waterZ = TileElementWaterHeight(newLoc); if (waterZ != 0 && z >= waterZ && newLoc.z <= waterZ) { @@ -151,7 +151,7 @@ void VehicleCrashParticle::Serialise(DataSerialiser& stream) stream << acceleration_z; } -void VehicleCrashParticle::Paint(paint_session& session, int32_t imageDirection) const +void VehicleCrashParticle::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); @@ -203,7 +203,7 @@ void CrashSplashParticle::Serialise(DataSerialiser& stream) stream << frame; } -void CrashSplashParticle::Paint(paint_session& session, int32_t imageDirection) const +void CrashSplashParticle::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); @@ -218,7 +218,7 @@ void CrashSplashParticle::Paint(paint_session& session, int32_t imageDirection) */ void SteamParticle::Create(const CoordsXYZ& coords) { - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement != nullptr && coords.z > surfaceElement->GetBaseZ()) { SteamParticle* steam = CreateEntity(); @@ -262,7 +262,7 @@ void SteamParticle::Serialise(DataSerialiser& stream) stream << time_to_move; } -void SteamParticle::Paint(paint_session& session, int32_t imageDirection) const +void SteamParticle::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); @@ -308,7 +308,7 @@ void ExplosionCloud::Serialise(DataSerialiser& stream) stream << frame; } -void ExplosionCloud::Paint(paint_session& session, int32_t imageDirection) const +void ExplosionCloud::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); @@ -353,7 +353,7 @@ void ExplosionFlare::Serialise(DataSerialiser& stream) stream << frame; } -void ExplosionFlare::Paint(paint_session& session, int32_t imageDirection) const +void ExplosionFlare::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); diff --git a/src/openrct2/entity/Particle.h b/src/openrct2/entity/Particle.h index c34525592f..23c0b068b7 100644 --- a/src/openrct2/entity/Particle.h +++ b/src/openrct2/entity/Particle.h @@ -13,7 +13,7 @@ class DataSerialiser; struct CoordsXYZ; -struct paint_session; +struct PaintSession; struct VehicleColour; struct VehicleCrashParticle : EntityBase @@ -32,7 +32,7 @@ struct VehicleCrashParticle : EntityBase static void Create(VehicleColour& colours, const CoordsXYZ& vehiclePos); void Update(); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; struct CrashSplashParticle : EntityBase @@ -42,7 +42,7 @@ struct CrashSplashParticle : EntityBase static void Create(const CoordsXYZ& splashPos); void Update(); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; struct ExplosionFlare : EntityBase @@ -52,7 +52,7 @@ struct ExplosionFlare : EntityBase static void Create(const CoordsXYZ& flarePos); void Update(); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; struct ExplosionCloud : EntityBase @@ -62,7 +62,7 @@ struct ExplosionCloud : EntityBase static void Create(const CoordsXYZ& cloudPos); void Update(); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; struct SteamParticle : EntityBase @@ -74,5 +74,5 @@ struct SteamParticle : EntityBase static void Create(const CoordsXYZ& coords); void Update(); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; }; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 00df0b4ed8..9534596bf2 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -294,7 +294,7 @@ bool Peep::CheckForPath() return true; } - TileElement* tile_element = map_get_first_element_at(NextLoc); + TileElement* tile_element = MapGetFirstElementAt(NextLoc); auto mapType = TileElementType::Path; if (GetNextIsSurface()) @@ -321,11 +321,17 @@ bool Peep::CheckForPath() return false; } -bool Peep::PathIsBlockedByVehicle() +bool Peep::ShouldWaitForLevelCrossing() { + if (IsOnPathBlockedByVehicle()) + { + // Try to get out of the way + return false; + } + auto curPos = TileCoordsXYZ(GetLocation()); auto dstPos = TileCoordsXYZ(CoordsXYZ{ GetDestination(), NextLoc.z }); - if ((curPos.x != dstPos.x || curPos.y != dstPos.y) && footpath_is_blocked_by_vehicle(dstPos)) + if ((curPos.x != dstPos.x || curPos.y != dstPos.y) && FootpathIsBlockedByVehicle(dstPos)) { return true; } @@ -335,10 +341,16 @@ bool Peep::PathIsBlockedByVehicle() bool Peep::IsOnLevelCrossing() { - auto trackElement = map_get_track_element_at(GetLocation()); + auto trackElement = MapGetTrackElementAt(GetLocation()); return trackElement != nullptr; } +bool Peep::IsOnPathBlockedByVehicle() +{ + auto curPos = TileCoordsXYZ(GetLocation()); + return FootpathIsBlockedByVehicle(curPos); +} + PeepActionSpriteType Peep::GetActionSpriteType() { if (IsActionInterruptable()) @@ -614,11 +626,11 @@ void Peep::PickupAbort(int32_t old_x) // dropped. GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) { - auto* pathElement = map_get_path_element_at(location); + auto* pathElement = MapGetPathElementAt(location); TileElement* tileElement = reinterpret_cast(pathElement); if (pathElement == nullptr) { - tileElement = reinterpret_cast(map_get_surface_element_at(location.ToCoordsXYZ())); + tileElement = reinterpret_cast(MapGetSurfaceElementAt(location.ToCoordsXYZ())); } if (tileElement == nullptr) { @@ -629,7 +641,7 @@ GameActions::Result Peep::Place(const TileCoordsXYZ& location, bool apply) // in the middle of a tile. CoordsXYZ destination = { location.ToCoordsXY().ToTileCentre(), tileElement->GetBaseZ() + 16 }; - if (!map_is_location_owned(destination)) + if (!MapIsLocationOwned(destination)) { return GameActions::Result(GameActions::Status::NotOwned, STR_ERR_CANT_PLACE_PERSON_HERE, STR_LAND_NOT_OWNED_BY_PARK); } @@ -701,7 +713,7 @@ void peep_sprite_remove(Peep* peep) EntityRemove(peep); auto intent = Intent(wasGuest ? INTENT_ACTION_REFRESH_GUEST_LIST : INTENT_ACTION_REFRESH_STAFF_LIST); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** @@ -716,7 +728,7 @@ void Peep::Remove() { decrement_guests_in_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } if (State == PeepState::EnteringPark) { @@ -740,7 +752,7 @@ void Peep::UpdateFalling() if (Action == PeepActionType::Drowning) return; - if (gConfigNotifications.guest_died) + if (gConfigNotifications.GuestDied) { auto ft = Formatter(); FormatNameTo(ft); @@ -753,7 +765,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(CoordsXY{ x, y }); + TileElement* tile_element = MapGetFirstElementAt(CoordsXY{ x, y }); TileElement* saved_map = nullptr; int32_t saved_height = 0; @@ -764,7 +776,7 @@ void Peep::UpdateFalling() // If a path check if we are on it if (tile_element->GetType() == TileElementType::Path) { - int32_t height = map_height_from_slope( + int32_t height = MapHeightFromSlope( { x, y }, tile_element->AsPath()->GetSlopeDirection(), tile_element->AsPath()->IsSloped()) + tile_element->GetBaseZ(); @@ -804,7 +816,7 @@ void Peep::UpdateFalling() return; } } - int32_t map_height = tile_element_height({ x, y }); + int32_t map_height = TileElementHeight({ x, y }); if (map_height < z || map_height - 4 > z) continue; saved_height = map_height; @@ -976,6 +988,10 @@ void Peep::Update() if (State == PeepState::Queuing) stepsToTake += stepsToTake / 2; } + // Ensure guests make it across a level crossing in time + constexpr auto minStepsForCrossing = 55; + if (stepsToTake < minStepsForCrossing && IsOnPathBlockedByVehicle()) + stepsToTake = minStepsForCrossing; uint32_t carryCheck = StepProgress + stepsToTake; StepProgress = carryCheck; @@ -1118,7 +1134,7 @@ void peep_problem_warnings_update() else if (hungerCounter >= PEEP_HUNGER_WARNING_THRESHOLD && hungerCounter >= gNumGuestsInPark / 16) { warningThrottle[0] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Hungry); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_ARE_HUNGRY, thoughtId, {}); @@ -1130,7 +1146,7 @@ void peep_problem_warnings_update() else if (thirstCounter >= PEEP_THIRST_WARNING_THRESHOLD && thirstCounter >= gNumGuestsInPark / 16) { warningThrottle[1] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Thirsty); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_ARE_THIRSTY, thoughtId, {}); @@ -1142,7 +1158,7 @@ void peep_problem_warnings_update() else if (toiletCounter >= PEEP_TOILET_WARNING_THRESHOLD && toiletCounter >= gNumGuestsInPark / 16) { warningThrottle[2] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Toilet); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_CANT_FIND_TOILET, thoughtId, {}); @@ -1154,7 +1170,7 @@ void peep_problem_warnings_update() else if (litterCounter >= PEEP_LITTER_WARNING_THRESHOLD && litterCounter >= gNumGuestsInPark / 32) { warningThrottle[3] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::BadLitter); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_DISLIKE_LITTER, thoughtId, {}); @@ -1166,7 +1182,7 @@ void peep_problem_warnings_update() else if (disgustCounter >= PEEP_DISGUST_WARNING_THRESHOLD && disgustCounter >= gNumGuestsInPark / 32) { warningThrottle[4] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::PathDisgusting); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_DISGUSTED_BY_PATHS, thoughtId, {}); @@ -1178,7 +1194,7 @@ void peep_problem_warnings_update() else if (vandalismCounter >= PEEP_VANDALISM_WARNING_THRESHOLD && vandalismCounter >= gNumGuestsInPark / 32) { warningThrottle[5] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Vandalism); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_DISLIKE_VANDALISM, thoughtId, {}); @@ -1190,7 +1206,7 @@ void peep_problem_warnings_update() else if (noexitCounter >= PEEP_NOEXIT_WARNING_THRESHOLD) { warningThrottle[6] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::CantFindExit); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_GETTING_LOST_OR_STUCK, thoughtId, {}); @@ -1199,7 +1215,7 @@ void peep_problem_warnings_update() else if (lostCounter >= PEEP_LOST_WARNING_THRESHOLD) { warningThrottle[6] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { constexpr auto thoughtId = static_cast(PeepThoughtType::Lost); News::AddItemToQueue(News::ItemType::Peeps, STR_PEEPS_GETTING_LOST_OR_STUCK, thoughtId, {}); @@ -1212,7 +1228,7 @@ void peep_problem_warnings_update() { // The amount of guests complaining about queue duration is at least 5% of the amount of queuing guests. // This includes guests who are no longer queuing. warningThrottle[7] = 4; - if (gConfigNotifications.guest_warnings) + if (gConfigNotifications.GuestWarnings) { auto rideWithMostQueueComplaints = std::max_element( queueComplainingGuestsMap.begin(), queueComplainingGuestsMap.end(), @@ -1243,7 +1259,7 @@ void peep_update_crowd_noise() if (OpenRCT2::Audio::gGameSoundsOff) return; - if (!gConfigSound.sound_enabled) + if (!gConfigSound.SoundEnabled) return; if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) @@ -1337,7 +1353,7 @@ void peep_applause() } // Play applause noise - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Applause, 0, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Applause, 0, ContextGetWidth() / 2); } /** @@ -1639,7 +1655,7 @@ void peep_set_map_tooltip(Peep* peep) auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** @@ -1666,7 +1682,7 @@ void Peep::SwitchNextActionSpriteType() */ static void peep_return_to_centre_of_tile(Peep* peep) { - peep->PeepDirection = direction_reverse(peep->PeepDirection); + peep->PeepDirection = DirectionReverse(peep->PeepDirection); auto destination = peep->GetLocation().ToTileCentre(); peep->SetDestination(destination, 5); } @@ -1783,7 +1799,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin auto ft = Formatter(); guest->FormatNameTo(ft); ride->FormatNameTo(ft); - if (gConfigNotifications.guest_queuing_for_ride) + if (gConfigNotifications.GuestQueuingForRide) { News::AddItemToQueue( News::ItemType::PeepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->sprite_index, ft); @@ -1811,7 +1827,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin uint8_t entranceDirection = tile_element->GetDirection(); if (entranceDirection != guest->PeepDirection) { - if (direction_reverse(entranceDirection) != guest->PeepDirection) + if (DirectionReverse(entranceDirection) != guest->PeepDirection) { peep_return_to_centre_of_tile(guest); return true; @@ -1844,7 +1860,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin { auto ft = Formatter(); guest->FormatNameTo(ft); - if (gConfigNotifications.guest_left_park) + if (gConfigNotifications.GuestLeftPark) { News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_LEFT_PARK, guest->sprite_index, ft); } @@ -1880,7 +1896,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin auto nextLoc = coords.ToTileStart() + CoordsDirectionDelta[entranceDirection]; // Make sure there is a path right behind the entrance, otherwise turn around - TileElement* nextTileElement = map_get_first_element_at(nextLoc); + TileElement* nextTileElement = MapGetFirstElementAt(nextLoc); do { if (nextTileElement == nullptr) @@ -1904,7 +1920,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin break; } - if (direction_reverse(slopeDirection) != entranceDirection) + if (DirectionReverse(slopeDirection) != entranceDirection) continue; if (z - 2 != nextTileElement->base_height) @@ -1932,7 +1948,7 @@ static bool peep_interact_with_entrance(Peep* peep, const CoordsXYE& coords, uin return true; } - money16 entranceFee = park_get_entrance_fee(); + money16 entranceFee = ParkGetEntranceFee(); if (entranceFee != 0) { if (guest->HasItem(ShopItem::Voucher)) @@ -2134,7 +2150,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords) int16_t z = tile_element->GetBaseZ(); auto* guest = peep->As(); - if (map_is_location_owned({ coords, z })) + if (MapIsLocationOwned({ coords, z })) { if (guest != nullptr && guest->OutsideOfPark) { @@ -2180,7 +2196,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords) if ((tile_element->AsPath()->HasQueueBanner()) && (tile_element->AsPath()->GetQueueBannerDirection() - == direction_reverse(guest->PeepDirection)) // Ride sign is facing the direction the peep is walking + == DirectionReverse(guest->PeepDirection)) // Ride sign is facing the direction the peep is walking ) { /* Peep is approaching the entrance of a ride queue. @@ -2213,7 +2229,7 @@ static void peep_interact_with_path(Peep* peep, const CoordsXYE& coords) auto ft = Formatter(); guest->FormatNameTo(ft); ride->FormatNameTo(ft); - if (gConfigNotifications.guest_queuing_for_ride) + if (gConfigNotifications.GuestQueuingForRide) { News::AddItemToQueue( News::ItemType::PeepOnRide, STR_PEEP_TRACKING_PEEP_JOINED_QUEUE_FOR_X, guest->sprite_index, ft); @@ -2328,7 +2344,7 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords) ride->FormatNameTo(ft); StringId string_id = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_PEEP_TRACKING_PEEP_IS_IN_X : STR_PEEP_TRACKING_PEEP_IS_ON_X; - if (gConfigNotifications.guest_used_facility) + if (gConfigNotifications.GuestUsedFacility) { News::AddItemToQueue(News::ItemType::PeepOnRide, string_id, guest->sprite_index, ft); } @@ -2404,7 +2420,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) return; } - if (map_is_edge(newLoc)) + if (MapIsEdge(newLoc)) { if (guest != nullptr && guest->OutsideOfPark) { @@ -2414,7 +2430,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) return; } - TileElement* tileElement = map_get_first_element_at(newLoc); + TileElement* tileElement = MapGetFirstElementAt(newLoc); if (tileElement == nullptr) return; int16_t base_z = std::max(0, (z / 8) - 2); @@ -2456,7 +2472,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) if (Is() || (GetNextIsSurface())) { - int16_t height = abs(tile_element_height(newLoc) - z); + int16_t height = abs(TileElementHeight(newLoc) - z); if (height <= 3 || (Is() && height <= 32)) { InteractionRideIndex = RideId::GetNull(); @@ -2466,13 +2482,13 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) SetState(PeepState::One); } - if (!map_is_location_in_park(newLoc)) + if (!MapIsLocationInPark(newLoc)) { peep_return_to_centre_of_tile(this); return; } - auto surfaceElement = map_get_surface_element_at(newLoc); + auto surfaceElement = MapGetSurfaceElementAt(newLoc); if (surfaceElement == nullptr) { peep_return_to_centre_of_tile(this); @@ -2522,11 +2538,11 @@ int32_t Peep::GetZOnSlope(int32_t tile_x, int32_t tile_y) if (GetNextIsSurface()) { - return tile_element_height({ tile_x, tile_y }); + return TileElementHeight({ tile_x, tile_y }); } uint8_t slope = GetNextDirection(); - return NextLoc.z + map_height_from_slope({ tile_x, tile_y }, slope, GetNextIsSloped()); + return NextLoc.z + MapHeightFromSlope({ tile_x, tile_y }, slope, GetNextIsSloped()); } StringId get_real_name_string_id_from_id(uint32_t id) @@ -2613,7 +2629,7 @@ void peep_update_names(bool realNames) } auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); gfx_invalidate_screen(); } @@ -2755,7 +2771,7 @@ void Peep::Serialise(DataSerialiser& stream) stream << PeepFlags; } -void Peep::Paint(paint_session& session, int32_t imageDirection) const +void Peep::Paint(PaintSession& session, int32_t imageDirection) const { PROFILED_FUNCTION(); @@ -2805,7 +2821,10 @@ void Peep::Paint(paint_session& session, int32_t imageDirection) const // bound_box_offset_z to make sure peeps are drawn on top of railways uint32_t baseImageId = (imageDirection >> 3) + GetPeepAnimation(SpriteType, actionSpriteType).base_image + imageOffset * 4; auto imageId = ImageId(baseImageId, TshirtColour, TrousersColour); - PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 1, 1, 11 }, { 0, 0, z + 5 }); + + auto bb = BoundBoxXYZ{ { 0, 0, z + 5 }, { 1, 1, 11 } }; + auto offset = CoordsXYZ{ 0, 0, z }; + PaintAddImageAsParent(session, imageId, { 0, 0, z }, bb); auto* guest = As(); if (guest != nullptr) @@ -2813,21 +2832,21 @@ void Peep::Paint(paint_session& session, int32_t imageDirection) const if (baseImageId >= 10717 && baseImageId < 10749) { imageId = ImageId(baseImageId + 32, guest->HatColour); - PaintAddImageAsChild(session, imageId, { 0, 0, z }, { 1, 1, 11 }, { 0, 0, z + 5 }); + PaintAddImageAsChild(session, imageId, offset, bb); return; } if (baseImageId >= 10781 && baseImageId < 10813) { imageId = ImageId(baseImageId + 32, guest->BalloonColour); - PaintAddImageAsChild(session, imageId, { 0, 0, z }, { 1, 1, 11 }, { 0, 0, z + 5 }); + PaintAddImageAsChild(session, imageId, offset, bb); return; } if (baseImageId >= 11197 && baseImageId < 11229) { imageId = ImageId(baseImageId + 32, guest->UmbrellaColour); - PaintAddImageAsChild(session, imageId, { 0, 0, z }, { 1, 1, 11 }, { 0, 0, z + 5 }); + PaintAddImageAsChild(session, imageId, offset, bb); return; } } diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index fff6eb4601..48f7399dcb 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -29,7 +29,7 @@ constexpr auto PEEP_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP; class Formatter; struct TileElement; -struct paint_session; +struct PaintSession; namespace GameActions { @@ -407,13 +407,14 @@ public: // Peep [[nodiscard]] CoordsXY GetDestination() const; void Serialise(class DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; // TODO: Make these private again when done refactoring public: // Peep [[nodiscard]] bool CheckForPath(); - bool PathIsBlockedByVehicle(); + bool ShouldWaitForLevelCrossing(); bool IsOnLevelCrossing(); + bool IsOnPathBlockedByVehicle(); void PerformNextAction(uint8_t& pathing_result); void PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result); [[nodiscard]] int32_t GetZOnSlope(int32_t tile_x, int32_t tile_y); diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 882262f11b..ed73b6a8ed 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -81,7 +81,7 @@ template<> bool EntityBase::Is() const bool Staff::IsLocationInPatrol(const CoordsXY& loc) const { // Check if location is in the park - if (!map_is_location_owned_or_has_rights(loc)) + if (!MapIsLocationOwnedOrHasRights(loc)) return false; // Check if staff has patrol area @@ -168,7 +168,7 @@ bool Staff::CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) cons } /* Search through all adjacent map elements */ - TileElement* test_element = map_get_first_element_at(adjacPos); + TileElement* test_element = MapGetFirstElementAt(adjacPos); if (test_element == nullptr) return false; bool pathfound = false; @@ -360,7 +360,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const int16_t nextZ = ((z + COORDS_Z_STEP) & 0xFFF0) / COORDS_Z_STEP; - TileElement* tileElement = map_get_first_element_at(nextTile); + TileElement* tileElement = MapGetFirstElementAt(nextTile); if (tileElement == nullptr) return INVALID_DIRECTION; do @@ -375,7 +375,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const nextTile = CoordsXY(x, y).ToTileStart() + CoordsDirectionDelta[nextDirection]; - tileElement = map_get_first_element_at(nextTile); + tileElement = MapGetFirstElementAt(nextTile); if (tileElement == nullptr) return INVALID_DIRECTION; @@ -400,7 +400,7 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const { if (!(GetNextIsSurface())) { - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement == nullptr) return INVALID_DIRECTION; @@ -428,10 +428,10 @@ uint8_t Staff::HandymanDirectionToUncutGrass(uint8_t valid_directions) const CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[chosenDirection]; - if (!map_is_location_valid(chosenTile)) + if (!MapIsLocationValid(chosenTile)) continue; - auto surfaceElement = map_get_surface_element_at(chosenTile); + auto surfaceElement = MapGetSurfaceElementAt(chosenTile); if (surfaceElement != nullptr) { if (std::abs(surfaceElement->GetBaseZ() - NextLoc.z) <= 2 * COORDS_Z_STEP) @@ -461,7 +461,7 @@ Direction Staff::HandymanDirectionRandSurface(uint8_t validDirections) const CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; - if (map_surface_is_blocked(chosenTile)) + if (MapSurfaceIsBlocked(chosenTile)) continue; break; @@ -503,7 +503,7 @@ bool Staff::DoHandymanPathFinding() } else { - auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ NextLoc }); + auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ NextLoc }); if (pathElement == nullptr) return true; @@ -531,10 +531,10 @@ bool Staff::DoHandymanPathFinding() } else { - pathDirections &= ~(1 << direction_reverse(PeepDirection)); + pathDirections &= ~(1 << DirectionReverse(PeepDirection)); if (pathDirections == 0) { - pathDirections |= 1 << direction_reverse(PeepDirection); + pathDirections |= 1 << DirectionReverse(PeepDirection); } } @@ -550,11 +550,11 @@ bool Staff::DoHandymanPathFinding() } // newDirection can only contain a cardinal direction at this point, no diagonals - assert(direction_valid(newDirection)); + assert(DirectionValid(newDirection)); CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; - while (!map_is_location_valid(chosenTile)) + while (!MapIsLocationValid(chosenTile)) { newDirection = HandymanDirectionRandSurface(validDirections); chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; @@ -591,15 +591,15 @@ Direction Staff::DirectionSurface(Direction initialDirection) const direction &= 3; - if (fence_in_the_way({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, direction)) + if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, direction)) continue; - if (fence_in_the_way({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, direction_reverse(direction))) + if (WallInTheWay({ NextLoc, NextLoc.z, NextLoc.z + PEEP_CLEARANCE_HEIGHT }, DirectionReverse(direction))) continue; CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[direction]; - if (!map_surface_is_blocked(chosenTile)) + if (!MapSurfaceIsBlocked(chosenTile)) { return direction; } @@ -669,10 +669,10 @@ Direction Staff::MechanicDirectionPath(uint8_t validDirections, PathElement* pat } // Check if this is dead end - i.e. only way out is the reverse direction. - pathDirections &= ~(1 << direction_reverse(PeepDirection)); + pathDirections &= ~(1 << DirectionReverse(PeepDirection)); if (pathDirections == 0) { - pathDirections |= (1 << direction_reverse(PeepDirection)); + pathDirections |= (1 << DirectionReverse(PeepDirection)); } Direction direction = bitscanforward(pathDirections); @@ -759,7 +759,7 @@ bool Staff::DoMechanicPathFinding() } else { - auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ NextLoc }); + auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ NextLoc }); if (pathElement == nullptr) return true; @@ -767,11 +767,11 @@ bool Staff::DoMechanicPathFinding() } // countof(CoordsDirectionDelta) - assert(direction_valid(newDirection)); + assert(DirectionValid(newDirection)); CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; - while (!map_is_location_valid(chosenTile)) + while (!MapIsLocationValid(chosenTile)) { newDirection = MechanicDirectionSurface(); chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; @@ -801,10 +801,10 @@ Direction Staff::DirectionPath(uint8_t validDirections, PathElement* pathElement return DirectionSurface(scenario_rand() & 3); } - pathDirections &= ~(1 << direction_reverse(PeepDirection)); + pathDirections &= ~(1 << DirectionReverse(PeepDirection)); if (pathDirections == 0) { - pathDirections |= (1 << direction_reverse(PeepDirection)); + pathDirections |= (1 << DirectionReverse(PeepDirection)); } Direction direction = bitscanforward(pathDirections); @@ -815,7 +815,7 @@ Direction Staff::DirectionPath(uint8_t validDirections, PathElement* pathElement } direction = scenario_rand() & 3; - for (uint8_t i = 0; i < NumOrthogonalDirections; ++i, direction = direction_next(direction)) + for (uint8_t i = 0; i < NumOrthogonalDirections; ++i, direction = DirectionNext(direction)) { if (pathDirections & (1 << direction)) return direction; @@ -840,7 +840,7 @@ bool Staff::DoMiscPathFinding() } else { - auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ NextLoc }); + auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ NextLoc }); if (pathElement == nullptr) return true; @@ -849,7 +849,7 @@ bool Staff::DoMiscPathFinding() CoordsXY chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; - while (!map_is_location_valid(chosenTile)) + while (!MapIsLocationValid(chosenTile)) { newDirection = DirectionSurface(scenario_rand() & 3); chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; @@ -874,6 +874,9 @@ bool Staff::IsMechanicHeadingToFixRideBlockingPath() return false; auto ride = get_ride(trackElement->GetRideIndex()); + if (ride == nullptr) + return false; + return ride->id == CurrentRide && ride->breakdown_reason == BREAKDOWN_SAFETY_CUT_OUT; } @@ -1027,7 +1030,7 @@ uint32_t staff_get_available_entertainer_costumes() { if (scenery_group_is_invented(i)) { - const auto sgEntry = get_scenery_group_entry(i); + const auto sgEntry = GetSceneryGroupEntry(i); entertainerCostumes |= sgEntry->entertainer_costumes; } } @@ -1074,7 +1077,7 @@ void Staff::UpdateMowing() { if (auto loc = UpdateAction(); loc.has_value()) { - int16_t checkZ = tile_element_height(*loc); + int16_t checkZ = TileElementHeight(*loc); MoveTo({ loc.value(), checkZ }); return; } @@ -1098,11 +1101,11 @@ void Staff::UpdateMowing() if (Var37 != 7) continue; - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr && surfaceElement->CanGrassGrow()) { surfaceElement->SetGrassLength(GRASS_LENGTH_MOWED); - map_invalidate_tile_zoom0({ NextLoc, surfaceElement->GetBaseZ(), surfaceElement->GetBaseZ() + 16 }); + MapInvalidateTileZoom0({ NextLoc, surfaceElement->GetBaseZ(), surfaceElement->GetBaseZ() + 16 }); } StaffLawnsMown++; WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS; @@ -1145,7 +1148,7 @@ void Staff::UpdateWatering() auto actionLoc = CoordsXY{ NextLoc } + CoordsDirectionDelta[Var37]; - TileElement* tile_element = map_get_first_element_at(actionLoc); + TileElement* tile_element = MapGetFirstElementAt(actionLoc); if (tile_element == nullptr) return; @@ -1163,7 +1166,7 @@ void Staff::UpdateWatering() continue; tile_element->AsSmallScenery()->SetAge(0); - map_invalidate_tile_zoom0({ actionLoc, tile_element->GetBaseZ(), tile_element->GetClearanceZ() }); + MapInvalidateTileZoom0({ actionLoc, tile_element->GetBaseZ(), tile_element->GetClearanceZ() }); StaffGardensWatered++; WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS; } while (!(tile_element++)->IsLastForTile()); @@ -1212,7 +1215,7 @@ void Staff::UpdateEmptyingBin() if (ActionFrame != 11) return; - TileElement* tile_element = map_get_first_element_at(NextLoc); + TileElement* tile_element = MapGetFirstElementAt(NextLoc); if (tile_element == nullptr) return; @@ -1247,7 +1250,7 @@ void Staff::UpdateEmptyingBin() uint8_t additionStatus = tile_element->AsPath()->GetAdditionStatus() | ((3 << Var37) << Var37); tile_element->AsPath()->SetAdditionStatus(additionStatus); - map_invalidate_tile_zoom0({ NextLoc, tile_element->GetBaseZ(), tile_element->GetClearanceZ() }); + MapInvalidateTileZoom0({ NextLoc, tile_element->GetBaseZ(), tile_element->GetClearanceZ() }); StaffBinsEmptied++; WindowInvalidateFlags |= PEEP_INVALIDATE_STAFF_STATS; } @@ -1338,7 +1341,7 @@ void Staff::UpdateHeadingToInspect() if (!CheckForPath()) return; - if (PathIsBlockedByVehicle() && !IsMechanicHeadingToFixRideBlockingPath()) + if (ShouldWaitForLevelCrossing() && !IsMechanicHeadingToFixRideBlockingPath()) return; uint8_t pathingResult; @@ -1446,7 +1449,7 @@ void Staff::UpdateAnswering() if (!CheckForPath()) return; - if (PathIsBlockedByVehicle() && !IsMechanicHeadingToFixRideBlockingPath()) + if (ShouldWaitForLevelCrossing() && !IsMechanicHeadingToFixRideBlockingPath()) return; uint8_t pathingResult; @@ -1524,7 +1527,7 @@ bool Staff::UpdatePatrollingFindWatering() auto chosenLoc = CoordsXY{ NextLoc } + CoordsDirectionDelta[chosen_position]; - TileElement* tile_element = map_get_first_element_at(chosenLoc); + TileElement* tile_element = MapGetFirstElementAt(chosenLoc); // This seems to happen in some SV4 files. if (tile_element == nullptr) @@ -1591,7 +1594,7 @@ bool Staff::UpdatePatrollingFindBin() if (GetNextIsSurface()) return false; - TileElement* tileElement = map_get_first_element_at(NextLoc); + TileElement* tileElement = MapGetFirstElementAt(NextLoc); if (tileElement == nullptr) return false; @@ -1658,7 +1661,7 @@ bool Staff::UpdatePatrollingFindGrass() if (!(GetNextIsSurface())) return false; - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr && surfaceElement->CanGrassGrow()) { if ((surfaceElement->GetGrassLength() & 0x7) >= GRASS_LENGTH_CLEAR_1) @@ -1781,7 +1784,7 @@ void Staff::UpdatePatrolling() if (!CheckForPath()) return; - if (PathIsBlockedByVehicle() && !IsMechanicHeadingToFixRideBlockingPath()) + if (ShouldWaitForLevelCrossing() && !IsMechanicHeadingToFixRideBlockingPath()) return; uint8_t pathingResult; @@ -1791,7 +1794,7 @@ void Staff::UpdatePatrolling() if (GetNextIsSurface()) { - auto surfaceElement = map_get_surface_element_at(NextLoc); + auto surfaceElement = MapGetSurfaceElementAt(NextLoc); if (surfaceElement != nullptr) { @@ -2207,7 +2210,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride) return true; } - auto tileElement = map_get_track_element_at(stationPos); + auto tileElement = MapGetTrackElementAt(stationPos); if (tileElement == nullptr) { log_error("Couldn't find tile_element"); @@ -2296,7 +2299,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride) CoordsXYE input; input.x = stationPosition.x; input.y = stationPosition.y; - input.element = map_get_track_element_at_from_ride({ input.x, input.y, stationPosition.z }, CurrentRide); + input.element = MapGetTrackElementAtFromRide({ input.x, input.y, stationPosition.z }, CurrentRide); if (input.element == nullptr) { return true; diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 9d7e6a8312..7878a3652f 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -55,13 +55,13 @@ bool chat_available() void chat_open() { gChatOpen = true; - _chatTextInputSession = context_start_text_input(_chatCurrentLine, sizeof(_chatCurrentLine)); + _chatTextInputSession = ContextStartTextInput(_chatCurrentLine, sizeof(_chatCurrentLine)); } void chat_close() { gChatOpen = false; - context_stop_text_input(); + ContextStopTextInput(); } void chat_toggle() @@ -99,9 +99,9 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor) } _chatLeft = 10; - _chatRight = std::min((context_get_width() - 10), CHAT_MAX_WINDOW_WIDTH); + _chatRight = std::min((ContextGetWidth() - 10), CHAT_MAX_WINDOW_WIDTH); _chatWidth = _chatRight - _chatLeft; - _chatBottom = context_get_height() - 45; + _chatBottom = ContextGetHeight() - 45; _chatTop = _chatBottom - 10; char* inputLine = _chatCurrentLine; @@ -198,10 +198,10 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor) gfx_set_dirty_blocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } }); // TODO: Show caret if the input text has multiple lines - if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer, FontSpriteBase::MEDIUM) < (_chatWidth - 10)) + if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer, FontStyle::Medium) < (_chatWidth - 10)) { lineBuffer.assign(_chatCurrentLine, _chatTextInputSession->SelectionStart); - int32_t caretX = screenCoords.x + gfx_get_string_width(lineBuffer, FontSpriteBase::MEDIUM); + int32_t caretX = screenCoords.x + gfx_get_string_width(lineBuffer, FontStyle::Medium); int32_t caretY = screenCoords.y + 14; gfx_fill_rect(dpi, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PALETTE_INDEX_56); @@ -274,12 +274,13 @@ static void chat_clear_input() static int32_t chat_history_draw_string( rct_drawpixelinfo* dpi, const char* text, const ScreenCoordsXY& screenCoords, int32_t width) { - auto buffer = gCommonStringFormatBuffer; - FormatStringToBuffer(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), "{OUTLINE}{WHITE}{STRING}", text); + char buffer[CommonTextBufferSize]; + auto bufferPtr = buffer; + FormatStringToBuffer(buffer, sizeof(buffer), "{OUTLINE}{WHITE}{STRING}", text); int32_t numLines; - gfx_wrap_string(buffer, width, FontSpriteBase::MEDIUM, &numLines); - auto lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + gfx_wrap_string(bufferPtr, width, FontStyle::Medium, &numLines); + auto lineHeight = font_get_line_height(FontStyle::Medium); int32_t expectedY = screenCoords.y - (numLines * lineHeight); if (expectedY < 50) @@ -290,8 +291,8 @@ static int32_t chat_history_draw_string( auto lineY = screenCoords.y; for (int32_t line = 0; line <= numLines; ++line) { - gfx_draw_string(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, buffer, { TEXT_COLOUR_254 }); - buffer = get_string_end(buffer) + 1; + gfx_draw_string(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 }); + bufferPtr = get_string_end(bufferPtr) + 1; lineY += lineHeight; } return lineY - screenCoords.y; @@ -301,17 +302,18 @@ static int32_t chat_history_draw_string( // Almost the same as gfx_draw_string_left_wrapped int32_t chat_string_wrapped_get_height(void* args, int32_t width) { - char* buffer = gCommonStringFormatBuffer; - format_string(buffer, 256, STR_STRING, args); + char buffer[CommonTextBufferSize]; + auto bufferPtr = buffer; + format_string(bufferPtr, 256, STR_STRING, args); int32_t numLines; - gfx_wrap_string(buffer, width, FontSpriteBase::MEDIUM, &numLines); - int32_t lineHeight = font_get_line_height(FontSpriteBase::MEDIUM); + gfx_wrap_string(bufferPtr, width, FontStyle::Medium, &numLines); + int32_t lineHeight = font_get_line_height(FontStyle::Medium); int32_t lineY = 0; for (int32_t line = 0; line <= numLines; ++line) { - buffer = get_string_end(buffer) + 1; + bufferPtr = get_string_end(bufferPtr) + 1; lineY += lineHeight; } diff --git a/src/openrct2/interface/Fonts.cpp b/src/openrct2/interface/Fonts.cpp index ff027d46c2..14b7a69248 100644 --- a/src/openrct2/interface/Fonts.cpp +++ b/src/openrct2/interface/Fonts.cpp @@ -14,6 +14,7 @@ #include "../drawing/TTF.h" #include "../localisation/Language.h" #include "../localisation/LocalisationService.h" +#include "../util/Util.h" #include "FontFamilies.h" using namespace OpenRCT2::Localisation; @@ -25,81 +26,81 @@ uint8_t const HINTING_THRESHOLD_MEDIUM = 60; // clang-format off TTFFontSetDescriptor TTFFontMSGothic = { { + { "msgothic.ttc", "MS PGothic", 12, 1, 0, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, + { "msgothic.ttc", "MS PGothic", 12, 1, 0, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { "msgothic.ttc", "MS PGothic", 9, 1, 1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, - { "msgothic.ttc", "MS PGothic", 12, 1, 0, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, - { "msgothic.ttc", "MS PGothic", 12, 1, 0, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontNotoSansMono = { { + { "NotoSansCJK-Regular.ttc", "Noto Sans Mono CJK JP", 12, 1, -3, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, + { "NotoSansCJK-Regular.ttc", "Noto Sans Mono CJK JP", 12, 1, -3, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { "NotoSansCJK-Regular.ttc", "Noto Sans Mono CJK JP", 9, 1, -2, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, - { "NotoSansCJK-Regular.ttc", "Noto Sans Mono CJK JP", 12, 1, -3, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, - { "NotoSansCJK-Regular.ttc", "Noto Sans Mono CJK JP", 12, 1, -3, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontHiragano = { { + { u8"ヒラギノ丸ゴ ProN W4.ttc", "Hiragino Maru Gothic ProN", 11, 1, 0, 13, HINTING_THRESHOLD_MEDIUM, nullptr }, + { u8"ヒラギノ丸ゴ ProN W4.ttc", "Hiragino Maru Gothic ProN", 11, 1, 0, 13, HINTING_THRESHOLD_MEDIUM, nullptr }, { u8"ヒラギノ丸ゴ ProN W4.ttc", "Hiragino Maru Gothic ProN", 9, 1, 1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, - { u8"ヒラギノ丸ゴ ProN W4.ttc", "Hiragino Maru Gothic ProN", 11, 1, 0, 13, HINTING_THRESHOLD_MEDIUM, nullptr }, - { u8"ヒラギノ丸ゴ ProN W4.ttc", "Hiragino Maru Gothic ProN", 11, 1, 0, 13, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontMingLiu = { { - { "msjh.ttc", "JhengHei", 9, -1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, { "mingliu.ttc", "MingLiU", 11, 1, 1, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { "mingliu.ttc", "MingLiU", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, + { "msjh.ttc", "JhengHei", 9, -1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontHeiti = { { - { u8"华文黑体.ttf", "STHeiti", 9, -1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, { u8"华文黑体.ttf", "STHeiti", 11, 1, 1, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { u8"华文黑体.ttf", "STHeiti", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, + { u8"华文黑体.ttf", "STHeiti", 9, -1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontSimSun = { { - { "msyh.ttc", "Microsoft YaHei", 9, -1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, { "simsun.ttc", "SimSun", 11, 1, -1, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { "simsun.ttc", "SimSun", 12, 1, -2, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, + { "msyh.ttc", "Microsoft YaHei", 9, -1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontLiHeiPro = { { - { u8"儷黑 Pro.ttf", "LiHei Pro", 9, 1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, { u8"儷黑 Pro.ttf", "LiHei Pro", 11, 1, 0, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { u8"儷黑 Pro.ttf", "LiHei Pro", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, + { u8"儷黑 Pro.ttf", "LiHei Pro", 9, 1, -1, 9, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontGulim = { { + { "gulim.ttc", "Gulim", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, + { "gulim.ttc", "Gulim", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, { "gulim.ttc", "Gulim", 10, 1, 0, 10, HINTING_DISABLED, nullptr }, - { "gulim.ttc", "Gulim", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, - { "gulim.ttc", "Gulim", 12, 1, 0, 15, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; TTFFontSetDescriptor TTFFontMalgun = { { + { "malgun.ttf", "Malgun Gothic", 12, 1, -3, 15, HINTING_THRESHOLD_LOW, nullptr }, + { "malgun.ttf", "Malgun Gothic", 12, 1, -3, 15, HINTING_THRESHOLD_LOW, nullptr }, { "malgun.ttf", "Malgun Gothic", 10, 1, -3, 10, HINTING_THRESHOLD_LOW, nullptr }, - { "malgun.ttf", "Malgun Gothic", 12, 1, -3, 15, HINTING_THRESHOLD_LOW, nullptr }, - { "malgun.ttf", "Malgun Gothic", 12, 1, -3, 15, HINTING_THRESHOLD_LOW, nullptr }, } }; TTFFontSetDescriptor TTFFontNanum = { { + { "NanumGothic.ttf", "Nanum Gothic", 12, 1, -2, 15, HINTING_THRESHOLD_LOW, nullptr }, + { "NanumGothic.ttf", "Nanum Gothic", 12, 1, -2, 15, HINTING_THRESHOLD_LOW, nullptr }, { "NanumGothic.ttf", "Nanum Gothic", 10, 1, -2, 10, HINTING_DISABLED, nullptr }, - { "NanumGothic.ttf", "Nanum Gothic", 12, 1, -2, 15, HINTING_THRESHOLD_LOW, nullptr }, - { "NanumGothic.ttf", "Nanum Gothic", 12, 1, -2, 15, HINTING_THRESHOLD_LOW, nullptr }, } }; TTFFontSetDescriptor TTFFontArial = { { + { "arial.ttf", "Arial", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, + { "arial.ttf", "Arial", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, { "arial.ttf", "Arial", 10, 0, -1, 9, HINTING_THRESHOLD_LOW, nullptr }, - { "arial.ttf", "Arial", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, - { "arial.ttf", "Arial", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, } }; TTFFontSetDescriptor TTFFontArialUnicode = { { + { "arialuni.ttf", "Arial Unicode MS", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, + { "arialuni.ttf", "Arial Unicode MS", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, { "arialuni.ttf", "Arial Unicode MS", 10, 0, -1, 9, HINTING_THRESHOLD_LOW, nullptr }, - { "arialuni.ttf", "Arial Unicode MS", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, - { "arialuni.ttf", "Arial Unicode MS", 12, 0, -1, 12, HINTING_THRESHOLD_LOW, nullptr }, } }; TTFFontSetDescriptor TTFFontMicroHei = { { - { "wqy-microhei.ttc", "WenQuanYi Micro Hei", 10, -1, -1, 10, HINTING_THRESHOLD_MEDIUM, nullptr }, { "wqy-microhei.ttc", "WenQuanYi Micro Hei", 11, 1, -1, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, { "wqy-microhei.ttc", "WenQuanYi Micro Hei", 11, 1, -2, 14, HINTING_THRESHOLD_MEDIUM, nullptr }, + { "wqy-microhei.ttc", "WenQuanYi Micro Hei", 10, -1, -1, 10, HINTING_THRESHOLD_MEDIUM, nullptr }, } }; // clang-format on #endif // NO_TTF @@ -127,12 +128,12 @@ static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescrip static bool LoadCustomConfigFont(LocalisationService& localisationService) { static TTFFontSetDescriptor TTFFontCustom = { { - { gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_tiny, gConfigFonts.x_offset, gConfigFonts.y_offset, - gConfigFonts.height_tiny, gConfigFonts.hinting_threshold, nullptr }, - { gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_small, gConfigFonts.x_offset, gConfigFonts.y_offset, - gConfigFonts.height_small, gConfigFonts.hinting_threshold, nullptr }, - { gConfigFonts.file_name, gConfigFonts.font_name, gConfigFonts.size_medium, gConfigFonts.x_offset, - gConfigFonts.y_offset, gConfigFonts.height_medium, gConfigFonts.hinting_threshold, nullptr }, + { gConfigFonts.FileName, gConfigFonts.FontName, gConfigFonts.SizeTiny, gConfigFonts.OffsetX, gConfigFonts.OffsetY, + gConfigFonts.HeightTiny, gConfigFonts.HintingThreshold, nullptr }, + { gConfigFonts.FileName, gConfigFonts.FontName, gConfigFonts.SizeSmall, gConfigFonts.OffsetX, gConfigFonts.OffsetY, + gConfigFonts.HeightSmall, gConfigFonts.HintingThreshold, nullptr }, + { gConfigFonts.FileName, gConfigFonts.FontName, gConfigFonts.SizeMedium, gConfigFonts.OffsetX, gConfigFonts.OffsetY, + gConfigFonts.HeightMedium, gConfigFonts.HintingThreshold, nullptr }, } }; ttf_dispose(); @@ -152,7 +153,7 @@ void TryLoadFonts(LocalisationService& localisationService) if (fontFamily != FAMILY_OPENRCT2_SPRITE) { - if (!String::IsNullOrEmpty(gConfigFonts.file_name)) + if (!String::IsNullOrEmpty(gConfigFonts.FileName)) { if (LoadCustomConfigFont(localisationService)) { @@ -168,7 +169,7 @@ void TryLoadFonts(LocalisationService& localisationService) return; } - TTFFontDescriptor smallFont = font->size[FONT_SIZE_SMALL]; + TTFFontDescriptor smallFont = font->size[EnumValue(FontStyle::Small)]; log_verbose("Unable to load TrueType font '%s' -- trying the next font in the family.", smallFont.font_name); } @@ -183,7 +184,7 @@ void TryLoadFonts(LocalisationService& localisationService) return; } - TTFFontDescriptor smallFont = font->size[FONT_SIZE_SMALL]; + TTFFontDescriptor smallFont = font->size[EnumValue(FontStyle::Small)]; log_verbose("Unable to load TrueType font '%s' -- trying the next font in the family.", smallFont.font_name); } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 20459a1c43..c11ebf8609 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -586,7 +586,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) { console.WriteFormatLine("guest_initial_happiness %d%% (%d)", 15, gGuestInitialHappiness); } - else if (current_happiness == calculate_guest_initial_happiness(i)) + else if (current_happiness == CalculateGuestInitialHappiness(i)) { console.WriteFormatLine("guest_initial_happiness %d%% (%d)", i, gGuestInitialHappiness); break; @@ -669,7 +669,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "console_small_font") { - console.WriteFormatLine("console_small_font %d", gConfigInterface.console_small_font); + console.WriteFormatLine("console_small_font %d", gConfigInterface.ConsoleSmallFont); } else if (argv[0] == "location") { @@ -686,19 +686,19 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "window_scale") { - console.WriteFormatLine("window_scale %.3f", gConfigGeneral.window_scale); + console.WriteFormatLine("window_scale %.3f", gConfigGeneral.WindowScale); } else if (argv[0] == "window_limit") { - console.WriteFormatLine("window_limit %d", gConfigGeneral.window_limit); + console.WriteFormatLine("window_limit %d", gConfigGeneral.WindowLimit); } else if (argv[0] == "render_weather_effects") { - console.WriteFormatLine("render_weather_effects %d", gConfigGeneral.render_weather_effects); + console.WriteFormatLine("render_weather_effects %d", gConfigGeneral.RenderWeatherEffects); } else if (argv[0] == "render_weather_gloom") { - console.WriteFormatLine("render_weather_gloom %d", gConfigGeneral.render_weather_gloom); + console.WriteFormatLine("render_weather_gloom %d", gConfigGeneral.RenderWeatherGloom); } else if (argv[0] == "cheat_sandbox_mode") { @@ -723,7 +723,7 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) #ifndef NO_TTF else if (argv[0] == "enable_hinting") { - console.WriteFormatLine("enable_hinting %d", gConfigFonts.enable_hinting); + console.WriteFormatLine("enable_hinting %d", gConfigFonts.EnableHinting); } #endif else @@ -735,7 +735,6 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv) } static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) { - uint32_t i; if (argv.size() > 1) { int32_t int_val[4]; @@ -744,7 +743,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) bool double_valid[4]; bool invalidArgs = false; - for (i = 0; i < 4; i++) + for (uint32_t i = 0; i < std::size(int_val); i++) { if (i + 1 < argv.size()) { @@ -833,7 +832,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) else if (argv[0] == "guest_initial_happiness" && invalidArguments(&invalidArgs, int_valid[0])) { auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialHappiness, calculate_guest_initial_happiness(static_cast(int_val[0]))); + ScenarioSetSetting::GuestInitialHappiness, CalculateGuestInitialHappiness(static_cast(int_val[0]))); scenarioSetSetting.SetCallback([&console](const GameAction*, const GameActions::Result* res) { if (res->Error != GameActions::Status::Ok) console.WriteLineError("set guest_initial_happiness command failed, likely due to permissions."); @@ -1048,8 +1047,8 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "console_small_font" && invalidArguments(&invalidArgs, int_valid[0])) { - gConfigInterface.console_small_font = (int_val[0] != 0); - config_save_default(); + gConfigInterface.ConsoleSmallFont = (int_val[0] != 0); + ConfigSaveDefault(); console.Execute("get console_small_font"); } else if (argv[0] == "location" && invalidArguments(&invalidArgs, int_valid[0] && int_valid[1])) @@ -1058,7 +1057,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) if (w != nullptr) { auto location = TileCoordsXYZ(int_val[0], int_val[1], 0).ToCoordsXYZ().ToTileCentre(); - location.z = tile_element_height(location); + location.z = TileElementHeight(location); w->SetLocation(location); viewport_update_position(w); console.Execute("get location"); @@ -1067,11 +1066,11 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) else if (argv[0] == "window_scale" && invalidArguments(&invalidArgs, double_valid[0])) { float newScale = static_cast(0.001 * std::trunc(1000 * double_val[0])); - gConfigGeneral.window_scale = std::clamp(newScale, 0.5f, 5.0f); - config_save_default(); + gConfigGeneral.WindowScale = std::clamp(newScale, 0.5f, 5.0f); + ConfigSaveDefault(); gfx_invalidate_screen(); - context_trigger_resize(); - context_update_cursor_scale(); + ContextTriggerResize(); + ContextUpdateCursorScale(); console.Execute("get window_scale"); } else if (argv[0] == "window_limit" && invalidArguments(&invalidArgs, int_valid[0])) @@ -1081,14 +1080,14 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) } else if (argv[0] == "render_weather_effects" && invalidArguments(&invalidArgs, int_valid[0])) { - gConfigGeneral.render_weather_effects = (int_val[0] != 0); - config_save_default(); + gConfigGeneral.RenderWeatherEffects = (int_val[0] != 0); + ConfigSaveDefault(); console.Execute("get render_weather_effects"); } else if (argv[0] == "render_weather_gloom" && invalidArguments(&invalidArgs, int_valid[0])) { - gConfigGeneral.render_weather_gloom = (int_val[0] != 0); - config_save_default(); + gConfigGeneral.RenderWeatherGloom = (int_val[0] != 0); + ConfigSaveDefault(); console.Execute("get render_weather_gloom"); } else if (argv[0] == "cheat_sandbox_mode" && invalidArguments(&invalidArgs, int_valid[0])) @@ -1171,8 +1170,8 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv) #ifndef NO_TTF else if (argv[0] == "enable_hinting" && invalidArguments(&invalidArgs, int_valid[0])) { - gConfigFonts.enable_hinting = (int_val[0] != 0); - config_save_default(); + gConfigFonts.EnableHinting = (int_val[0] != 0); + ConfigSaveDefault(); console.Execute("get enable_hinting"); ttf_toggle_hinting(); } @@ -1201,8 +1200,8 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar { char name[9] = { 0 }; std::fill_n(name, 8, ' '); - int32_t i = 0; - for (const char* ch = argv[0].c_str(); *ch != '\0' && i < 8; ch++) + std::size_t i = 0; + for (const char* ch = argv[0].c_str(); *ch != '\0' && i < std::size(name) - 1; ch++) { name[i++] = *ch; } @@ -1260,10 +1259,10 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar research_reset_current_item(); gSilentResearch = false; } - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); gWindowUpdateTicks = 0; gfx_invalidate_screen(); @@ -1331,7 +1330,7 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv) { // Only this window should be open for safety reasons window_close_all(); - context_open_window(WindowClass::EditorObjectSelection); + ContextOpenWindow(WindowClass::EditorObjectSelection); } } else if (argv[0] == "inventions_list" && invalidArguments(&invalidTitle, !title)) @@ -1342,12 +1341,12 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv) } else { - context_open_window(WindowClass::EditorInventionList); + ContextOpenWindow(WindowClass::EditorInventionList); } } else if (argv[0] == "scenario_options" && invalidArguments(&invalidTitle, !title)) { - context_open_window(WindowClass::EditorScenarioOptions); + ContextOpenWindow(WindowClass::EditorScenarioOptions); } else if (argv[0] == "objective_options" && invalidArguments(&invalidTitle, !title)) { @@ -1357,16 +1356,16 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv) } else { - context_open_window(WindowClass::EditorObjectiveOptions); + ContextOpenWindow(WindowClass::EditorObjectiveOptions); } } else if (argv[0] == "options") { - context_open_window(WindowClass::Options); + ContextOpenWindow(WindowClass::Options); } else if (argv[0] == "themes") { - context_open_window(WindowClass::Themes); + ContextOpenWindow(WindowClass::Themes); } else if (invalidTitle) { @@ -1397,7 +1396,7 @@ static int32_t cc_remove_floating_objects(InteractiveConsole& console, const arg static int32_t cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv) { tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() == TileElementType::Surface) @@ -1405,7 +1404,7 @@ static int32_t cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused // Remove all park fence flags it.element->AsSurface()->SetParkFences(0); } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); gfx_invalidate_screen(); @@ -1517,7 +1516,7 @@ static int32_t cc_load_park([[maybe_unused]] InteractiveConsole& console, [[mayb { savePath += ".park"; } - if (context_load_park_from_file(savePath.c_str())) + if (OpenRCT2::GetContext()->LoadParkFromFile(savePath)) { console.WriteFormatLine("Park %s was loaded successfully", savePath.c_str()); } @@ -1829,7 +1828,7 @@ static int32_t cc_add_news_item([[maybe_unused]] InteractiveConsole& console, [[ if (argv.size() < 2) { console.WriteLineWarning("Too few arguments"); - static_assert(News::ItemTypeCount == 10, "News::ItemType::Count changed, update console command!"); + static_assert(News::ItemTypeCount == 11, "News::ItemType::Count changed, update console command!"); console.WriteLine("add_news_item [assoc]"); console.WriteLine("type is one of:"); console.WriteLine(" 0 (News::ItemType::Null)"); @@ -1842,6 +1841,7 @@ static int32_t cc_add_news_item([[maybe_unused]] InteractiveConsole& console, [[ console.WriteLine(" 7 (News::ItemType::Peeps)"); console.WriteLine(" 8 (News::ItemType::Award)"); console.WriteLine(" 9 (News::ItemType::Graph)"); + console.WriteLine(" 10 (News::ItemType::Campaign)"); console.WriteLine("message is the message to display, wrapped in quotes for multiple words"); console.WriteLine("assoc is the associated id of ride/peep/tile/etc. If the selected ItemType doesn't need an assoc " "(Null, Money, Award, Graph), you can leave this field blank"); diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 774385801e..d1d2b0c1aa 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -90,11 +90,11 @@ void screenshot_check() if (!screenshotPath.empty()) { - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 100, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 100, ContextGetWidth() / 2); } else { - context_show_error(STR_SCREENSHOT_FAILED, STR_NONE, {}); + ContextShowError(STR_SCREENSHOT_FAILED, STR_NONE, {}); } // redraw_weather(); @@ -215,7 +215,7 @@ std::string screenshot_dump_png_32bpp(int32_t width, int32_t height, const void* static int32_t GetHighestBaseClearanceZ(const CoordsXY& location, const bool useViewClipping) { int32_t z = 0; - auto element = map_get_first_element_at(location); + auto element = MapGetFirstElementAt(location); if (element != nullptr) { do @@ -241,7 +241,7 @@ static int32_t GetTallestVisibleTileTop( { auto location = TileCoordsXY(x, y).ToCoordsXY(); int32_t z = GetHighestBaseClearanceZ(location, useViewClipping); - int32_t viewY = translate_3d_to_2d_with_z(rotation, CoordsXYZ(location.ToTileCentre(), z)).y; + int32_t viewY = Translate3DTo2DWithZ(rotation, CoordsXYZ(location.ToTileCentre(), z)).y; minViewY = std::min(minViewY, viewY); } } @@ -304,10 +304,10 @@ static rct_viewport GetGiantViewport(int32_t rotation, ZoomLevel zoom) // Calculate the viewport bounds auto corners = cornerCoords[useViewClipping ? 1 : 0]; - auto screenCoords1 = translate_3d_to_2d_with_z(rotation, { corners[0].ToCoordsXY().ToTileCentre(), 0 }); - auto screenCoords2 = translate_3d_to_2d_with_z(rotation, { corners[1].ToCoordsXY().ToTileCentre(), 0 }); - auto screenCoords3 = translate_3d_to_2d_with_z(rotation, { corners[2].ToCoordsXY().ToTileCentre(), 0 }); - auto screenCoords4 = translate_3d_to_2d_with_z(rotation, { corners[3].ToCoordsXY().ToTileCentre(), 0 }); + auto screenCoords1 = Translate3DTo2DWithZ(rotation, { corners[0].ToCoordsXY().ToTileCentre(), 0 }); + auto screenCoords2 = Translate3DTo2DWithZ(rotation, { corners[1].ToCoordsXY().ToTileCentre(), 0 }); + auto screenCoords3 = Translate3DTo2DWithZ(rotation, { corners[2].ToCoordsXY().ToTileCentre(), 0 }); + auto screenCoords4 = Translate3DTo2DWithZ(rotation, { corners[3].ToCoordsXY().ToTileCentre(), 0 }); auto left = std::min({ screenCoords1.x, screenCoords2.x, screenCoords3.x, screenCoords4.x }) - 32; auto top = GetTallestVisibleTileTop(rotation, corners[0], corners[1], useViewClipping); @@ -364,7 +364,7 @@ void screenshot_giant() { viewport.flags = vp->flags; } - if (gConfigGeneral.transparent_screenshot) + if (gConfigGeneral.TransparentScreenshot) { viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND; } @@ -379,12 +379,12 @@ void screenshot_giant() Formatter ft; ft.Add(STR_STRING); ft.Add(filename.c_str()); - context_show_error(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft); + ContextShowError(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft); } catch (const std::exception& e) { log_error("%s", e.what()); - context_show_error(STR_SCREENSHOT_FAILED, STR_NONE, {}); + ContextShowError(STR_SCREENSHOT_FAILED, STR_NONE, {}); } ReleaseDPI(dpi); @@ -556,7 +556,7 @@ static void ApplyOptions(const ScreenshotOptions* options, rct_viewport& viewpor CheatsSet(CheatType::RemoveLitter); } - if (options->transparent || gConfigGeneral.transparent_screenshot) + if (options->transparent || gConfigGeneral.TransparentScreenshot) { viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND; } @@ -667,10 +667,10 @@ int32_t cmdline_for_screenshot(const char** argv, int32_t argc, ScreenshotOption if (centreMapY) customY = (mapSize.y / 2) * 32 + 16; - int32_t z = tile_element_height({ customX, customY }); + int32_t z = TileElementHeight({ customX, customY }); CoordsXYZ coords3d = { customX, customY, z }; - auto coords2d = translate_3d_to_2d_with_z(customRotation, coords3d); + auto coords2d = Translate3DTo2DWithZ(customRotation, coords3d); viewport.viewPos = { coords2d.x - ((viewport.view_width << customZoom) / 2), coords2d.y - ((viewport.view_height << customZoom) / 2) }; @@ -763,9 +763,9 @@ void CaptureImage(const CaptureOptions& options) viewport.view_width = viewport.width; viewport.view_height = viewport.height; - auto z = tile_element_height(options.View->Position); + auto z = TileElementHeight(options.View->Position); CoordsXYZ coords3d(options.View->Position, z); - auto coords2d = translate_3d_to_2d_with_z(options.Rotation, coords3d); + auto coords2d = Translate3DTo2DWithZ(options.Rotation, coords3d); viewport.viewPos = { coords2d.x - ((options.Zoom.ApplyTo(viewport.view_width)) / 2), coords2d.y - ((options.Zoom.ApplyTo(viewport.view_height)) / 2) }; viewport.zoom = options.Zoom; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 17fe9f53b7..06faa0198e 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -25,6 +25,7 @@ #include "../paint/Paint.h" #include "../profiling/Profiling.h" #include "../ride/Ride.h" +#include "../ride/RideData.h" #include "../ride/TrackDesign.h" #include "../ride/Vehicle.h" #include "../ui/UiContext.h" @@ -44,26 +45,25 @@ using namespace OpenRCT2; -//#define DEBUG_SHOW_DIRTY_BOX uint8_t gShowGridLinesRefCount; uint8_t gShowLandRightsRefCount; -uint8_t gShowConstuctionRightsRefCount; +uint8_t gShowConstructionRightsRefCount; static std::list _viewports; rct_viewport* g_music_tracking_viewport; static std::unique_ptr _paintJobs; -static std::vector _paintColumns; +static std::vector _paintColumns; ScreenCoordsXY gSavedView; ZoomLevel gSavedViewZoom; uint8_t gSavedViewRotation; -paint_entry* gNextFreePaintStruct; +PaintEntry* gNextFreePaintStruct; uint8_t gCurrentRotation; static uint32_t _currentImageType; -InteractionInfo::InteractionInfo(const paint_struct* ps) +InteractionInfo::InteractionInfo(const PaintStruct* ps) : Loc(ps->map_x, ps->map_y) , Element(ps->tileElement) , Entity(ps->entity) @@ -117,7 +117,7 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, rct_vi return std::nullopt; } - auto screenCoord = translate_3d_to_2d_with_z(get_current_rotation(), loc); + auto screenCoord = Translate3DTo2DWithZ(get_current_rotation(), loc); screenCoord.x -= viewport->view_width / 2; screenCoord.y -= viewport->view_height / 2; return { screenCoord }; @@ -186,7 +186,7 @@ void viewport_create(rct_window* w, const ScreenCoordsXY& screenCoords, int32_t viewport->zoom = zoom; viewport->flags = 0; - if (gConfigGeneral.always_show_gridlines) + if (gConfigGeneral.AlwaysShowGridlines) viewport->flags |= VIEWPORT_FLAG_GRIDLINES; w->viewport = viewport; @@ -248,7 +248,7 @@ CoordsXYZ viewport_adjust_for_map_height(const ScreenCoordsXY& startCoords) for (int32_t i = 0; i < 6; i++) { pos = viewport_coord_to_map_coord(startCoords, height); - height = tile_element_height(pos); + height = TileElementHeight(pos); // 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. @@ -463,8 +463,8 @@ static void viewport_move(const ScreenCoordsXY& coords, rct_window* w, rct_viewp { int32_t left = std::max(viewport->pos.x, 0); int32_t top = std::max(viewport->pos.y, 0); - int32_t right = std::min(viewport->pos.x + viewport->width, context_get_width()); - int32_t bottom = std::min(viewport->pos.y + viewport->height, context_get_height()); + int32_t right = std::min(viewport->pos.x + viewport->width, ContextGetWidth()); + int32_t bottom = std::min(viewport->pos.y + viewport->height, ContextGetHeight()); if (left >= right) return; @@ -489,7 +489,7 @@ static void viewport_move(const ScreenCoordsXY& coords, rct_window* w, rct_viewp viewport->pos.x = 0; } - int32_t eax = viewport->pos.x + viewport->width - context_get_width(); + int32_t eax = viewport->pos.x + viewport->width - ContextGetWidth(); if (eax > 0) { viewport->width -= eax; @@ -510,7 +510,7 @@ static void viewport_move(const ScreenCoordsXY& coords, rct_window* w, rct_viewp viewport->pos.y = 0; } - eax = viewport->pos.y + viewport->height - context_get_height(); + eax = viewport->pos.y + viewport->height - ContextGetHeight(); if (eax > 0) { viewport->height -= eax; @@ -673,7 +673,7 @@ void viewport_update_sprite_follow(rct_window* window) if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - int32_t height = (tile_element_height({ sprite->x, sprite->y })) - 16; + int32_t height = (TileElementHeight({ sprite->x, sprite->y })) - 16; int32_t underground = sprite->z < height; viewport_set_underground_flag(underground, window, window->viewport); } @@ -761,7 +761,7 @@ void viewport_update_smart_guest_follow(rct_window* window, const Guest* peep) CoordsXYZ coordFocus; coordFocus.x = xy.x; coordFocus.y = xy.y; - coordFocus.z = tile_element_height(xy) + (4 * COORDS_Z_STEP); + coordFocus.z = TileElementHeight(xy) + (4 * COORDS_Z_STEP); focus = Focus(coordFocus); window->viewport_target_sprite = EntityId::GetNull(); } @@ -842,7 +842,7 @@ void viewport_render( } static void record_session( - const paint_session& session, std::vector* recorded_sessions, size_t record_index) + const PaintSession& session, std::vector* recorded_sessions, size_t record_index) { // Perform a deep copy of the paint session, use relative offsets. // This is done to extract the session for benchmark. @@ -853,7 +853,7 @@ static void record_session( recordedSession.Entries.resize(session.PaintEntryChain.GetCount()); // Mind the offset needs to be calculated against the original `session`, not `session_copy` - std::unordered_map entryRemap; + std::unordered_map entryRemap; // Copy all entries auto paintIndex = 0; @@ -865,11 +865,11 @@ static void record_session( auto& src = chain->PaintStructs[i]; auto& dst = recordedSession.Entries[paintIndex++]; dst = src; - entryRemap[src.AsBasic()] = reinterpret_cast(i * sizeof(paint_entry)); + entryRemap[src.AsBasic()] = reinterpret_cast(i * sizeof(PaintEntry)); } chain = chain->Next; } - entryRemap[nullptr] = reinterpret_cast(-1); + entryRemap[nullptr] = reinterpret_cast(-1); // Remap all entries for (auto& ps : recordedSession.Entries) @@ -902,7 +902,7 @@ static void record_session( } static void viewport_fill_column( - paint_session& session, std::vector* recorded_sessions, size_t record_index) + PaintSession& session, std::vector* recorded_sessions, size_t record_index) { PROFILED_FUNCTION(); @@ -914,7 +914,7 @@ static void viewport_fill_column( PaintSessionArrange(session); } -static void viewport_paint_column(paint_session& session) +static void viewport_paint_column(PaintSession& session) { PROFILED_FUNCTION(); @@ -933,7 +933,7 @@ static void viewport_paint_column(paint_session& session) PaintDrawStructs(session); - if (gConfigGeneral.render_weather_gloom && !gTrackDesignSaveMode && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_ENTITIES) + if (gConfigGeneral.RenderWeatherGloom && !gTrackDesignSaveMode && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_ENTITIES) && !(session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { viewport_paint_weather_gloom(&session.DPI); @@ -999,7 +999,7 @@ void viewport_paint( _paintColumns.clear(); - bool useMultithreading = gConfigGeneral.multithreading; + bool useMultithreading = gConfigGeneral.MultiThreading; if (useMultithreading && _paintJobs == nullptr) { _paintJobs = std::make_unique(); @@ -1027,7 +1027,7 @@ void viewport_paint( // Generate and sort columns. for (x = alignedX; x < rightBorder; x += 32, index++) { - paint_session* session = PaintSessionAlloc(&dpi1, viewFlags); + PaintSession* session = PaintSessionAlloc(&dpi1, viewFlags); _paintColumns.push_back(session); rct_drawpixelinfo& dpi2 = session->DPI; @@ -1169,7 +1169,7 @@ void rct_viewport::Invalidate() const CoordsXY viewport_coord_to_map_coord(const ScreenCoordsXY& coords, int32_t z) { - // Reverse of translate_3d_to_2d_with_z + // Reverse of Translate3DTo2DWithZ CoordsXY ret = { coords.y - coords.x / 2 + z, coords.y + coords.x / 2 + z }; auto inverseRotation = DirectionFlipXAxis(get_current_rotation()); return ret.Rotate(inverseRotation); @@ -1202,13 +1202,15 @@ void show_gridlines() */ void hide_gridlines() { - gShowGridLinesRefCount--; + if (gShowGridLinesRefCount > 0) + gShowGridLinesRefCount--; + if (gShowGridLinesRefCount == 0) { rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) { - if (!gConfigGeneral.always_show_gridlines) + if (!gConfigGeneral.AlwaysShowGridlines) { mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; mainWindow->Invalidate(); @@ -1244,7 +1246,9 @@ void show_land_rights() */ void hide_land_rights() { - gShowLandRightsRefCount--; + if (gShowLandRightsRefCount > 0) + gShowLandRightsRefCount--; + if (gShowLandRightsRefCount == 0) { rct_window* mainWindow = window_get_main(); @@ -1265,7 +1269,7 @@ void hide_land_rights() */ void show_construction_rights() { - if (gShowConstuctionRightsRefCount == 0) + if (gShowConstructionRightsRefCount == 0) { rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) @@ -1277,7 +1281,7 @@ void show_construction_rights() } } } - gShowConstuctionRightsRefCount++; + gShowConstructionRightsRefCount++; } /** @@ -1286,8 +1290,10 @@ void show_construction_rights() */ void hide_construction_rights() { - gShowConstuctionRightsRefCount--; - if (gShowConstuctionRightsRefCount == 0) + if (gShowConstructionRightsRefCount > 0) + gShowConstructionRightsRefCount--; + + if (gShowConstructionRightsRefCount == 0) { rct_window* mainWindow = window_get_main(); if (mainWindow != nullptr) @@ -1404,7 +1410,7 @@ static bool IsTileElementVegetation(const TileElement* tileElement) return false; } -VisibilityKind GetPaintStructVisibility(const paint_struct* ps, uint32_t viewFlags) +VisibilityKind GetPaintStructVisibility(const PaintStruct* ps, uint32_t viewFlags) { switch (ps->sprite_type) { @@ -1414,12 +1420,29 @@ VisibilityKind GetPaintStructVisibility(const paint_struct* ps, uint32_t viewFla switch (ps->entity->Type) { case EntityType::Vehicle: + { if (viewFlags & VIEWPORT_FLAG_HIDE_VEHICLES) { return (viewFlags & VIEWPORT_FLAG_INVISIBLE_VEHICLES) ? VisibilityKind::Hidden : VisibilityKind::Partial; } + // Rides without track can technically have a 'vehicle': + // these should be hidden if 'hide rides' is enabled + if (viewFlags & VIEWPORT_FLAG_HIDE_RIDES) + { + auto vehicle = ps->entity->As(); + if (vehicle == nullptr) + break; + + auto ride = vehicle->GetRide(); + if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK)) + { + return (viewFlags & VIEWPORT_FLAG_INVISIBLE_RIDES) ? VisibilityKind::Hidden + : VisibilityKind::Partial; + } + } break; + } case EntityType::Guest: if (viewFlags & VIEWPORT_FLAG_HIDE_GUESTS) { @@ -1484,9 +1507,9 @@ VisibilityKind GetPaintStructVisibility(const paint_struct* ps, uint32_t viewFla } /** - * Checks if a paint_struct sprite type is in the filter mask. + * Checks if a PaintStruct sprite type is in the filter mask. */ -static bool PSSpriteTypeIsInFilter(paint_struct* ps, uint16_t filter) +static bool PSSpriteTypeIsInFilter(PaintStruct* ps, uint16_t filter) { if (ps->sprite_type != ViewportInteractionItem::None && ps->sprite_type != ViewportInteractionItem::Label && ps->sprite_type <= ViewportInteractionItem::Banner) @@ -1804,18 +1827,18 @@ static bool is_sprite_interacted_with(rct_drawpixelinfo* dpi, ImageId imageId, c * * rct2: 0x0068862C */ -InteractionInfo set_interaction_info_from_paint_session(paint_session* session, uint32_t viewFlags, uint16_t filter) +InteractionInfo set_interaction_info_from_paint_session(PaintSession* session, uint32_t viewFlags, uint16_t filter) { PROFILED_FUNCTION(); - paint_struct* ps = &session->PaintHead; + PaintStruct* ps = &session->PaintHead; rct_drawpixelinfo* dpi = &session->DPI; InteractionInfo info{}; while ((ps = ps->next_quadrant_ps) != nullptr) { - paint_struct* old_ps = ps; - paint_struct* next_ps = ps; + PaintStruct* old_ps = ps; + PaintStruct* next_ps = ps; while (next_ps != nullptr) { ps = next_ps; @@ -1831,7 +1854,7 @@ InteractionInfo set_interaction_info_from_paint_session(paint_session* session, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnull-dereference" - for (attached_paint_struct* attached_ps = ps->attached_ps; attached_ps != nullptr; attached_ps = attached_ps->next) + for (AttachedPaintStruct* attached_ps = ps->attached_ps; attached_ps != nullptr; attached_ps = attached_ps->next) { if (is_sprite_interacted_with(dpi, attached_ps->image_id, { (attached_ps->x + ps->x), (attached_ps->y + ps->y) })) { @@ -1895,7 +1918,7 @@ InteractionInfo get_map_coordinates_from_pos_window(rct_window* window, const Sc dpi.zoom_level = myviewport->zoom; dpi.width = 1; - paint_session* session = PaintSessionAlloc(&dpi, myviewport->flags); + PaintSession* session = PaintSessionAlloc(&dpi, myviewport->flags); PaintSessionGenerate(*session); PaintSessionArrange(*session); info = set_interaction_info_from_paint_session(session, myviewport->flags, flags & 0xFFFF); @@ -1998,7 +2021,7 @@ std::optional screen_get_map_xy(const ScreenCoordsXY& screenCoords, rc // Iterates the cursor location to work out exactly where on the tile it is for (int32_t i = 0; i < 5; i++) { - int32_t z = tile_element_height(cursorMapPos); + int32_t z = TileElementHeight(cursorMapPos); cursorMapPos = viewport_coord_to_map_coord(start_vp_pos, z); cursorMapPos.x = std::clamp(cursorMapPos.x, info.Loc.x, info.Loc.x + 31); cursorMapPos.y = std::clamp(cursorMapPos.y, info.Loc.y, info.Loc.y + 31); @@ -2024,7 +2047,7 @@ std::optional screen_get_map_xy_with_z(const ScreenCoordsXY& screenCoo auto vpCoords = viewport->ScreenToViewportCoord(screenCoords); auto mapPosition = viewport_coord_to_map_coord(vpCoords, z); - if (!map_is_location_valid(mapPosition)) + if (!MapIsLocationValid(mapPosition)) { return std::nullopt; } @@ -2042,7 +2065,7 @@ std::optional screen_get_map_xy_quadrant(const ScreenCoordsXY& screenC if (!mapCoords.has_value()) return std::nullopt; - *quadrant = map_get_tile_quadrant(*mapCoords); + *quadrant = MapGetTileQuadrant(*mapCoords); return mapCoords->ToTileStart(); } @@ -2056,7 +2079,7 @@ std::optional screen_get_map_xy_quadrant_with_z(const ScreenCoordsXY& if (!mapCoords.has_value()) return std::nullopt; - *quadrant = map_get_tile_quadrant(*mapCoords); + *quadrant = MapGetTileQuadrant(*mapCoords); return mapCoords->ToTileStart(); } @@ -2070,7 +2093,7 @@ std::optional screen_get_map_xy_side(const ScreenCoordsXY& screenCoord if (!mapCoords.has_value()) return std::nullopt; - *side = map_get_tile_side(*mapCoords); + *side = MapGetTileSide(*mapCoords); return mapCoords->ToTileStart(); } @@ -2084,7 +2107,7 @@ std::optional screen_get_map_xy_side_with_z(const ScreenCoordsXY& scre if (!mapCoords.has_value()) return std::nullopt; - *side = map_get_tile_side(*mapCoords); + *side = MapGetTileSide(*mapCoords); return mapCoords->ToTileStart(); } @@ -2114,11 +2137,11 @@ uint8_t get_current_rotation() int32_t get_height_marker_offset() { // Height labels in units - if (gConfigGeneral.show_height_as_units) + if (gConfigGeneral.ShowHeightAsUnits) return 0; // Height labels in feet - if (gConfigGeneral.measurement_format == MeasurementFormat::Imperial) + if (gConfigGeneral.MeasurementFormat == MeasurementFormat::Imperial) return 1 * 256; // Height labels in metres diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 29bf674203..f4fbf17ae8 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -16,16 +16,16 @@ #include #include -struct paint_session; +struct PaintSession; struct RecordedPaintSession; -struct paint_struct; +struct PaintStruct; struct rct_drawpixelinfo; struct TileElement; struct rct_window; struct EntityBase; struct Guest; struct Staff; -struct paint_entry; +struct PaintEntry; // Flags must currenly retain their values to avoid breaking plugins. // Values can be changed when plugins move to using named constants. @@ -94,7 +94,7 @@ constexpr uint16_t ViewportInteractionItemAll = std::numeric_limits::m struct InteractionInfo { InteractionInfo() = default; - InteractionInfo(const paint_struct* ps); + InteractionInfo(const PaintStruct* ps); CoordsXY Loc; TileElement* Element{}; EntityBase* Entity{}; @@ -109,7 +109,7 @@ struct InteractionInfo */ extern uint8_t gShowGridLinesRefCount; extern uint8_t gShowLandRightsRefCount; -extern uint8_t gShowConstuctionRightsRefCount; +extern uint8_t gShowConstructionRightsRefCount; // rct2: 0x014234BC extern rct_viewport* g_music_tracking_viewport; @@ -117,7 +117,7 @@ extern ScreenCoordsXY gSavedView; extern ZoomLevel gSavedViewZoom; extern uint8_t gSavedViewRotation; -extern paint_entry* gNextFreePaintStruct; +extern PaintEntry* gNextFreePaintStruct; extern uint8_t gCurrentRotation; void viewport_init_all(); @@ -154,7 +154,7 @@ void viewport_set_visibility(uint8_t mode); InteractionInfo get_map_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t flags); InteractionInfo get_map_coordinates_from_pos_window(rct_window* window, const ScreenCoordsXY& screenCoords, int32_t flags); -InteractionInfo set_interaction_info_from_paint_session(paint_session* session, uint32_t viewFlags, uint16_t filter); +InteractionInfo set_interaction_info_from_paint_session(PaintSession* session, uint32_t viewFlags, uint16_t filter); InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoords); bool ViewportInteractionLeftOver(const ScreenCoordsXY& screenCoords); bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords); @@ -178,4 +178,4 @@ int32_t get_height_marker_offset(); void viewport_set_saved_view(); -VisibilityKind GetPaintStructVisibility(const paint_struct* ps, uint32_t viewFlags); +VisibilityKind GetPaintStructVisibility(const PaintStruct* ps, uint32_t viewFlags); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 6a842cd84a..c38aa3c4ef 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -186,10 +186,10 @@ static void window_close_surplus(int32_t cap, WindowClass avoid_classification) */ void window_set_window_limit(int32_t value) { - int32_t prev = gConfigGeneral.window_limit; + int32_t prev = gConfigGeneral.WindowLimit; int32_t val = std::clamp(value, WINDOW_LIMIT_MIN, WINDOW_LIMIT_MAX); - gConfigGeneral.window_limit = val; - config_save_default(); + gConfigGeneral.WindowLimit = val; + ConfigSaveDefault(); // Checks if value decreases and then closes surplus // windows if one sets a limit lower than the number of windows open if (val < prev) @@ -743,7 +743,7 @@ void window_push_others_right(rct_window& window) return; w->Invalidate(); - if (window.windowPos.x + window.width + 13 >= context_get_width()) + if (window.windowPos.x + window.width + 13 >= ContextGetWidth()) return; auto push_amount = window.windowPos.x + window.width - w->windowPos.x + 3; w->windowPos.x += push_amount; @@ -773,7 +773,7 @@ void window_push_others_below(rct_window& w1) return; // Check if there is room to push it down - if (w1.windowPos.y + w1.height + 80 >= context_get_height()) + if (w1.windowPos.y + w1.height + 80 >= ContextGetHeight()) return; // Invalidate the window's current area @@ -820,7 +820,7 @@ void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords) window_unfollow_sprite(w); if (w.viewport != nullptr) { - int16_t height = tile_element_height(coords); + int16_t height = TileElementHeight(coords); if (coords.z < height - 16) { if (!(w.viewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE)) @@ -838,7 +838,7 @@ void window_scroll_to_location(rct_window& w, const CoordsXYZ& coords) } } - auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), coords); + auto screenCoords = Translate3DTo2DWithZ(get_current_rotation(), coords); int32_t i = 0; if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) @@ -932,7 +932,7 @@ void window_rotate_camera(rct_window& w, int32_t direction) { coords.x = mapXYCoords->x; coords.y = mapXYCoords->y; - coords.z = tile_element_height(coords); + coords.z = TileElementHeight(coords); } gCurrentRotation = (get_current_rotation() + direction) & 3; @@ -955,7 +955,7 @@ void window_viewport_get_map_coords_by_cursor( const 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(); + auto mouseCoords = ContextGetCursorPositionScaled(); // Compute map coordinate by mouse position. auto viewportPos = w.viewport->ScreenToViewportCoord(mouseCoords); @@ -965,7 +965,7 @@ void window_viewport_get_map_coords_by_cursor( *map_y = mapCoords.y; // Get viewport coordinates centring around the tile. - int32_t z = tile_element_height(mapCoords); + int32_t z = TileElementHeight(mapCoords); auto centreLoc = centre_2d_coordinates({ mapCoords.x, mapCoords.y, z }, w.viewport); if (!centreLoc) @@ -986,7 +986,7 @@ void window_viewport_get_map_coords_by_cursor( 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 }); + int32_t z = TileElementHeight({ map_x, map_y }); auto centreLoc = centre_2d_coordinates({ map_x, map_y, z }, w.viewport); if (!centreLoc.has_value()) @@ -996,7 +996,7 @@ void window_viewport_centre_tile_around_cursor(rct_window& w, int32_t map_x, int } // Get mouse position to offset against. - auto mouseCoords = context_get_cursor_position_scaled(); + auto mouseCoords = ContextGetCursorPositionScaled(); // Rebase mouse position onto centre of window, and compensate for zoom level. int32_t rebased_x = w.viewport->zoom.ApplyTo((w.width >> 1) - mouseCoords.x); @@ -1035,7 +1035,7 @@ void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor) int32_t saved_map_y = 0; int32_t offset_x = 0; int32_t offset_y = 0; - if (gConfigGeneral.zoom_to_cursor && atCursor) + if (gConfigGeneral.ZoomToCursor && atCursor) { window_viewport_get_map_coords_by_cursor(w, &saved_map_x, &saved_map_y, &offset_x, &offset_y); } @@ -1061,7 +1061,7 @@ void window_zoom_set(rct_window& w, ZoomLevel zoomLevel, bool atCursor) } // Zooming to cursor? Centre around the tile we were hovering over just now. - if (gConfigGeneral.zoom_to_cursor && atCursor) + if (gConfigGeneral.ZoomToCursor && atCursor) { window_viewport_centre_tile_around_cursor(w, saved_map_x, saved_map_y, offset_x, offset_y); } @@ -1306,9 +1306,8 @@ void window_resize(rct_window& w, int32_t dw, int32_t dh) window_event_invalidate_call(&w); // Update scroll widgets - for (int32_t i = 0; i < 3; i++) + for (auto& scroll : w.scrolls) { - auto& scroll = w.scrolls[i]; scroll.h_right = WINDOW_SCROLL_UNDEFINED; scroll.v_bottom = WINDOW_SCROLL_UNDEFINED; } @@ -1362,6 +1361,7 @@ bool tool_set(const rct_window& w, WidgetIndex widgetIndex, Tool tool) } input_set_flag(INPUT_FLAG_TOOL_ACTIVE, true); + input_set_flag(INPUT_FLAG_4, false); input_set_flag(INPUT_FLAG_6, false); gCurrentToolId = tool; gCurrentToolWidget.window_classification = w.classification; @@ -1380,8 +1380,8 @@ void tool_cancel() { input_set_flag(INPUT_FLAG_TOOL_ACTIVE, false); - map_invalidate_selection_rect(); - map_invalidate_map_selection_tiles(); + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); // Reset map selection gMapSelectFlags = 0; @@ -1449,9 +1449,14 @@ void window_event_dropdown_call(rct_window* w, WidgetIndex widgetIndex, int32_t void window_event_unknown_05_call(rct_window* w) { - if (w->event_handlers != nullptr) - if (w->event_handlers->unknown_05 != nullptr) - w->event_handlers->unknown_05(w); + if (w->event_handlers == nullptr) + { + w->OnUnknown5(); + } + else if (w->event_handlers->unknown_05 != nullptr) + { + w->event_handlers->unknown_05(w); + } } void window_event_update_call(rct_window* w) @@ -1574,11 +1579,12 @@ void window_event_viewport_rotate_call(rct_window* w) w->event_handlers->viewport_rotate(w); } -void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType) +void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType) { - if (w->event_handlers != nullptr) - if (w->event_handlers->unknown_15 != nullptr) - w->event_handlers->unknown_15(w, scrollIndex, scrollAreaType); + if (w->event_handlers == nullptr) + w->OnScrollSelect(scrollIndex, scrollAreaType); + else if (w->event_handlers->scroll_select != nullptr) + w->event_handlers->scroll_select(w, scrollIndex, scrollAreaType); } OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback) @@ -1874,7 +1880,7 @@ static void window_snap_right(rct_window& w, int32_t proximity) leftMost = std::min(leftMost, w2->windowPos.x); }); - auto screenWidth = context_get_width(); + auto screenWidth = ContextGetWidth(); if (screenWidth >= wLeftProximity && screenWidth <= wRightProximity) leftMost = std::min(leftMost, screenWidth); @@ -1904,7 +1910,7 @@ static void window_snap_bottom(rct_window& w, int32_t proximity) topMost = std::min(topMost, w2->windowPos.y); }); - auto screenHeight = context_get_height(); + auto screenHeight = ContextGetHeight(); if (screenHeight >= wTopProximity && screenHeight <= wBottomProximity) topMost = std::min(topMost, screenHeight); @@ -1917,7 +1923,7 @@ void window_move_and_snap(rct_window& w, ScreenCoordsXY newWindowCoords, int32_t auto originalPos = w.windowPos; int32_t minY = (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) ? 1 : TOP_TOOLBAR_HEIGHT + 2; - newWindowCoords.y = std::clamp(newWindowCoords.y, minY, context_get_height() - 34); + newWindowCoords.y = std::clamp(newWindowCoords.y, minY, ContextGetHeight() - 34); if (snapProximity > 0) { @@ -1978,7 +1984,7 @@ void window_start_textbox( // from crashing the game. gTextBoxInput[maxLength - 1] = '\0'; - gTextInput = context_start_text_input(gTextBoxInput, maxLength); + gTextInput = ContextStartTextInput(gTextBoxInput, maxLength); } void window_cancel_textbox() @@ -1992,7 +1998,7 @@ void window_cancel_textbox() } gCurrentTextBox.window.classification = WindowClass::Null; gCurrentTextBox.window.number = 0; - context_stop_text_input(); + ContextStopTextInput(); gUsingWidgetTextBox = false; if (w != nullptr) { @@ -2233,3 +2239,23 @@ void WidgetScrollUpdateThumbs(rct_window& w, WidgetIndex widget_index) } } } + +void rct_window::ResizeFrame() +{ + // Frame + widgets[0].right = width - 1; + widgets[0].bottom = height - 1; + // Title + widgets[1].right = width - 2; + // Close button + widgets[2].left = width - 13; + widgets[2].right = width - 3; +} + +void rct_window::ResizeFrameWithPage() +{ + ResizeFrame(); + // Page background + widgets[3].right = width - 1; + widgets[3].bottom = height - 1; +} diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index ae6ffd1bfe..02909a72e8 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -241,7 +241,7 @@ struct WindowEventList void (*scroll_mouseover)(struct rct_window*, int32_t, const ScreenCoordsXY&){}; void (*text_input)(struct rct_window*, WidgetIndex, char*){}; void (*viewport_rotate)(struct rct_window*){}; - void (*unknown_15)(struct rct_window*, int32_t, int32_t){}; + void (*scroll_select)(struct rct_window*, int32_t, int32_t){}; OpenRCT2String (*tooltip)(struct rct_window*, const WidgetIndex, const StringId){}; void (*cursor)(struct rct_window*, WidgetIndex, const ScreenCoordsXY&, CursorID*){}; void (*moved)(struct rct_window*, const ScreenCoordsXY&){}; @@ -375,6 +375,7 @@ enum WV_EDITOR_BOTTOM_TOOLBAR, WV_CHANGELOG, WV_NEW_VERSION_INFO, + WV_FINANCE_MARKETING, }; enum WindowDetail @@ -685,7 +686,7 @@ void window_event_scroll_mousedrag_call(rct_window* w, int32_t scrollIndex, cons void window_event_scroll_mouseover_call(rct_window* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); void window_event_textinput_call(rct_window* w, WidgetIndex widgetIndex, char* text); void window_event_viewport_rotate_call(rct_window* w); -void window_event_unknown_15_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); +void window_event_scroll_select_call(rct_window* w, int32_t scrollIndex, int32_t scrollAreaType); OpenRCT2String window_event_tooltip_call(rct_window* w, const WidgetIndex widgetIndex, const StringId fallback); CursorID window_event_cursor_call(rct_window* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); void window_event_moved_call(rct_window* w, const ScreenCoordsXY& screenCoords); diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 2b09d0e036..fec402e149 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -157,6 +157,9 @@ struct rct_window { return {}; } + virtual void OnScrollSelect(int32_t scrollIndex, int32_t scrollAreaType) + { + } virtual void OnScrollMouseDrag(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { } @@ -178,7 +181,7 @@ struct rct_window virtual void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) { } - virtual void OnToolUp(WidgetIndex, const ScreenCoordsXY&) + virtual void OnToolUp(WidgetIndex widgetIndex, const ScreenCoordsXY&) { } virtual void OnToolAbort(WidgetIndex widgetIndex) @@ -191,6 +194,12 @@ struct rct_window { } virtual CursorID OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID); + virtual void OnUnknown5() + { + } + + void ResizeFrame(); + void ResizeFrameWithPage(); }; #ifdef __WARN_SUGGEST_FINAL_METHODS__ diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 585de5ad8c..03c17eb19c 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -345,7 +345,6 @@ - @@ -487,6 +486,7 @@ + @@ -841,7 +841,6 @@ - @@ -1011,4 +1010,4 @@ - \ No newline at end of file + diff --git a/src/openrct2/localisation/Currency.cpp b/src/openrct2/localisation/Currency.cpp index aabc27977a..9ab69aee72 100644 --- a/src/openrct2/localisation/Currency.cpp +++ b/src/openrct2/localisation/Currency.cpp @@ -38,12 +38,12 @@ currency_descriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)] = { void currency_load_custom_currency_config() { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = gConfigGeneral.custom_currency_rate; - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = gConfigGeneral.custom_currency_affix; - if (gConfigGeneral.custom_currency_symbol != nullptr) + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = gConfigGeneral.CustomCurrencyRate; + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = gConfigGeneral.CustomCurrencyAffix; + if (gConfigGeneral.CustomCurrencySymbol != nullptr) { safe_strcpy( - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, gConfigGeneral.custom_currency_symbol, + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, gConfigGeneral.CustomCurrencySymbol, CURRENCY_SYMBOL_MAX_SIZE); } } diff --git a/src/openrct2/localisation/Formatting.cpp b/src/openrct2/localisation/Formatting.cpp index 4e34e80ec1..2e476bd06a 100644 --- a/src/openrct2/localisation/Formatting.cpp +++ b/src/openrct2/localisation/Formatting.cpp @@ -383,7 +383,7 @@ namespace OpenRCT2 template void FormatCurrency(FormatBuffer& ss, T rawValue) { - auto currencyDesc = &CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)]; + auto currencyDesc = &CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)]; auto value = static_cast(rawValue) * currencyDesc->rate; // Negative sign @@ -402,7 +402,7 @@ namespace OpenRCT2 // Currency symbol auto symbol = currencyDesc->symbol_unicode; auto affix = currencyDesc->affix_unicode; - if (!font_supports_string(symbol, FONT_SIZE_MEDIUM)) + if (!font_supports_string(symbol, FontStyle::Medium)) { symbol = currencyDesc->symbol_ascii; affix = currencyDesc->affix_ascii; @@ -533,7 +533,7 @@ namespace OpenRCT2 case FormatToken::Velocity: if constexpr (std::is_integral()) { - switch (gConfigGeneral.measurement_format) + switch (gConfigGeneral.MeasurementFormat) { default: case MeasurementFormat::Imperial: @@ -563,7 +563,7 @@ namespace OpenRCT2 case FormatToken::Length: if constexpr (std::is_integral()) { - switch (gConfigGeneral.measurement_format) + switch (gConfigGeneral.MeasurementFormat) { default: case MeasurementFormat::Imperial: diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index 028ab89fb6..bade24d985 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -36,7 +36,7 @@ #include #include -thread_local char gCommonStringFormatBuffer[512]; +thread_local char gCommonStringFormatBuffer[CommonTextBufferSize]; #ifdef DEBUG // Set to true before a string format call to see details of the formatting. @@ -424,7 +424,7 @@ void format_readable_speed(char* buf, size_t bufSize, uint64_t sizeBytes) money32 string_to_money(const char* string_to_monetise) { const char* decimal_char = language_get_string(STR_LOCALE_DECIMAL_POINT); - const currency_descriptor* currencyDesc = &CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)]; + const currency_descriptor* currencyDesc = &CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)]; char processedString[128] = {}; Guard::Assert(strlen(string_to_monetise) < sizeof(processedString)); @@ -521,7 +521,7 @@ void money_to_string(money32 amount, char* buffer_to_put_value_to, size_t buffer return; } - const currency_descriptor* currencyDesc = &CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)]; + const currency_descriptor* currencyDesc = &CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)]; int sign = amount >= 0 ? 1 : -1; int a = abs(amount) * currencyDesc->rate; diff --git a/src/openrct2/localisation/Localisation.h b/src/openrct2/localisation/Localisation.h index f967baa703..83cb859f98 100644 --- a/src/openrct2/localisation/Localisation.h +++ b/src/openrct2/localisation/Localisation.h @@ -51,11 +51,13 @@ bool is_user_string_id(StringId stringId); #define REAL_NAME_START 0xA000 #define REAL_NAME_END 0xDFFF +constexpr const size_t CommonTextBufferSize = 512; + // Real name data extern const char real_name_initials[16]; extern const char* real_names[1024]; -extern thread_local char gCommonStringFormatBuffer[512]; +extern thread_local char gCommonStringFormatBuffer[CommonTextBufferSize]; extern bool gDebugStringFormatting; extern const StringId SpeedNames[5]; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index d994abbf97..235c93d00a 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -2197,20 +2197,20 @@ enum : uint16_t STR_SIGN_TEXT_PROMPT = 2993, STR_CHANGE_SIGN_TEXT_TIP = 2994, STR_DEMOLISH_SIGN_TIP = 2995, - STR_TEXT_COLOR_BLACK = 2996, - STR_TEXT_COLOR_GREY = 2997, - STR_TEXT_COLOR_WHITE = 2998, - STR_TEXT_COLOR_RED = 2999, - STR_TEXT_COLOR_GREEN = 3000, - STR_TEXT_COLOR_YELLOW = 3001, - STR_TEXT_COLOR_TOPAZ = 3002, - STR_TEXT_COLOR_CELADON = 3003, - STR_TEXT_COLOR_BABYBLUE = 3004, - STR_TEXT_COLOR_PALELAVENDER = 3005, - STR_TEXT_COLOR_PALEGOLD = 3006, - STR_TEXT_COLOR_LIGHTPINK = 3007, - STR_TEXT_COLOR_PEARLAQUA = 3008, - STR_TEXT_COLOR_PALESILVER = 3009, + STR_TEXT_COLOUR_BLACK = 2996, + STR_TEXT_COLOUR_GREY = 2997, + STR_TEXT_COLOUR_WHITE = 2998, + STR_TEXT_COLOUR_RED = 2999, + STR_TEXT_COLOUR_GREEN = 3000, + STR_TEXT_COLOUR_YELLOW = 3001, + STR_TEXT_COLOUR_TOPAZ = 3002, + STR_TEXT_COLOUR_CELADON = 3003, + STR_TEXT_COLOUR_BABYBLUE = 3004, + STR_TEXT_COLOUR_PALELAVENDER = 3005, + STR_TEXT_COLOUR_PALEGOLD = 3006, + STR_TEXT_COLOUR_LIGHTPINK = 3007, + STR_TEXT_COLOUR_PEARLAQUA = 3008, + STR_TEXT_COLOUR_PALESILVER = 3009, STR_UNABLE_TO_LOAD_FILE = 3010, STR_FILE_CONTAINS_INVALID_DATA = 3011, STR_MUSIC_STYLE_DODGEMS_BEAT = 3012, @@ -2841,8 +2841,6 @@ enum : uint16_t STR_SHOW_MULTIPLAYER_STATUS_TIP = 5504, STR_UNABLE_TO_CONNECT_TO_SERVER = 5505, STR_CHEAT_IGNORE_INTENSITY = 5506, - STR_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM = 5508, - STR_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM_TIP = 5509, STR_OPTIONS_SOUND_VALUE_DEFAULT = 5510, STR_OPTIONS_SOUND_VALUE_UNKNOWN = 5511, STR_SAVE_GAME_AS = 5512, @@ -3915,6 +3913,21 @@ enum : uint16_t STR_RELOAD_ASSET_PACKS_TIP = 6525, STR_BASE_GRAPHICS_MUSIC_SOUND = 6526, + STR_COMPETITIONS = 6527, + + STR_INVALID_TRACK_PARAMETERS = 6528, + STR_INVALID_COLOUR_SCHEME_PARAMETER = 6529, + + STR_SCENARIO_CATEGORY_UCES = 6530, + STR_UCES_TM = 6531, + STR_UCES_KD = 6532, + + STR_EXCITEMENT_FACTOR_NEGATIVE = 6533, + STR_INTENSITY_FACTOR_NEGATIVE = 6534, + STR_NAUSEA_FACTOR_NEGATIVE = 6535, + + STR_ERROR_PARK_VERSION_TOO_NEW_MESSAGE_2 = 6536, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 046d4297dc..55ea7f1dca 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -178,13 +178,13 @@ static bool award_is_deserved_best_value(int32_t activeAwardTypes) if (activeAwardTypes & EnumToFlag(AwardType::MostDisappointing)) return false; - if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !park_entry_price_unlocked()) + if ((gParkFlags & PARK_FLAGS_NO_MONEY) || !ParkEntranceFeeUnlocked()) return false; if (gTotalRideValueForMoney < 10.00_GBP) return false; - if (park_get_entrance_fee() + 0.10_GBP >= gTotalRideValueForMoney / 2) + if (ParkGetEntranceFee() + 0.10_GBP >= gTotalRideValueForMoney / 2) return false; return true; @@ -231,7 +231,7 @@ static bool award_is_deserved_worst_value(int32_t activeAwardTypes) if (gParkFlags & PARK_FLAGS_NO_MONEY) return false; - const auto parkEntranceFee = park_get_entrance_fee(); + const auto parkEntranceFee = ParkGetEntranceFee(); if (parkEntranceFee == 0.00_GBP) return false; if (parkEntranceFee <= gTotalRideValueForMoney) @@ -385,7 +385,7 @@ static bool award_is_deserved_best_toilets([[maybe_unused]] int32_t activeAwardT return false; // At least one open toilet for every 128 guests - if (numToilets < gNumGuestsInPark / 128U) + if (numToilets < gNumGuestsInPark / 128u) return false; // Count number of guests who are thinking they need the toilet @@ -631,7 +631,7 @@ void award_update_all() { // Add award _currentAwards.push_back(Award{ 5u, awardType }); - if (gConfigNotifications.park_award) + if (gConfigNotifications.ParkAward) { News::AddItemToQueue(News::ItemType::Award, AwardNewsStrings[EnumValue(awardType)], 0, {}); } diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 37f1148d41..9b2cc77aeb 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -97,7 +97,7 @@ void finance_payment(money64 amount, ExpenditureType type) } auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index 32a098bb41..215cc5037a 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -50,11 +50,11 @@ uint16_t marketing_get_campaign_guest_generation_probability(int32_t campaignTyp switch (campaign->Type) { case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE: - if (park_get_entrance_fee() < 4.00_GBP) + if (ParkGetEntranceFee() < 4.00_GBP) probability /= 8; break; case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE: - if (park_get_entrance_fee() < 6.00_GBP) + if (ParkGetEntranceFee() < 6.00_GBP) probability /= 8; break; case ADVERTISING_CAMPAIGN_RIDE_FREE: @@ -71,7 +71,7 @@ uint16_t marketing_get_campaign_guest_generation_probability(int32_t campaignTyp static void marketing_raise_finished_notification(const MarketingCampaign& campaign) { - if (gConfigNotifications.park_marketing_campaign_finished) + if (gConfigNotifications.ParkMarketingCampaignFinished) { Formatter ft; // This sets the string parameters for the marketing types that have an argument. @@ -88,7 +88,7 @@ static void marketing_raise_finished_notification(const MarketingCampaign& campa ft.Add(GetShopItemDescriptor(campaign.ShopItemType).Naming.Plural); } - News::AddItemToQueue(News::ItemType::Money, MarketingCampaignNames[campaign.Type][2], 0, ft); + News::AddItemToQueue(News::ItemType::Campaign, MarketingCampaignNames[campaign.Type][2], 0, ft); } } @@ -174,12 +174,12 @@ bool marketing_is_campaign_type_applicable(int32_t campaignType) { case ADVERTISING_CAMPAIGN_PARK_ENTRY_FREE: case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE: - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) return false; return true; case ADVERTISING_CAMPAIGN_RIDE_FREE: - if (!park_ride_prices_unlocked()) + if (!ParkRidePricesUnlocked()) return false; // fall-through diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 398856f6ac..52ec2c704e 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -115,7 +115,7 @@ void News::InitQueue() } auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } uint16_t News::ItemQueues::IncrementTicks() @@ -130,7 +130,7 @@ static void TickCurrent() if (ticks == 1 && (gScreenFlags == SCREEN_FLAGS_PLAYING)) { // Play sound - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::NewsItem, 0, context_get_width() / 2); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::NewsItem, 0, ContextGetWidth() / 2); } } @@ -161,7 +161,7 @@ void News::UpdateCurrentItem() return; auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); // Update the current news item TickCurrent(); @@ -196,7 +196,7 @@ void News::ItemQueues::ArchiveCurrent() // Invalidate current news item bar auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** @@ -219,7 +219,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s break; } auto rideViewCentre = ride->overall_view.ToTileCentre(); - subjectLoc = CoordsXYZ{ rideViewCentre, tile_element_height(rideViewCentre) }; + subjectLoc = CoordsXYZ{ rideViewCentre, TileElementHeight(rideViewCentre) }; break; } case News::ItemType::PeepOnRide: @@ -275,7 +275,7 @@ std::optional News::GetSubjectLocation(News::ItemType type, int32_t s static_cast(subjectUnsigned >> 16) }; if (!subjectXY.IsNull()) { - subjectLoc = CoordsXYZ{ subjectXY, tile_element_height(subjectXY) }; + subjectLoc = CoordsXYZ{ subjectXY, TileElementHeight(subjectXY) }; } break; } @@ -367,7 +367,7 @@ void News::OpenSubject(News::ItemType type, int32_t subject) { auto intent = Intent(WindowClass::Ride); intent.putExtra(INTENT_EXTRA_RIDE_ID, subject); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case News::ItemType::PeepOnRide: @@ -378,12 +378,15 @@ void News::OpenSubject(News::ItemType type, int32_t subject) { auto intent = Intent(WindowClass::Peep); intent.putExtra(INTENT_EXTRA_PEEP, peep); - context_open_intent(&intent); + ContextOpenIntent(&intent); } break; } case News::ItemType::Money: - context_open_window(WindowClass::Finances); + ContextOpenWindow(WindowClass::Finances); + break; + case News::ItemType::Campaign: + ContextOpenWindowView(WV_FINANCE_MARKETING); break; case News::ItemType::Research: { @@ -393,13 +396,13 @@ void News::OpenSubject(News::ItemType type, int32_t subject) auto intent = Intent(INTENT_ACTION_NEW_RIDE_OF_TYPE); intent.putExtra(INTENT_EXTRA_RIDE_TYPE, item.baseRideType); intent.putExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, item.entryIndex); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } auto intent = Intent(INTENT_ACTION_NEW_SCENERY); intent.putExtra(INTENT_EXTRA_SCENERY_GROUP_ENTRY_INDEX, item.entryIndex); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case News::ItemType::Peeps: @@ -407,14 +410,14 @@ void News::OpenSubject(News::ItemType type, int32_t subject) auto intent = Intent(WindowClass::GuestList); intent.putExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsThinkingX)); intent.putExtra(INTENT_EXTRA_RIDE_ID, subject); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } case News::ItemType::Award: - context_open_window_view(WV_PARK_AWARDS); + ContextOpenWindowView(WV_PARK_AWARDS); break; case News::ItemType::Graph: - context_open_window_view(WV_PARK_RATING); + ContextOpenWindowView(WV_PARK_RATING); break; case News::ItemType::Null: case News::ItemType::Blank: @@ -437,7 +440,7 @@ void News::DisableNewsItems(News::ItemType type, uint32_t assoc) if (&newsItem == &gNewsItems.Current()) { auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } }); diff --git a/src/openrct2/management/NewsItem.h b/src/openrct2/management/NewsItem.h index 1102f6ddcb..c07e438b4d 100644 --- a/src/openrct2/management/NewsItem.h +++ b/src/openrct2/management/NewsItem.h @@ -36,6 +36,7 @@ namespace News Peeps, Award, Graph, + Campaign, Count }; @@ -81,6 +82,7 @@ namespace News case News::ItemType::Peeps: case News::ItemType::Award: case News::ItemType::Graph: + case News::ItemType::Campaign: return News::ItemTypeProperty::HasSubject; case News::ItemType::Ride: case News::ItemType::PeepOnRide: diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index ed884bbe44..a4ec99ea11 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -208,7 +208,7 @@ void research_finish_item(ResearchItem* researchItem) if (!RideTypeIsValid(base_ride_type)) { log_warning("Invalid ride type: %d", base_ride_type); - base_ride_type = ride_entry_get_first_non_null_ride_type(rideEntry); + base_ride_type = rideEntry->GetFirstNonNullRideType(); } StringId availabilityString; @@ -272,7 +272,7 @@ void research_finish_item(ResearchItem* researchItem) if (!gSilentResearch) { - if (gConfigNotifications.ride_researched) + if (gConfigNotifications.RideResearched) { News::AddItemToQueue(News::ItemType::Research, availabilityString, researchItem->rawValue, ft); } @@ -284,7 +284,7 @@ void research_finish_item(ResearchItem* researchItem) else { // Scenery - rct_scenery_group_entry* sceneryGroupEntry = get_scenery_group_entry(researchItem->entryIndex); + rct_scenery_group_entry* sceneryGroupEntry = GetSceneryGroupEntry(researchItem->entryIndex); if (sceneryGroupEntry != nullptr) { scenery_group_set_invented(researchItem->entryIndex); @@ -294,7 +294,7 @@ void research_finish_item(ResearchItem* researchItem) if (!gSilentResearch) { - if (gConfigNotifications.ride_researched) + if (gConfigNotifications.RideResearched) { News::AddItemToQueue( News::ItemType::Research, STR_NEWS_ITEM_RESEARCH_NEW_SCENERY_SET_AVAILABLE, researchItem->rawValue, ft); @@ -302,7 +302,7 @@ void research_finish_item(ResearchItem* researchItem) } research_invalidate_related_windows(); - init_scenery(); + SceneryInit(); } } } @@ -494,7 +494,7 @@ void research_populate_list_random() // Scenery for (uint32_t i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - rct_scenery_group_entry* sceneryGroupEntry = get_scenery_group_entry(i); + rct_scenery_group_entry* sceneryGroupEntry = GetSceneryGroupEntry(i); if (sceneryGroupEntry == nullptr) { continue; @@ -610,7 +610,7 @@ void scenery_set_not_invented(const ScenerySelection& sceneryItem) bool scenery_group_is_invented(int32_t sgIndex) { - const auto sgEntry = get_scenery_group_entry(sgIndex); + const auto sgEntry = GetSceneryGroupEntry(sgIndex); if (sgEntry == nullptr || sgEntry->SceneryEntries.empty()) { return false; @@ -635,7 +635,7 @@ bool scenery_group_is_invented(int32_t sgIndex) void scenery_group_set_invented(int32_t sgIndex) { - const auto sgEntry = get_scenery_group_entry(sgIndex); + const auto sgEntry = GetSceneryGroupEntry(sgIndex); if (sgEntry != nullptr) { for (const auto& entry : sgEntry->SceneryEntries) @@ -649,7 +649,7 @@ void set_all_scenery_groups_not_invented() { for (int32_t i = 0; i < MAX_SCENERY_GROUP_OBJECTS; ++i) { - rct_scenery_group_entry* scenery_set = get_scenery_group_entry(i); + rct_scenery_group_entry* scenery_set = GetSceneryGroupEntry(i); if (scenery_set == nullptr) { continue; @@ -715,7 +715,7 @@ StringId ResearchItem::GetName() const return rideEntry->naming.Name; } - rct_scenery_group_entry* sceneryEntry = get_scenery_group_entry(entryIndex); + rct_scenery_group_entry* sceneryEntry = GetSceneryGroupEntry(entryIndex); if (sceneryEntry == nullptr) { return STR_EMPTY; @@ -751,7 +751,7 @@ static void ResearchRemoveNullItems(std::vector& items) } else { - return get_scenery_group_entry(researchItem.entryIndex) == nullptr; + return GetSceneryGroupEntry(researchItem.entryIndex) == nullptr; } }); items.erase(it, std::end(items)); @@ -776,7 +776,7 @@ static void research_mark_item_as_researched(const ResearchItem& item) } else if (item.type == Research::EntryType::Scenery) { - const auto sgEntry = get_scenery_group_entry(item.entryIndex); + const auto sgEntry = GetSceneryGroupEntry(item.entryIndex); if (sgEntry != nullptr) { for (const auto& sceneryEntry : sgEntry->SceneryEntries) @@ -822,7 +822,7 @@ static void ResearchAddAllMissingItems(bool isResearched) for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - const auto* groupEntry = get_scenery_group_entry(i); + const auto* groupEntry = GetSceneryGroupEntry(i); if (groupEntry != nullptr) { research_insert_scenery_group_entry(i, isResearched); @@ -1028,7 +1028,8 @@ 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 == gResearchNextItem.value()) + if (gResearchNextItem.has_value() && !gResearchNextItem->IsNull() + && researchItem.baseRideType == gResearchNextItem.value().baseRideType) { // Copy the "first of type" flag. researchItem.flags = gResearchNextItem->flags; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index a8f7d338ee..6ef1363452 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -42,7 +42,9 @@ // 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 "10" + #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; @@ -280,7 +282,7 @@ bool NetworkBase::BeginClient(const std::string& host, uint16_t port) // risk of tick collision with the server map and title screen map. GameActions::SuspendQueue(); - auto keyPath = network_get_private_key_path(gConfigNetwork.player_name); + auto keyPath = network_get_private_key_path(gConfigNetwork.PlayerName); if (!File::Exists(keyPath)) { Console::WriteLine("Generating key... This may take a while"); @@ -308,7 +310,7 @@ bool NetworkBase::BeginClient(const std::string& host, uint16_t port) const std::string hash = _key.PublicKeyHash(); const utf8* publicKeyHash = hash.c_str(); - keyPath = network_get_public_key_path(gConfigNetwork.player_name, publicKeyHash); + keyPath = network_get_public_key_path(gConfigNetwork.PlayerName, publicKeyHash); Console::WriteLine("Key generated, saving public bits as %s", keyPath.c_str()); try @@ -370,12 +372,12 @@ bool NetworkBase::BeginServer(uint16_t port, const std::string& address) return false; } - ServerName = gConfigNetwork.server_name; - ServerDescription = gConfigNetwork.server_description; - ServerGreeting = gConfigNetwork.server_greeting; - ServerProviderName = gConfigNetwork.provider_name; - ServerProviderEmail = gConfigNetwork.provider_email; - ServerProviderWebsite = gConfigNetwork.provider_website; + ServerName = gConfigNetwork.ServerName; + ServerDescription = gConfigNetwork.ServerDescription; + ServerGreeting = gConfigNetwork.ServerGreeting; + ServerProviderName = gConfigNetwork.ProviderName; + ServerProviderEmail = gConfigNetwork.ProviderEmail; + ServerProviderWebsite = gConfigNetwork.ProviderWebsite; IsServerPlayerInvisible = gOpenRCT2Headless; @@ -384,7 +386,7 @@ bool NetworkBase::BeginServer(uint16_t port, const std::string& address) BeginChatLog(); BeginServerLog(); - NetworkPlayer* player = AddPlayer(gConfigNetwork.player_name, ""); + NetworkPlayer* player = AddPlayer(gConfigNetwork.PlayerName, ""); player->Flags |= NETWORK_PLAYER_FLAG_ISSERVER; player->Group = 0; player_id = player->Id; @@ -405,7 +407,7 @@ bool NetworkBase::BeginServer(uint16_t port, const std::string& address) status = NETWORK_STATUS_CONNECTED; listening_port = port; - _serverState.gamestateSnapshotsEnabled = gConfigNetwork.desync_debugging; + _serverState.gamestateSnapshotsEnabled = gConfigNetwork.DesyncDebugging; _advertiser = CreateServerAdvertiser(listening_port); game_load_scripts(); @@ -564,7 +566,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_resolving }); intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); - context_open_intent(&intent); + ContextOpenIntent(&intent); } break; } @@ -579,7 +581,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_connecting }); intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); - context_open_intent(&intent); + ContextOpenIntent(&intent); server_connect_time = Platform::GetTicks(); } @@ -596,7 +598,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_authenticating }); intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); - context_open_intent(&intent); + ContextOpenIntent(&intent); break; } default: @@ -608,8 +610,8 @@ void NetworkBase::UpdateClient() } Close(); - context_force_close_window_by_class(WindowClass::NetworkStatus); - context_show_error(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + ContextForceCloseWindowByClass(WindowClass::NetworkStatus); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); break; } } @@ -622,7 +624,7 @@ void NetworkBase::UpdateClient() // Do not show disconnect message window when password window closed/canceled if (_serverConnection->AuthStatus == NetworkAuth::RequirePassword) { - context_force_close_window_by_class(WindowClass::NetworkStatus); + ContextForceCloseWindowByClass(WindowClass::NetworkStatus); } else { @@ -640,7 +642,7 @@ void NetworkBase::UpdateClient() auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_disconnected }); - context_open_intent(&intent); + ContextOpenIntent(&intent); } window_close_by_class(WindowClass::Multiplayer); Close(); @@ -792,9 +794,9 @@ bool NetworkBase::CheckDesynchronizaton() auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_desync }); - context_open_intent(&intent); + ContextOpenIntent(&intent); - if (!gConfigNetwork.stay_connected) + if (!gConfigNetwork.StayConnected) { Close(); } @@ -866,12 +868,12 @@ std::string NetworkBase::GenerateAdvertiseKey() std::string NetworkBase::GetMasterServerUrl() { - if (gConfigNetwork.master_server_url.empty()) + if (gConfigNetwork.MasterServerUrl.empty()) { return OPENRCT2_MASTER_SERVER_URL; } - return gConfigNetwork.master_server_url; + return gConfigNetwork.MasterServerUrl; } NetworkGroup* NetworkBase::AddGroup() @@ -1109,7 +1111,7 @@ void NetworkBase::BeginChatLog() void NetworkBase::AppendChatLog(std::string_view s) { - if (gConfigNetwork.log_chat && _chat_log_fs.is_open()) + if (gConfigNetwork.LogChat && _chat_log_fs.is_open()) { AppendLog(_chat_log_fs, s); } @@ -1147,7 +1149,7 @@ void NetworkBase::BeginServerLog() void NetworkBase::AppendServerLog(const std::string& s) { - if (gConfigNetwork.log_server_actions && _server_log_fs.is_open()) + if (gConfigNetwork.LogServerActions && _server_log_fs.is_open()) { AppendLog(_server_log_fs, s); } @@ -1581,10 +1583,10 @@ void NetworkBase::Server_Send_SETDISCONNECTMSG(NetworkConnection& connection, co json_t NetworkBase::GetServerInfoAsJson() const { json_t jsonObj = { - { "name", gConfigNetwork.server_name }, { "requiresPassword", _password.size() > 0 }, - { "version", network_get_version() }, { "players", GetNumVisiblePlayers() }, - { "maxPlayers", gConfigNetwork.maxplayers }, { "description", gConfigNetwork.server_description }, - { "greeting", gConfigNetwork.server_greeting }, { "dedicated", gOpenRCT2Headless }, + { "name", gConfigNetwork.ServerName }, { "requiresPassword", _password.size() > 0 }, + { "version", network_get_version() }, { "players", GetNumVisiblePlayers() }, + { "maxPlayers", gConfigNetwork.Maxplayers }, { "description", gConfigNetwork.ServerDescription }, + { "greeting", gConfigNetwork.ServerGreeting }, { "dedicated", gOpenRCT2Headless }, }; return jsonObj; } @@ -1597,9 +1599,9 @@ void NetworkBase::Server_Send_GAMEINFO(NetworkConnection& connection) // Provider details json_t jsonProvider = { - { "name", gConfigNetwork.provider_name }, - { "email", gConfigNetwork.provider_email }, - { "website", gConfigNetwork.provider_website }, + { "name", gConfigNetwork.ProviderName }, + { "email", gConfigNetwork.ProviderEmail }, + { "website", gConfigNetwork.ProviderWebsite }, }; jsonObj["provider"] = jsonProvider; @@ -2117,7 +2119,7 @@ std::string NetworkBase::MakePlayerNameUnique(const std::string& name) void NetworkBase::Client_Handle_TOKEN(NetworkConnection& connection, NetworkPacket& packet) { - auto keyPath = network_get_private_key_path(gConfigNetwork.player_name); + auto keyPath = network_get_private_key_path(gConfigNetwork.PlayerName); if (!File::Exists(keyPath)) { log_error("Key file (%s) was not found. Restart client to re-generate it.", keyPath.c_str()); @@ -2160,7 +2162,7 @@ void NetworkBase::Client_Handle_TOKEN(NetworkConnection& connection, NetworkPack // when process dump gets collected at some point in future. _key.Unload(); - Client_Send_AUTH(gConfigNetwork.player_name, gCustomPassword, pubkey, signature); + Client_Send_AUTH(gConfigNetwork.PlayerName, gCustomPassword, pubkey, signature); } void NetworkBase::Server_Handle_REQUEST_GAMESTATE(NetworkConnection& connection, NetworkPacket& packet) @@ -2246,7 +2248,7 @@ void NetworkBase::Client_Handle_AUTH(NetworkConnection& connection, NetworkPacke connection.Disconnect(); break; case NetworkAuth::RequirePassword: - context_open_window_view(WV_NETWORK_PASSWORD); + ContextOpenWindowView(WV_NETWORK_PASSWORD); break; case NetworkAuth::UnknownKeyDisallowed: connection.SetLastDisconnectReason(STR_MULTIPLAYER_UNKNOWN_KEY_DISALLOWED); @@ -2323,7 +2325,7 @@ void NetworkBase::Client_Handle_OBJECTS_LIST(NetworkConnection& connection, Netw auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ objectListMsg }); intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); - context_open_intent(&intent); + ContextOpenIntent(&intent); uint8_t objectType{}; packet >> objectType; @@ -2460,7 +2462,7 @@ void NetworkBase::Client_Handle_GAMESTATE(NetworkConnection& connection, Network auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_desync }); - context_open_intent(&intent); + ContextOpenIntent(&intent); } } } @@ -2559,7 +2561,7 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke if (verified) { log_verbose("Connection %s: Signature verification ok. Hash %s", hostName, hash.c_str()); - if (gConfigNetwork.known_keys_only && _userManager.GetUserByHash(hash) == nullptr) + if (gConfigNetwork.KnownKeysOnly && _userManager.GetUserByHash(hash) == nullptr) { log_verbose("Connection %s: Hash %s, not known", hostName, hash.c_str()); connection.AuthStatus = NetworkAuth::UnknownKeyDisallowed; @@ -2612,7 +2614,7 @@ void NetworkBase::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacke } } - if (GetNumVisiblePlayers() >= gConfigNetwork.maxplayers) + if (GetNumVisiblePlayers() >= gConfigNetwork.Maxplayers) { connection.AuthStatus = NetworkAuth::Full; log_info("Connection %s: Server is full.", hostName); @@ -2669,7 +2671,7 @@ void NetworkBase::Client_Handle_MAP([[maybe_unused]] NetworkConnection& connecti auto intent = Intent(WindowClass::NetworkStatus); intent.putExtra(INTENT_EXTRA_MESSAGE, std::string{ str_downloading_map }); intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { ::GetContext()->GetNetwork().Close(); }); - context_open_intent(&intent); + ContextOpenIntent(&intent); std::memcpy(&chunk_buffer[offset], const_cast(static_cast(packet.Read(chunksize))), chunksize); if (offset + chunksize == size) @@ -2677,7 +2679,7 @@ void NetworkBase::Client_Handle_MAP([[maybe_unused]] NetworkConnection& connecti // Allow queue processing of game actions again. GameActions::ResumeQueue(); - context_force_close_window_by_class(WindowClass::NetworkStatus); + ContextForceCloseWindowByClass(WindowClass::NetworkStatus); game_unload_scripts(); game_notify_map_change(); @@ -2733,7 +2735,7 @@ bool NetworkBase::LoadMap(IStream* stream) importer->Import(); EntityTweener::Get().Reset(); - AutoCreateMapAnimations(); + MapAnimationAutoCreate(); gLastAutoSaveUpdate = AUTOSAVE_PAUSE; result = true; @@ -3061,7 +3063,7 @@ void NetworkBase::Client_Handle_SHOWERROR([[maybe_unused]] NetworkConnection& co { StringId title, message; packet >> title >> message; - context_show_error(title, message, {}); + ContextShowError(title, message, {}); } void NetworkBase::Client_Handle_GROUPLIST([[maybe_unused]] NetworkConnection& connection, NetworkPacket& packet) @@ -3823,7 +3825,7 @@ void network_send_game_action(const GameAction* action) void network_send_password(const std::string& password) { auto& network = OpenRCT2::GetContext()->GetNetwork(); - const auto keyPath = network_get_private_key_path(gConfigNetwork.player_name); + const auto keyPath = network_get_private_key_path(gConfigNetwork.PlayerName); if (!File::Exists(keyPath)) { log_error("Private key %s missing! Restart the game to generate it.", keyPath.c_str()); @@ -3846,7 +3848,7 @@ void network_send_password(const std::string& password) // 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. network._key.Unload(); - network.Client_Send_AUTH(gConfigNetwork.player_name, password, pubkey, signature); + network.Client_Send_AUTH(gConfigNetwork.PlayerName, password, pubkey, signature); } void network_set_password(const char* password) diff --git a/src/openrct2/network/NetworkServerAdvertiser.cpp b/src/openrct2/network/NetworkServerAdvertiser.cpp index 85c1ebf686..1d822a0e6b 100644 --- a/src/openrct2/network/NetworkServerAdvertiser.cpp +++ b/src/openrct2/network/NetworkServerAdvertiser.cpp @@ -89,7 +89,7 @@ public: { UpdateLAN(); # ifndef DISABLE_HTTP - if (gConfigNetwork.advertise) + if (gConfigNetwork.Advertise) { UpdateWAN(); } @@ -179,9 +179,9 @@ private: { "port", _port }, }; - if (!gConfigNetwork.advertise_address.empty()) + if (!gConfigNetwork.AdvertiseAddress.empty()) { - body["address"] = gConfigNetwork.advertise_address; + body["address"] = gConfigNetwork.AdvertiseAddress; } request.body = body.dump(); @@ -335,9 +335,9 @@ private: static std::string GetMasterServerUrl() { std::string result = OPENRCT2_MASTER_SERVER_URL; - if (!gConfigNetwork.master_server_url.empty()) + if (!gConfigNetwork.MasterServerUrl.empty()) { - result = gConfigNetwork.master_server_url; + result = gConfigNetwork.MasterServerUrl; } return result; } diff --git a/src/openrct2/network/ServerList.cpp b/src/openrct2/network/ServerList.cpp index eaa727ac8c..c997807c4d 100644 --- a/src/openrct2/network/ServerList.cpp +++ b/src/openrct2/network/ServerList.cpp @@ -361,9 +361,9 @@ std::future> ServerList::FetchOnlineServerListAsync auto f = p->get_future(); std::string masterServerUrl = OPENRCT2_MASTER_SERVER_URL; - if (!gConfigNetwork.master_server_url.empty()) + if (!gConfigNetwork.MasterServerUrl.empty()) { - masterServerUrl = gConfigNetwork.master_server_url; + masterServerUrl = gConfigNetwork.MasterServerUrl; } Http::Request request; diff --git a/src/openrct2/object/MusicObject.cpp b/src/openrct2/object/MusicObject.cpp index eec2442ec5..bdf1659fa9 100644 --- a/src/openrct2/object/MusicObject.cpp +++ b/src/openrct2/object/MusicObject.cpp @@ -18,6 +18,7 @@ #include "../core/IStream.hpp" #include "../core/Json.hpp" #include "../core/Path.hpp" +#include "../drawing/Image.h" #include "../localisation/StringIds.h" #include "../ride/Ride.h" #include "RideObject.h" @@ -71,6 +72,9 @@ void MusicObject::Load() track.Size = track.Asset.GetSize(); } } + + _hasPreview = !!GetImageTable().GetCount(); + _previewImageId = gfx_object_allocate_images(GetImageTable().GetImages(), GetImageTable().GetCount()); } void MusicObject::Unload() @@ -84,7 +88,10 @@ void MusicObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t hei // Write (no image) int32_t x = width / 2; int32_t y = height / 2; - DrawTextBasic(dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE }); + if (_hasPreview) + gfx_draw_sprite(dpi, ImageId(_previewImageId), { 0, 0 }); + else + DrawTextBasic(dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE }); } void MusicObject::ReadJson(IReadObjectContext* context, json_t& root) diff --git a/src/openrct2/object/MusicObject.h b/src/openrct2/object/MusicObject.h index 9aaf0cd620..7145c6b9a7 100644 --- a/src/openrct2/object/MusicObject.h +++ b/src/openrct2/object/MusicObject.h @@ -49,6 +49,8 @@ private: MusicNiceFactor _niceFactor; AudioSampleTable _sampleTable; AudioSampleTable _loadedSampleTable; + bool _hasPreview{}; + uint32_t _previewImageId{}; public: StringId NameStringId{}; diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index ca0457c900..6a2b37b7bb 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -250,6 +250,7 @@ class Object { private: std::string _identifier; + std::string _version; ObjectEntryDescriptor _descriptor{}; StringTable _stringTable; ImageTable _imageTable; @@ -363,6 +364,14 @@ public: const std::vector& GetAuthors() const; void SetAuthors(std::vector&& authors); + const std::string& GetVersion() const + { + return _version; + } + void SetVersion(const std::string& version) + { + _version = version; + } const ImageTable& GetImageTable() const { diff --git a/src/openrct2/object/ObjectAsset.h b/src/openrct2/object/ObjectAsset.h index dcbfab67dd..560a73d0fe 100644 --- a/src/openrct2/object/ObjectAsset.h +++ b/src/openrct2/object/ObjectAsset.h @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2021 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index df02b97dd9..7ebf361fe8 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -521,6 +521,7 @@ namespace ObjectFactory if (id == OpenRCT2::Audio::AudioObjectIdentifiers::Rct2cBase) id = OpenRCT2::Audio::AudioObjectIdentifiers::Rct2Base; + auto version = Json::GetString(jRoot["version"]); ObjectEntryDescriptor descriptor; auto originalId = Json::GetString(jRoot["originalId"]); if (originalId.length() == 8 + 1 + 8 + 1 + 8) @@ -539,8 +540,9 @@ namespace ObjectFactory { descriptor = ObjectEntryDescriptor(objectType, id); } - + descriptor.Version = version; result = CreateObject(objectType); + result->SetVersion(version); result->SetIdentifier(id); result->SetDescriptor(descriptor); result->MarkAsJsonObject(); diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index 46aff5dccf..aeeeb12f3b 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -121,6 +121,7 @@ public: item.Generation = object->GetGeneration(); item.Identifier = object->GetIdentifier(); item.ObjectEntry = object->GetObjectEntry(); + item.Version = object->GetVersion(); item.Path = path; item.Name = object->GetName(); item.Authors = object->GetAuthors(); @@ -419,6 +420,7 @@ private: { conflict = FindObject(item.Identifier); } + if (conflict == nullptr) { size_t index = _items.size(); @@ -435,6 +437,21 @@ private: } return true; } + // When there is a conflict between a DAT file and a JSON file, the JSON should take precedence. + else if (item.Generation == ObjectGeneration::JSON && conflict->Generation == ObjectGeneration::DAT) + { + const auto id = conflict->Id; + const auto oldPath = conflict->Path; + _items[id] = item; + _items[id].Id = id; + if (!item.Identifier.empty()) + { + _newItemMap[item.Identifier] = id; + } + + Console::Error::WriteLine("Object conflict: '%s' was overridden by '%s'", oldPath.c_str(), item.Path.c_str()); + return true; + } Console::Error::WriteLine("Object conflict: '%s'", conflict->Path.c_str()); Console::Error::WriteLine(" : '%s'", item.Path.c_str()); @@ -567,7 +584,7 @@ private: auto fileName = GetFileNameForNewObject(generation, name); auto extension = (generation == ObjectGeneration::DAT ? u8".DAT" : u8".parkobj"); auto fullPath = Path::Combine(userObjPath, fileName + extension); - auto counter = 1U; + auto counter = 1u; while (File::Exists(fullPath)) { counter++; diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index feb75ed72b..1456b84ca7 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -43,6 +43,7 @@ struct ObjectRepositoryItem rct_object_entry ObjectEntry; std::string Path; std::string Name; + std::string Version; std::vector Authors; std::vector Sources; std::shared_ptr LoadedObject{}; diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 86e9db6bc6..5987bef18b 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -326,7 +326,7 @@ ImageIndex RideObject::GetPreviewImage(ride_type_t type) void RideObject::SetRepositoryItem(ObjectRepositoryItem* item) const { // Find the first non-null ride type, to be used when checking the ride group and determining the category. - uint8_t firstRideType = ride_entry_get_first_non_null_ride_type(&_legacyType); + auto firstRideType = _legacyType.GetFirstNonNullRideType(); uint8_t category = GetRideTypeDescriptor(firstRideType).Category; for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) diff --git a/src/openrct2/object/SceneryGroupObject.cpp b/src/openrct2/object/SceneryGroupObject.cpp index d1b32cfcbc..a4fa621c20 100644 --- a/src/openrct2/object/SceneryGroupObject.cpp +++ b/src/openrct2/object/SceneryGroupObject.cpp @@ -153,7 +153,7 @@ void SceneryGroupObject::ReadJson(IReadObjectContext* context, json_t& root) if (properties.is_object()) { - _legacyType.priority = Json::GetNumber(properties["priority"]); + _legacyType.priority = Json::GetNumber(properties["priority"], 40); _legacyType.entertainer_costumes = ReadJsonEntertainerCostumes(properties["entertainerCostumes"]); _items = ReadJsonEntries(context, properties["entries"]); diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index c1c9e55237..586e40329b 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -175,29 +175,6 @@ void SmallSceneryObject::PerformFixes() static const auto& scgPirat = GetScgPiratHeader(); SetPrimarySceneryGroup(scgPirat); } - - // ToonTowner's wooden roofs. Make them show up in the Mine Theming. - if (identifier == "TTRFWD01" || - identifier == "TTRFWD02" || - identifier == "TTRFWD03" || - identifier == "TTRFWD04" || - identifier == "TTRFWD05" || - identifier == "TTRFWD06" || - identifier == "TTRFWD07" || - identifier == "TTRFWD08") - { - static const auto& scgMine = GetScgMineHeader(); - SetPrimarySceneryGroup(scgMine); - } - - // ToonTowner's glass roofs. Make them show up in the Abstract Theming. - if (identifier == "TTRFGL01" || - identifier == "TTRFGL02" || - identifier == "TTRFGL03") - { - static const auto& scgAbstr = GetScgAbstrHeader(); - SetPrimarySceneryGroup(scgAbstr); - } } // clang-format on @@ -206,16 +183,6 @@ ObjectEntryDescriptor SmallSceneryObject::GetScgPiratHeader() const return ObjectEntryDescriptor("rct2.scenery_group.scgpirat"); } -ObjectEntryDescriptor SmallSceneryObject::GetScgMineHeader() const -{ - return ObjectEntryDescriptor("rct2.scgmine"); -} - -ObjectEntryDescriptor SmallSceneryObject::GetScgAbstrHeader() const -{ - return ObjectEntryDescriptor("rct2.scenery_group.scgabstr"); -} - void SmallSceneryObject::ReadJson(IReadObjectContext* context, json_t& root) { Guard::Assert(root.is_object(), "SmallSceneryObject::ReadJson expects parameter root to be object"); diff --git a/src/openrct2/object/SmallSceneryObject.h b/src/openrct2/object/SmallSceneryObject.h index fcaadba643..884c3d0d2f 100644 --- a/src/openrct2/object/SmallSceneryObject.h +++ b/src/openrct2/object/SmallSceneryObject.h @@ -38,6 +38,4 @@ private: static std::vector ReadJsonFrameOffsets(json_t& jFrameOffsets); void PerformFixes(); ObjectEntryDescriptor GetScgPiratHeader() const; - ObjectEntryDescriptor GetScgMineHeader() const; - ObjectEntryDescriptor GetScgAbstrHeader() const; }; diff --git a/src/openrct2/paint/Paint.Entity.cpp b/src/openrct2/paint/Paint.Entity.cpp index c4861fbe53..46fa2a3f25 100644 --- a/src/openrct2/paint/Paint.Entity.cpp +++ b/src/openrct2/paint/Paint.Entity.cpp @@ -34,11 +34,11 @@ * Paint Quadrant * rct2: 0x0069E8B0 */ -void EntityPaintSetup(paint_session& session, const CoordsXY& pos) +void EntityPaintSetup(PaintSession& session, const CoordsXY& pos) { PROFILED_FUNCTION(); - if (!map_is_location_valid(pos)) + if (!MapIsLocationValid(pos)) { return; } diff --git a/src/openrct2/paint/Paint.Entity.h b/src/openrct2/paint/Paint.Entity.h index 061960e6d1..c4de900620 100644 --- a/src/openrct2/paint/Paint.Entity.h +++ b/src/openrct2/paint/Paint.Entity.h @@ -9,7 +9,7 @@ #pragma once -struct paint_session; +struct PaintSession; struct CoordsXY; -void EntityPaintSetup(paint_session& session, const CoordsXY& pos); +void EntityPaintSetup(PaintSession& session, const CoordsXY& pos); diff --git a/src/openrct2/rct12/SawyerEncoding.h b/src/openrct2/paint/Paint.SessionFlags.h similarity index 62% rename from src/openrct2/rct12/SawyerEncoding.h rename to src/openrct2/paint/Paint.SessionFlags.h index 4f31962318..7b002d848d 100644 --- a/src/openrct2/rct12/SawyerEncoding.h +++ b/src/openrct2/paint/Paint.SessionFlags.h @@ -11,15 +11,8 @@ #include "../common.h" -namespace OpenRCT2 +namespace PaintSessionFlags { - struct IStream; -} - -enum class RCT12TrackDesignVersion : uint8_t; - -namespace SawyerEncoding -{ - bool ValidateChecksum(OpenRCT2::IStream* stream); - RCT12TrackDesignVersion ValidateTrackChecksum(OpenRCT2::IStream* stream); -} // namespace SawyerEncoding + constexpr uint8_t PassedSurface = 1u << 0; + constexpr uint8_t IsTrackPiecePreview = 1u << 1; +} // namespace PaintSessionFlags diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index acbeb48b2d..e80a1303e8 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -55,11 +55,11 @@ bool gShowDirtyVisuals; 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, ImageId imageId, int32_t x, int32_t y); -static ImageId PaintPSColourifyImage(const paint_struct* ps, ImageId imageId, uint32_t viewFlags); +static void PaintAttachedPS(rct_drawpixelinfo* dpi, PaintStruct* ps, uint32_t viewFlags); +static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y); +static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uint32_t viewFlags); -static int32_t RemapPositionToQuadrant(const paint_struct& ps, uint8_t rotation) +static int32_t RemapPositionToQuadrant(const PaintStruct& ps, uint8_t rotation) { constexpr auto MapRangeMax = MaxPaintQuadrants * COORDS_XY_STEP; constexpr auto MapRangeCenter = MapRangeMax / 2; @@ -85,7 +85,7 @@ static int32_t RemapPositionToQuadrant(const paint_struct& ps, uint8_t rotation) return 0; } -static void PaintSessionAddPSToQuadrant(paint_session& session, paint_struct* ps) +static void PaintSessionAddPSToQuadrant(PaintSession& session, PaintStruct* ps) { const auto positionHash = RemapPositionToQuadrant(*ps, session.CurrentRotation); @@ -148,8 +148,8 @@ static constexpr CoordsXYZ RotateBoundBoxSize(const CoordsXYZ& bbSize, const uin /** * Extracted from 0x0098196c, 0x0098197c, 0x0098198c, 0x0098199c */ -static paint_struct* CreateNormalPaintStruct( - paint_session& session, ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) +static PaintStruct* CreateNormalPaintStruct( + PaintSession& session, ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) { auto* const g1 = gfx_get_g1_element(image_id); if (g1 == nullptr) @@ -161,7 +161,7 @@ static paint_struct* CreateNormalPaintStruct( auto swappedRotCoord = CoordsXYZ{ offset.Rotate(swappedRotation), offset.z }; swappedRotCoord += session.SpritePosition; - const auto imagePos = translate_3d_to_2d_with_z(session.CurrentRotation, swappedRotCoord); + const auto imagePos = Translate3DTo2DWithZ(session.CurrentRotation, swappedRotCoord); if (!ImageWithinDPI(imagePos, *g1, session.DPI)) { @@ -197,7 +197,7 @@ static paint_struct* CreateNormalPaintStruct( return ps; } -template void PaintSessionGenerateRotate(paint_session& session) +template void PaintSessionGenerateRotate(PaintSession& session) { // Optimised modified version of viewport_coord_to_map_coord ScreenCoordsXY screenCoord = { floor2(session.DPI.x, 32), floor2((session.DPI.y - 16), 32) }; @@ -222,14 +222,14 @@ template void PaintSessionGenerateRotate(paint_session& sessi for (; numVerticalTiles > 0; --numVerticalTiles) { - tile_element_paint_setup(session, mapTile); + TileElementPaintSetup(session, mapTile); EntityPaintSetup(session, mapTile); const auto loc1 = mapTile + adjacentTiles[0]; EntityPaintSetup(session, loc1); const auto loc2 = mapTile + adjacentTiles[1]; - tile_element_paint_setup(session, loc2); + TileElementPaintSetup(session, loc2); EntityPaintSetup(session, loc2); const auto loc3 = mapTile + adjacentTiles[2]; @@ -243,7 +243,7 @@ template void PaintSessionGenerateRotate(paint_session& sessi * * rct2: 0x0068B6C2 */ -void PaintSessionGenerate(paint_session& session) +void PaintSessionGenerate(PaintSession& session) { session.CurrentRotation = get_current_rotation(); switch (DirectionFlipXAxis(session.CurrentRotation)) @@ -263,13 +263,12 @@ void PaintSessionGenerate(paint_session& session) } } -template -static bool CheckBoundingBox(const paint_struct_bound_box& initialBBox, const paint_struct_bound_box& currentBBox) +template static bool CheckBoundingBox(const PaintStructBoundBox& initialBBox, const PaintStructBoundBox& currentBBox) { return false; } -template<> bool CheckBoundingBox<0>(const paint_struct_bound_box& initialBBox, const paint_struct_bound_box& currentBBox) +template<> bool CheckBoundingBox<0>(const PaintStructBoundBox& initialBBox, const PaintStructBoundBox& currentBBox) { if (initialBBox.z_end >= currentBBox.z && initialBBox.y_end >= currentBBox.y && initialBBox.x_end >= currentBBox.x && !(initialBBox.z < currentBBox.z_end && initialBBox.y < currentBBox.y_end && initialBBox.x < currentBBox.x_end)) @@ -279,7 +278,7 @@ template<> bool CheckBoundingBox<0>(const paint_struct_bound_box& initialBBox, c return false; } -template<> bool CheckBoundingBox<1>(const paint_struct_bound_box& initialBBox, const paint_struct_bound_box& currentBBox) +template<> bool CheckBoundingBox<1>(const PaintStructBoundBox& initialBBox, const PaintStructBoundBox& currentBBox) { if (initialBBox.z_end >= currentBBox.z && initialBBox.y_end >= currentBBox.y && initialBBox.x_end < currentBBox.x && !(initialBBox.z < currentBBox.z_end && initialBBox.y < currentBBox.y_end && initialBBox.x >= currentBBox.x_end)) @@ -289,7 +288,7 @@ template<> bool CheckBoundingBox<1>(const paint_struct_bound_box& initialBBox, c return false; } -template<> bool CheckBoundingBox<2>(const paint_struct_bound_box& initialBBox, const paint_struct_bound_box& currentBBox) +template<> bool CheckBoundingBox<2>(const PaintStructBoundBox& initialBBox, const PaintStructBoundBox& currentBBox) { if (initialBBox.z_end >= currentBBox.z && initialBBox.y_end < currentBBox.y && initialBBox.x_end < currentBBox.x && !(initialBBox.z < currentBBox.z_end && initialBBox.y >= currentBBox.y_end && initialBBox.x >= currentBBox.x_end)) @@ -299,7 +298,7 @@ template<> bool CheckBoundingBox<2>(const paint_struct_bound_box& initialBBox, c return false; } -template<> bool CheckBoundingBox<3>(const paint_struct_bound_box& initialBBox, const paint_struct_bound_box& currentBBox) +template<> bool CheckBoundingBox<3>(const PaintStructBoundBox& initialBBox, const PaintStructBoundBox& currentBBox) { if (initialBBox.z_end >= currentBBox.z && initialBBox.y_end < currentBBox.y && initialBBox.x_end >= currentBBox.x && !(initialBBox.z < currentBBox.z_end && initialBBox.y >= currentBBox.y_end && initialBBox.x < currentBBox.x_end)) @@ -312,16 +311,16 @@ template<> bool CheckBoundingBox<3>(const paint_struct_bound_box& initialBBox, c 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); + 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) +static PaintStruct* PaintArrangeStructsHelperRotation(PaintStruct* ps_next, uint16_t quadrantIndex, uint8_t flag) { - paint_struct* ps; - paint_struct* ps_temp; + PaintStruct* ps; + PaintStruct* ps_temp; // Get the first node in the specified quadrant. do @@ -334,7 +333,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui // 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; + PaintStruct* psQuadrantEntry = ps; // Visit all nodes in the linked quadrant list and determine their current // sorting relevancy. @@ -394,7 +393,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui ps_temp = ps; // Compare current node against the remaining children. - const paint_struct_bound_box& initialBBox = ps_next->bounds; + const PaintStructBoundBox& initialBBox = ps_next->bounds; while (true) { ps = ps_next; @@ -406,7 +405,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui if (!(ps_next->SortFlags & PaintSortFlags::Neighbour)) continue; - const paint_struct_bound_box& currentBBox = ps_next->bounds; + const PaintStructBoundBox& currentBBox = ps_next->bounds; const bool compareResult = CheckBoundingBox(initialBBox, currentBBox); @@ -414,7 +413,7 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui { // 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; + PaintStruct* ps_temp2 = ps_temp->next_quadrant_ps; ps_temp->next_quadrant_ps = ps_next; ps_next->next_quadrant_ps = ps_temp2; ps_next = ps; @@ -427,9 +426,9 @@ static paint_struct* PaintArrangeStructsHelperRotation(paint_struct* ps_next, ui template static void PaintSessionArrange(PaintSessionCore& session, bool) { - paint_struct* psHead = &session.PaintHead; + PaintStruct* psHead = &session.PaintHead; - paint_struct* ps = psHead; + PaintStruct* ps = psHead; ps->next_quadrant_ps = nullptr; uint32_t quadrantIndex = session.QuadrantBackIndex; @@ -437,7 +436,7 @@ template static void PaintSessionArrange(PaintSessionCore& sessio { do { - paint_struct* ps_next = session.Quadrants[quadrantIndex]; + PaintStruct* ps_next = session.Quadrants[quadrantIndex]; if (ps_next != nullptr) { ps->next_quadrant_ps = ps_next; @@ -450,7 +449,7 @@ template static void PaintSessionArrange(PaintSessionCore& sessio } } while (++quadrantIndex <= session.QuadrantFrontIndex); - paint_struct* ps_cache = PaintArrangeStructsHelperRotation( + PaintStruct* ps_cache = PaintArrangeStructsHelperRotation( psHead, session.QuadrantBackIndex & 0xFFFF, PaintSortFlags::Neighbour); quadrantIndex = session.QuadrantBackIndex; @@ -482,7 +481,7 @@ void PaintSessionArrange(PaintSessionCore& session) Guard::Assert(false); } -static void PaintDrawStruct(paint_session& session, paint_struct* ps) +static void PaintDrawStruct(PaintSession& session, PaintStruct* ps) { rct_drawpixelinfo* dpi = &session.DPI; @@ -527,11 +526,11 @@ static void PaintDrawStruct(paint_session& session, paint_struct* ps) * * rct2: 0x00688485 */ -void PaintDrawStructs(paint_session& session) +void PaintDrawStructs(PaintSession& session) { PROFILED_FUNCTION(); - paint_struct* ps = &session.PaintHead; + PaintStruct* ps = &session.PaintHead; for (ps = ps->next_quadrant_ps; ps != nullptr;) { @@ -546,9 +545,9 @@ void PaintDrawStructs(paint_session& session) * rct2: 0x00688596 * Part of 0x688485 */ -static void PaintAttachedPS(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t viewFlags) +static void PaintAttachedPS(rct_drawpixelinfo* dpi, PaintStruct* ps, uint32_t viewFlags) { - attached_paint_struct* attached_ps = ps->attached_ps; + AttachedPaintStruct* attached_ps = ps->attached_ps; for (; attached_ps != nullptr; attached_ps = attached_ps->next) { auto screenCoords = ScreenCoordsXY{ attached_ps->x + ps->x, attached_ps->y + ps->y }; @@ -565,7 +564,7 @@ static void PaintAttachedPS(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t v } } -static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* ps, ImageId imageId, int32_t x, int32_t y) +static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y) { const uint8_t colour = BoundBoxDebugColours[EnumValue(ps->sprite_type)]; const uint8_t rotation = get_current_rotation(); @@ -575,56 +574,56 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* ps->bounds.y_end, ps->bounds.z_end, }; - const auto screenCoordFrontTop = translate_3d_to_2d_with_z(rotation, frontTop); + const auto screenCoordFrontTop = Translate3DTo2DWithZ(rotation, frontTop); const CoordsXYZ frontBottom = { ps->bounds.x_end, ps->bounds.y_end, ps->bounds.z, }; - const auto screenCoordFrontBottom = translate_3d_to_2d_with_z(rotation, frontBottom); + const auto screenCoordFrontBottom = Translate3DTo2DWithZ(rotation, frontBottom); const CoordsXYZ leftTop = { ps->bounds.x, ps->bounds.y_end, ps->bounds.z_end, }; - const auto screenCoordLeftTop = translate_3d_to_2d_with_z(rotation, leftTop); + const auto screenCoordLeftTop = Translate3DTo2DWithZ(rotation, leftTop); const CoordsXYZ leftBottom = { ps->bounds.x, ps->bounds.y_end, ps->bounds.z, }; - const auto screenCoordLeftBottom = translate_3d_to_2d_with_z(rotation, leftBottom); + const auto screenCoordLeftBottom = Translate3DTo2DWithZ(rotation, leftBottom); const CoordsXYZ rightTop = { ps->bounds.x_end, ps->bounds.y, ps->bounds.z_end, }; - const auto screenCoordRightTop = translate_3d_to_2d_with_z(rotation, rightTop); + const auto screenCoordRightTop = Translate3DTo2DWithZ(rotation, rightTop); const CoordsXYZ rightBottom = { ps->bounds.x_end, ps->bounds.y, ps->bounds.z, }; - const auto screenCoordRightBottom = translate_3d_to_2d_with_z(rotation, rightBottom); + const auto screenCoordRightBottom = Translate3DTo2DWithZ(rotation, rightBottom); const CoordsXYZ backTop = { ps->bounds.x, ps->bounds.y, ps->bounds.z_end, }; - const auto screenCoordBackTop = translate_3d_to_2d_with_z(rotation, backTop); + const auto screenCoordBackTop = Translate3DTo2DWithZ(rotation, backTop); const CoordsXYZ backBottom = { ps->bounds.x, ps->bounds.y, ps->bounds.z, }; - const auto screenCoordBackBottom = translate_3d_to_2d_with_z(rotation, backBottom); + const auto screenCoordBackBottom = Translate3DTo2DWithZ(rotation, backBottom); // bottom square gfx_draw_line(dpi, { screenCoordFrontBottom, screenCoordLeftBottom }, colour); @@ -651,7 +650,7 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, paint_struct* gfx_draw_line(dpi, { screenCoordFrontTop, screenCoordRightTop }, colour); } -static ImageId PaintPSColourifyImage(const paint_struct* ps, ImageId imageId, uint32_t viewFlags) +static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uint32_t viewFlags) { auto visibility = GetPaintStructVisibility(ps, viewFlags); switch (visibility) @@ -665,12 +664,12 @@ static ImageId PaintPSColourifyImage(const paint_struct* ps, ImageId imageId, ui } } -paint_session* PaintSessionAlloc(rct_drawpixelinfo* dpi, uint32_t viewFlags) +PaintSession* PaintSessionAlloc(rct_drawpixelinfo* dpi, uint32_t viewFlags) { return GetContext()->GetPainter()->CreateSession(dpi, viewFlags); } -void PaintSessionFree([[maybe_unused]] paint_session* session) +void PaintSessionFree([[maybe_unused]] PaintSession* session) { GetContext()->GetPainter()->ReleaseSession(session); } @@ -685,16 +684,16 @@ void PaintSessionFree([[maybe_unused]] paint_session* session) * @param bound_box_length_y (si) * @param bound_box_length_z (ah) * @param z_offset (dx) - * @return (ebp) paint_struct on success (CF == 0), nullptr on failure (CF == 1) + * @return (ebp) PaintStruct on success (CF == 0), nullptr on failure (CF == 1) */ -paint_struct* PaintAddImageAsParent( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize) +PaintStruct* PaintAddImageAsParent( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize) { return PaintAddImageAsParent(session, image_id, offset, { offset, boundBoxSize }); } -paint_struct* PaintAddImageAsParent( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, +PaintStruct* PaintAddImageAsParent( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset) { return PaintAddImageAsParent(session, image_id, offset, { boundBoxOffset, boundBoxSize }); @@ -713,11 +712,11 @@ paint_struct* PaintAddImageAsParent( * @param bound_box_offset_x (0x009DEA52) * @param bound_box_offset_y (0x009DEA54) * @param bound_box_offset_z (0x009DEA56) - * @return (ebp) paint_struct on success (CF == 0), nullptr on failure (CF == 1) + * @return (ebp) PaintStruct on success (CF == 0), nullptr on failure (CF == 1) */ // Track Pieces, Shops. -paint_struct* PaintAddImageAsParent( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) +PaintStruct* PaintAddImageAsParent( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) { session.LastPS = nullptr; session.LastAttachedPS = nullptr; @@ -747,24 +746,17 @@ paint_struct* PaintAddImageAsParent( * @param bound_box_offset_x (0x009DEA52) * @param bound_box_offset_y (0x009DEA54) * @param bound_box_offset_z (0x009DEA56) - * @return (ebp) paint_struct on success (CF == 0), nullptr on failure (CF == 1) + * @return (ebp) PaintStruct on success (CF == 0), nullptr on failure (CF == 1) * Creates a paint struct but does not allocate to a paint quadrant. Result cannot be ignored! */ -[[nodiscard]] paint_struct* PaintAddImageAsOrphan( - paint_session& session, const ImageId& imageId, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) +[[nodiscard]] PaintStruct* PaintAddImageAsOrphan( + PaintSession& session, const ImageId imageId, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) { session.LastPS = nullptr; session.LastAttachedPS = nullptr; return CreateNormalPaintStruct(session, imageId, offset, boundBox); } -paint_struct* PaintAddImageAsChild( - paint_session& session, const ImageId& imageId, const CoordsXYZ& offset, const CoordsXYZ& boundBoxLength, - const CoordsXYZ& boundBoxOffset) -{ - return PaintAddImageAsChild(session, imageId, offset, { boundBoxOffset, boundBoxLength }); -} - /** * * rct2: 0x006874B0, 0x00687618, 0x0068778C, 0x00687902, 0x0098199C @@ -779,13 +771,13 @@ paint_struct* PaintAddImageAsChild( * @param bound_box_offset_x (0x009DEA52) * @param bound_box_offset_y (0x009DEA54) * @param bound_box_offset_z (0x009DEA56) - * @return (ebp) paint_struct on success (CF == 0), nullptr on failure (CF == 1) + * @return (ebp) PaintStruct on success (CF == 0), nullptr on failure (CF == 1) * If there is no parent paint struct then image is added as a parent */ -paint_struct* PaintAddImageAsChild( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) +PaintStruct* PaintAddImageAsChild( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox) { - paint_struct* parentPS = session.LastPS; + PaintStruct* parentPS = session.LastPS; if (parentPS == nullptr) { return PaintAddImageAsParent(session, image_id, offset, boundBox); @@ -810,7 +802,7 @@ paint_struct* PaintAddImageAsChild( * @param y (cx) * @return (!CF) success */ -bool PaintAttachToPreviousAttach(paint_session& session, const ImageId& imageId, int32_t x, int32_t y) +bool PaintAttachToPreviousAttach(PaintSession& session, const ImageId imageId, int32_t x, int32_t y) { auto* previousAttachedPS = session.LastAttachedPS; if (previousAttachedPS == nullptr) @@ -843,7 +835,7 @@ bool PaintAttachToPreviousAttach(paint_session& session, const ImageId& imageId, * @param y (cx) * @return (!CF) success */ -bool PaintAttachToPreviousPS(paint_session& session, const ImageId& image_id, int32_t x, int32_t y) +bool PaintAttachToPreviousPS(PaintSession& session, const ImageId image_id, int32_t x, int32_t y) { auto* masterPs = session.LastPS; if (masterPs == nullptr) @@ -862,7 +854,7 @@ bool PaintAttachToPreviousPS(paint_session& session, const ImageId& image_id, in ps->y = y; ps->IsMasked = false; - attached_paint_struct* oldFirstAttached = masterPs->attached_ps; + AttachedPaintStruct* oldFirstAttached = masterPs->attached_ps; masterPs->attached_ps = ps; ps->next = oldFirstAttached; @@ -880,7 +872,7 @@ bool PaintAttachToPreviousPS(paint_session& session, const ImageId& image_id, in * @param rotation (ebp) */ void PaintFloatingMoneyEffect( - paint_session& session, money64 amount, StringId string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, + PaintSession& session, money64 amount, StringId string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation) { auto* ps = session.AllocateStringPaintEntry(); @@ -894,7 +886,7 @@ void PaintFloatingMoneyEffect( session.SpritePosition.y, z, }; - const auto coord = translate_3d_to_2d_with_z(rotation, position); + const auto coord = Translate3DTo2DWithZ(rotation, position); ps->string_id = string_id; ps->next = nullptr; @@ -910,7 +902,7 @@ void PaintFloatingMoneyEffect( * * rct2: 0x006860C3 */ -void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, paint_string_struct* ps) +void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, PaintStringStruct* ps) { do { @@ -919,7 +911,7 @@ void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, paint_string_struct* ps) // Use sprite font unless the currency contains characters unsupported by the sprite font auto forceSpriteFont = false; - const auto& currencyDesc = CurrencyDescriptors[EnumValue(gConfigGeneral.currency_format)]; + const auto& currencyDesc = CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)]; if (LocalisationService_UseTrueTypeFont() && font_supports_string_sprite(currencyDesc.symbol_unicode)) { forceSpriteFont = true; @@ -927,7 +919,7 @@ void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, paint_string_struct* ps) gfx_draw_string_with_y_offsets( dpi, buffer, COLOUR_BLACK, { ps->x, ps->y }, reinterpret_cast(ps->y_offsets), forceSpriteFont, - FontSpriteBase::MEDIUM); + FontStyle::Medium); } while ((ps = ps->next) != nullptr); } @@ -958,7 +950,7 @@ PaintEntryPool::Chain& PaintEntryPool::Chain::operator=(Chain&& chain) noexcept return *this; } -paint_entry* PaintEntryPool::Chain::Allocate() +PaintEntry* PaintEntryPool::Chain::Allocate() { if (Pool == nullptr) { diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index ac71d5f9cb..c77b4d968c 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -25,9 +25,9 @@ struct TileElement; enum class RailingEntrySupportType : uint8_t; enum class ViewportInteractionItem : uint8_t; -struct attached_paint_struct +struct AttachedPaintStruct { - attached_paint_struct* next; + AttachedPaintStruct* next; ImageId image_id; ImageId ColourImageId; int32_t x; @@ -35,7 +35,7 @@ struct attached_paint_struct bool IsMasked; }; -struct paint_struct_bound_box +struct PaintStructBoundBox { int32_t x; int32_t y; @@ -45,12 +45,12 @@ struct paint_struct_bound_box int32_t z_end; }; -struct paint_struct +struct PaintStruct { - paint_struct_bound_box bounds; - attached_paint_struct* attached_ps; - paint_struct* children; - paint_struct* next_quadrant_ps; + PaintStructBoundBox bounds; + AttachedPaintStruct* attached_ps; + PaintStruct* children; + PaintStruct* next_quadrant_ps; TileElement* tileElement; EntityBase* entity; ImageId image_id; @@ -63,46 +63,46 @@ struct paint_struct ViewportInteractionItem sprite_type; }; -struct paint_string_struct +struct PaintStringStruct { StringId string_id; - paint_string_struct* next; + PaintStringStruct* next; int32_t x; int32_t y; uint32_t args[4]; uint8_t* y_offsets; }; -struct paint_entry +struct PaintEntry { private: - std::array data; + std::array data; public: - paint_struct* AsBasic() + PaintStruct* AsBasic() { - auto* res = reinterpret_cast(data.data()); - ::new (res) paint_struct(); + auto* res = reinterpret_cast(data.data()); + ::new (res) PaintStruct(); return res; } - attached_paint_struct* AsAttached() + AttachedPaintStruct* AsAttached() { - auto* res = reinterpret_cast(data.data()); - ::new (res) attached_paint_struct(); + auto* res = reinterpret_cast(data.data()); + ::new (res) AttachedPaintStruct(); return res; } - paint_string_struct* AsString() + PaintStringStruct* AsString() { - auto* res = reinterpret_cast(data.data()); - ::new (res) paint_string_struct(); + auto* res = reinterpret_cast(data.data()); + ::new (res) PaintStringStruct(); return res; } }; -static_assert(sizeof(paint_entry) >= sizeof(paint_struct)); -static_assert(sizeof(paint_entry) >= sizeof(attached_paint_struct)); -static_assert(sizeof(paint_entry) >= sizeof(paint_string_struct)); +static_assert(sizeof(PaintEntry) >= sizeof(PaintStruct)); +static_assert(sizeof(PaintEntry) >= sizeof(AttachedPaintStruct)); +static_assert(sizeof(PaintEntry) >= sizeof(PaintStringStruct)); -struct sprite_bb +struct SpriteBb { uint32_t sprite_id; CoordsXYZ offset; @@ -110,14 +110,14 @@ struct sprite_bb CoordsXYZ bb_size; }; -struct support_height +struct SupportHeight { uint16_t height; uint8_t slope; uint8_t pad; }; -struct tunnel_entry +struct TunnelEntry { uint8_t height; uint8_t type; @@ -130,7 +130,7 @@ static constexpr int32_t MaxPaintQuadrants = MAXIMUM_MAP_SIZE_TECHNICAL * 2; #define TUNNEL_MAX_COUNT 65 /** - * A pool of paint_entry instances that can be rented out. + * A pool of PaintEntry instances that can be rented out. * The internal implementation uses an unrolled linked list so that each * paint session can quickly allocate a new paint entry until it requires * another node / block of paint entries. Only the node allocation needs to @@ -145,7 +145,7 @@ public: { Node* Next{}; size_t Count{}; - paint_entry PaintStructs[NodeSize]{}; + PaintEntry PaintStructs[NodeSize]{}; }; struct Chain @@ -161,7 +161,7 @@ public: Chain& operator=(Chain&& chain) noexcept; - paint_entry* Allocate(); + PaintEntry* Allocate(); void Clear(); size_t GetCount() const; }; @@ -181,29 +181,29 @@ public: struct PaintSessionCore { - paint_struct PaintHead; - paint_struct* Quadrants[MaxPaintQuadrants]; - paint_struct* LastPS; - paint_string_struct* PSStringHead; - paint_string_struct* LastPSString; - attached_paint_struct* LastAttachedPS; + PaintStruct PaintHead; + PaintStruct* Quadrants[MaxPaintQuadrants]; + PaintStruct* LastPS; + PaintStringStruct* PSStringHead; + PaintStringStruct* LastPSString; + AttachedPaintStruct* LastAttachedPS; const TileElement* SurfaceElement; EntityBase* CurrentlyDrawnEntity; TileElement* CurrentlyDrawnTileElement; const TileElement* PathElementOnSameHeight; const TileElement* TrackElementOnSameHeight; - paint_struct* WoodenSupportsPrependTo; + PaintStruct* WoodenSupportsPrependTo; CoordsXY SpritePosition; CoordsXY MapPosition; uint32_t ViewFlags; uint32_t QuadrantBackIndex; uint32_t QuadrantFrontIndex; ImageId TrackColours[4]; - support_height SupportSegments[9]; - support_height Support; + SupportHeight SupportSegments[9]; + SupportHeight Support; uint16_t WaterHeight; - tunnel_entry LeftTunnels[TUNNEL_MAX_COUNT]; - tunnel_entry RightTunnels[TUNNEL_MAX_COUNT]; + TunnelEntry LeftTunnels[TUNNEL_MAX_COUNT]; + TunnelEntry RightTunnels[TUNNEL_MAX_COUNT]; uint8_t LeftTunnelCount; uint8_t RightTunnelCount; uint8_t VerticalTunnelHeight; @@ -212,12 +212,12 @@ struct PaintSessionCore ViewportInteractionItem InteractionType; }; -struct paint_session : public PaintSessionCore +struct PaintSession : public PaintSessionCore { rct_drawpixelinfo DPI; PaintEntryPool::Chain PaintEntryChain; - paint_struct* AllocateNormalPaintEntry() noexcept + PaintStruct* AllocateNormalPaintEntry() noexcept { auto* entry = PaintEntryChain.Allocate(); if (entry != nullptr) @@ -228,7 +228,7 @@ struct paint_session : public PaintSessionCore return nullptr; } - attached_paint_struct* AllocateAttachedPaintEntry() noexcept + AttachedPaintStruct* AllocateAttachedPaintEntry() noexcept { auto* entry = PaintEntryChain.Allocate(); if (entry != nullptr) @@ -239,7 +239,7 @@ struct paint_session : public PaintSessionCore return nullptr; } - paint_string_struct* AllocateStringPaintEntry() noexcept + PaintStringStruct* AllocateStringPaintEntry() noexcept { auto* entry = PaintEntryChain.Allocate(); if (entry != nullptr) @@ -275,10 +275,10 @@ struct FootpathPaintInfo struct RecordedPaintSession { PaintSessionCore Session; - std::vector Entries; + std::vector Entries; }; -extern paint_session gPaintSession; +extern PaintSession gPaintSession; // Globals for paint clipping extern uint8_t gClipHeight; @@ -294,42 +294,39 @@ extern bool gPaintBoundingBoxes; extern bool gPaintBlockedTiles; extern bool gPaintWidePathsAsGhost; -paint_struct* PaintAddImageAsParent( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); -paint_struct* PaintAddImageAsParent( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, +PaintStruct* PaintAddImageAsParent( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); +PaintStruct* PaintAddImageAsParent( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); -paint_struct* PaintAddImageAsParent( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox); -[[nodiscard]] paint_struct* PaintAddImageAsOrphan( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox); -paint_struct* PaintAddImageAsChild( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxLength, - const CoordsXYZ& boundBoxOffset); -paint_struct* PaintAddImageAsChild( - paint_session& session, const ImageId& image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox); +PaintStruct* PaintAddImageAsParent( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox); +[[nodiscard]] PaintStruct* PaintAddImageAsOrphan( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox); +PaintStruct* PaintAddImageAsChild( + PaintSession& session, const ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox); -paint_struct* PaintAddImageAsChildRotated( - paint_session& session, const uint8_t direction, const ImageId& image_id, const CoordsXYZ& offset, +PaintStruct* PaintAddImageAsChildRotated( + PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset); -paint_struct* PaintAddImageAsParentRotated( - paint_session& session, const uint8_t direction, const ImageId& image_id, const CoordsXYZ& offset, +PaintStruct* PaintAddImageAsParentRotated( + PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize); -paint_struct* PaintAddImageAsParentRotated( - paint_session& session, const uint8_t direction, const ImageId& imageId, const CoordsXYZ& offset, +PaintStruct* PaintAddImageAsParentRotated( + PaintSession& session, const uint8_t direction, const ImageId imageId, 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); +void PaintUtilPushTunnelRotated(PaintSession& session, uint8_t direction, uint16_t height, uint8_t type); -bool PaintAttachToPreviousAttach(paint_session& session, const ImageId& imageId, int32_t x, int32_t y); -bool PaintAttachToPreviousPS(paint_session& session, const ImageId& image_id, int32_t x, int32_t y); +bool PaintAttachToPreviousAttach(PaintSession& session, const ImageId imageId, int32_t x, int32_t y); +bool PaintAttachToPreviousPS(PaintSession& session, const ImageId image_id, int32_t x, int32_t y); void PaintFloatingMoneyEffect( - paint_session& session, money64 amount, StringId string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, + PaintSession& session, money64 amount, StringId 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); -void PaintSessionFree(paint_session* session); -void PaintSessionGenerate(paint_session& session); +PaintSession* PaintSessionAlloc(rct_drawpixelinfo* dpi, uint32_t viewFlags); +void PaintSessionFree(PaintSession* session); +void PaintSessionGenerate(PaintSession& session); void PaintSessionArrange(PaintSessionCore& session); -void PaintDrawStructs(paint_session& session); -void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, paint_string_struct* ps); +void PaintDrawStructs(PaintSession& session); +void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, PaintStringStruct* ps); diff --git a/src/openrct2/paint/PaintHelpers.cpp b/src/openrct2/paint/PaintHelpers.cpp index b20e706af9..9fe75da7d8 100644 --- a/src/openrct2/paint/PaintHelpers.cpp +++ b/src/openrct2/paint/PaintHelpers.cpp @@ -11,8 +11,8 @@ #include "../ride/TrackPaint.h" #include "Paint.h" -paint_struct* PaintAddImageAsParentRotated( - paint_session& session, const uint8_t direction, const ImageId& imageId, const CoordsXYZ& offset, +PaintStruct* PaintAddImageAsParentRotated( + PaintSession& session, const uint8_t direction, const ImageId imageId, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset) { if (direction & 1) @@ -25,8 +25,8 @@ paint_struct* PaintAddImageAsParentRotated( return PaintAddImageAsParent(session, imageId, offset, boundBoxSize, boundBoxOffset); } -paint_struct* PaintAddImageAsParentRotated( - paint_session& session, const uint8_t direction, const ImageId& image_id, const CoordsXYZ& offset, +PaintStruct* PaintAddImageAsParentRotated( + PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize) { if (direction & 1) @@ -38,28 +38,28 @@ paint_struct* PaintAddImageAsParentRotated( return PaintAddImageAsParent(session, image_id, offset, boundBoxSize); } -paint_struct* PaintAddImageAsChildRotated( - paint_session& session, const uint8_t direction, const ImageId& image_id, const CoordsXYZ& offset, +PaintStruct* PaintAddImageAsChildRotated( + PaintSession& session, const uint8_t direction, const ImageId image_id, const CoordsXYZ& offset, const CoordsXYZ& boundBoxSize, const CoordsXYZ& boundBoxOffset) { if (direction & 1) { return PaintAddImageAsChild( - session, image_id, { offset.y, offset.x, offset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z }, - { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }); + session, image_id, { offset.y, offset.x, offset.z }, + { { boundBoxOffset.y, boundBoxOffset.x, boundBoxOffset.z }, { boundBoxSize.y, boundBoxSize.x, boundBoxSize.z } }); } - return PaintAddImageAsChild(session, image_id, offset, boundBoxSize, boundBoxOffset); + return PaintAddImageAsChild(session, image_id, offset, { boundBoxOffset, boundBoxSize }); } -void paint_util_push_tunnel_rotated(paint_session& session, uint8_t direction, uint16_t height, uint8_t type) +void PaintUtilPushTunnelRotated(PaintSession& session, uint8_t direction, uint16_t height, uint8_t type) { if (direction & 1) { - paint_util_push_tunnel_right(session, height, type); + PaintUtilPushTunnelRight(session, height, type); } else { - paint_util_push_tunnel_left(session, height, type); + PaintUtilPushTunnelLeft(session, height, type); } } diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index b9ff0918af..763f456113 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -76,7 +76,7 @@ void Painter::Paint(IDrawingEngine& de) if (text != nullptr) PaintReplayNotice(dpi, text); - if (gConfigGeneral.show_fps) + if (gConfigGeneral.ShowFPS) { PaintFPS(dpi); } @@ -90,7 +90,7 @@ void Painter::PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text) char buffer[64]{}; FormatStringToBuffer(buffer, sizeof(buffer), "{OUTLINE}{RED}{STRING}", text); - auto stringWidth = gfx_get_string_width(buffer, FontSpriteBase::MEDIUM); + auto stringWidth = gfx_get_string_width(buffer, FontStyle::Medium); screenCoords.x = screenCoords.x - stringWidth; if (((gCurrentTicks >> 1) & 0xF) > 4) @@ -110,7 +110,7 @@ void Painter::PaintFPS(rct_drawpixelinfo* dpi) FormatStringToBuffer(buffer, sizeof(buffer), "{OUTLINE}{WHITE}{INT32}", _currentFPS); // Draw Text - int32_t stringWidth = gfx_get_string_width(buffer, FontSpriteBase::MEDIUM); + int32_t stringWidth = gfx_get_string_width(buffer, FontStyle::Medium); screenCoords.x = screenCoords.x - (stringWidth / 2); gfx_draw_string(dpi, screenCoords, buffer); @@ -131,11 +131,11 @@ void Painter::MeasureFPS() _lastSecond = currentTime; } -paint_session* Painter::CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags) +PaintSession* Painter::CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags) { PROFILED_FUNCTION(); - paint_session* session = nullptr; + PaintSession* session = nullptr; if (_freePaintSessions.empty() == false) { @@ -148,7 +148,7 @@ paint_session* Painter::CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags else { // Create new one in pool. - _paintSessionPool.emplace_back(std::make_unique()); + _paintSessionPool.emplace_back(std::make_unique()); session = _paintSessionPool.back().get(); } @@ -172,7 +172,7 @@ paint_session* Painter::CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags return session; } -void Painter::ReleaseSession(paint_session* session) +void Painter::ReleaseSession(PaintSession* session) { PROFILED_FUNCTION(); diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index e1b1299190..b677e596f0 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -36,8 +36,8 @@ namespace OpenRCT2 { private: std::shared_ptr const _uiContext; - std::vector> _paintSessionPool; - std::vector _freePaintSessions; + std::vector> _paintSessionPool; + std::vector _freePaintSessions; PaintEntryPool _paintStructPool; time_t _lastSecond = 0; int32_t _currentFPS = 0; @@ -47,8 +47,8 @@ namespace OpenRCT2 explicit Painter(const std::shared_ptr& uiContext); void Paint(Drawing::IDrawingEngine& de); - paint_session* CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags); - void ReleaseSession(paint_session* session); + PaintSession* CreateSession(rct_drawpixelinfo* dpi, uint32_t viewFlags); + void ReleaseSession(PaintSession* session); ~Painter(); private: diff --git a/src/openrct2/paint/Supports.cpp b/src/openrct2/paint/Supports.cpp index 6f268c76a3..d6f7f2c575 100644 --- a/src/openrct2/paint/Supports.cpp +++ b/src/openrct2/paint/Supports.cpp @@ -15,6 +15,7 @@ #include "../util/Math.hpp" #include "../world/Surface.h" #include "Boundbox.h" +#include "Paint.SessionFlags.h" #include "Paint.h" #include "tile_element/Paint.TileElement.h" @@ -445,30 +446,18 @@ static constexpr const uint16_t word_97B3C4[] = { // clang-format on -bool wooden_a_supports_paint_setup( - paint_session& session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags) -{ - return wooden_a_supports_paint_setup(session, supportType, special, height, ImageId::FromUInt32(imageColourFlags)); -} - -bool wooden_b_supports_paint_setup( - paint_session& session, int32_t supportType, int32_t special, int32_t height, uint32_t imageColourFlags) -{ - return wooden_a_supports_paint_setup(session, supportType, special, height, ImageId::FromUInt32(imageColourFlags)); -} - /** * Adds paint structs for wooden supports. * rct2: 0x006629BC * @param supportType (edi) Type and direction of supports. * @param special (ax) Used for curved supports. * @param height (dx) The height of the supports. - * @param imageColourFlags (ebp) The colour and palette flags for the support sprites. + * @param imageTemplate (ebp) The colour and palette flags for the support sprites. * @param[out] underground (Carry flag) true if underground. * @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, ImageId imageTemplate) +bool WoodenASupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate) { if (!(session.Flags & PaintSessionFlags::PassedSurface)) { @@ -623,13 +612,13 @@ bool wooden_a_supports_paint_setup( * @param supportType (edi) * @param special (ax) * @param height (dx) - * @param imageColourFlags (ebp) + * @param imageTemplate (ebp) * @param[out] underground (Carry Flag) * * @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, ImageId imageTemplate) +bool WoodenBSupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate) { if (!(session.Flags & PaintSessionFlags::PassedSurface)) { @@ -794,13 +783,13 @@ bool wooden_b_supports_paint_setup( * @param segment (ebx) * @param special (ax) * @param height (edx) - * @param imageColourFlags (ebp) + * @param imageTemplate (ebp) * rct2: 0x00663105 */ -bool metal_a_supports_paint_setup( - paint_session& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageColourFlags) +bool MetalASupportsPaintSetup( + PaintSession& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageTemplate) { - support_height* supportSegments = session.SupportSegments; + SupportHeight* supportSegments = session.SupportSegments; if (!(session.Flags & PaintSessionFlags::PassedSurface)) { @@ -813,7 +802,7 @@ bool metal_a_supports_paint_setup( { return false; } - imageColourFlags = ImageId(0).WithTransparency(FilterPaletteID::PaletteDarken1); + imageTemplate = ImageId(0).WithTransparency(FilterPaletteID::PaletteDarken1); } int16_t originalHeight = height; @@ -862,7 +851,7 @@ bool metal_a_supports_paint_setup( int16_t boundBoxLengthX = _97B062[ebp].x; int16_t boundBoxLengthY = _97B062[ebp].y; - auto image_id = imageColourFlags.WithIndex(_metalSupportTypeToCrossbeamImages[supportType][ebp]); + auto image_id = imageTemplate.WithIndex(_metalSupportTypeToCrossbeamImages[supportType][ebp]); PaintAddImageAsParent(session, image_id, { xOffset, yOffset, height }, { boundBoxLengthX, boundBoxLengthY, 1 }); segment = newSegment; @@ -880,7 +869,7 @@ bool metal_a_supports_paint_setup( uint32_t imageIndex = _97B15C[supportType].base_id; imageIndex += metal_supports_slope_image_map[supportSegments[segment].slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]; - auto image_id = imageColourFlags.WithIndex(imageIndex); + auto image_id = imageTemplate.WithIndex(imageIndex); PaintAddImageAsParent(session, image_id, { xOffset, yOffset, supportSegments[segment].height }, { 0, 0, 5 }); @@ -904,7 +893,7 @@ bool metal_a_supports_paint_setup( uint32_t imageIndex = _97B15C[supportType].beam_id; imageIndex += heightDiff - 1; - auto image_id = imageColourFlags.WithIndex(imageIndex); + auto image_id = imageTemplate.WithIndex(imageIndex); PaintAddImageAsParent(session, image_id, { xOffset, yOffset, height }, { 0, 0, heightDiff - 1 }); } @@ -936,7 +925,7 @@ bool metal_a_supports_paint_setup( if (count == 3 && z == 0x10) imageIndex++; - auto image_id = imageColourFlags.WithIndex(imageIndex); + auto image_id = imageTemplate.WithIndex(imageIndex); PaintAddImageAsParent(session, image_id, { xOffset, yOffset, height }, { 0, 0, z - 1 }); height += z; @@ -976,7 +965,7 @@ bool metal_a_supports_paint_setup( uint32_t imageIndex = _97B190[supportType].beam_id; imageIndex += z - 1; - auto image_id = imageColourFlags.WithIndex(imageIndex); + auto image_id = imageTemplate.WithIndex(imageIndex); PaintAddImageAsParent(session, image_id, { xOffset, yOffset, height }, { 0, 0, 0 }, boundBoxOffset); @@ -994,14 +983,14 @@ bool metal_a_supports_paint_setup( * @param segment (ebx) * @param special (ax) * @param height (edx) - * @param imageColourFlags (ebp) + * @param imageTemplate (ebp) * * @return (Carry Flag) */ -bool metal_b_supports_paint_setup( - paint_session& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageColourFlags) +bool MetalBSupportsPaintSetup( + PaintSession& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageTemplate) { - support_height* supportSegments = session.SupportSegments; + SupportHeight* supportSegments = session.SupportSegments; uint8_t originalSegment = segment; if (!(session.Flags & PaintSessionFlags::PassedSurface)) @@ -1015,7 +1004,7 @@ bool metal_b_supports_paint_setup( { return false; } - imageColourFlags = ImageId(0).WithTransparency(FilterPaletteID::PaletteDarken1); + imageTemplate = ImageId(0).WithTransparency(FilterPaletteID::PaletteDarken1); } uint16_t _9E3294 = 0xFFFF; @@ -1061,7 +1050,7 @@ bool metal_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageColourFlags.WithIndex(_metalSupportTypeToCrossbeamImages[supportType][ebp]), + session, imageTemplate.WithIndex(_metalSupportTypeToCrossbeamImages[supportType][ebp]), { SupportBoundBoxes[originalSegment] + loc_97B052[ebp], baseHeight }, { _97B062[ebp], 1 }); } @@ -1078,7 +1067,7 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].base_id + imageOffset; PaintAddImageAsParent( - session, imageColourFlags.WithIndex(imageId), { SupportBoundBoxes[segment], supportSegments[segment].height }, + session, imageTemplate.WithIndex(imageId), { SupportBoundBoxes[segment], supportSegments[segment].height }, { 0, 0, 5 }); baseHeight = supportSegments[segment].height + 6; @@ -1094,7 +1083,7 @@ bool metal_b_supports_paint_setup( if (heightDiff > 0) { PaintAddImageAsParent( - session, imageColourFlags.WithIndex(_97B15C[supportType].beam_id + (heightDiff - 1)), + session, imageTemplate.WithIndex(_97B15C[supportType].beam_id + (heightDiff - 1)), { SupportBoundBoxes[segment], baseHeight }, { 0, 0, heightDiff - 1 }); } @@ -1130,7 +1119,7 @@ bool metal_b_supports_paint_setup( } PaintAddImageAsParent( - session, imageColourFlags.WithIndex(imageId), { SupportBoundBoxes[segment], baseHeight }, { 0, 0, beamLength - 1 }); + session, imageTemplate.WithIndex(imageId), { SupportBoundBoxes[segment], baseHeight }, { 0, 0, beamLength - 1 }); baseHeight += beamLength; i++; @@ -1159,7 +1148,7 @@ bool metal_b_supports_paint_setup( uint32_t imageId = _97B15C[supportType].beam_id + (beamLength - 1); PaintAddImageAsParent( - session, imageColourFlags.WithIndex(imageId), { SupportBoundBoxes[originalSegment], baseHeight }, { 0, 0, 0 }, + session, imageTemplate.WithIndex(imageId), { SupportBoundBoxes[originalSegment], baseHeight }, { 0, 0, 0 }, { SupportBoundBoxes[originalSegment], height }); baseHeight += beamLength; } @@ -1174,14 +1163,14 @@ bool metal_b_supports_paint_setup( * @param supportType (edi) * @param special (ax) * @param height (dx) - * @param imageColourFlags (ebp) + * @param imageTemplate (ebp) * @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, ImageId imageTemplate, +bool PathASupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate, const FootpathPaintInfo& pathPaintInfo, bool* underground) { if (underground != nullptr) @@ -1307,7 +1296,7 @@ bool path_a_supports_paint_setup( } else { - paint_struct* paintStruct = PaintAddImageAsOrphan( + PaintStruct* paintStruct = PaintAddImageAsOrphan( session, imageTemplate.WithIndex(imageIndex), { 0, 0, baseHeight }, boundBox); hasSupports = true; if (paintStruct != nullptr) @@ -1330,16 +1319,16 @@ bool path_a_supports_paint_setup( * @param segment (ebx) * @param special (ax) * @param height (dx) - * @param imageColourFlags (ebp) + * @param imageTemplate (ebp) * @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, ImageId imageTemplate, +bool PathBSupportsPaintSetup( + PaintSession& session, int32_t segment, int32_t special, int32_t height, ImageId imageTemplate, const FootpathPaintInfo& pathPaintInfo) { - support_height* supportSegments = session.SupportSegments; + SupportHeight* supportSegments = session.SupportSegments; if (!(session.Flags & PaintSessionFlags::PassedSurface)) { diff --git a/src/openrct2/paint/Supports.h b/src/openrct2/paint/Supports.h index 3452340682..45da3121be 100644 --- a/src/openrct2/paint/Supports.h +++ b/src/openrct2/paint/Supports.h @@ -17,23 +17,19 @@ 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, ImageId imageTemplate); -bool wooden_b_supports_paint_setup( - paint_session& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate); -bool wooden_a_supports_paint_setup( - 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 metal_a_supports_paint_setup( - paint_session& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageColourFlags); -bool metal_b_supports_paint_setup( - paint_session& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageColourFlags); -bool path_a_supports_paint_setup( - paint_session& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate, +bool WoodenASupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate); +bool WoodenBSupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate); +bool MetalASupportsPaintSetup( + PaintSession& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageTemplate); +bool MetalBSupportsPaintSetup( + PaintSession& session, uint8_t supportType, uint8_t segment, int32_t special, int32_t height, ImageId imageTemplate); +bool PathASupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate, const FootpathPaintInfo& pathPaintInfo, bool* underground); -bool path_b_supports_paint_setup( - paint_session& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate, +bool PathBSupportsPaintSetup( + PaintSession& session, int32_t supportType, int32_t special, int32_t height, ImageId imageTemplate, const FootpathPaintInfo& pathPaintInfo); // There are 13 types of metal supports. A graphic showing all of them is available here: diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index f8fa402eda..759fa9b678 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -41,26 +41,26 @@ enum VirtualFloorFlags VIRTUAL_FLOOR_FORCE_INVALIDATION = (1 << 2), }; -bool virtual_floor_is_enabled() +bool VirtualFloorIsEnabled() { return (_virtualFloorFlags & VIRTUAL_FLOOR_FLAG_ENABLED) != 0; } -void virtual_floor_set_height(int16_t height) +void VirtualFloorSetHeight(int16_t height) { - if (!virtual_floor_is_enabled()) + if (!VirtualFloorIsEnabled()) { return; } if (_virtualFloorHeight != height) { - virtual_floor_invalidate(); + VirtualFloorInvalidate(); _virtualFloorHeight = height; } } -static void virtual_floor_reset() +static void VirtualFloorReset() { _virtualFloorLastMinPos.x = std::numeric_limits::max(); _virtualFloorLastMinPos.y = std::numeric_limits::max(); @@ -69,20 +69,20 @@ static void virtual_floor_reset() _virtualFloorHeight = 0; } -void virtual_floor_enable() +void VirtualFloorEnable() { - if (virtual_floor_is_enabled()) + if (VirtualFloorIsEnabled()) { return; } - virtual_floor_reset(); + VirtualFloorReset(); _virtualFloorFlags |= VIRTUAL_FLOOR_FLAG_ENABLED; } -void virtual_floor_disable() +void VirtualFloorDisable() { - if (!virtual_floor_is_enabled()) + if (!VirtualFloorIsEnabled()) { return; } @@ -91,13 +91,13 @@ void virtual_floor_disable() // Force invalidation, even if the position hasn't changed. _virtualFloorFlags |= VIRTUAL_FLOOR_FORCE_INVALIDATION; - virtual_floor_invalidate(); + VirtualFloorInvalidate(); _virtualFloorFlags &= ~VIRTUAL_FLOOR_FORCE_INVALIDATION; - virtual_floor_reset(); + VirtualFloorReset(); } -void virtual_floor_invalidate() +void VirtualFloorInvalidate() { PROFILED_FUNCTION(); @@ -140,7 +140,7 @@ void virtual_floor_invalidate() log_verbose( "Invalidating previous region, Min: %d %d, Max: %d %d", _virtualFloorLastMinPos.x, _virtualFloorLastMinPos.y, _virtualFloorLastMaxPos.x, _virtualFloorLastMaxPos.y); - map_invalidate_region(_virtualFloorLastMinPos, _virtualFloorLastMaxPos); + MapInvalidateRegion(_virtualFloorLastMinPos, _virtualFloorLastMaxPos); } } @@ -161,7 +161,7 @@ void virtual_floor_invalidate() if (min_position.x != std::numeric_limits::max() && min_position.y != std::numeric_limits::max() && max_position.x != std::numeric_limits::lowest() && max_position.y != std::numeric_limits::lowest()) { - map_invalidate_region(min_position, max_position); + MapInvalidateRegion(min_position, max_position); // Save minimal and maximal positions. _virtualFloorLastMinPos.x = min_position.x; @@ -174,9 +174,9 @@ void virtual_floor_invalidate() } } -bool virtual_floor_tile_is_floor(const CoordsXY& loc) +bool VirtualFloorTileIsFloor(const CoordsXY& loc) { - if (!virtual_floor_is_enabled()) + if (!VirtualFloorIsEnabled()) { return false; } @@ -206,7 +206,7 @@ bool virtual_floor_tile_is_floor(const CoordsXY& loc) return false; } -static void virtual_floor_get_tile_properties( +static void VirtualFloorGetTileProperties( const CoordsXY& loc, int16_t height, bool* outOccupied, bool* tileOwned, uint8_t* outOccupiedEdges, bool* outBelowGround, bool* aboveGround, bool* outLit) { @@ -239,7 +239,7 @@ static void virtual_floor_get_tile_properties( } } - *tileOwned = map_is_location_owned({ loc, height }); + *tileOwned = MapIsLocationOwned({ loc, height }); if (gCheatsSandboxMode) *tileOwned = true; @@ -292,7 +292,7 @@ static void virtual_floor_get_tile_properties( } } -void virtual_floor_paint(paint_session& session) +void VirtualFloorPaint(PaintSession& session) { PROFILED_FUNCTION(); @@ -322,7 +322,7 @@ void virtual_floor_paint(paint_session& session) bool weAreAboveGround; uint8_t litEdges = 0; - virtual_floor_get_tile_properties( + VirtualFloorGetTileProperties( session.MapPosition, virtualFloorClipHeight, &weAreOccupied, &weAreOwned, &occupiedEdges, &weAreBelowGround, &weAreAboveGround, &weAreLit); @@ -345,7 +345,7 @@ void virtual_floor_paint(paint_session& session) bool theyAreOwned; bool theyAreAboveGround; - virtual_floor_get_tile_properties( + VirtualFloorGetTileProperties( theirLocation, virtualFloorClipHeight, &theyAreOccupied, &theyAreOwned, &theirOccupiedEdges, &theyAreBelowGround, &theyAreAboveGround, &theyAreLit); @@ -402,7 +402,7 @@ void virtual_floor_paint(paint_session& session) { 5, 5, _virtualFloorHeight + ((dullEdges & EDGE_NW) ? -2 : 0) }); } - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Glassy) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Glassy) return; if (!weAreOccupied && !weAreLit && weAreAboveGround && weAreOwned) @@ -412,7 +412,7 @@ void virtual_floor_paint(paint_session& session) } } -uint16_t virtual_floor_get_height() +uint16_t VirtualFloorGetHeight() { return _virtualFloorHeight; } diff --git a/src/openrct2/paint/VirtualFloor.h b/src/openrct2/paint/VirtualFloor.h index 2a2f3279d6..cb608bd716 100644 --- a/src/openrct2/paint/VirtualFloor.h +++ b/src/openrct2/paint/VirtualFloor.h @@ -20,17 +20,17 @@ enum class VirtualFloorStyles : int32_t Glassy }; -struct paint_session; +struct PaintSession; -uint16_t virtual_floor_get_height(); +uint16_t VirtualFloorGetHeight(); -bool virtual_floor_is_enabled(); -void virtual_floor_set_height(int16_t height); +bool VirtualFloorIsEnabled(); +void VirtualFloorSetHeight(int16_t height); -void virtual_floor_enable(); -void virtual_floor_disable(); -void virtual_floor_invalidate(); +void VirtualFloorEnable(); +void VirtualFloorDisable(); +void VirtualFloorInvalidate(); -bool virtual_floor_tile_is_floor(const CoordsXY& loc); +bool VirtualFloorTileIsFloor(const CoordsXY& loc); -void virtual_floor_paint(paint_session& session); +void VirtualFloorPaint(PaintSession& session); diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 30cc444f05..23457850cc 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -32,13 +32,13 @@ constexpr CoordsXY BannerBoundBoxes[][2] = { }; static void PaintBannerScrollingText( - paint_session& session, const BannerSceneryEntry& bannerEntry, Banner& banner, const BannerElement& bannerElement, + PaintSession& session, const BannerSceneryEntry& bannerEntry, Banner& banner, const BannerElement& bannerElement, Direction direction, int32_t height, const CoordsXYZ& bbOffset) { PROFILED_FUNCTION(); // If text on hidden direction or ghost - direction = direction_reverse(direction) - 1; + direction = DirectionReverse(direction) - 1; if (direction >= 2 || (bannerElement.IsGhost())) return; @@ -52,7 +52,7 @@ static void PaintBannerScrollingText( banner.FormatTextTo(ft, true); char text[256]; - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } @@ -61,13 +61,13 @@ static void PaintBannerScrollingText( format_string(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } - auto stringWidth = gfx_get_string_width(text, FontSpriteBase::TINY); + auto stringWidth = gfx_get_string_width(text, FontStyle::Tiny); auto scroll = (gCurrentTicks / 2) % stringWidth; auto imageId = scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode, COLOUR_BLACK); - PaintAddImageAsChild(session, imageId, { 0, 0, height + 22 }, { 1, 1, 21 }, bbOffset); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 22 }, { bbOffset, { 1, 1, 21 } }); } -void PaintBanner(paint_session& session, uint8_t direction, int32_t height, const BannerElement& bannerElement) +void PaintBanner(PaintSession& session, uint8_t direction, int32_t height, const BannerElement& bannerElement) { PROFILED_FUNCTION(); @@ -81,7 +81,7 @@ void PaintBanner(paint_session& session, uint8_t direction, int32_t height, cons return; } - auto* bannerEntry = get_banner_entry(banner->type); + auto* bannerEntry = GetBannerEntry(banner->type); if (bannerEntry == nullptr) { return; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index af7869d578..b1e6483cd3 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -34,7 +34,7 @@ using namespace OpenRCT2; static void PaintRideEntranceExitScrollingText( - paint_session& session, const EntranceElement& entranceEl, const StationObject& stationObj, Direction direction, + PaintSession& session, const EntranceElement& entranceEl, const StationObject& stationObj, Direction direction, int32_t height) { PROFILED_FUNCTION(); @@ -61,7 +61,7 @@ static void PaintRideEntranceExitScrollingText( } char text[256]; - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } @@ -69,15 +69,15 @@ static void PaintRideEntranceExitScrollingText( { format_string(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } - auto stringWidth = gfx_get_string_width(text, FontSpriteBase::TINY); + auto stringWidth = gfx_get_string_width(text, FontStyle::Tiny); auto scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; PaintAddImageAsChild( session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, stationObj.ScrollingMode, COLOUR_BLACK), - { 0, 0, height + stationObj.Height }, { 28, 28, 51 }, { 2, 2, height + stationObj.Height }); + { 0, 0, height + stationObj.Height }, { { 2, 2, height + stationObj.Height }, { 28, 28, 51 } }); } -static void PaintRideEntranceExitLightEffects(paint_session& session, int32_t height, const EntranceElement& entranceEl) +static void PaintRideEntranceExitLightEffects(PaintSession& session, int32_t height, const EntranceElement& entranceEl) { PROFILED_FUNCTION(); @@ -106,7 +106,7 @@ static void PaintRideEntranceExitLightEffects(paint_session& session, int32_t he } } -static void PaintRideEntranceExit(paint_session& session, uint8_t direction, int32_t height, const EntranceElement& entranceEl) +static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int32_t height, const EntranceElement& entranceEl) { PROFILED_FUNCTION(); @@ -162,7 +162,7 @@ static void PaintRideEntranceExit(paint_session& session, uint8_t direction, int CoordsXYZ boundBoxLength = { (direction & 1) ? 2 : 28, (direction & 1) ? 28 : 2, - isExit ? 35 : 51, + isExit ? 32 : 48, }; // Back @@ -188,7 +188,7 @@ static void PaintRideEntranceExit(paint_session& session, uint8_t direction, int { { (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height }, boundBoxLength }); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); if (!entranceEl.IsGhost()) PaintRideEntranceExitScrollingText(session, entranceEl, *stationObj, direction, height); @@ -198,15 +198,15 @@ static void PaintRideEntranceExit(paint_session& session, uint8_t direction, int { supportsImageTemplate = ImageId().WithPrimary(COLOUR_SATURATED_BROWN); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, supportsImageTemplate); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, supportsImageTemplate); height += isExit ? 40 : 56; - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height, 0x20); } static void PaintParkEntranceScrollingText( - paint_session& session, const EntranceObject& entrance, Direction direction, int32_t height) + PaintSession& session, const EntranceObject& entrance, Direction direction, int32_t height) { PROFILED_FUNCTION(); @@ -232,7 +232,7 @@ static void PaintParkEntranceScrollingText( } char text[256]; - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } @@ -241,7 +241,7 @@ static void PaintParkEntranceScrollingText( format_string(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data()); } - auto stringWidth = gfx_get_string_width(text, FontSpriteBase::TINY); + auto stringWidth = gfx_get_string_width(text, FontStyle::Tiny); auto scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; auto imageIndex = scrolling_text_setup( session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode + direction / 2, COLOUR_BLACK); @@ -249,7 +249,7 @@ static void PaintParkEntranceScrollingText( PaintAddImageAsChild(session, imageIndex, { 0, 0, textHeight }, { { 2, 2, textHeight }, { 28, 28, 47 } }); } -static void PaintParkEntranceLightEffects(paint_session& session) +static void PaintParkEntranceLightEffects(PaintSession& session) { PROFILED_FUNCTION(); @@ -259,7 +259,7 @@ static void PaintParkEntranceLightEffects(paint_session& session) } } -static void PaintParkEntrance(paint_session& session, uint8_t direction, int32_t height, const EntranceElement& entranceEl) +static void PaintParkEntrance(PaintSession& session, uint8_t direction, int32_t height, const EntranceElement& entranceEl) { PROFILED_FUNCTION(); @@ -326,13 +326,13 @@ static void PaintParkEntrance(paint_session& session, uint8_t direction, int32_t { supportsImageTemplate = ImageId().WithPrimary(COLOUR_SATURATED_BROWN); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, supportsImageTemplate); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, supportsImageTemplate); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } -static void PaintHeightMarkers(paint_session& session, const EntranceElement& entranceEl, int32_t height) +static void PaintHeightMarkers(PaintSession& session, const EntranceElement& entranceEl, int32_t height) { PROFILED_FUNCTION(); @@ -351,7 +351,7 @@ static void PaintHeightMarkers(paint_session& session, const EntranceElement& en } } -void PaintEntrance(paint_session& session, uint8_t direction, int32_t height, const EntranceElement& entranceElement) +void PaintEntrance(PaintSession& session, uint8_t direction, int32_t height, const EntranceElement& entranceElement) { PROFILED_FUNCTION(); diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 666ac155d6..ac9f6c149b 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -53,7 +53,7 @@ static constexpr const BoundBoxXY LargeSceneryBoundBoxes[] = { // clang-format on static void PaintLargeScenerySupports( - paint_session& session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement, ImageId imageTemplate, + PaintSession& session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement, ImageId imageTemplate, const rct_large_scenery_tile& tile) { PROFILED_FUNCTION(); @@ -69,18 +69,18 @@ static void PaintLargeScenerySupports( special = 49; } - wooden_b_supports_paint_setup(session, (direction & 1), special, supportHeight, imageTemplate); + WoodenBSupportsPaintSetup(session, (direction & 1), special, supportHeight, imageTemplate); int32_t clearanceHeight = ceil2(tileElement.GetClearanceZ() + 15, 16); if (tile.flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE) { - paint_util_set_segment_support_height(session, SEGMENTS_ALL, clearanceHeight, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, clearanceHeight, 0x20); } else { - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); } - paint_util_set_general_support_height(session, clearanceHeight, 0x20); + PaintUtilSetGeneralSupportHeight(session, clearanceHeight, 0x20); } static std::string_view LargeSceneryCalculateDisplayText(const LargeSceneryText& text, std::string_view s, bool height) @@ -105,7 +105,7 @@ static int32_t DivToMinusInfinity(int32_t a, int32_t b) } static void PaintLargeScenery3DTextLine( - paint_session& session, const LargeSceneryEntry& sceneryEntry, const LargeSceneryText& text, std::string_view line, + PaintSession& session, const LargeSceneryEntry& sceneryEntry, const LargeSceneryText& text, std::string_view line, ImageId imageTemplate, Direction direction, int32_t offsetY) { PROFILED_FUNCTION(); @@ -181,7 +181,7 @@ static bool Is3DTextSingleLine(const LargeSceneryText& text, std::string_view s) } static void PaintLargeScenery3DText( - paint_session& session, const LargeSceneryEntry& sceneryEntry, const rct_large_scenery_tile& tile, + PaintSession& session, const LargeSceneryEntry& sceneryEntry, const rct_large_scenery_tile& tile, const LargeSceneryElement& tileElement, uint8_t direction, uint16_t height, bool isGhost) { PROFILED_FUNCTION(); @@ -295,7 +295,7 @@ static void PaintLargeScenery3DText( } static void PaintLargeSceneryScrollingText( - paint_session& session, const LargeSceneryEntry& sceneryEntry, const LargeSceneryElement& tileElement, uint8_t direction, + PaintSession& session, const LargeSceneryEntry& sceneryEntry, const LargeSceneryElement& tileElement, uint8_t direction, uint16_t height, const CoordsXYZ& bbOffset, bool isGhost) { PROFILED_FUNCTION(); @@ -311,7 +311,7 @@ static void PaintLargeSceneryScrollingText( banner->FormatTextTo(ft); char text[256]; - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper(text, sizeof(text), STR_SCROLLING_SIGN_TEXT, ft.Data()); } @@ -321,13 +321,13 @@ static void PaintLargeSceneryScrollingText( } auto scrollMode = sceneryEntry.scrolling_mode + ((direction + 1) & 3); - auto stringWidth = gfx_get_string_width(text, FontSpriteBase::TINY); + auto stringWidth = gfx_get_string_width(text, FontStyle::Tiny); auto scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; auto imageId = scrolling_text_setup(session, STR_SCROLLING_SIGN_TEXT, ft, scroll, scrollMode, textPaletteIndex); - PaintAddImageAsChild(session, imageId, { 0, 0, height + 25 }, { 1, 1, 21 }, bbOffset); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 25 }, { bbOffset, { 1, 1, 21 } }); } -void PaintLargeScenery(paint_session& session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement) +void PaintLargeScenery(PaintSession& session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement) { PROFILED_FUNCTION(); diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index c4c76ee9aa..8813542955 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -37,6 +37,7 @@ #include "../../world/Surface.h" #include "../../world/TileInspector.h" #include "../Boundbox.h" +#include "../Paint.SessionFlags.h" #include "../Supports.h" #include "Paint.Surface.h" #include "Paint.TileElement.h" @@ -88,11 +89,11 @@ static constexpr const uint8_t byte_98D8A4[] = { }; // clang-format on -void path_paint_box_support( - paint_session& session, const PathElement& pathElement, int32_t height, const FootpathPaintInfo& pathPaintInfo, +void PathPaintBoxSupport( + PaintSession& session, const PathElement& pathElement, int32_t height, const FootpathPaintInfo& pathPaintInfo, bool hasSupports, ImageId imageTemplate, ImageId sceneryImageTemplate); -void path_paint_pole_support( - paint_session& session, const PathElement& pathElement, int16_t height, const FootpathPaintInfo& pathPaintInfo, +void PathPaintPoleSupport( + PaintSession& session, const PathElement& pathElement, int16_t height, const FootpathPaintInfo& pathPaintInfo, bool hasSupports, ImageId imageTemplate, ImageId sceneryImageTemplate); static ImageIndex GetEdgeImageOffset(edge_t edge) @@ -139,8 +140,8 @@ static ImageIndex GetFootpathBenchImage(const PathBitEntry& pathBitEntry, edge_t } /* rct2: 0x006A5AE5 */ -static void path_bit_lights_paint( - paint_session& session, const PathBitEntry& pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, +static void PathBitLightsPaint( + PaintSession& session, const PathBitEntry& pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, ImageId imageTemplate) { if (pathElement.IsSloped()) @@ -173,7 +174,7 @@ static void path_bit_lights_paint( } } -static bool IsBinFull(paint_session& session, const PathElement& pathElement, edge_t edge) +static bool IsBinFull(PaintSession& session, const PathElement& pathElement, edge_t edge) { switch (edge) { @@ -191,8 +192,8 @@ static bool IsBinFull(paint_session& session, const PathElement& pathElement, ed } /* rct2: 0x006A5C94 */ -static void path_bit_bins_paint( - paint_session& session, const PathBitEntry& pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, +static void PathBitBinsPaint( + PaintSession& session, const PathBitEntry& pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, ImageId imageTemplate) { if (pathElement.IsSloped()) @@ -236,8 +237,8 @@ static void path_bit_bins_paint( } /* rct2: 0x006A5E81 */ -static void path_bit_benches_paint( - paint_session& session, const PathBitEntry& pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, +static void PathBitBenchesPaint( + PaintSession& session, const PathBitEntry& pathBitEntry, const PathElement& pathElement, int32_t height, uint8_t edges, ImageId imageTemplate) { auto isBroken = pathElement.IsBroken(); @@ -270,8 +271,8 @@ static void path_bit_benches_paint( } /* rct2: 0x006A6008 */ -static void path_bit_jumping_fountains_paint( - paint_session& session, const PathBitEntry& pathBitEntry, int32_t height, ImageId imageTemplate, rct_drawpixelinfo* dpi) +static void PathBitJumpingFountainsPaint( + PaintSession& session, const PathBitEntry& pathBitEntry, int32_t height, ImageId imageTemplate, rct_drawpixelinfo* dpi) { if (dpi->zoom_level > ZoomLevel{ 0 }) return; @@ -287,8 +288,8 @@ static void path_bit_jumping_fountains_paint( * rct2: 0x006A4101 * @param tile_element (esi) */ -static void sub_6A4101( - paint_session& session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool hasSupports, +static void PathPaintFencesAndQueueBanners( + PaintSession& session, const PathElement& pathElement, uint16_t height, uint32_t connectedEdges, bool hasSupports, const FootpathPaintInfo& pathPaintInfo, ImageId imageTemplate) { PROFILED_FUNCTION(); @@ -296,7 +297,6 @@ static void sub_6A4101( auto imageId = imageTemplate.WithIndex(pathPaintInfo.RailingsImageId); if (pathElement.IsQueue()) { - uint8_t local_ebp = connectedEdges & 0x0F; if (pathElement.IsSloped()) { switch ((pathElement.GetSlopeDirection() + session.CurrentRotation) & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) @@ -329,21 +329,22 @@ static void sub_6A4101( } else { - switch (local_ebp) + const auto pathEdges = connectedEdges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK; + switch (pathEdges) { - case 1: + case 0b0001: PaintAddImageAsParent( session, imageId.WithIndexOffset(17), { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( session, imageId.WithIndexOffset(17), { 0, 28, height }, { 28, 1, 7 }, { 0, 28, height + 2 }); break; - case 2: + case 0b0010: PaintAddImageAsParent( session, imageId.WithIndexOffset(18), { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( session, imageId.WithIndexOffset(18), { 28, 0, height }, { 1, 28, 7 }, { 28, 0, height + 2 }); break; - case 3: + case 0b0011: PaintAddImageAsParent( session, imageId.WithIndexOffset(17), { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( @@ -352,19 +353,19 @@ static void sub_6A4101( PaintAddImageAsParent( session, imageId.WithIndexOffset(25), { 0, 0, height }, { 4, 4, 7 }, { 0, 28, height + 2 }); break; - case 4: + case 0b0100: PaintAddImageAsParent( session, imageId.WithIndexOffset(19), { 0, 4, height }, { 28, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( session, imageId.WithIndexOffset(19), { 0, 28, height }, { 28, 1, 7 }, { 0, 28, height + 2 }); break; - case 5: + case 0b0101: PaintAddImageAsParent( session, imageId.WithIndexOffset(15), { 0, 4, height }, { 32, 1, 7 }, { 0, 4, height + 2 }); PaintAddImageAsParent( session, imageId.WithIndexOffset(15), { 0, 28, height }, { 32, 1, 7 }, { 0, 28, height + 2 }); break; - case 6: + case 0b0110: PaintAddImageAsParent( session, imageId.WithIndexOffset(18), { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( @@ -372,13 +373,13 @@ static void sub_6A4101( PaintAddImageAsParent( session, imageId.WithIndexOffset(26), { 0, 0, height }, { 4, 4, 7 }, { 28, 28, height + 2 }); break; - case 8: + case 0b1000: PaintAddImageAsParent( session, imageId.WithIndexOffset(16), { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( session, imageId.WithIndexOffset(16), { 28, 0, height }, { 1, 28, 7 }, { 28, 0, height + 2 }); break; - case 9: + case 0b1001: PaintAddImageAsParent( session, imageId.WithIndexOffset(16), { 28, 0, height }, { 1, 28, 7 }, { 28, 0, height + 2 }); PaintAddImageAsParent( @@ -386,13 +387,13 @@ static void sub_6A4101( PaintAddImageAsParent( session, imageId.WithIndexOffset(24), { 0, 0, height }, { 4, 4, 7 }, { 0, 0, height + 2 }); break; - case 10: + case 0b1010: PaintAddImageAsParent( session, imageId.WithIndexOffset(14), { 4, 0, height }, { 1, 32, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( session, imageId.WithIndexOffset(14), { 28, 0, height }, { 1, 32, 7 }, { 28, 0, height + 2 }); break; - case 12: + case 0b1100: PaintAddImageAsParent( session, imageId.WithIndexOffset(16), { 4, 0, height }, { 1, 28, 7 }, { 4, 0, height + 2 }); PaintAddImageAsParent( @@ -402,7 +403,7 @@ static void sub_6A4101( session, imageId.WithIndexOffset(27), { 0, 0, height }, { 4, 4, 7 }, { 28, 0, height + 2 }); break; default: - // purposely left empty + // Purposely left empty, queues cannot have 3 or 4 connected edges break; } } @@ -418,7 +419,7 @@ static void sub_6A4101( if (pathElement.IsSloped()) { if (pathElement.GetSlopeDirection() == direction) - height += 16; + height += COORDS_Z_STEP * 2; } direction += session.CurrentRotation; direction &= 3; @@ -455,7 +456,7 @@ static void sub_6A4101( { ft.Add(STR_RIDE_ENTRANCE_CLOSED); } - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper( gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_BANNER_TEXT_FORMAT, ft.Data()); @@ -465,12 +466,12 @@ static void sub_6A4101( format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_BANNER_TEXT_FORMAT, ft.Data()); } - uint16_t stringWidth = gfx_get_string_width(gCommonStringFormatBuffer, FontSpriteBase::TINY); + uint16_t stringWidth = gfx_get_string_width(gCommonStringFormatBuffer, FontStyle::Tiny); uint16_t scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; PaintAddImageAsChild( session, scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode, COLOUR_BLACK), - { 0, 0, height + 7 }, { 1, 1, 21 }, boundBoxOffsets); + { 0, 0, height + 7 }, { boundBoxOffsets, { 1, 1, 21 } }); } session.InteractionType = ViewportInteractionItem::Footpath; @@ -709,7 +710,7 @@ static void sub_6A4101( * @param sceneryImageFlags (0x00F3EF74) */ static void sub_6A3F61( - paint_session& session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, + PaintSession& session, const PathElement& pathElement, uint16_t connectedEdges, uint16_t height, const FootpathPaintInfo& pathPaintInfo, ImageId imageTemplate, ImageId sceneryImageTemplate, bool hasSupports) { // eax -- @@ -728,8 +729,6 @@ static void sub_6A3F61( if (dpi->zoom_level <= ZoomLevel{ 1 }) { - bool paintScenery = true; - if (!gTrackDesignSaveMode) { if (pathElement.HasAddition()) @@ -742,39 +741,36 @@ static void sub_6A3F61( // Draw additional path bits (bins, benches, lamps, queue screens) auto* pathAddEntry = pathElement.GetAdditionEntry(); - + bool drawAddition = true; // Can be null if the object is not loaded. - if (pathAddEntry == nullptr) + if (pathAddEntry == nullptr + || ((session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && !(pathElement.IsBroken()) + && pathAddEntry->draw_type != PathBitDrawType::Bin)) { - paintScenery = false; + drawAddition = false; } - else if ( - (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) && !(pathElement.IsBroken()) - && pathAddEntry->draw_type != PathBitDrawType::Bin) - { - paintScenery = false; - } - else + + if (drawAddition) { switch (pathAddEntry->draw_type) { case PathBitDrawType::Light: - path_bit_lights_paint( + PathBitLightsPaint( session, *pathAddEntry, pathElement, height, static_cast(connectedEdges), sceneryImageTemplate); break; case PathBitDrawType::Bin: - path_bit_bins_paint( + PathBitBinsPaint( session, *pathAddEntry, pathElement, height, static_cast(connectedEdges), sceneryImageTemplate); break; case PathBitDrawType::Bench: - path_bit_benches_paint( + PathBitBenchesPaint( session, *pathAddEntry, pathElement, height, static_cast(connectedEdges), sceneryImageTemplate); break; case PathBitDrawType::JumpingFountain: - path_bit_jumping_fountains_paint(session, *pathAddEntry, height, sceneryImageTemplate, dpi); + PathBitJumpingFountainsPaint(session, *pathAddEntry, height, sceneryImageTemplate, dpi); break; } @@ -790,8 +786,7 @@ static void sub_6A3F61( // Redundant zoom-level check removed - if (paintScenery) - sub_6A4101(session, pathElement, height, connectedEdges, hasSupports, pathPaintInfo, imageTemplate); + PathPaintFencesAndQueueBanners(session, pathElement, height, connectedEdges, hasSupports, pathPaintInfo, imageTemplate); } // This is about tunnel drawing @@ -804,17 +799,17 @@ static void sub_6A3F61( if (sloped && direction == EDGE_NE) { // Path going down into the tunnel - paint_util_push_tunnel_right(session, height + 16, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_PATH_AND_MINI_GOLF); } else if (connectedEdges & EDGE_NE) { // Flat path with edge to the right (north-east) - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_11); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_11); } else { // Path going up, or flat and not connected to the right - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); } } @@ -827,17 +822,17 @@ static void sub_6A3F61( if (sloped && direction == EDGE_SE) { // Path going down into the tunnel - paint_util_push_tunnel_left(session, height + 16, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_PATH_AND_MINI_GOLF); } else if (connectedEdges & EDGE_NW) { // Flat path with edge to the left (north-west) - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_11); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_11); } else { // Path going up, or flat and not connected to the left - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); } } @@ -866,9 +861,9 @@ static FootpathPaintInfo GetFootpathPaintInfo(const PathElement& pathEl) return pathPaintInfo; } -static bool ShouldDrawSupports(paint_session& session, const PathElement& pathEl, uint16_t height) +static bool ShouldDrawSupports(PaintSession& session, const PathElement& pathEl, uint16_t height) { - auto surface = map_get_surface_element_at(session.MapPosition); + auto surface = MapGetSurfaceElementAt(session.MapPosition); if (surface == nullptr) { return true; @@ -896,7 +891,7 @@ static bool ShouldDrawSupports(paint_session& session, const PathElement& pathEl return false; } -static void PaintPatrolAreas(paint_session& session, const PathElement& pathEl) +static void PaintPatrolAreas(PaintSession& session, const PathElement& pathEl) { auto colour = GetPatrolAreaTileColour(session.MapPosition); if (colour) @@ -914,7 +909,7 @@ static void PaintPatrolAreas(paint_session& session, const PathElement& pathEl) } } -static void PaintHeightMarkers(paint_session& session, const PathElement& pathEl) +static void PaintHeightMarkers(PaintSession& session, const PathElement& pathEl) { PROFILED_FUNCTION(); @@ -935,7 +930,7 @@ static void PaintHeightMarkers(paint_session& session, const PathElement& pathEl } } -static void PaintLampLightEffects(paint_session& session, const PathElement& pathEl, uint16_t height) +static void PaintLampLightEffects(PaintSession& session, const PathElement& pathEl, uint16_t height) { PROFILED_FUNCTION(); @@ -970,7 +965,7 @@ static void PaintLampLightEffects(paint_session& session, const PathElement& pat /** * rct2: 0x0006A3590 */ -void PaintPath(paint_session& session, uint16_t height, const PathElement& tileElement) +void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileElement) { PROFILED_FUNCTION(); @@ -1031,18 +1026,18 @@ void PaintPath(paint_session& session, uint16_t height, const PathElement& tileE auto pathPaintInfo = GetFootpathPaintInfo(tileElement); if (pathPaintInfo.SupportType == RailingEntrySupportType::Pole) { - path_paint_pole_support(session, tileElement, height, pathPaintInfo, hasSupports, imageTemplate, sceneryImageTemplate); + PathPaintPoleSupport(session, tileElement, height, pathPaintInfo, hasSupports, imageTemplate, sceneryImageTemplate); } else { - path_paint_box_support(session, tileElement, height, pathPaintInfo, hasSupports, imageTemplate, sceneryImageTemplate); + PathPaintBoxSupport(session, tileElement, height, pathPaintInfo, hasSupports, imageTemplate, sceneryImageTemplate); } PaintLampLightEffects(session, tileElement, height); } -void path_paint_box_support( - paint_session& session, const PathElement& pathElement, int32_t height, const FootpathPaintInfo& pathPaintInfo, +void PathPaintBoxSupport( + PaintSession& session, const PathElement& pathElement, int32_t height, const FootpathPaintInfo& pathPaintInfo, bool hasSupports, ImageId imageTemplate, ImageId sceneryImageTemplate) { PROFILED_FUNCTION(); @@ -1134,7 +1129,7 @@ void path_paint_box_support( } auto supportType = byte_98D8A4[edges] == 0 ? 0 : 1; - path_a_supports_paint_setup(session, supportType, ax, height, imageTemplate, pathPaintInfo, nullptr); + PathASupportsPaintSetup(session, supportType, ax, height, imageTemplate, pathPaintInfo, nullptr); height += 32; if (pathElement.IsSloped()) @@ -1142,45 +1137,45 @@ void path_paint_box_support( height += 16; } - paint_util_set_general_support_height(session, height, 0x20); + PaintUtilSetGeneralSupportHeight(session, height, 0x20); if (pathElement.IsQueue() || (pathElement.GetEdgesAndCorners() != 0xFF && hasSupports)) { - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); return; } if (pathElement.GetEdgesAndCorners() == 0xFF) { - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); return; } - paint_util_set_segment_support_height(session, SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, 0xFFFF, 0); if (edges & 1) { - paint_util_set_segment_support_height(session, SEGMENT_CC, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC, 0xFFFF, 0); } if (edges & 2) { - paint_util_set_segment_support_height(session, SEGMENT_D4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D4, 0xFFFF, 0); } if (edges & 4) { - paint_util_set_segment_support_height(session, SEGMENT_D0, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0, 0xFFFF, 0); } if (edges & 8) { - paint_util_set_segment_support_height(session, SEGMENT_C8, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8, 0xFFFF, 0); } } -void path_paint_pole_support( - paint_session& session, const PathElement& pathElement, int16_t height, const FootpathPaintInfo& pathPaintInfo, +void PathPaintPoleSupport( + PaintSession& session, const PathElement& pathElement, int16_t height, const FootpathPaintInfo& pathPaintInfo, bool hasSupports, ImageId imageTemplate, ImageId sceneryImageTemplate) { PROFILED_FUNCTION(); @@ -1291,7 +1286,7 @@ void path_paint_pole_support( { imageTemplate = ImageId().WithPrimary(supportColour); } - path_b_supports_paint_setup(session, supports[i], ax, height, imageTemplate, pathPaintInfo); + PathBSupportsPaintSetup(session, supports[i], ax, height, imageTemplate, pathPaintInfo); } } @@ -1301,39 +1296,39 @@ void path_paint_pole_support( height += 16; } - paint_util_set_general_support_height(session, height, 0x20); + PaintUtilSetGeneralSupportHeight(session, height, 0x20); if (pathElement.IsQueue() || (pathElement.GetEdgesAndCorners() != 0xFF && hasSupports)) { - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); return; } if (pathElement.GetEdgesAndCorners() == 0xFF) { - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); return; } - paint_util_set_segment_support_height(session, SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, 0xFFFF, 0); if (edges & EDGE_NE) { - paint_util_set_segment_support_height(session, SEGMENT_CC, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC, 0xFFFF, 0); } if (edges & EDGE_SE) { - paint_util_set_segment_support_height(session, SEGMENT_D4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D4, 0xFFFF, 0); } if (edges & EDGE_SW) { - paint_util_set_segment_support_height(session, SEGMENT_D0, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0, 0xFFFF, 0); } if (edges & EDGE_NW) { - paint_util_set_segment_support_height(session, SEGMENT_C8, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8, 0xFFFF, 0); } } diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 91fc7bc63f..2ae54b1ea1 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -31,7 +31,7 @@ static constexpr const CoordsXY lengths[] = { }; static void PaintSmallScenerySupports( - paint_session& session, const SmallSceneryEntry& sceneryEntry, const SmallSceneryElement& sceneryElement, + PaintSession& session, const SmallSceneryEntry& sceneryEntry, const SmallSceneryElement& sceneryElement, Direction direction, int32_t height, ImageId imageTemplate) { PROFILED_FUNCTION(); @@ -61,50 +61,50 @@ static void PaintSmallScenerySupports( } auto supportType = (direction & 1) ? 1 : 0; - wooden_b_supports_paint_setup(session, supportType, special, supportHeight, supportImageTemplate); + WoodenBSupportsPaintSetup(session, supportType, special, supportHeight, supportImageTemplate); } static void SetSupportHeights( - paint_session& session, const SmallSceneryEntry& sceneryEntry, const SmallSceneryElement& sceneryElement, int32_t height) + PaintSession& session, const SmallSceneryEntry& sceneryEntry, const SmallSceneryElement& sceneryElement, int32_t height) { height += sceneryEntry.height; - paint_util_set_general_support_height(session, ceil2(height, 8), 0x20); + PaintUtilSetGeneralSupportHeight(session, ceil2(height, 8), 0x20); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_BUILD_DIRECTLY_ONTOP)) { if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { - paint_util_set_segment_support_height(session, SEGMENT_C4, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, height, 0x20); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~SEGMENT_C4, height, 0x20); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { auto direction = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) % 4; - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), height, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), height, 0x20); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG27 | SMALL_SCENERY_FLAG_FULL_TILE)) { - paint_util_set_segment_support_height(session, SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, 0xFFFF, 0); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { auto direction = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) % 4; - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); } } static void PaintSmallSceneryBody( - paint_session& session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement, + PaintSession& session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement, const SmallSceneryEntry* sceneryEntry, ImageId imageTemplate) { PROFILED_FUNCTION(); @@ -317,7 +317,7 @@ static void PaintSmallSceneryBody( } } -void PaintSmallScenery(paint_session& session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement) +void PaintSmallScenery(PaintSession& session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement) { PROFILED_FUNCTION(); diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 547d7806ca..450558c7a2 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -32,6 +32,7 @@ #include "../../world/Surface.h" #include "../../world/TileInspector.h" #include "../Boundbox.h" +#include "../Paint.SessionFlags.h" #include "Paint.TileElement.h" #include @@ -299,7 +300,7 @@ static constexpr const tile_surface_boundary_data _tileSurfaceBoundaries[4] = { }, }; -static const TerrainSurfaceObject* get_surface_object(size_t index) +static const TerrainSurfaceObject* GetSurfaceObject(size_t index) { PROFILED_FUNCTION(); @@ -313,14 +314,14 @@ static const TerrainSurfaceObject* get_surface_object(size_t index) return result; } -static ImageId get_surface_image( - const paint_session& session, ObjectEntryIndex index, int32_t offset, uint8_t rotation, int32_t grassLength, bool grid, +static ImageId GetSurfaceImage( + const PaintSession& session, ObjectEntryIndex index, int32_t offset, uint8_t rotation, int32_t grassLength, bool grid, bool underground) { PROFILED_FUNCTION(); ImageId image; - auto obj = get_surface_object(index); + auto obj = GetSurfaceObject(index); if (obj != nullptr) { image = ImageId(obj->GetImageId( @@ -333,12 +334,12 @@ static ImageId get_surface_image( return image; } -static ImageId get_surface_pattern(uint8_t index, int32_t offset) +static ImageId GetSurfacePattern(uint8_t index, int32_t offset) { PROFILED_FUNCTION(); ImageId image; - auto obj = get_surface_object(index); + auto obj = GetSurfaceObject(index); if (obj != nullptr) { image = ImageId(obj->PatternBaseImageId + offset); @@ -350,11 +351,11 @@ static ImageId get_surface_pattern(uint8_t index, int32_t offset) return image; } -static bool surface_should_smooth_self(uint8_t index) +static bool SurfaceShouldSmoothSelf(uint8_t index) { PROFILED_FUNCTION(); - auto obj = get_surface_object(index); + auto obj = GetSurfaceObject(index); if (obj != nullptr) { return obj->Flags & TERRAIN_SURFACE_FLAGS::SMOOTH_WITH_SELF; @@ -362,11 +363,11 @@ static bool surface_should_smooth_self(uint8_t index) return false; } -static bool surface_should_smooth(uint8_t index) +static bool SurfaceShouldSmooth(uint8_t index) { PROFILED_FUNCTION(); - auto obj = get_surface_object(index); + auto obj = GetSurfaceObject(index); if (obj != nullptr) { return obj->Flags & TERRAIN_SURFACE_FLAGS::SMOOTH_WITH_OTHER; @@ -374,7 +375,7 @@ static bool surface_should_smooth(uint8_t index) return false; } -static ImageId get_edge_image_with_offset(uint8_t index, uint32_t offset) +static ImageId GetEdgeImageWithOffset(uint8_t index, uint32_t offset) { ImageId result; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -387,7 +388,7 @@ static ImageId get_edge_image_with_offset(uint8_t index, uint32_t offset) return result; } -static ImageId get_edge_image(uint8_t index, uint8_t type) +static ImageId GetEdgeImage(uint8_t index, uint8_t type) { static constexpr uint32_t offsets[] = { 0, @@ -399,12 +400,12 @@ static ImageId get_edge_image(uint8_t index, uint8_t type) ImageId result; if (type < std::size(offsets)) { - result = get_edge_image_with_offset(index, offsets[type]); + result = GetEdgeImageWithOffset(index, offsets[type]); } return result; } -static ImageId get_tunnel_image(ObjectEntryIndex index, uint8_t type, edge_t edge) +static ImageId GetTunnelImage(ObjectEntryIndex index, uint8_t type, edge_t edge) { PROFILED_FUNCTION(); @@ -426,12 +427,12 @@ static ImageId get_tunnel_image(ObjectEntryIndex index, uint8_t type, edge_t edg ImageId result; if (type < std::size(offsets)) { - result = get_edge_image_with_offset(index, offsets[type]).WithIndexOffset(edge == EDGE_BOTTOMRIGHT ? 2 : 0); + result = GetEdgeImageWithOffset(index, offsets[type]).WithIndexOffset(edge == EDGE_BOTTOMRIGHT ? 2 : 0); } return result; } -static uint8_t viewport_surface_paint_setup_get_relative_slope(const SurfaceElement& surfaceElement, int32_t rotation) +static uint8_t ViewportSurfacePaintSetupGetRelativeSlope(const SurfaceElement& surfaceElement, int32_t rotation) { const uint8_t slope = surfaceElement.GetSlope(); const uint8_t slopeHeight = slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT; @@ -443,8 +444,8 @@ static uint8_t viewport_surface_paint_setup_get_relative_slope(const SurfaceElem /** * rct2: 0x0065E890, 0x0065E946, 0x0065E9FC, 0x0065EAB2 */ -static void viewport_surface_smoothen_edge( - paint_session& session, enum edge_t edge, struct tile_descriptor self, struct tile_descriptor neighbour) +static void ViewportSurfaceSmoothenEdge( + PaintSession& session, enum edge_t edge, struct tile_descriptor self, struct tile_descriptor neighbour) { PROFILED_FUNCTION(); @@ -523,15 +524,15 @@ static void viewport_surface_smoothen_edge( if (cl == dh) return; - if (!surface_should_smooth_self(self.terrain)) + if (!SurfaceShouldSmoothSelf(self.terrain)) return; } else { - if (!surface_should_smooth(self.terrain)) + if (!SurfaceShouldSmooth(self.terrain)) return; - if (!surface_should_smooth(neighbour.terrain)) + if (!SurfaceShouldSmooth(neighbour.terrain)) return; } @@ -539,14 +540,14 @@ static void viewport_surface_smoothen_edge( if (PaintAttachToPreviousPS(session, image_id, 0, 0)) { - attached_paint_struct* out = session.LastAttachedPS; + AttachedPaintStruct* out = session.LastAttachedPS; // set content and enable masking - out->ColourImageId = get_surface_pattern(neighbour.terrain, cl); + out->ColourImageId = GetSurfacePattern(neighbour.terrain, cl); out->IsMasked = true; } } -static bool tile_is_inside_clip_view(const tile_descriptor& tile) +static bool TileIsInsideClipView(const tile_descriptor& tile) { if (tile.tile_element == nullptr) return false; @@ -563,8 +564,8 @@ static bool tile_is_inside_clip_view(const tile_descriptor& tile) return true; } -static void viewport_surface_draw_tile_side_bottom( - paint_session& session, enum edge_t edge, uint16_t height, uint8_t edgeStyle, struct tile_descriptor self, +static void ViewportSurfaceDrawTileSideBottom( + PaintSession& session, enum edge_t edge, uint16_t height, uint8_t edgeStyle, struct tile_descriptor self, struct tile_descriptor neighbour, bool isWater) { PROFILED_FUNCTION(); @@ -578,7 +579,7 @@ static void viewport_surface_draw_tile_side_bottom( CoordsXY tunnelBounds = { 1, 1 }; CoordsXY tunnelTopBoundBoxOffset = { 0, 0 }; - const tunnel_entry* tunnelArray; + const TunnelEntry* tunnelArray; switch (edge) { case EDGE_BOTTOMLEFT: @@ -615,7 +616,7 @@ static void viewport_surface_draw_tile_side_bottom( return; } - bool neighbourIsClippedAway = (session.ViewFlags & VIEWPORT_FLAG_CLIP_VIEW) && !tile_is_inside_clip_view(neighbour); + bool neighbourIsClippedAway = (session.ViewFlags & VIEWPORT_FLAG_CLIP_VIEW) && !TileIsInsideClipView(neighbour); if (neighbour.tile_element == nullptr || neighbourIsClippedAway) { @@ -643,10 +644,10 @@ static void viewport_surface_draw_tile_side_bottom( return; } - auto baseImageId = get_edge_image(edgeStyle, 0); + auto baseImageId = GetEdgeImage(edgeStyle, 0); if (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) { - baseImageId = get_edge_image(edgeStyle, 1); + baseImageId = GetEdgeImage(edgeStyle, 1); } if (edge == EDGE_BOTTOMRIGHT) @@ -734,7 +735,7 @@ static void viewport_surface_draw_tile_side_bottom( boundBoxLength -= 16; } - auto imageId = get_tunnel_image(edgeStyle, tunnelType, edge); + auto imageId = GetTunnelImage(edgeStyle, tunnelType, edge); PaintAddImageAsParent( session, imageId, { offset, zOffset }, { tunnelBounds.x, tunnelBounds.y, boundBoxLength - 1 }, { 0, 0, boundBoxOffsetZ }); @@ -748,7 +749,7 @@ static void viewport_surface_draw_tile_side_bottom( boundBoxLength -= 16; } - imageId = get_tunnel_image(edgeStyle, tunnelType, edge).WithIndexOffset(1); + imageId = GetTunnelImage(edgeStyle, tunnelType, edge).WithIndexOffset(1); PaintAddImageAsParent( session, imageId, { offset, curHeight * COORDS_Z_PER_TINY_Z }, { tunnelBounds.x, tunnelBounds.y, boundBoxLength - 1 }, @@ -762,25 +763,25 @@ static void viewport_surface_draw_tile_side_bottom( /** * rct2: 0x0065EB7D, 0x0065F0D8 */ -static void viewport_surface_draw_land_side_bottom( - paint_session& session, enum edge_t edge, uint16_t height, uint8_t edgeStyle, struct tile_descriptor self, +static void ViewportSurfaceDrawLandSideBottom( + PaintSession& session, enum edge_t edge, uint16_t height, uint8_t edgeStyle, struct tile_descriptor self, struct tile_descriptor neighbour) { - viewport_surface_draw_tile_side_bottom(session, edge, height, edgeStyle, self, neighbour, false); + ViewportSurfaceDrawTileSideBottom(session, edge, height, edgeStyle, self, neighbour, false); } /** * rct2: 0x0065F8B9, 0x0065FE26 */ -static void viewport_surface_draw_water_side_bottom( - paint_session& session, enum edge_t edge, uint16_t height, uint8_t edgeStyle, struct tile_descriptor self, +static void ViewportSurfaceDrawWaterSideBottom( + PaintSession& session, enum edge_t edge, uint16_t height, uint8_t edgeStyle, struct tile_descriptor self, struct tile_descriptor neighbour) { - viewport_surface_draw_tile_side_bottom(session, edge, height, edgeStyle, self, neighbour, true); + ViewportSurfaceDrawTileSideBottom(session, edge, height, edgeStyle, self, neighbour, true); } -static void viewport_surface_draw_tile_side_top( - paint_session& session, enum edge_t edge, uint16_t height, uint8_t terrain, struct tile_descriptor self, +static void ViewportSurfaceDrawTileSideTop( + PaintSession& session, enum edge_t edge, uint16_t height, uint8_t terrain, struct tile_descriptor self, struct tile_descriptor neighbour, bool isWater) { PROFILED_FUNCTION(); @@ -850,10 +851,10 @@ static void viewport_surface_draw_tile_side_top( ImageId baseImageId; if (isWater) { - baseImageId = get_edge_image(terrain, 2); // var_08 + baseImageId = GetEdgeImage(terrain, 2); // var_08 if (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) { - baseImageId = get_edge_image(terrain, 1); // var_04 + baseImageId = GetEdgeImage(terrain, 1); // var_04 } baseImageId = baseImageId.WithIndexOffset(edge == EDGE_TOPLEFT ? 5 : 0); } @@ -862,12 +863,12 @@ static void viewport_surface_draw_tile_side_top( if (!(session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE)) { const uint8_t incline = (cornerHeight2 - cornerHeight1) + 1; - const auto imageId = get_edge_image(terrain, 3).WithIndexOffset((edge == EDGE_TOPLEFT ? 3 : 0) + incline); + const auto imageId = GetEdgeImage(terrain, 3).WithIndexOffset((edge == EDGE_TOPLEFT ? 3 : 0) + incline); const int16_t y = (height - cornerHeight1) * COORDS_Z_PER_TINY_Z; PaintAttachToPreviousPS(session, imageId, 0, y); return; } - baseImageId = get_edge_image(terrain, 1).WithIndexOffset(edge == EDGE_TOPLEFT ? 5 : 0); + baseImageId = GetEdgeImage(terrain, 1).WithIndexOffset(edge == EDGE_TOPLEFT ? 5 : 0); } uint8_t cur_height = std::min(neighbourCornerHeight2, neighbourCornerHeight1); @@ -921,24 +922,24 @@ static void viewport_surface_draw_tile_side_top( /** * rct2: 0x0065F63B, 0x0065F77D */ -static void viewport_surface_draw_land_side_top( - paint_session& session, enum edge_t edge, uint16_t height, uint8_t terrain, struct tile_descriptor self, +static void ViewportSurfaceDrawLandSideTop( + PaintSession& session, enum edge_t edge, uint16_t height, uint8_t terrain, struct tile_descriptor self, struct tile_descriptor neighbour) { - viewport_surface_draw_tile_side_top(session, edge, height, terrain, self, neighbour, false); + ViewportSurfaceDrawTileSideTop(session, edge, height, terrain, self, neighbour, false); } /** * rct2: 0x0066039B, 0x006604F1 */ -static void viewport_surface_draw_water_side_top( - paint_session& session, enum edge_t edge, uint16_t height, uint8_t terrain, struct tile_descriptor self, +static void ViewportSurfaceDrawWaterSideTop( + PaintSession& session, enum edge_t edge, uint16_t height, uint8_t terrain, struct tile_descriptor self, struct tile_descriptor neighbour) { - viewport_surface_draw_tile_side_top(session, edge, height, terrain, self, neighbour, true); + ViewportSurfaceDrawTileSideTop(session, edge, height, terrain, self, neighbour, true); } -static std::pair surface_get_height_above_water( +static std::pair SurfaceGetHeightAboveWater( const SurfaceElement& surfaceElement, const int32_t height, const int32_t surfaceShape) { int32_t localSurfaceShape = surfaceShape; @@ -995,14 +996,14 @@ std::optional GetPatrolAreaTileColour(const CoordsXY& pos) return {}; } -static void PaintPatrolArea(paint_session& session, const SurfaceElement& element, int32_t height, uint8_t surfaceShape) +static void PaintPatrolArea(PaintSession& session, const SurfaceElement& element, int32_t height, uint8_t surfaceShape) { auto colour = GetPatrolAreaTileColour(session.MapPosition); if (colour) { assert(surfaceShape < std::size(byte_97B444)); - auto [localZ, localSurfaceShape] = surface_get_height_above_water(element, height, surfaceShape); + auto [localZ, localSurfaceShape] = SurfaceGetHeightAboveWater(element, height, surfaceShape); auto imageId = ImageId(SPR_TERRAIN_SELECTION_PATROL_AREA + byte_97B444[localSurfaceShape], *colour); auto* backup = session.LastPS; @@ -1014,7 +1015,7 @@ static void PaintPatrolArea(paint_session& session, const SurfaceElement& elemen /** * rct2: 0x0066062C */ -void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, const SurfaceElement& tileElement) +void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, const SurfaceElement& tileElement) { PROFILED_FUNCTION(); @@ -1026,7 +1027,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co const auto zoomLevel = dpi->zoom_level; const uint8_t rotation = session.CurrentRotation; const auto terrain_type = tileElement.GetSurfaceStyle(); - const uint8_t surfaceShape = viewport_surface_paint_setup_get_relative_slope(tileElement, rotation); + const uint8_t surfaceShape = ViewportSurfacePaintSetupGetRelativeSlope(tileElement, rotation); const CoordsXY& base = session.SpritePosition; const corner_height& cornerHeights = corner_heights[surfaceShape]; const TileElement* elementPtr = &reinterpret_cast(tileElement); @@ -1047,7 +1048,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co tile_descriptor tileDescriptors[5]; tileDescriptors[0] = selfDescriptor; - for (int32_t i = 0; i < 4; i++) + for (std::size_t i = 0; i < std::size(viewport_surface_paint_data); i++) { const CoordsXY& offset = viewport_surface_paint_data[i][rotation]; const CoordsXY position = base + offset; @@ -1055,18 +1056,18 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co tile_descriptor& descriptor = tileDescriptors[i + 1]; descriptor.tile_element = nullptr; - if (!map_is_location_valid(position)) + if (!MapIsLocationValid(position)) { continue; } - auto surfaceElement = map_get_surface_element_at(position); + auto surfaceElement = MapGetSurfaceElementAt(position); if (surfaceElement == nullptr) { continue; } - const uint32_t surfaceSlope = viewport_surface_paint_setup_get_relative_slope(*surfaceElement, rotation); + const uint32_t surfaceSlope = ViewportSurfacePaintSetupGetRelativeSlope(*surfaceElement, rotation); const uint8_t baseHeight = surfaceElement->GetBaseZ() / 16; const corner_height& ch = corner_heights[surfaceSlope]; @@ -1085,7 +1086,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co const int16_t x = session.MapPosition.x; const int16_t y = session.MapPosition.y; - int32_t surfaceHeight = tile_element_height({ x + 16, y + 16 }); + int32_t surfaceHeight = TileElementHeight({ x + 16, y + 16 }); int32_t dx = surfaceHeight + 3; int32_t image_id = (SPR_HEIGHT_MARKER_BASE + dx / 16); @@ -1127,7 +1128,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co } else { - imageId = get_surface_image(session, terrain_type, image_offset, rotation, grassLength, showGridlines, false); + imageId = GetSurfaceImage(session, terrain_type, image_offset, rotation, grassLength, showGridlines, false); } if (session.ViewFlags & (VIEWPORT_FLAG_UNDERGROUND_INSIDE | VIEWPORT_FLAG_HIDE_BASE)) { @@ -1156,7 +1157,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co { PaintAddImageAsParent(session, ImageId(SPR_TERRAIN_SELECTION_SQUARE_SIMPLE), { 0, 0, spawn.z }, { 32, 32, 16 }); - const int32_t offset = (direction_reverse(spawn.direction) + rotation) & 3; + const int32_t offset = (DirectionReverse(spawn.direction) + rotation) & 3; const auto image_id = ImageId(PEEP_SPAWN_ARROW_0 + offset, COLOUR_LIGHT_BLUE); PaintAddImageAsParent(session, image_id, { 0, 0, spawn.z }, { 32, 32, 19 }); } @@ -1174,8 +1175,8 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co 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; - paint_struct* backup = session.LastPS; + const int32_t height2 = (TileElementHeight({ pos.x + 16, pos.y + 16 })) + 3; + PaintStruct* backup = session.LastPS; PaintAddImageAsParent(session, ImageId(SPR_LAND_OWNERSHIP_AVAILABLE), { 16, 16, height2 }, { 1, 1, 0 }); session.LastPS = backup; } @@ -1191,8 +1192,8 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co 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 }); - paint_struct* backup = session.LastPS; + const int32_t height2 = TileElementHeight({ pos.x + 16, pos.y + 16 }); + PaintStruct* backup = session.LastPS; PaintAddImageAsParent( session, ImageId(SPR_LAND_CONSTRUCTION_RIGHTS_AVAILABLE), { 16, 16, height2 + 3 }, { 1, 1, 0 }); session.LastPS = backup; @@ -1244,12 +1245,12 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co 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, height, surfaceShape); + auto [local_height, local_surfaceShape] = SurfaceGetHeightAboveWater(tileElement, height, surfaceShape); const auto fpId = static_cast(38); const auto image_id = ImageId(SPR_TERRAIN_SELECTION_CORNER + byte_97B444[local_surfaceShape], fpId); - paint_struct* backup = session.LastPS; + PaintStruct* backup = session.LastPS; PaintAddImageAsParent(session, image_id, { 0, 0, local_height }, { 32, 32, 1 }); session.LastPS = backup; } @@ -1280,19 +1281,19 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co } if (zoomLevel <= ZoomLevel{ 0 } && has_surface && !(session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) - && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_BASE) && gConfigGeneral.landscape_smoothing) + && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_BASE) && gConfigGeneral.LandscapeSmoothing) { - viewport_surface_smoothen_edge(session, EDGE_TOPLEFT, tileDescriptors[0], tileDescriptors[3]); - viewport_surface_smoothen_edge(session, EDGE_TOPRIGHT, tileDescriptors[0], tileDescriptors[4]); - viewport_surface_smoothen_edge(session, EDGE_BOTTOMLEFT, tileDescriptors[0], tileDescriptors[1]); - viewport_surface_smoothen_edge(session, EDGE_BOTTOMRIGHT, tileDescriptors[0], tileDescriptors[2]); + ViewportSurfaceSmoothenEdge(session, EDGE_TOPLEFT, tileDescriptors[0], tileDescriptors[3]); + ViewportSurfaceSmoothenEdge(session, EDGE_TOPRIGHT, tileDescriptors[0], tileDescriptors[4]); + ViewportSurfaceSmoothenEdge(session, EDGE_BOTTOMLEFT, tileDescriptors[0], tileDescriptors[1]); + ViewportSurfaceSmoothenEdge(session, EDGE_BOTTOMRIGHT, tileDescriptors[0], tileDescriptors[2]); } if ((session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) && !(session.ViewFlags & VIEWPORT_FLAG_HIDE_BASE) && !(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) { const uint8_t image_offset = byte_97B444[surfaceShape]; - auto imageId = get_surface_image(session, terrain_type, image_offset, rotation, 1, false, true); + auto imageId = GetSurfaceImage(session, terrain_type, image_offset, rotation, 1, false, true); PaintAttachToPreviousPS(session, imageId, 0, 0); } @@ -1304,12 +1305,10 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co log_verbose("edgeStyle: %d", edgeStyle); } - viewport_surface_draw_land_side_top(session, EDGE_TOPLEFT, height, edgeStyle, tileDescriptors[0], tileDescriptors[3]); - viewport_surface_draw_land_side_top(session, EDGE_TOPRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[4]); - viewport_surface_draw_land_side_bottom( - session, EDGE_BOTTOMLEFT, height, edgeStyle, tileDescriptors[0], tileDescriptors[1]); - viewport_surface_draw_land_side_bottom( - session, EDGE_BOTTOMRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[2]); + ViewportSurfaceDrawLandSideTop(session, EDGE_TOPLEFT, height, edgeStyle, tileDescriptors[0], tileDescriptors[3]); + ViewportSurfaceDrawLandSideTop(session, EDGE_TOPRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[4]); + ViewportSurfaceDrawLandSideBottom(session, EDGE_BOTTOMLEFT, height, edgeStyle, tileDescriptors[0], tileDescriptors[1]); + ViewportSurfaceDrawLandSideBottom(session, EDGE_BOTTOMRIGHT, height, edgeStyle, tileDescriptors[0], tileDescriptors[2]); } const uint16_t waterHeight = tileElement.GetWaterHeight(); @@ -1333,7 +1332,7 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co const auto image_id = ImageId(SPR_WATER_MASK + image_offset, FilterPaletteID::PaletteWater).WithBlended(true); PaintAddImageAsParent(session, image_id, { 0, 0, waterHeight }, { 32, 32, -1 }); - const bool transparent = gConfigGeneral.transparent_water || (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); + const bool transparent = gConfigGeneral.TransparentWater || (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); const uint32_t overlayStart = transparent ? SPR_WATER_OVERLAY : SPR_RCT1_WATER_OVERLAY; PaintAttachToPreviousPS(session, ImageId(overlayStart + image_offset), 0, 0); @@ -1343,13 +1342,13 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co const uint32_t edgeStyle = tileElement.GetEdgeStyle(); // end new code - viewport_surface_draw_water_side_bottom( + ViewportSurfaceDrawWaterSideBottom( session, EDGE_BOTTOMLEFT, waterHeight, edgeStyle, tileDescriptors[0], tileDescriptors[1]); - viewport_surface_draw_water_side_bottom( + ViewportSurfaceDrawWaterSideBottom( session, EDGE_BOTTOMRIGHT, waterHeight, edgeStyle, tileDescriptors[0], tileDescriptors[2]); - viewport_surface_draw_water_side_top( + ViewportSurfaceDrawWaterSideTop( session, EDGE_TOPLEFT, waterHeight, edgeStyle, tileDescriptors[0], tileDescriptors[3]); - viewport_surface_draw_water_side_top( + ViewportSurfaceDrawWaterSideTop( session, EDGE_TOPRIGHT, waterHeight, edgeStyle, tileDescriptors[0], tileDescriptors[4]); } } @@ -1426,12 +1425,12 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 00 00 00 // 00 00 // 00 - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, height, 0); - paint_util_force_set_general_support_height(session, height, 0); + PaintUtilForceSetGeneralSupportHeight(session, height, 0); break; case 1: @@ -1441,11 +1440,11 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 01 01 01 // 1B 1B // 1B - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, height, 0); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 1); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_D4, height + 6, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_C0, height + 6 + 6, 0x1B); - paint_util_force_set_general_support_height(session, height, 1); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, height, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 1); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 6 + 6, 0x1B); + PaintUtilForceSetGeneralSupportHeight(session, height, 1); break; case 2: @@ -1455,11 +1454,11 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 17 02 00 // 17 00 // 02 - paint_util_set_segment_support_height(session, SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, height, 0); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 2); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_D0, height + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_B8, height + 6 + 6, 0x17); - paint_util_force_set_general_support_height(session, height, 2); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, height, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 2); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 6 + 6, 0x17); + PaintUtilForceSetGeneralSupportHeight(session, height, 2); break; case 3: @@ -1469,10 +1468,10 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 03 03 03 // 03 03 // 03 - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC, height + 2, 3); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, height + 2 + 6, 3); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0, height + 2 + 6 + 6, 3); - paint_util_force_set_general_support_height(session, height, 3); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC, height + 2, 3); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, height + 2 + 6, 3); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0, height + 2 + 6 + 6, 3); + PaintUtilForceSetGeneralSupportHeight(session, height, 3); break; case 4: @@ -1482,11 +1481,11 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 04 04 04 // 00 00 // 00 - paint_util_set_segment_support_height(session, SEGMENT_C0 | SEGMENT_D0 | SEGMENT_D4, height, 0); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 4); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC, height + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_B4, height + 6 + 6, 0x1E); - paint_util_force_set_general_support_height(session, height, 4); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0 | SEGMENT_D0 | SEGMENT_D4, height, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 4); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 6 + 6, 0x1E); + PaintUtilForceSetGeneralSupportHeight(session, height, 4); break; case 5: @@ -1496,12 +1495,12 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 05 05 05 ░░ ░░ ░░ // 1B 1B ▒▒ ▒▒ // 1B ▓▓ - paint_util_set_segment_support_height(session, SEGMENT_B4, height + 6 + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC, height + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 5); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_D4, height + 6, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_C0, height + 6 + 6, 0x1B); - paint_util_force_set_general_support_height(session, height, 5); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 5); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 6 + 6, 0x1B); + PaintUtilForceSetGeneralSupportHeight(session, height, 5); break; case 6: @@ -1511,10 +1510,10 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 06 06 06 ▓▓ ▒▒ ░░ // 06 06 ▒▒ ░░ // 06 ░░ - paint_util_set_segment_support_height(session, SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0, height + 2, 6); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, height + 2 + 6, 6); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, height + 2 + 6 + 6, 6); - paint_util_force_set_general_support_height(session, height, 6); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0, height + 2, 6); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, height + 2 + 6, 6); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, height + 2 + 6 + 6, 6); + PaintUtilForceSetGeneralSupportHeight(session, height, 6); break; case 7: @@ -1524,113 +1523,113 @@ void PaintSurface(paint_session& session, uint8_t direction, uint16_t height, co // 00 07 17 ▓▓ ▓▓ ░░ // 00 17 ▓▓ ▒▒ // 07 ▓▓ - paint_util_set_segment_support_height(session, SEGMENT_BC, height + 4, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 7); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_D0 | SEGMENT_B8, height + 4 + 6 + 6, 0); - paint_util_force_set_general_support_height(session, height, 7); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 4, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 7); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0 | SEGMENT_B8, height + 4 + 6 + 6, 0); + PaintUtilForceSetGeneralSupportHeight(session, height, 7); break; case 8: // loc_6620D8 - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C8 | SEGMENT_D0, height, 0); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 8); - paint_util_set_segment_support_height(session, SEGMENT_CC | SEGMENT_D4, height + 6, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_BC, height + 6 + 6, 0x1D); - paint_util_force_set_general_support_height(session, height, 8); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C8 | SEGMENT_D0, height, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 8); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 6 + 6, 0x1D); + PaintUtilForceSetGeneralSupportHeight(session, height, 8); break; case 9: // loc_66216D - paint_util_force_set_general_support_height(session, height, 9); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8, height + 2, 9); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, height + 2 + 6, 9); - paint_util_set_segment_support_height(session, SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, height + 2 + 6 + 6, 9); + PaintUtilForceSetGeneralSupportHeight(session, height, 9); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8, height + 2, 9); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, height + 2 + 6, 9); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, height + 2 + 6 + 6, 9); break; case 10: // loc_662206 - paint_util_force_set_general_support_height(session, height, 0xA); - paint_util_set_segment_support_height(session, SEGMENT_B8, height + 6 + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_D0, height + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 0xA); - paint_util_set_segment_support_height(session, SEGMENT_CC | SEGMENT_D4, height + 6, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_BC, height + 6 + 6, 0x1D); + PaintUtilForceSetGeneralSupportHeight(session, height, 0xA); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 0xA); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 6 + 6, 0x1D); break; case 11: // loc_66229B - paint_util_force_set_general_support_height(session, height, 0xB); - paint_util_set_segment_support_height(session, SEGMENT_B4, height + 4, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0xB); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C0, height + 4 + 6 + 6, 0); + PaintUtilForceSetGeneralSupportHeight(session, height, 0xB); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 4, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0xB); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C0, height + 4 + 6 + 6, 0); break; case 12: // loc_662334 - paint_util_force_set_general_support_height(session, height, 0xC); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0, height + 2, 0xC); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, height + 2 + 6, 0xC); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC, height + 2 + 6 + 6, 0xC); + PaintUtilForceSetGeneralSupportHeight(session, height, 0xC); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0, height + 2, 0xC); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, height + 2 + 6, 0xC); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC, height + 2 + 6 + 6, 0xC); break; case 13: // loc_6623CD - paint_util_force_set_general_support_height(session, height, 0xD); - paint_util_set_segment_support_height(session, SEGMENT_B8, height + 4, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0xD); - paint_util_set_segment_support_height(session, SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC, height + 4 + 6 + 6, 0); + PaintUtilForceSetGeneralSupportHeight(session, height, 0xD); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 4, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0xD); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC, height + 4 + 6 + 6, 0); break; case 14: // loc_662466 - paint_util_force_set_general_support_height(session, height, 0xE); - paint_util_set_segment_support_height(session, SEGMENT_C0, height + 4, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0xE); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_B4, height + 4 + 6 + 6, 0); + PaintUtilForceSetGeneralSupportHeight(session, height, 0xE); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 4, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0xE); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_B4, height + 4 + 6 + 6, 0); break; case 23: // loc_6624FF - paint_util_force_set_general_support_height(session, height, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_BC, height + 4, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6 + 6 + 6, 0x17); - paint_util_set_segment_support_height(session, SEGMENT_B8, height + 4 + 6 + 6 + 6 + 6, 0x17); + PaintUtilForceSetGeneralSupportHeight(session, height, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 4, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 4 + 6 + 6 + 6 + 6, 0x17); break; case 27: // loc_6625A0 - paint_util_force_set_general_support_height(session, height, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_B4, height + 4, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6 + 6 + 6, 0x1B); - paint_util_set_segment_support_height(session, SEGMENT_C0, height + 4 + 6 + 6 + 6 + 6, 0x1B); + PaintUtilForceSetGeneralSupportHeight(session, height, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 4, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 4 + 6 + 6 + 6 + 6, 0x1B); break; case 29: // loc_662641 - paint_util_force_set_general_support_height(session, height, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_B8, height + 4, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6 + 6 + 6, 0x1D); - paint_util_set_segment_support_height(session, SEGMENT_BC, height + 4 + 6 + 6 + 6 + 6, 0x1D); + PaintUtilForceSetGeneralSupportHeight(session, height, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 4, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 4 + 6 + 6 + 6 + 6, 0x1D); break; case 30: // loc_6626E2 - paint_util_force_set_general_support_height(session, height, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_C0, height + 4, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6 + 6 + 6, 0x1E); - paint_util_set_segment_support_height(session, SEGMENT_B4, height + 4 + 6 + 6 + 6 + 6, 0x1E); + PaintUtilForceSetGeneralSupportHeight(session, height, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 4, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 4 + 6 + 6 + 6 + 6, 0x1E); break; } } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index fa84825db1..62c507cd8a 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -27,6 +27,7 @@ #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/Surface.h" +#include "../Paint.SessionFlags.h" #include "../Paint.h" #include "../Supports.h" #include "../VirtualFloor.h" @@ -34,8 +35,8 @@ #include -static void blank_tiles_paint(paint_session& session, int32_t x, int32_t y); -static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoords); +static void BlankTilesPaint(PaintSession& session, int32_t x, int32_t y); +static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoords); const int32_t SEGMENTS_ALL = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4; @@ -44,14 +45,14 @@ const int32_t SEGMENTS_ALL = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | * * rct2: 0x0068B35F */ -void tile_element_paint_setup(paint_session& session, const CoordsXY& mapCoords, bool isTrackPiecePreview) +void TileElementPaintSetup(PaintSession& session, const CoordsXY& mapCoords, bool isTrackPiecePreview) { PROFILED_FUNCTION(); - if (!map_is_edge(mapCoords)) + if (!MapIsEdge(mapCoords)) { - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_force_set_general_support_height(session, -1, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilForceSetGeneralSupportHeight(session, -1, 0); session.Flags = isTrackPiecePreview ? PaintSessionFlags::IsTrackPiecePreview : 0; session.WaterHeight = 0xFFFF; @@ -59,7 +60,7 @@ void tile_element_paint_setup(paint_session& session, const CoordsXY& mapCoords, } else if (!(session.ViewFlags & VIEWPORT_FLAG_TRANSPARENT_BACKGROUND)) { - blank_tiles_paint(session, mapCoords.x, mapCoords.y); + BlankTilesPaint(session, mapCoords.x, mapCoords.y); } } @@ -67,7 +68,7 @@ void tile_element_paint_setup(paint_session& session, const CoordsXY& mapCoords, * * rct2: 0x0068B60E */ -static void blank_tiles_paint(paint_session& session, int32_t x, int32_t y) +static void BlankTilesPaint(PaintSession& session, int32_t x, int32_t y) { int32_t dx = 0; switch (session.CurrentRotation) @@ -113,7 +114,7 @@ bool gShowSupportSegmentHeights = false; * * rct2: 0x0068B3FB */ -static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoords) +static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoords) { PROFILED_FUNCTION(); @@ -136,16 +137,16 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo session.MapPosition.x = coords.x; session.MapPosition.y = coords.y; - auto* tile_element = map_get_first_element_at(session.MapPosition); + auto* tile_element = MapGetFirstElementAt(session.MapPosition); if (tile_element == nullptr) return; uint8_t rotation = session.CurrentRotation; bool partOfVirtualFloor = false; - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - partOfVirtualFloor = virtual_floor_tile_is_floor(session.MapPosition); + partOfVirtualFloor = VirtualFloorTileIsFloor(session.MapPosition); } switch (rotation) @@ -164,7 +165,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo break; } - int32_t screenMinY = translate_3d_to_2d_with_z(rotation, { coords, 0 }).y; + int32_t screenMinY = Translate3DTo2DWithZ(rotation, { coords, 0 }).y; // Display little yellow arrow when building footpaths? if ((gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_ARROW) && session.MapPosition.x == gMapSelectArrowPosition.x @@ -204,7 +205,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo if (partOfVirtualFloor) { // We must pretend this tile is at least as tall as the virtual floor - max_height = std::max(max_height, virtual_floor_get_height()); + max_height = std::max(max_height, VirtualFloorGetHeight()); } if (screenMinY - (max_height + 32) >= dpi->y + dpi->height) @@ -289,9 +290,9 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo session.MapPosition = mapPosition; } while (!(tile_element++)->IsLastForTile()); - if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off && partOfVirtualFloor) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off && partOfVirtualFloor) { - virtual_floor_paint(session); + VirtualFloorPaint(session); } if (!gShowSupportSegmentHeights) @@ -310,9 +311,9 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo { 1, 7, 3 }, }; - for (int32_t sy = 0; sy < 3; sy++) + for (std::size_t sy = 0; sy < std::size(segmentPositions); sy++) { - for (int32_t sx = 0; sx < 3; sx++) + for (std::size_t sx = 0; sx < std::size(segmentPositions[sy]); sx++) { uint16_t segmentHeight = session.SupportSegments[segmentPositions[sy][sx]].height; auto imageColourFlats = ImageId(SPR_LAND_TOOL_SIZE_1).WithTransparency(FilterPaletteID::PaletteDarken3); @@ -328,9 +329,9 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo if ((session.ViewFlags & VIEWPORT_FLAG_CLIP_VIEW) && (segmentHeight > gClipHeight)) continue; - int32_t xOffset = sy * 10; - int32_t yOffset = -22 + sx * 10; - paint_struct* ps = PaintAddImageAsParent( + int32_t xOffset = static_cast(sy) * 10; + int32_t yOffset = -22 + static_cast(sx) * 10; + PaintStruct* ps = PaintAddImageAsParent( session, imageColourFlats, { xOffset, yOffset, segmentHeight }, { 10, 10, 1 }, { xOffset + 1, yOffset + 16, segmentHeight }); if (ps != nullptr) @@ -341,7 +342,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo } } -void paint_util_push_tunnel_left(paint_session& session, uint16_t height, uint8_t type) +void PaintUtilPushTunnelLeft(PaintSession& session, uint16_t height, uint8_t type) { session.LeftTunnels[session.LeftTunnelCount] = { static_cast((height / 16)), type }; if (session.LeftTunnelCount < TUNNEL_MAX_COUNT - 1) @@ -351,7 +352,7 @@ void paint_util_push_tunnel_left(paint_session& session, uint16_t height, uint8_ } } -void paint_util_push_tunnel_right(paint_session& session, uint16_t height, uint8_t type) +void PaintUtilPushTunnelRight(PaintSession& session, uint16_t height, uint8_t type) { session.RightTunnels[session.RightTunnelCount] = { static_cast((height / 16)), type }; if (session.RightTunnelCount < TUNNEL_MAX_COUNT - 1) @@ -361,22 +362,22 @@ void paint_util_push_tunnel_right(paint_session& session, uint16_t height, uint8 } } -void paint_util_set_vertical_tunnel(paint_session& session, uint16_t height) +void PaintUtilSetVerticalTunnel(PaintSession& session, uint16_t height) { session.VerticalTunnelHeight = height / 16; } -void paint_util_set_general_support_height(paint_session& session, int16_t height, uint8_t slope) +void PaintUtilSetGeneralSupportHeight(PaintSession& session, int16_t height, uint8_t slope) { if (session.Support.height >= height) { return; } - paint_util_force_set_general_support_height(session, height, slope); + PaintUtilForceSetGeneralSupportHeight(session, height, slope); } -void paint_util_force_set_general_support_height(paint_session& session, int16_t height, uint8_t slope) +void PaintUtilForceSetGeneralSupportHeight(PaintSession& session, int16_t height, uint8_t slope) { session.Support.height = height; session.Support.slope = slope; @@ -386,10 +387,10 @@ 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) +void PaintUtilSetSegmentSupportHeight(PaintSession& session, int32_t segments, uint16_t height, uint8_t slope) { - support_height* supportSegments = session.SupportSegments; - for (int32_t s = 0; s < 9; s++) + SupportHeight* supportSegments = session.SupportSegments; + for (std::size_t s = 0; s < std::size(segment_offsets); s++) { if (segments & segment_offsets[s]) { @@ -402,7 +403,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) +uint16_t PaintUtilRotateSegments(uint16_t segments, uint8_t rotation) { uint8_t temp = segments & 0xFF; temp = Numerics::rol8(temp, rotation * 2); @@ -410,7 +411,7 @@ uint16_t paint_util_rotate_segments(uint16_t segments, uint8_t rotation) return (segments & 0xFF00) | temp; } -bool PaintShouldShowHeightMarkers(const paint_session& session, const uint32_t viewportFlag) +bool PaintShouldShowHeightMarkers(const PaintSession& session, const uint32_t viewportFlag) { auto dpi = &session.DPI; return (session.ViewFlags & viewportFlag) && (dpi->zoom_level <= ZoomLevel{ 0 }); diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index ac05486dc5..fafe89b0f5 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -12,7 +12,7 @@ #include "../../common.h" #include "../../world/Map.h" -struct paint_session; +struct PaintSession; enum edge_t { @@ -71,12 +71,6 @@ enum TUNNEL_TYPE_COUNT }; -namespace PaintSessionFlags -{ - constexpr uint8_t PassedSurface = 1u << 0; - constexpr uint8_t IsTrackPiecePreview = 1u << 1; -} // namespace PaintSessionFlags - extern const int32_t SEGMENTS_ALL; extern const uint16_t segment_offsets[9]; @@ -86,24 +80,24 @@ extern const CoordsXY BannerBoundBoxes[][2]; extern const uint8_t PathSlopeToLandSlope[4]; -void paint_util_push_tunnel_left(paint_session& session, uint16_t height, uint8_t type); -void paint_util_push_tunnel_right(paint_session& session, uint16_t height, uint8_t type); -void paint_util_set_vertical_tunnel(paint_session& session, uint16_t height); +void PaintUtilPushTunnelLeft(PaintSession& session, uint16_t height, uint8_t type); +void PaintUtilPushTunnelRight(PaintSession& session, uint16_t height, uint8_t type); +void PaintUtilSetVerticalTunnel(PaintSession& session, uint16_t height); -void paint_util_set_general_support_height(paint_session& session, int16_t height, uint8_t slope); -void paint_util_force_set_general_support_height(paint_session& session, int16_t height, uint8_t slope); -void paint_util_set_segment_support_height(paint_session& session, int32_t segments, uint16_t height, uint8_t slope); -uint16_t paint_util_rotate_segments(uint16_t segments, uint8_t rotation); +void PaintUtilSetGeneralSupportHeight(PaintSession& session, int16_t height, uint8_t slope); +void PaintUtilForceSetGeneralSupportHeight(PaintSession& session, int16_t height, uint8_t slope); +void PaintUtilSetSegmentSupportHeight(PaintSession& session, int32_t segments, uint16_t height, uint8_t slope); +uint16_t PaintUtilRotateSegments(uint16_t segments, uint8_t rotation); -void tile_element_paint_setup(paint_session& session, const CoordsXY& mapCoords, bool isTrackPiecePreview = false); +void TileElementPaintSetup(PaintSession& session, const CoordsXY& mapCoords, bool isTrackPiecePreview = false); -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); +void PaintEntrance(PaintSession& session, uint8_t direction, int32_t height, const EntranceElement& entranceElement); +void PaintBanner(PaintSession& session, uint8_t direction, int32_t height, const BannerElement& bannerElement); +void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, const SurfaceElement& tileElement); +void PaintPath(PaintSession& session, uint16_t height, const PathElement& tileElement); +void PaintSmallScenery(PaintSession& session, uint8_t direction, int32_t height, const SmallSceneryElement& sceneryElement); +void PaintWall(PaintSession& session, uint8_t direction, int32_t height, const WallElement& tileElement); +void PaintLargeScenery(PaintSession& session, uint8_t direction, uint16_t height, const LargeSceneryElement& tileElement); +void PaintTrack(PaintSession& session, uint8_t direction, int32_t height, const TrackElement& tileElement); -bool PaintShouldShowHeightMarkers(const paint_session& session, const uint32_t viewportFlag); +bool PaintShouldShowHeightMarkers(const PaintSession& session, const uint32_t viewportFlag); diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 7255095378..4e445867ab 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -46,7 +46,7 @@ static constexpr const uint8_t* DirectionToDoorImageOffset[] = { DirectionToDoor DirectionToDoorImageOffset2, DirectionToDoorImageOffset3 }; static void PaintWallDoor( - paint_session& session, const WallSceneryEntry& wallEntry, ImageId imageId, CoordsXYZ offset, BoundBoxXYZ bbR1, + PaintSession& session, const WallSceneryEntry& wallEntry, ImageId imageId, CoordsXYZ offset, BoundBoxXYZ bbR1, BoundBoxXYZ bbR2, BoundBoxXYZ bbL) { PROFILED_FUNCTION(); @@ -66,7 +66,7 @@ static void PaintWallDoor( } static void PaintWallDoor( - paint_session& session, const WallSceneryEntry& wallEntry, const WallElement& wallElement, ImageId imageTemplate, + PaintSession& session, const WallSceneryEntry& wallEntry, const WallElement& wallElement, ImageId imageTemplate, Direction direction, int32_t height) { PROFILED_FUNCTION(); @@ -130,7 +130,7 @@ static void PaintWallDoor( } static void PaintWallWall( - paint_session& session, const WallSceneryEntry& wallEntry, ImageId imageTemplate, uint32_t imageOffset, CoordsXYZ offset, + PaintSession& session, const WallSceneryEntry& wallEntry, ImageId imageTemplate, uint32_t imageOffset, CoordsXYZ offset, BoundBoxXYZ boundBox, bool isGhost) { PROFILED_FUNCTION(); @@ -146,7 +146,7 @@ static void PaintWallWall( } static void PaintWallScrollingText( - paint_session& session, const WallSceneryEntry& wallEntry, const WallElement& wallElement, Direction direction, + PaintSession& session, const WallSceneryEntry& wallEntry, const WallElement& wallElement, Direction direction, int32_t height, const CoordsXYZ& boundsOffset, bool isGhost) { PROFILED_FUNCTION(); @@ -172,7 +172,7 @@ static void PaintWallScrollingText( auto ft = Formatter(); banner->FormatTextTo(ft); char signString[256]; - if (gConfigGeneral.upper_case_banners) + if (gConfigGeneral.UpperCaseBanners) { format_string_to_upper(signString, sizeof(signString), STR_SCROLLING_SIGN_TEXT, ft.Data()); } @@ -181,14 +181,14 @@ static void PaintWallScrollingText( format_string(signString, sizeof(signString), STR_SCROLLING_SIGN_TEXT, ft.Data()); } - auto stringWidth = gfx_get_string_width(signString, FontSpriteBase::TINY); + auto stringWidth = gfx_get_string_width(signString, FontStyle::Tiny); auto scroll = stringWidth > 0 ? (gCurrentTicks / 2) % stringWidth : 0; auto imageId = scrolling_text_setup(session, STR_SCROLLING_SIGN_TEXT, ft, scroll, scrollingMode, textPaletteIndex); - PaintAddImageAsChild(session, imageId, { 0, 0, height + 8 }, { 1, 1, 13 }, boundsOffset); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 8 }, { boundsOffset, { 1, 1, 13 } }); } static void PaintWallWall( - paint_session& session, const WallSceneryEntry& wallEntry, const WallElement& wallElement, ImageId imageTemplate, + PaintSession& session, const WallSceneryEntry& wallEntry, const WallElement& wallElement, ImageId imageTemplate, Direction direction, int32_t height, bool isGhost) { PROFILED_FUNCTION(); @@ -296,7 +296,7 @@ static void PaintWallWall( PaintWallScrollingText(session, wallEntry, wallElement, direction, height, boundBox.offset, isGhost); } -void PaintWall(paint_session& session, uint8_t direction, int32_t height, const WallElement& wallElement) +void PaintWall(PaintSession& session, uint8_t direction, int32_t height, const WallElement& wallElement) { PROFILED_FUNCTION(); @@ -322,7 +322,7 @@ void PaintWall(paint_session& session, uint8_t direction, int32_t height, const imageTemplate = imageTemplate.WithTertiary(wallElement.GetTertiaryColour()); } - paint_util_set_general_support_height(session, 8 * wallElement.clearance_height, 0x20); + PaintUtilSetGeneralSupportHeight(session, 8 * wallElement.clearance_height, 0x20); auto isGhost = false; if (gTrackDesignSaveMode || (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index a5fb0a39a1..5be5e18ff8 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -338,6 +338,13 @@ namespace OpenRCT2 identifier = "openrct2.ride.single_rail_coaster"; } } + else if (version <= 14) + { + if (identifier == "openrct2.ride.alp1") + { + identifier = "openrct2.ride.alpine_coaster"; + } + } desc.Identifier = identifier; desc.Version = cs.Read(); @@ -388,7 +395,7 @@ namespace OpenRCT2 { cs.Write(DESCRIPTOR_JSON); cs.Write(entry.Identifier); - cs.Write(""); // reserved for version + cs.Write(entry.Version); } else { @@ -975,7 +982,7 @@ namespace OpenRCT2 auto found = os.ReadWriteChunk( ParkFileChunkType::TILES, - [pathToSurfaceMap, pathToQueueSurfaceMap, pathToRailingsMap](OrcaStream::ChunkStream& cs) { + [pathToSurfaceMap, pathToQueueSurfaceMap, pathToRailingsMap, &os](OrcaStream::ChunkStream& cs) { cs.ReadWrite(gMapSize.x); cs.ReadWrite(gMapSize.y); @@ -991,8 +998,8 @@ namespace OpenRCT2 SetTileElements(std::move(tileElements)); { tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it)) + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) { if (it.element->GetType() == TileElementType::Path) { @@ -1011,9 +1018,19 @@ namespace OpenRCT2 } } } + else if (it.element->GetType() == TileElementType::Track) + { + auto* trackElement = it.element->AsTrack(); + if (TrackTypeMustBeMadeInvisible( + trackElement->GetRideType(), trackElement->GetTrackType(), + os.GetHeader().TargetVersion)) + { + it.element->SetInvisible(true); + } + } } } - UpdateParkEntranceLocations(); + ParkEntranceUpdateLocations(); } else { @@ -1034,7 +1051,7 @@ namespace OpenRCT2 { for (int32_t x = 0; x < gMapSize.x; x++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do @@ -2326,7 +2343,7 @@ int32_t scenario_save(u8string_view path, int32_t flags) Formatter ft; ft.Add(e.what()); - context_show_error(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_STRING, ft); + ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_STRING, ft); gfx_invalidate_screen(); auto ctx = OpenRCT2::GetContext(); diff --git a/src/openrct2/park/ParkFile.h b/src/openrct2/park/ParkFile.h index d0c172a532..7df5ab0959 100644 --- a/src/openrct2/park/ParkFile.h +++ b/src/openrct2/park/ParkFile.h @@ -8,7 +8,7 @@ struct ObjectRepositoryItem; namespace OpenRCT2 { // Current version that is saved. - constexpr uint32_t PARK_FILE_CURRENT_VERSION = 14; + constexpr uint32_t PARK_FILE_CURRENT_VERSION = 16; // The minimum version that is forwards compatible with the current version. constexpr uint32_t PARK_FILE_MIN_VERSION = 14; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 844ba93a52..ac13f024ca 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -126,7 +126,7 @@ static int32_t path_get_permitted_edges(PathElement* pathElement) */ static int32_t peep_move_one_tile(Direction direction, Peep& peep) { - assert(direction_valid(direction)); + assert(DirectionValid(direction)); auto newTile = CoordsXY{ CoordsXY{ peep.NextLoc } + CoordsDirectionDelta[direction] }.ToTileCentre(); if (newTile.x >= MAXIMUM_MAP_SIZE_BIG || newTile.y >= MAXIMUM_MAP_SIZE_BIG) @@ -185,15 +185,15 @@ static int32_t guest_surface_path_finding(Peep& peep) auto pathPos = CoordsXYRangedZ{ peep.NextLoc, peep.NextLoc.z, peep.NextLoc.z + PATH_CLEARANCE }; Direction randDirection = scenario_rand() & 3; - if (!fence_in_the_way(pathPos, randDirection)) + if (!WallInTheWay(pathPos, randDirection)) { pathPos.x += CoordsDirectionDelta[randDirection].x; pathPos.y += CoordsDirectionDelta[randDirection].y; - Direction backwardsDirection = direction_reverse(randDirection); + Direction backwardsDirection = DirectionReverse(randDirection); - if (!fence_in_the_way(pathPos, backwardsDirection)) + if (!WallInTheWay(pathPos, backwardsDirection)) { - if (!map_surface_is_blocked(pathPos)) + if (!MapSurfaceIsBlocked(pathPos)) { return peep_move_one_tile(randDirection, peep); } @@ -210,15 +210,15 @@ static int32_t guest_surface_path_finding(Peep& peep) pathPos.x = peep.NextLoc.x; pathPos.y = peep.NextLoc.y; - if (!fence_in_the_way(pathPos, randDirection)) + if (!WallInTheWay(pathPos, randDirection)) { pathPos.x += CoordsDirectionDelta[randDirection].x; pathPos.y += CoordsDirectionDelta[randDirection].y; - Direction backwardsDirection = direction_reverse(randDirection); + Direction backwardsDirection = DirectionReverse(randDirection); - if (!fence_in_the_way(pathPos, backwardsDirection)) + if (!WallInTheWay(pathPos, backwardsDirection)) { - if (!map_surface_is_blocked(pathPos)) + if (!MapSurfaceIsBlocked(pathPos)) { return peep_move_one_tile(randDirection, peep); } @@ -230,15 +230,15 @@ static int32_t guest_surface_path_finding(Peep& peep) pathPos.x = peep.NextLoc.x; pathPos.y = peep.NextLoc.y; - if (!fence_in_the_way(pathPos, randDirection)) + if (!WallInTheWay(pathPos, randDirection)) { pathPos.x += CoordsDirectionDelta[randDirection].x; pathPos.y += CoordsDirectionDelta[randDirection].y; - Direction backwardsDirection = direction_reverse(randDirection); + Direction backwardsDirection = DirectionReverse(randDirection); - if (!fence_in_the_way(pathPos, backwardsDirection)) + if (!WallInTheWay(pathPos, backwardsDirection)) { - if (!map_surface_is_blocked(pathPos)) + if (!MapSurfaceIsBlocked(pathPos)) { return peep_move_one_tile(randDirection, peep); } @@ -280,7 +280,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, PathElement } loc += TileDirectionDelta[chosenDirection]; - nextTileElement = map_get_first_element_at(loc); + nextTileElement = MapGetFirstElementAt(loc); do { if (nextTileElement == nullptr) @@ -330,7 +330,7 @@ static uint8_t footpath_element_dest_in_dir(TileCoordsXYZ loc, Direction chosenD return PATH_SEARCH_LIMIT_REACHED; loc += TileDirectionDelta[chosenDirection]; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { return PATH_SEARCH_FAILED; @@ -388,7 +388,7 @@ static uint8_t footpath_element_dest_in_dir(TileCoordsXYZ loc, Direction chosenD return PATH_SEARCH_WIDE; uint8_t edges = path_get_permitted_edges(tileElement->AsPath()); - edges &= ~(1 << direction_reverse(chosenDirection)); + edges &= ~(1 << DirectionReverse(chosenDirection)); loc.z = tileElement->base_height; for (Direction dir : ALL_DIRECTIONS) @@ -742,7 +742,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); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { return; @@ -1005,7 +1005,7 @@ static void peep_pathfind_heuristic_search( #endif // defined(DEBUG_LEVEL_2) && DEBUG_LEVEL_2 /* Remove the reverse edge (i.e. the edge back to the previous map element.) */ - edges &= ~(1 << direction_reverse(test_edge)); + edges &= ~(1 << DirectionReverse(test_edge)); int32_t next_test_edge = bitscanforward(edges); @@ -1286,7 +1286,7 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p #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); + TileElement* dest_tile_element = MapGetFirstElementAt(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 @@ -1405,7 +1405,7 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p /* 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 != goal) + if (!DirectionValid(peep.PathfindGoal.direction) || peep.PathfindGoal != goal) { peep.PathfindGoal = { goal, 0 }; @@ -1590,7 +1590,7 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p if (isThin) { - for (int32_t i = 0; i < 4; ++i) + for (std::size_t i = 0; i < peep.PathfindHistory.size(); ++i) { if (peep.PathfindHistory[i] == loc) { @@ -1599,13 +1599,13 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p peep.PathfindHistory[i].direction &= ~(1 << chosen_edge); /* Also remove the edge through which the peep * entered the junction from those left to try. */ - peep.PathfindHistory[i].direction &= ~(1 << direction_reverse(peep.PeepDirection)); + peep.PathfindHistory[i].direction &= ~(1 << DirectionReverse(peep.PeepDirection)); #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (_pathFindDebug) { log_verbose( - "Updating existing pf_history (in index: %d) for %d,%d,%d without entry edge %d & exit edge %d.", i, - loc.x, loc.y, loc.z, direction_reverse(peep.PeepDirection), chosen_edge); + "Updating existing pf_history (in index: %u) for %d,%d,%d without entry edge %d & exit edge %d.", i, + loc.x, loc.y, loc.z, DirectionReverse(peep.PeepDirection), chosen_edge); } #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 return chosen_edge; @@ -1621,13 +1621,13 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p peep.PathfindHistory[i].direction &= ~(1 << chosen_edge); /* Also remove the edge through which the peep * entered the junction from those left to try. */ - peep.PathfindHistory[i].direction &= ~(1 << direction_reverse(peep.PeepDirection)); + peep.PathfindHistory[i].direction &= ~(1 << DirectionReverse(peep.PeepDirection)); #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (_pathFindDebug) { log_verbose( "Storing new pf_history (in index: %d) for %d,%d,%d without entry edge %d & exit edge %d.", i, loc.x, loc.y, - loc.z, direction_reverse(peep.PeepDirection), chosen_edge); + loc.z, DirectionReverse(peep.PeepDirection), chosen_edge); } #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 } @@ -1747,7 +1747,7 @@ int32_t OriginalPathfinding::GuestPathFindParkEntranceLeaving(Peep& peep, uint8_ if (peep.PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) { entranceGoal = peep.PathfindGoal; - auto* entranceElement = map_get_park_entrance_element_at(entranceGoal.ToCoordsXYZ(), false); + auto* entranceElement = MapGetParkEntranceElementAt(entranceGoal.ToCoordsXYZ(), false); // If entrance no longer exists, choose a new one if (entranceElement == nullptr) { @@ -1797,7 +1797,7 @@ int32_t OriginalPathfinding::GuestPathFindParkEntranceLeaving(Peep& peep, uint8_ static void get_ride_queue_end(TileCoordsXYZ& loc) { TileCoordsXY queueEnd = { 0, 0 }; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { @@ -1820,7 +1820,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) if (!found) return; - Direction direction = direction_reverse(tileElement->GetDirection()); + Direction direction = DirectionReverse(tileElement->GetDirection()); TileElement* lastPathElement = nullptr; TileElement* firstPathElement = nullptr; @@ -1845,7 +1845,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) } nextTile += TileDirectionDelta[direction]; - tileElement = map_get_first_element_at(nextTile); + tileElement = MapGetFirstElementAt(nextTile); found = false; if (tileElement == nullptr) break; @@ -1875,7 +1875,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) if (!tileElement->AsPath()->IsSloped()) break; - if (tileElement->AsPath()->GetSlopeDirection() != direction_reverse(direction)) + if (tileElement->AsPath()->GetSlopeDirection() != DirectionReverse(direction)) break; baseZ -= 2; @@ -1890,7 +1890,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) if (!tileElement->AsPath()->IsQueue()) break; - if (!(tileElement->AsPath()->GetEdges() & (1 << direction_reverse(direction)))) + if (!(tileElement->AsPath()->GetEdges() & (1 << DirectionReverse(direction)))) break; if (firstPathElement == nullptr) @@ -1906,7 +1906,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) if (tileElement->AsPath()->GetEdges() & (1 << (direction))) continue; - direction = direction_reverse(direction); + direction = DirectionReverse(direction); // More queue to go. if (tileElement->AsPath()->GetEdges() & (1 << (direction))) continue; @@ -1988,7 +1988,7 @@ int32_t OriginalPathfinding::CalculateNextDestination(Guest& peep) TileCoordsXYZ loc{ peep.NextLoc }; - auto* pathElement = map_get_path_element_at(loc); + auto* pathElement = MapGetPathElementAt(loc); if (pathElement == nullptr) { return 1; @@ -2024,7 +2024,7 @@ int32_t OriginalPathfinding::CalculateNextDestination(Guest& peep) edges = adjustedEdges; } - int32_t direction = direction_reverse(peep.PeepDirection); + int32_t direction = DirectionReverse(peep.PeepDirection); // Check if in a dead end (i.e. only edge is where the peep came from) if (!(edges & ~(1 << direction))) { @@ -2280,7 +2280,7 @@ bool GuestPathfinding::IsValidPathZAndDirection(TileElement* tileElement, int32_ } else { - slopeDirection = direction_reverse(slopeDirection); + slopeDirection = DirectionReverse(slopeDirection); if (slopeDirection != currentDirection) return false; if (currentZ != tileElement->base_height + 2) diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 4d9e356edb..70baaae795 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -104,13 +104,13 @@ static bool OnCrash( { if (!succeeded) { - constexpr const char* DumpFailedMessage = "Failed to create the dump. Please file an issue with OpenRCT2 on GitHub and " - "provide latest save, and provide " - "information about what you did before the crash occurred."; - printf("%s\n", DumpFailedMessage); + constexpr const wchar_t* DumpFailedMessage = L"Failed to create the dump. Please file an issue with OpenRCT2 on GitHub " + L"and provide latest save, and provide information about what you did " + L"before the crash occurred."; + wprintf(L"%ls\n", DumpFailedMessage); if (!gOpenRCT2SilentBreakpad) { - MessageBoxA(nullptr, DumpFailedMessage, OPENRCT2_NAME, MB_OK | MB_ICONERROR); + MessageBoxW(nullptr, DumpFailedMessage, L"" OPENRCT2_NAME, MB_OK | MB_ICONERROR); } return succeeded; } @@ -198,7 +198,7 @@ static bool OnCrash( } auto configFilePathUTF8 = String::ToUtf8(configFilePath); - if (config_save(configFilePathUTF8)) + if (ConfigSave(configFilePathUTF8)) { _uploadFiles[L"attachment_config.ini"] = configFilePath; } diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index 1ddeaa52eb..de937c14ce 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -417,7 +417,7 @@ namespace Platform // Epoch starts from: 1970-01-01T00:00:00Z // Convert to ticks from 0001-01-01T00:00:00Z - uint64_t utcEpochTicks = static_cast(tv.tv_sec) * 10000000ULL + tv.tv_usec * 10; + uint64_t utcEpochTicks = static_cast(tv.tv_sec) * 10000000uLL + tv.tv_usec * 10; datetime64 utcNow = epochAsTicks + utcEpochTicks; return utcNow; } diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 663f8ea56e..0cdfc37089 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -45,7 +45,7 @@ static uint32_t _frequency = 0; static LARGE_INTEGER _entryTimestamp; // The name of the mutex used to prevent multiple instances of the game from running -static constexpr char SINGLE_INSTANCE_MUTEX_NAME[] = "RollerCoaster Tycoon 2_GSKMUTEX"; +static constexpr wchar_t SINGLE_INSTANCE_MUTEX_NAME[] = L"RollerCoaster Tycoon 2_GSKMUTEX"; # define SOFTWARE_CLASSES L"Software\\Classes" # define MUI_CACHE L"Local Settings\\Software\\Microsoft\\Windows\\Shell\\MuiCache" @@ -224,7 +224,7 @@ namespace Platform bool IsOSVersionAtLeast(uint32_t major, uint32_t minor, uint32_t build) { bool result = false; - auto hModule = GetModuleHandleA("ntdll.dll"); + auto hModule = GetModuleHandleW(L"ntdll.dll"); if (hModule != nullptr) { using RtlGetVersionPtr = long(WINAPI*)(PRTL_OSVERSIONINFOW); @@ -470,7 +470,7 @@ namespace Platform if (RegOpenKeyW(HKEY_CURRENT_USER, SOFTWARE_CLASSES, &hRootKey) == ERROR_SUCCESS) { // [hRootKey\.ext] - RegDeleteTreeA(hRootKey, extension); + RegDeleteTreeW(hRootKey, String::ToWideChar(extension).c_str()); // [hRootKey\OpenRCT2.ext] auto progIdName = get_progIdName(extension); @@ -524,7 +524,7 @@ namespace Platform FILETIME ftCreate, ftAccess, ftWrite; if (GetFileTime(hFile, &ftCreate, &ftAccess, &ftWrite)) { - lastModified = (static_cast(ftWrite.dwHighDateTime) << 32ULL) + lastModified = (static_cast(ftWrite.dwHighDateTime) << 32uLL) | static_cast(ftWrite.dwLowDateTime); } CloseHandle(hFile); @@ -590,109 +590,81 @@ namespace Platform uint16_t GetLocaleLanguage() { - CHAR langCode[4]; - - if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVLANGNAME, reinterpret_cast(&langCode), sizeof(langCode)) - == 0) + wchar_t langCode[LOCALE_NAME_MAX_LENGTH]; + if (GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, langCode, static_cast(std::size(langCode))) == 0) { return LANGUAGE_UNDEFINED; } - if (strcmp(langCode, "ENG") == 0) + const std::pair supportedLocales[] = { + { L"ar", /*LANGUAGE_ARABIC*/ LANGUAGE_UNDEFINED }, // Experimental, don't risk offering it by default yet + { L"ca", LANGUAGE_CATALAN }, + { L"zh-Hans", LANGUAGE_CHINESE_SIMPLIFIED }, // May not be accurate enough + { L"zh-Hant", LANGUAGE_CHINESE_TRADITIONAL }, // May not be accurate enough + { L"cs", LANGUAGE_CZECH }, + { L"da", LANGUAGE_DANISH }, + { L"de", LANGUAGE_GERMAN }, + { L"en-GB", LANGUAGE_ENGLISH_UK }, + { L"en-US", LANGUAGE_ENGLISH_US }, + { L"eo", LANGUAGE_ESPERANTO }, + { L"es", LANGUAGE_SPANISH }, + { L"fr", LANGUAGE_FRENCH }, + { L"it", LANGUAGE_ITALIAN }, + { L"ja", LANGUAGE_JAPANESE }, + { L"ko", LANGUAGE_KOREAN }, + { L"hu", LANGUAGE_HUNGARIAN }, + { L"nl", LANGUAGE_DUTCH }, + { L"no", LANGUAGE_NORWEGIAN }, + { L"pl", LANGUAGE_POLISH }, + { L"pt-BR", LANGUAGE_PORTUGUESE_BR }, + { L"ru", LANGUAGE_RUSSIAN }, + { L"fi", LANGUAGE_FINNISH }, + { L"sv", LANGUAGE_SWEDISH }, + { L"tr", LANGUAGE_TURKISH }, + { L"vi", LANGUAGE_VIETNAMESE }, + }; + static_assert( + std::size(supportedLocales) == LANGUAGE_COUNT - 1, "GetLocaleLanguage: List of languages does not match the enum!"); + + for (const auto& locale : supportedLocales) { - return LANGUAGE_ENGLISH_UK; - } - if (strcmp(langCode, "ENU") == 0) - { - return LANGUAGE_ENGLISH_US; - } - if (strcmp(langCode, "DEU") == 0) - { - return LANGUAGE_GERMAN; - } - if (strcmp(langCode, "NLD") == 0) - { - return LANGUAGE_DUTCH; - } - if (strcmp(langCode, "FRA") == 0) - { - return LANGUAGE_FRENCH; - } - if (strcmp(langCode, "HUN") == 0) - { - return LANGUAGE_HUNGARIAN; - } - if (strcmp(langCode, "PLK") == 0) - { - return LANGUAGE_POLISH; - } - if (strcmp(langCode, "ESP") == 0) - { - return LANGUAGE_SPANISH; - } - if (strcmp(langCode, "SVE") == 0) - { - return LANGUAGE_SWEDISH; - } - if (strcmp(langCode, "ITA") == 0) - { - return LANGUAGE_ITALIAN; - } - if (strcmp(langCode, "POR") == 0) - { - return LANGUAGE_PORTUGUESE_BR; - } - if (strcmp(langCode, "FIN") == 0) - { - return LANGUAGE_FINNISH; - } - if (strcmp(langCode, "NOR") == 0) - { - return LANGUAGE_NORWEGIAN; - } - if (strcmp(langCode, "DAN") == 0) - { - return LANGUAGE_DANISH; + if (wcsncmp(langCode, locale.first.data(), locale.first.length()) == 0) + { + return locale.second; + } } return LANGUAGE_UNDEFINED; } CurrencyType GetLocaleCurrency() { - CHAR currCode[4]; - if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SINTLSYMBOL, reinterpret_cast(&currCode), sizeof(currCode)) == 0) + wchar_t currCode[9]; + if (GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SINTLSYMBOL, currCode, static_cast(std::size(currCode))) == 0) { return Platform::GetCurrencyValue(nullptr); } - return Platform::GetCurrencyValue(currCode); + return Platform::GetCurrencyValue(String::ToUtf8(currCode).c_str()); } MeasurementFormat GetLocaleMeasurementFormat() { UINT measurement_system; - if (GetLocaleInfo( - LOCALE_USER_DEFAULT, LOCALE_IMEASURE | LOCALE_RETURN_NUMBER, reinterpret_cast(&measurement_system), - sizeof(measurement_system)) + if (GetLocaleInfoEx( + LOCALE_NAME_USER_DEFAULT, LOCALE_IMEASURE | LOCALE_RETURN_NUMBER, reinterpret_cast(&measurement_system), + sizeof(measurement_system) / sizeof(wchar_t)) == 0) { return MeasurementFormat::Metric; } - switch (measurement_system) - { - case 1: - return MeasurementFormat::Imperial; - case 0: - default: - return MeasurementFormat::Metric; - } + return measurement_system == 1 ? MeasurementFormat::Imperial : MeasurementFormat::Metric; } uint8_t GetLocaleDateFormat() { // Retrieve short date format, eg "MM/dd/yyyy" - wchar_t dateFormat[20]; + wchar_t dateFormat[80]; if (GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SSHORTDATE, dateFormat, static_cast(std::size(dateFormat))) == 0) { @@ -705,8 +677,8 @@ namespace Platform // in our date formats. // https://msdn.microsoft.com/en-us/library/windows/desktop/dd317787(v=vs.85).aspx // - wchar_t first[sizeof(dateFormat)]; - wchar_t second[sizeof(dateFormat)]; + wchar_t first[std::size(dateFormat)]; + wchar_t second[std::size(dateFormat)]; if (swscanf_s( dateFormat, L"%l[dyM]%*l[^dyM]%l[dyM]%*l[^dyM]%*l[dyM]", first, static_cast(std::size(first)), second, static_cast(std::size(second))) @@ -715,17 +687,17 @@ namespace Platform return DATE_FORMAT_DAY_MONTH_YEAR; } - if (wcsncmp(L"d", first, 1) == 0) + if (first[0] == L'd') { return DATE_FORMAT_DAY_MONTH_YEAR; } - if (wcsncmp(L"M", first, 1) == 0) + if (first[0] == L'M') { return DATE_FORMAT_MONTH_DAY_YEAR; } - if (wcsncmp(L"y", first, 1) == 0) + if (first[0] == L'y') { - if (wcsncmp(L"d", second, 1) == 0) + if (second[0] == 'd') { return DATE_FORMAT_YEAR_DAY_MONTH; } @@ -742,21 +714,18 @@ namespace Platform { UINT fahrenheit; - // GetLocaleInfo will set fahrenheit to 1 if the locale on this computer + // GetLocaleInfoEx will set fahrenheit to 1 if the locale on this computer // uses the United States measurement system or 0 otherwise. - if (GetLocaleInfo( - LOCALE_USER_DEFAULT, LOCALE_IMEASURE | LOCALE_RETURN_NUMBER, reinterpret_cast(&fahrenheit), - sizeof(fahrenheit)) + if (GetLocaleInfoEx( + LOCALE_NAME_USER_DEFAULT, LOCALE_IMEASURE | LOCALE_RETURN_NUMBER, reinterpret_cast(&fahrenheit), + sizeof(fahrenheit) / sizeof(wchar_t)) == 0) { // Assume celsius by default if function call fails return TemperatureUnit::Celsius; } - if (fahrenheit) - return TemperatureUnit::Fahrenheit; - - return TemperatureUnit::Celsius; + return fahrenheit == 1 ? TemperatureUnit::Fahrenheit : TemperatureUnit::Celsius; } bool ProcessIsElevated() @@ -817,18 +786,15 @@ namespace Platform bool EnsureDirectoryExists(u8string_view path) { - if (Path::DirectoryExists(path)) - return 1; - auto wPath = String::ToWideChar(path); auto success = CreateDirectoryW(wPath.c_str(), nullptr); - return success != FALSE; + return success != FALSE || GetLastError() == ERROR_ALREADY_EXISTS; } bool LockSingleInstance() { // Check if operating system mutex exists - HANDLE mutex = CreateMutex(nullptr, FALSE, SINGLE_INSTANCE_MUTEX_NAME); + HANDLE mutex = CreateMutexW(nullptr, FALSE, SINGLE_INSTANCE_MUTEX_NAME); if (mutex == nullptr) { log_error("unable to create mutex"); @@ -872,7 +838,7 @@ namespace Platform ULARGE_INTEGER ull{}; ull.LowPart = localFileTime.dwLowDateTime; ull.HighPart = localFileTime.dwHighDateTime; - return ull.QuadPart / 10000000ULL - 11644473600ULL; + return ull.QuadPart / 10000000uLL - 11644473600uLL; } } return 0; @@ -883,12 +849,12 @@ namespace Platform // Get file time FILETIME fileTime; GetSystemTimeAsFileTime(&fileTime); - uint64_t fileTime64 = (static_cast(fileTime.dwHighDateTime) << 32ULL) + uint64_t fileTime64 = (static_cast(fileTime.dwHighDateTime) << 32uLL) | (static_cast(fileTime.dwLowDateTime)); // File time starts from: 1601-01-01T00:00:00Z // Convert to start from: 0001-01-01T00:00:00Z - datetime64 utcNow = fileTime64 - 504911232000000000ULL; + datetime64 utcNow = fileTime64 - 504911232000000000uLL; return utcNow; } @@ -902,11 +868,11 @@ namespace Platform { // [hRootKey\openrct2] HKEY hClassKey; - if (RegCreateKeyA(hRootKey, "openrct2", &hClassKey) == ERROR_SUCCESS) + if (RegCreateKeyW(hRootKey, L"openrct2", &hClassKey) == ERROR_SUCCESS) { - if (RegSetValueA(hClassKey, nullptr, REG_SZ, "URL:openrct2", 0) == ERROR_SUCCESS) + if (RegSetValueW(hClassKey, nullptr, REG_SZ, L"URL:openrct2", 0) == ERROR_SUCCESS) { - if (RegSetKeyValueA(hClassKey, nullptr, "URL Protocol", REG_SZ, "", 0) == ERROR_SUCCESS) + if (RegSetKeyValueW(hClassKey, nullptr, L"URL Protocol", REG_SZ, "", 0) == ERROR_SUCCESS) { // [hRootKey\openrct2\shell\open\command] wchar_t exePath[MAX_PATH]; diff --git a/src/openrct2/platform/Platform.macOS.mm b/src/openrct2/platform/Platform.macOS.mm index 5148cd0dd7..5d10f3ab89 100644 --- a/src/openrct2/platform/Platform.macOS.mm +++ b/src/openrct2/platform/Platform.macOS.mm @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2020 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 71c6bf2cc7..461c464ed7 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -1279,6 +1279,3 @@ namespace RCT1 track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, ride_type_t rideType); } // namespace RCT1 - -void load_from_sv4(const char* path); -void load_from_sc4(const char* path); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index c9adc0dee6..2e608ada20 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -196,7 +196,6 @@ namespace RCT1 SetDefaultNames(); determine_ride_entrance_and_exit_locations(); - map_count_remaining_land_rights(); research_determine_first_of_type(); CheatsReset(); @@ -1519,7 +1518,7 @@ namespace RCT1 auto tileAdded = false; if (coords.x < maxSize && coords.y < maxSize) { - // This is the equivalent of map_get_first_element_at(x, y), but on S4 data. + // This is the equivalent of MapGetFirstElementAt(x, y), but on S4 data. RCT12TileElement* srcElement = tilePointerIndex.GetFirstElementAt(coords); do { @@ -1693,6 +1692,11 @@ namespace RCT1 dst2->SetMazeEntry(src2->GetMazeEntry()); } + if (TrackTypeMustBeMadeInvisible(rideType, trackType)) + { + dst->SetInvisible(true); + } + return 1; } case TileElementType::SmallScenery: @@ -2229,7 +2233,7 @@ namespace RCT1 if (rideEntry != nullptr) { - auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); + auto rideType = rideEntry->GetFirstNonNullRideType(); dst->entryIndex = entryIndex; dst->baseRideType = rideType; dst->type = Research::EntryType::Ride; @@ -2248,7 +2252,7 @@ namespace RCT1 if (rideEntry != nullptr) { - auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); + auto rideType = rideEntry->GetFirstNonNullRideType(); dst->entryIndex = entryIndex; dst->baseRideType = rideType; dst->type = Research::EntryType::Ride; @@ -2408,8 +2412,8 @@ namespace RCT1 { gParkEntrances.clear(); tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it) && gParkEntrances.size() < Limits::MaxParkEntrances) + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it) && gParkEntrances.size() < Limits::MaxParkEntrances) { TileElement* element = it.element; @@ -2538,17 +2542,17 @@ namespace RCT1 station.Entrance = entranceCoords; station.Exit = exitCoords; - auto entranceElement = map_get_ride_exit_element_at(entranceCoords.ToCoordsXYZD(), false); + auto entranceElement = MapGetRideExitElementAt(entranceCoords.ToCoordsXYZD(), false); entranceElement->SetEntranceType(ENTRANCE_TYPE_RIDE_ENTRANCE); - auto exitElement = map_get_ride_entrance_element_at(exitCoords.ToCoordsXYZD(), false); + auto exitElement = MapGetRideEntranceElementAt(exitCoords.ToCoordsXYZD(), false); exitElement->SetEntranceType(ENTRANCE_TYPE_RIDE_EXIT); // Trigger footpath update - footpath_queue_chain_reset(); - footpath_connect_edges( + FootpathQueueChainReset(); + FootpathConnectEdges( entranceCoords.ToCoordsXY(), reinterpret_cast(entranceElement), GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - footpath_update_queue_chains(); + FootpathUpdateQueueChains(); } } } @@ -2563,7 +2567,7 @@ namespace RCT1 { for (int32_t y = 0; y < Limits::MaxMapSize; y++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do @@ -3082,21 +3086,3 @@ std::unique_ptr ParkImporter::CreateS4() { return std::make_unique(); } - -void load_from_sv4(const utf8* path) -{ - auto& objectMgr = GetContext()->GetObjectManager(); - auto s4Importer = std::make_unique(); - auto result = s4Importer->LoadSavedGame(path); - objectMgr.LoadObjects(result.RequiredObjects); - s4Importer->Import(); -} - -void load_from_sc4(const utf8* path) -{ - auto& objectMgr = GetContext()->GetObjectManager(); - auto s4Importer = std::make_unique(); - auto result = s4Importer->LoadScenario(path); - objectMgr.LoadObjects(result.RequiredObjects); - s4Importer->Import(); -} diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index 0e1a026bd5..581449a5e6 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -16,7 +16,6 @@ #include "../rct1/RCT1.h" #include "../rct1/Tables.h" #include "../rct12/SawyerChunkReader.h" -#include "../rct12/SawyerEncoding.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../ride/TrackDesign.h" @@ -53,12 +52,6 @@ namespace RCT1 bool LoadFromStream(OpenRCT2::IStream* stream) override { - auto checksumType = SawyerEncoding::ValidateTrackChecksum(stream); - if (!gConfigGeneral.allow_loading_with_incorrect_checksum && checksumType == RCT12TrackDesignVersion::unknown) - { - throw IOException("Invalid checksum."); - } - auto chunkReader = SawyerChunkReader(stream); auto data = chunkReader.ReadChunkTrack(); _stream.WriteArray(reinterpret_cast(data->GetData()), data->GetLength()); diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 89fe9f51f8..004526959a 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -30,7 +30,25 @@ using namespace OpenRCT2; RCT12TileElementType RCT12TileElementBase::GetType() const { - return static_cast((this->type & TILE_ELEMENT_TYPE_MASK) >> 2); + auto elem_type = static_cast((this->type & TILE_ELEMENT_TYPE_MASK) >> 2); + switch (elem_type) + { + case RCT12TileElementType::Surface: + case RCT12TileElementType::Path: + case RCT12TileElementType::Track: + case RCT12TileElementType::SmallScenery: + case RCT12TileElementType::Entrance: + case RCT12TileElementType::Wall: + case RCT12TileElementType::LargeScenery: + case RCT12TileElementType::Banner: + case RCT12TileElementType::Corrupt: + case RCT12TileElementType::EightCarsCorrupt14: + case RCT12TileElementType::EightCarsCorrupt15: + return elem_type; + default: + // Most corrupt elements were set to 0x255, but not all. Fallback to corrupt element if encountered unknown type. + return RCT12TileElementType::EightCarsCorrupt15; + } } uint8_t RCT12TileElementBase::GetDirection() const diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 16b3e24dfc..ad68b6c38d 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -290,7 +290,9 @@ constexpr TileElementType ToOpenRCT2TileElementType(RCT12TileElementType rct12ty return static_cast(rct12type); default: - throw std::runtime_error("This tile element type cannot be converted directly!"); + throw std::runtime_error( + "This tile element type cannot be converted directly! Tile element type: " + + std::to_string(static_cast(rct12type))); } } diff --git a/src/openrct2/rct12/SawyerEncoding.cpp b/src/openrct2/rct12/SawyerEncoding.cpp deleted file mode 100644 index 428aab1a45..0000000000 --- a/src/openrct2/rct12/SawyerEncoding.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014-2022 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 "SawyerEncoding.h" - -#include "../core/IStream.hpp" -#include "../core/Numerics.hpp" -#include "RCT12.h" - -#include - -namespace SawyerEncoding -{ - bool ValidateChecksum(OpenRCT2::IStream* stream) - { - uint64_t initialPosition = stream->GetPosition(); - uint64_t dataSize = stream->GetLength() - initialPosition; - if (dataSize < 8) - { - return false; - } - dataSize -= 4; - - try - { - // Calculate checksum - uint32_t checksum = 0; - do - { - uint8_t buffer[4096]; - uint64_t bufferSize = std::min(dataSize, sizeof(buffer)); - stream->Read(buffer, bufferSize); - - for (uint64_t i = 0; i < bufferSize; i++) - { - checksum += buffer[i]; - } - - dataSize -= bufferSize; - } while (dataSize != 0); - - // Read file checksum - uint32_t fileChecksum = stream->ReadValue(); - - // Rewind back to original position - stream->SetPosition(initialPosition); - return checksum == fileChecksum; - } - catch (const std::exception&) - { - // Rewind back to original position - stream->SetPosition(initialPosition); - return false; - } - } - - // Returns version number - RCT12TrackDesignVersion ValidateTrackChecksum(OpenRCT2::IStream* stream) - { - uint64_t initialPosition = stream->GetPosition(); - uint64_t dataSize = stream->GetLength() - initialPosition; - - if (dataSize < 4) - { - return RCT12TrackDesignVersion::unknown; - } - dataSize -= 4; - - try - { - const auto buffer = stream->ReadArray(dataSize); - const auto* data = buffer.get(); - uint32_t checksum = 0; - for (size_t i = 0; i < dataSize; i++, ++data) - { - uint8_t newByte = ((checksum & 0xFF) + *data) & 0xFF; - checksum = (checksum & 0xFFFFFF00) + newByte; - checksum = Numerics::rol32(checksum, 3); - } - - uint32_t fileChecksum = stream->ReadValue(); - // Rewind back to original position - stream->SetPosition(initialPosition); - - if (checksum - 0x1D4C1 == fileChecksum) - return RCT12TrackDesignVersion::TD6; - if (checksum - 0x1A67C == fileChecksum) - return RCT12TrackDesignVersion::TD4; - if (checksum - 0x1A650 == fileChecksum) - return RCT12TrackDesignVersion::TD4; - - return RCT12TrackDesignVersion::unknown; - } - catch (const std::exception&) - { - // Rewind back to original position - stream->SetPosition(initialPosition); - return RCT12TrackDesignVersion::unknown; - } - } -} // namespace SawyerEncoding diff --git a/src/openrct2/rct2/Limits.h b/src/openrct2/rct2/Limits.h index e56c01a4ff..0a22bc1860 100644 --- a/src/openrct2/rct2/Limits.h +++ b/src/openrct2/rct2/Limits.h @@ -39,7 +39,7 @@ namespace RCT2::Limits constexpr const uint8_t MaxBannerObjects = 32; constexpr const uint8_t MaxPathObjects = 16; constexpr const uint8_t MaxPathAdditionObjects = 15; - constexpr const uint8_t MaxScenereyGroupObjects = 19; + constexpr const uint8_t MaxSceneryGroupObjects = 19; constexpr const uint8_t MaxParkEntranceObjects = 1; constexpr const uint8_t MaxWaterObjects = 1; constexpr const uint8_t MaxScenarioTextObjects = 1; diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index 190b7ae51d..408404752e 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -216,6 +216,16 @@ namespace RCT2 "rct2.footpath_railings.concrete" }, { "PATHCRZY", "rct1ll.footpath_surface.tiles_green", "rct1aa.footpath_surface.queue_green", "rct2.footpath_railings.concrete" }, + + // Custom path mapping + { "PATHINVS", "openrct2.footpath_surface.invisible", "openrct2.footpath_surface.queue_invisible", + "openrct2.footpath_railings.invisible" }, + { "PATHCLR ", "openrct2.footpath_surface.invisible", "openrct2.footpath_surface.queue_invisible", + "openrct2.footpath_railings.invisible" }, + { "PAT25MKY", "openrct2.footpath_surface.invisible", "openrct2.footpath_surface.queue_invisible", + "openrct2.footpath_railings.invisible" }, + { "JAINVSFP", "openrct2.footpath_surface.invisible", "openrct2.footpath_surface.queue_invisible", + "openrct2.footpath_railings.invisible" }, }; const FootpathMapping* GetFootpathSurfaceId(const ObjectEntryDescriptor& desc, bool ideallyLoaded, bool isQueue) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index b642d6e398..2dab128e9a 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -35,7 +35,7 @@ namespace RCT2 Limits::MaxBannerObjects + Limits::MaxPathObjects + Limits::MaxPathAdditionObjects + - Limits::MaxScenereyGroupObjects + + Limits::MaxSceneryGroupObjects + Limits::MaxParkEntranceObjects + Limits::MaxWaterObjects + Limits::MaxScenarioTextObjects; @@ -51,7 +51,7 @@ namespace RCT2 Limits::MaxBannerObjects, Limits::MaxPathObjects, Limits::MaxPathAdditionObjects, - Limits::MaxScenereyGroupObjects, + Limits::MaxSceneryGroupObjects, Limits::MaxParkEntranceObjects, Limits::MaxWaterObjects, Limits::MaxScenarioTextObjects, @@ -815,7 +815,7 @@ namespace RCT2 rct_object_entry BannerObjects[Limits::MaxBannerObjects]; rct_object_entry PathObjects[Limits::MaxPathObjects]; rct_object_entry PathAdditionObjects[Limits::MaxPathAdditionObjects]; - rct_object_entry SceneryGroupObjects[Limits::MaxScenereyGroupObjects]; + rct_object_entry SceneryGroupObjects[Limits::MaxSceneryGroupObjects]; rct_object_entry ParkEntranceObjects[Limits::MaxParkEntranceObjects]; rct_object_entry WaterObjects[Limits::MaxWaterObjects]; rct_object_entry ScenarioTextObjects[Limits::MaxScenarioTextObjects]; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index f6a7bb693b..1ab1bf8d4b 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -52,7 +52,6 @@ #include "../rct12/EntryList.h" #include "../rct12/RCT12.h" #include "../rct12/SawyerChunkReader.h" -#include "../rct12/SawyerEncoding.h" #include "../rct2/RCT2.h" #include "../ride/Ride.h" #include "../ride/RideData.h" @@ -141,12 +140,6 @@ namespace RCT2 OpenRCT2::IStream* stream, bool isScenario, [[maybe_unused]] bool skipObjectCheck = false, const utf8* path = String::Empty) override { - if (isScenario && !gConfigGeneral.allow_loading_with_incorrect_checksum - && !SawyerEncoding::ValidateChecksum(stream)) - { - throw IOException("Invalid checksum."); - } - auto chunkReader = SawyerChunkReader(stream); chunkReader.ReadChunk(&_s6.header, sizeof(_s6.header)); @@ -506,9 +499,8 @@ namespace RCT2 // pad_13CE778 // Fix and set dynamic variables - map_strip_ghost_flag_from_elements(); + MapStripGhostFlagFromElements(); ConvertScenarioStringsToUTF8(); - map_count_remaining_land_rights(); determine_ride_entrance_and_exit_locations(); park.Name = GetUserString(_s6.park_name); @@ -660,7 +652,7 @@ namespace RCT2 }; for (const auto& tile : tilesToUncovered) { - auto* tileElement = map_get_first_element_at(tile); + auto* tileElement = MapGetFirstElementAt(tile); if (tileElement == nullptr) continue; @@ -685,7 +677,7 @@ namespace RCT2 }; for (const auto& tile : tilesToCovered) { - auto* tileElement = map_get_first_element_at(tile); + auto* tileElement = MapGetFirstElementAt(tile); if (tileElement == nullptr) continue; @@ -751,7 +743,7 @@ namespace RCT2 ObjectEntryIndex originalRideType = src->type; if (rideEntry != nullptr) { - originalRideType = ride_entry_get_first_non_null_ride_type(rideEntry); + originalRideType = rideEntry->GetFirstNonNullRideType(); } const auto isFlatRide = GetRideTypeDescriptor(originalRideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE); _isFlatRide.set(static_cast(index), isFlatRide); @@ -1450,6 +1442,11 @@ namespace RCT2 dst2->SetSeatRotation(src2->GetSeatRotation()); } + if (TrackTypeMustBeMadeInvisible(rideType, dst2->GetTrackType())) + { + dst->SetInvisible(true); + } + break; } case RCT12TileElementType::SmallScenery: @@ -1976,7 +1973,7 @@ namespace RCT2 // ride is on. It's possible to create unwanted behavior if a user layers spinning control track on top of // booster track but this is unlikely since only two rides have spinning control track - by default they load as // booster - TileElement* tileElement2 = map_get_track_element_at_of_type_seq( + TileElement* tileElement2 = MapGetTrackElementAtOfTypeSeq( dst->TrackLocation, TrackElemType::RotationControlToggle, 0); if (tileElement2 != nullptr) @@ -2316,85 +2313,3 @@ std::unique_ptr ParkImporter::CreateS6(IObjectRepository& objectR { return std::make_unique(objectRepository); } - -static void show_error(uint8_t errorType, StringId errorStringId) -{ - if (errorType == ERROR_TYPE_GENERIC) - { - context_show_error(errorStringId, STR_NONE, {}); - } - context_show_error(STR_UNABLE_TO_LOAD_FILE, errorStringId, {}); -} - -void load_from_sv6(const char* path) -{ - auto context = OpenRCT2::GetContext(); - auto s6Importer = std::make_unique(context->GetObjectRepository()); - try - { - auto& objectMgr = context->GetObjectManager(); - auto result = s6Importer->LoadSavedGame(path); - objectMgr.LoadObjects(result.RequiredObjects); - s6Importer->Import(); - game_fix_save_vars(); - AutoCreateMapAnimations(); - EntityTweener::Get().Reset(); - gScreenAge = 0; - gLastAutoSaveUpdate = AUTOSAVE_PAUSE; - } - catch (const ObjectLoadException&) - { - show_error(ERROR_TYPE_FILE_LOAD, STR_FILE_CONTAINS_INVALID_DATA); - } - catch (const IOException& loadError) - { - log_error("Error loading: %s", loadError.what()); - show_error(ERROR_TYPE_FILE_LOAD, STR_GAME_SAVE_FAILED); - } - catch (const UnsupportedRideTypeException&) - { - show_error(ERROR_TYPE_FILE_LOAD, STR_FILE_CONTAINS_UNSUPPORTED_RIDE_TYPES); - } - catch (const std::exception&) - { - show_error(ERROR_TYPE_FILE_LOAD, STR_FILE_CONTAINS_INVALID_DATA); - } -} - -/** - * - * rct2: 0x00676053 - * scenario (ebx) - */ -void load_from_sc6(const char* path) -{ - auto context = OpenRCT2::GetContext(); - auto& objManager = context->GetObjectManager(); - auto s6Importer = std::make_unique(context->GetObjectRepository()); - try - { - auto result = s6Importer->LoadScenario(path); - objManager.LoadObjects(result.RequiredObjects); - s6Importer->Import(); - game_fix_save_vars(); - AutoCreateMapAnimations(); - EntityTweener::Get().Reset(); - return; - } - catch (const ObjectLoadException& loadError) - { - log_error("Error loading: %s", loadError.what()); - show_error(ERROR_TYPE_FILE_LOAD, STR_GAME_SAVE_FAILED); - } - catch (const IOException& loadError) - { - log_error("Error loading: %s", loadError.what()); - show_error(ERROR_TYPE_FILE_LOAD, STR_GAME_SAVE_FAILED); - } - catch (const std::exception&) - { - show_error(ERROR_TYPE_FILE_LOAD, STR_FILE_CONTAINS_INVALID_DATA); - } - gScreenAge = 0; - gLastAutoSaveUpdate = AUTOSAVE_PAUSE; -} diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index 20a40d6120..33a64fdace 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -16,7 +16,6 @@ #include "../object/ObjectRepository.h" #include "../object/RideObject.h" #include "../rct12/SawyerChunkReader.h" -#include "../rct12/SawyerEncoding.h" #include "../ride/Ride.h" #include "../ride/RideData.h" #include "../ride/TrackDesign.h" @@ -57,12 +56,6 @@ namespace RCT2 bool LoadFromStream(OpenRCT2::IStream* stream) override { - if (!gConfigGeneral.allow_loading_with_incorrect_checksum - && SawyerEncoding::ValidateTrackChecksum(stream) != RCT12TrackDesignVersion::TD6) - { - throw IOException("Invalid checksum."); - } - auto chunkReader = SawyerChunkReader(stream); auto data = chunkReader.ReadChunkTrack(); _stream.WriteArray(reinterpret_cast(data->GetData()), data->GetLength()); diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 6033a50484..64a2615f09 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -244,7 +244,7 @@ bool Vehicle::CableLiftUpdateTrackMotionForwards() uint16_t trackTotalProgress = GetTrackProgress(); if (trackProgress >= trackTotalProgress) { - TileElement* trackElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + TileElement* trackElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, trackType, 0); CoordsXYE output; int32_t outputZ; @@ -307,7 +307,7 @@ bool Vehicle::CableLiftUpdateTrackMotionBackwards() if (static_cast(trackProgress) == -1) { auto trackType = GetTrackType(); - TileElement* trackElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + TileElement* trackElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, trackType, 0); auto input = CoordsXYE{ TrackLocation, trackElement }; track_begin_end output; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 353be2f659..dc0302c7d6 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -145,6 +145,11 @@ RideManager::Iterator RideManager::end() return RideManager::Iterator(*this, endIndex, endIndex); } +RideManager::Iterator RideManager::get(RideId rideId) +{ + return RideManager::Iterator(*this, rideId.ToUnderlying(), _rides.size()); +} + RideId GetNextFreeRideId() { auto result = static_cast(_rides.size()); @@ -421,7 +426,7 @@ bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output) TileElement* resultTileElement = nullptr; tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() != TileElementType::Track) @@ -455,7 +460,7 @@ bool ride_try_get_origin_element(const Ride* ride, CoordsXYE* output) { return true; } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); return resultTileElement != nullptr; } @@ -479,7 +484,7 @@ bool track_block_get_next_from_zero( trackPos += CoordsDirectionDelta[direction_start]; } - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) { output->element = nullptr; @@ -553,21 +558,10 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 return false; const auto& ted = GetTrackElementDescriptor(inputElement->GetTrackType()); - const auto* trackBlock = ted.Block; + const auto* trackBlock = ted.GetBlockForSequence(inputElement->GetSequenceIndex()); if (trackBlock == nullptr) return false; - // The sequence index may be higher than the amount of sequences actually present. - // We don’t know the amount of sequences present in the block upfront, but there is an end marker consisting of all 255s. - const auto sequenceIndex = inputElement->GetSequenceIndex(); - for (auto i = 0; i < sequenceIndex; i++) - { - trackBlock++; - - if (trackBlock == nullptr || trackBlock->index == 255) - return false; - } - const auto& trackCoordinate = ted.Coordinates; int32_t x = input->x; @@ -580,7 +574,7 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32 CoordsXY trackCoordOffset = { trackCoordinate.x, trackCoordinate.y }; CoordsXY trackBlockOffset = { trackBlock->x, trackBlock->y }; coords += trackCoordOffset.Rotate(rotation); - coords += trackBlockOffset.Rotate(direction_reverse(rotation)); + coords += trackBlockOffset.Rotate(DirectionReverse(rotation)); OriginZ -= trackBlock->z; OriginZ += trackCoordinate.z_end; @@ -603,7 +597,7 @@ bool track_block_get_previous_from_zero( const CoordsXYZ& startPos, Ride* ride, uint8_t direction, track_begin_end* outTrackBeginEnd) { uint8_t directionStart = direction; - direction = direction_reverse(direction); + direction = DirectionReverse(direction); auto trackPos = startPos; if (!(direction & TRACK_BLOCK_2)) @@ -611,13 +605,13 @@ bool track_block_get_previous_from_zero( trackPos += CoordsDirectionDelta[direction]; } - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) { outTrackBeginEnd->end_x = trackPos.x; outTrackBeginEnd->end_y = trackPos.y; outTrackBeginEnd->begin_element = nullptr; - outTrackBeginEnd->begin_direction = direction_reverse(directionStart); + outTrackBeginEnd->begin_direction = DirectionReverse(directionStart); return false; } @@ -631,12 +625,11 @@ bool track_block_get_previous_from_zero( continue; const auto* ted = &GetTrackElementDescriptor(trackElement->GetTrackType()); - const auto* nextTrackBlock = ted->Block; - if (nextTrackBlock == nullptr) - continue; const auto& nextTrackCoordinate = ted->Coordinates; - nextTrackBlock += trackElement->GetSequenceIndex(); + const auto* nextTrackBlock = ted->GetBlockForSequence(trackElement->GetSequenceIndex()); + if (nextTrackBlock == nullptr) + continue; if ((nextTrackBlock + 1)->index != 255) continue; @@ -660,7 +653,7 @@ bool track_block_get_previous_from_zero( CoordsXY coords = { outTrackBeginEnd->begin_x, outTrackBeginEnd->begin_y }; CoordsXY offsets = { nextTrackCoordinate.x, nextTrackCoordinate.y }; - coords += offsets.Rotate(direction_reverse(nextRotation)); + coords += offsets.Rotate(DirectionReverse(nextRotation)); outTrackBeginEnd->begin_x = coords.x; outTrackBeginEnd->begin_y = coords.y; @@ -673,7 +666,7 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->begin_z += nextTrackBlock2->z - nextTrackBlock->z; outTrackBeginEnd->begin_direction = nextRotation; - outTrackBeginEnd->end_direction = direction_reverse(directionStart); + outTrackBeginEnd->end_direction = DirectionReverse(directionStart); return true; } while (!(tileElement++)->IsLastForTile()); @@ -681,7 +674,7 @@ bool track_block_get_previous_from_zero( outTrackBeginEnd->end_y = trackPos.y; outTrackBeginEnd->begin_z = trackPos.z; outTrackBeginEnd->begin_element = nullptr; - outTrackBeginEnd->end_direction = direction_reverse(directionStart); + outTrackBeginEnd->end_direction = DirectionReverse(directionStart); return false; } @@ -709,12 +702,10 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra if (ride == nullptr) return false; - const auto* trackBlock = ted.Block; + const auto* trackBlock = ted.GetBlockForSequence(trackElement->GetSequenceIndex()); if (trackBlock == nullptr) return false; - trackBlock += trackElement->GetSequenceIndex(); - auto trackCoordinate = ted.Coordinates; int32_t z = trackElement->GetBaseZ(); @@ -722,7 +713,7 @@ bool track_block_get_previous(const CoordsXYE& trackPos, track_begin_end* outTra uint8_t rotation = trackElement->GetDirection(); CoordsXY coords = CoordsXY{ trackPos }; CoordsXY offsets = { trackBlock->x, trackBlock->y }; - coords += offsets.Rotate(direction_reverse(rotation)); + coords += offsets.Rotate(DirectionReverse(rotation)); z -= trackBlock->z; z += trackCoordinate.z_begin; @@ -768,7 +759,7 @@ int32_t ride_find_track_gap(const Ride* ride, CoordsXYE* input, CoordsXYE* outpu *output = it.current; return 1; } - //#2081: prevent an infinite loop + // #2081: prevent an infinite loop moveSlowIt = !moveSlowIt; if (moveSlowIt) { @@ -981,13 +972,13 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons { if (!(lifecycle_flags & RIDE_LIFECYCLE_TESTED)) { - context_show_error(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); return nullptr; } if (!ride_has_ratings(this)) { - context_show_error(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); return nullptr; } @@ -995,7 +986,7 @@ std::unique_ptr Ride::SaveToTrackDesign(TrackDesignState& tds) cons auto errMessage = td->CreateTrackDesign(tds, *this); if (errMessage != STR_NONE) { - context_show_error(STR_CANT_SAVE_TRACK_DESIGN, errMessage, {}); + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, errMessage, {}); return nullptr; } @@ -1126,10 +1117,10 @@ void UpdateChairlift(Ride& ride) return; auto bullwheelLoc = ride.ChairliftBullwheelLocation[0].ToCoordsXYZ(); - map_invalidate_tile_zoom1({ bullwheelLoc, bullwheelLoc.z, bullwheelLoc.z + (4 * COORDS_Z_STEP) }); + MapInvalidateTileZoom1({ bullwheelLoc, bullwheelLoc.z, bullwheelLoc.z + (4 * COORDS_Z_STEP) }); bullwheelLoc = ride.ChairliftBullwheelLocation[1].ToCoordsXYZ(); - map_invalidate_tile_zoom1({ bullwheelLoc, bullwheelLoc.z, bullwheelLoc.z + (4 * COORDS_Z_STEP) }); + MapInvalidateTileZoom1({ bullwheelLoc, bullwheelLoc.z, bullwheelLoc.z + (4 * COORDS_Z_STEP) }); } /** @@ -1242,7 +1233,7 @@ void UpdateSpiralSlide(Ride& ride) int32_t rotation = tileElement->GetDirection(); startLoc += ride_spiral_slide_main_tile_offset[rotation][current_rotation]; - map_invalidate_tile_zoom0({ startLoc, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTileZoom0({ startLoc, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); } } @@ -1564,7 +1555,7 @@ void ride_prepare_breakdown(Ride* ride, int32_t breakdownReason) */ void ride_breakdown_add_news_item(Ride* ride) { - if (gConfigNotifications.ride_broken_down) + if (gConfigNotifications.RideBrokenDown) { Formatter ft; ride->FormatNameTo(ft); @@ -1591,7 +1582,7 @@ static void ride_breakdown_status_update(Ride* ride) if (!(ride->not_fixed_timeout & 15) && ride->mechanic_status != RIDE_MECHANIC_STATUS_FIXING && ride->mechanic_status != RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES) { - if (gConfigNotifications.ride_warnings) + if (gConfigNotifications.RideWarnings) { Formatter ft; ride->FormatNameTo(ft); @@ -1766,7 +1757,7 @@ Staff* find_closest_mechanic(const CoordsXY& entrancePosition, int32_t forInspec } auto location = entrancePosition.ToTileStart(); - if (map_is_location_in_park(location)) + if (MapIsLocationInPark(location)) if (!peep->IsLocationInPatrol(location)) continue; @@ -2262,7 +2253,7 @@ static bool ride_entrance_exit_is_reachable(const TileCoordsXYZD& coordinates) TileCoordsXYZ loc{ coordinates.x, coordinates.y, coordinates.z }; loc -= TileDirectionDelta[coordinates.direction]; - return map_coord_is_connected(loc, coordinates.direction); + return MapCoordIsConnected(loc, coordinates.direction); } static void ride_entrance_exit_connected(Ride* ride) @@ -2280,7 +2271,7 @@ static void ride_entrance_exit_connected(Ride* ride) // name of ride is parameter of the format string Formatter ft; ride->FormatNameTo(ft); - if (gConfigNotifications.ride_warnings) + if (gConfigNotifications.RideWarnings) { News::AddItemToQueue(News::ItemType::Ride, STR_ENTRANCE_NOT_CONNECTED, ride->id.ToUnderlying(), ft); } @@ -2292,7 +2283,7 @@ static void ride_entrance_exit_connected(Ride* ride) // name of ride is parameter of the format string Formatter ft; ride->FormatNameTo(ft); - if (gConfigNotifications.ride_warnings) + if (gConfigNotifications.RideWarnings) { News::AddItemToQueue(News::ItemType::Ride, STR_EXIT_NOT_CONNECTED, ride->id.ToUnderlying(), ft); } @@ -2308,7 +2299,7 @@ static void ride_shop_connected(Ride* ride) return; TrackElement* trackElement = nullptr; - TileElement* tileElement = map_get_first_element_at(shopLoc); + TileElement* tileElement = MapGetFirstElementAt(shopLoc); do { if (tileElement == nullptr) @@ -2349,17 +2340,17 @@ static void ride_shop_connected(Ride* ride) entrance_directions >>= 1; // Flip direction north<->south, east<->west - uint8_t face_direction = direction_reverse(count); + uint8_t face_direction = DirectionReverse(count); int32_t y2 = shopLoc.y - TileDirectionDelta[face_direction].y; int32_t x2 = shopLoc.x - TileDirectionDelta[face_direction].x; - if (map_coord_is_connected({ x2, y2, tileElement->base_height }, face_direction)) + if (MapCoordIsConnected({ x2, y2, tileElement->base_height }, face_direction)) return; } // Name of ride is parameter of the format string - if (gConfigNotifications.ride_warnings) + if (gConfigNotifications.RideWarnings) { Formatter ft; ride->FormatNameTo(ft); @@ -2385,7 +2376,7 @@ static void ride_track_set_map_tooltip(TileElement* tileElement) ride->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -2401,7 +2392,7 @@ static void ride_queue_banner_set_map_tooltip(TileElement* tileElement) ride->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -2425,7 +2416,7 @@ static void ride_station_set_map_tooltip(TileElement* tileElement) ride->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -2472,7 +2463,7 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) ft.Add(queueLength); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } else { @@ -2492,7 +2483,7 @@ static void ride_entrance_set_map_tooltip(TileElement* tileElement) ft.Add(stationIndex.ToUnderlying() + 1); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } } @@ -2639,7 +2630,7 @@ static ResultWithMessage ride_check_for_entrance_exit(RideId rideIndex) } /** - * Calls footpath_chain_ride_queue for all entrances of the ride + * Calls FootpathChainRideQueue for all entrances of the ride * rct2: 0x006B5952 */ void Ride::ChainQueues() const @@ -2653,7 +2644,7 @@ void Ride::ChainQueues() const // This will fire for every entrance on this x, y and z, regardless whether that actually belongs to // the ride or not. - TileElement* tileElement = map_get_first_element_at(station.Entrance); + TileElement* tileElement = MapGetFirstElementAt(station.Entrance); if (tileElement != nullptr) { do @@ -2664,8 +2655,7 @@ void Ride::ChainQueues() const continue; int32_t direction = tileElement->GetDirection(); - footpath_chain_ride_queue( - id, GetStationIndex(&station), mapLocation, tileElement, direction_reverse(direction)); + FootpathChainRideQueue(id, GetStationIndex(&station), mapLocation, tileElement, DirectionReverse(direction)); } while (!(tileElement++)->IsLastForTile()); } } @@ -2995,7 +2985,7 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) { auto entranceExitMapPos = position->ToCoordsXYZ(); - TileElement* tileElement = map_get_first_element_at(*position); + TileElement* tileElement = MapGetFirstElementAt(*position); do { if (tileElement == nullptr) @@ -3010,7 +3000,7 @@ static void ride_set_maze_entrance_exit_points(Ride* ride) if (tileElement->GetBaseZ() != entranceExitMapPos.z) continue; - maze_entrance_hedge_removal({ entranceExitMapPos, tileElement }); + MazeEntranceHedgeRemoval({ entranceExitMapPos, tileElement }); } while (!(tileElement++)->IsLastForTile()); } } @@ -3405,7 +3395,7 @@ static void ride_create_vehicles_find_first_block(Ride* ride, CoordsXYE* outXYEl return; auto curTrackPos = vehicle->TrackLocation; - auto curTrackElement = map_get_track_element_at(curTrackPos); + auto curTrackElement = MapGetTrackElementAt(curTrackPos); assert(curTrackElement != nullptr); @@ -3436,7 +3426,7 @@ static void ride_create_vehicles_find_first_block(Ride* ride, CoordsXYE* outXYEl case TrackElemType::DiagUp60ToFlat: if (trackElement->HasChain()) { - TileElement* tileElement = map_get_track_element_at_of_type_seq( + TileElement* tileElement = MapGetTrackElementAtOfTypeSeq( { trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z }, trackType, 0); if (tileElement != nullptr) @@ -3494,7 +3484,7 @@ ResultWithMessage Ride::CreateVehicles(const CoordsXYE& element, bool isApplying { vehiclePos -= CoordsXYZ{ CoordsDirectionDelta[direction], 0 }; - trackElement = map_get_track_element_at(vehiclePos); + trackElement = MapGetTrackElementAt(vehiclePos); vehiclePos.z = trackElement->GetBaseZ(); } @@ -3627,7 +3617,7 @@ static ResultWithMessage ride_initialise_cable_lift_track(Ride* ride, bool isApp } bool success = false; - TileElement* tileElement = map_get_first_element_at(location); + TileElement* tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) return { false }; do @@ -3745,7 +3735,7 @@ static ResultWithMessage ride_create_cable_lift(RideId rideIndex, bool isApplyin } auto cableLiftLoc = ride->CableLiftLoc; - auto tileElement = map_get_track_element_at(cableLiftLoc); + auto tileElement = MapGetTrackElementAt(cableLiftLoc); int32_t direction = tileElement->GetDirection(); Vehicle* head = nullptr; @@ -3865,7 +3855,7 @@ static void ride_scroll_to_track_error(const CoordsXYE& trackElement) TrackElement* Ride::GetOriginElement(StationIndex stationIndex) const { auto stationLoc = GetStation(stationIndex).Start; - TileElement* tileElement = map_get_first_element_at(stationLoc); + TileElement* tileElement = MapGetFirstElementAt(stationLoc); if (tileElement == nullptr) return nullptr; do @@ -4602,8 +4592,8 @@ bool ride_has_any_track_elements(const Ride* ride) { tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it)) + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) { if (it.element->GetType() != TileElementType::Track) continue; @@ -4638,7 +4628,7 @@ void set_vehicle_type_image_max_sizes(CarEntry* vehicle_type, int32_t num_images for (int32_t i = 0; i < num_images; ++i) { - gfx_draw_sprite_software(&dpi, ImageId::FromUInt32(vehicle_type->base_image_id + i), { 0, 0 }); + gfx_draw_sprite_software(&dpi, ImageId(vehicle_type->base_image_id + i), { 0, 0 }); } int32_t al = -1; for (int32_t i = 99; i != 0; --i) @@ -5040,7 +5030,7 @@ static int32_t ride_get_track_length(Ride* ride) if (trackStart.IsNull()) continue; - tileElement = map_get_first_element_at(trackStart); + tileElement = MapGetFirstElementAt(trackStart); if (tileElement == nullptr) continue; do @@ -5285,7 +5275,7 @@ void Ride::SetNumCarsPerVehicle(int32_t numCarsPerVehicle) void Ride::SetToDefaultInspectionInterval() { - uint8_t defaultInspectionInterval = gConfigGeneral.default_inspection_interval; + uint8_t defaultInspectionInterval = gConfigGeneral.DefaultInspectionInterval; if (inspection_interval != defaultInspectionInterval) { if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) @@ -5308,7 +5298,7 @@ void Ride::Crash(uint8_t vehicleIndex) // Open ride window for crashed vehicle auto intent = Intent(WD_VEHICLE); intent.putExtra(INTENT_EXTRA_VEHICLE, vehicle); - rct_window* w = context_open_intent(&intent); + rct_window* w = ContextOpenIntent(&intent); rct_viewport* viewport = window_get_viewport(w); if (w != nullptr && viewport != nullptr) @@ -5317,7 +5307,7 @@ void Ride::Crash(uint8_t vehicleIndex) } } - if (gConfigNotifications.ride_crashed) + if (gConfigNotifications.RideCrashed) { Formatter ft; FormatNameTo(ft); @@ -5398,7 +5388,7 @@ money16 ride_get_price(const Ride* ride) return 0; if (ride->IsRide()) { - if (!park_ride_prices_unlocked()) + if (!ParkRidePricesUnlocked()) { return 0; } @@ -5413,7 +5403,7 @@ money16 ride_get_price(const Ride* ride) TileElement* get_station_platform(const CoordsXYRangedZ& coords) { bool foundTileElement = false; - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement != nullptr) { do @@ -5496,7 +5486,7 @@ bool ride_has_adjacent_station(Ride* ride) if (found) break; /* Check the other side of the station */ - direction = direction_reverse(direction); + direction = DirectionReverse(direction); found = check_for_adjacent_station(stationStart, direction); if (found) break; @@ -5516,22 +5506,6 @@ bool ride_has_ratings(const Ride* ride) return ride->excitement != RIDE_RATING_UNDEFINED; } -/** - * Searches for a non-null ride type in a ride entry. - * If none is found, it will still return RIDE_TYPE_NULL. - */ -ride_type_t ride_entry_get_first_non_null_ride_type(const rct_ride_entry* rideEntry) -{ - for (uint8_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) - { - if (rideEntry->ride_type[i] != RIDE_TYPE_NULL) - { - return rideEntry->ride_type[i]; - } - } - return RIDE_TYPE_NULL; -} - int32_t get_booster_speed(ride_type_t rideType, int32_t rawSpeed) { int8_t shiftFactor = GetRideTypeDescriptor(rideType).OperatingSettings.BoosterSpeedFactor; @@ -5583,7 +5557,7 @@ void fix_invalid_vehicle_sprite_sizes() bool ride_entry_has_category(const rct_ride_entry* rideEntry, uint8_t category) { - auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry); + auto rideType = rideEntry->GetFirstNonNullRideType(); return GetRideTypeDescriptor(rideType).Category == category; } @@ -5659,7 +5633,7 @@ void determine_ride_entrance_and_exit_locations() // Skip if the station has no entrance if (!entranceLoc.IsNull()) { - const EntranceElement* entranceElement = map_get_ride_entrance_element_at(entranceLoc.ToCoordsXYZD(), false); + const EntranceElement* entranceElement = MapGetRideEntranceElementAt(entranceLoc.ToCoordsXYZD(), false); if (entranceElement == nullptr || entranceElement->GetRideIndex() != ride.id || entranceElement->GetStationIndex() != stationIndex) @@ -5674,7 +5648,7 @@ void determine_ride_entrance_and_exit_locations() if (!exitLoc.IsNull()) { - const EntranceElement* entranceElement = map_get_ride_exit_element_at(exitLoc.ToCoordsXYZD(), false); + const EntranceElement* entranceElement = MapGetRideExitElementAt(exitLoc.ToCoordsXYZD(), false); if (entranceElement == nullptr || entranceElement->GetRideIndex() != ride.id || entranceElement->GetStationIndex() != stationIndex) @@ -5700,7 +5674,7 @@ void determine_ride_entrance_and_exit_locations() { for (int32_t x = 1; x < gMapSize.x - 1; x++) { - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ x, y }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement != nullptr) { @@ -5795,7 +5769,7 @@ void ride_clear_leftover_entrances(Ride* ride) if (entrance->GetRideIndex() != ride->id) continue; - tile_element_remove(entrance->as()); + TileElementRemove(entrance->as()); } } } @@ -5864,7 +5838,7 @@ void Ride::UpdateRideTypeForAllPieces() { for (int32_t x = 0; x < gMapSize.x; x++) { - auto* tileElement = map_get_first_element_at(TileCoordsXY(x, y)); + auto* tileElement = MapGetFirstElementAt(TileCoordsXY(x, y)); if (tileElement == nullptr) continue; @@ -5925,8 +5899,8 @@ std::vector GetTracklessRides() std::vector seen; seen.resize(256); tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it)) + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) { auto trackEl = it.element->AsTrack(); if (trackEl != nullptr && !trackEl->IsGhost()) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index f88ccaf482..439038e070 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -18,6 +18,7 @@ #include "../rct2/Limits.h" #include "../world/Map.h" #include "RideColour.h" +#include "RideEntry.h" #include "RideRatings.h" #include "RideTypes.h" #include "Track.h" @@ -39,7 +40,6 @@ struct Vehicle; struct rct_ride_entry; struct ResultWithMessage; -#define RIDE_TYPE_NULL 255 #define RIDE_ADJACENCY_CHECK_DISTANCE 5 constexpr uint8_t TUNE_ID_NULL = 0xFF; @@ -979,6 +979,7 @@ struct RideManager size_t size() const; Iterator begin(); Iterator end(); + Iterator get(RideId rideId); Iterator begin() const { return (const_cast(this))->begin(); @@ -1057,7 +1058,7 @@ bool track_block_get_previous_from_zero( void ride_get_start_of_track(CoordsXYE* output); void window_ride_construction_update_active_elements(); -money32 ride_entrance_exit_place_ghost( +money32 RideEntranceExitPlaceGhost( Ride* ride, const CoordsXY& entranceExitCoords, Direction direction, int32_t placeType, StationIndex stationNum); ResultWithMessage ride_are_all_possible_entrances_and_exits_built(Ride* ride); @@ -1088,7 +1089,6 @@ bool ride_has_adjacent_station(Ride* ride); bool ride_has_station_shelter(Ride* ride); bool ride_has_ratings(const Ride* ride); -ride_type_t ride_entry_get_first_non_null_ride_type(const rct_ride_entry* rideEntry); int32_t get_booster_speed(ride_type_t rideType, int32_t rawSpeed); void fix_invalid_vehicle_sprite_sizes(); bool ride_entry_has_category(const rct_ride_entry* rideEntry, uint8_t category); diff --git a/src/openrct2/ride/RideAudio.cpp b/src/openrct2/ride/RideAudio.cpp index 34a1300340..ef546c0366 100644 --- a/src/openrct2/ride/RideAudio.cpp +++ b/src/openrct2/ride/RideAudio.cpp @@ -257,7 +257,7 @@ namespace OpenRCT2::RideAudio return; // TODO Allow circus music (CSS24) to play if ride music is disabled (that should be sound) - if (gGameSoundsOff || !gConfigSound.ride_music_enabled) + if (gGameSoundsOff || !gConfigSound.RideMusicEnabled) return; StopInactiveRideMusicChannels(); @@ -382,7 +382,7 @@ namespace OpenRCT2::RideAudio { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gGameSoundsOff && g_music_tracking_viewport != nullptr) { - auto rotatedCoords = translate_3d_to_2d_with_z(get_current_rotation(), rideCoords); + auto rotatedCoords = Translate3DTo2DWithZ(get_current_rotation(), rideCoords); auto viewport = g_music_tracking_viewport; auto viewWidth = viewport->view_width; auto viewWidth2 = viewWidth * 2; @@ -397,11 +397,11 @@ namespace OpenRCT2::RideAudio else { auto x2 = (viewport->pos.x + viewport->zoom.ApplyInversedTo(rotatedCoords.x - viewport->viewPos.x)) * 0x10000; - auto screenWidth = std::max(context_get_width(), 64); + auto screenWidth = std::max(ContextGetWidth(), 64); auto panX = ((x2 / screenWidth) - 0x8000) >> 4; auto y2 = (viewport->pos.y + viewport->zoom.ApplyInversedTo(rotatedCoords.y - viewport->viewPos.y)) * 0x10000; - auto screenHeight = std::max(context_get_height(), 64); + auto screenHeight = std::max(ContextGetHeight(), 64); auto panY = ((y2 / screenHeight) - 0x8000) >> 4; auto volX = CalculateVolume(panX); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index c34ea33e1a..ead0b12f27 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -97,20 +97,20 @@ static int32_t ride_check_if_construction_allowed(Ride* ride) rct_ride_entry* rideEntry = ride->GetRideEntry(); if (rideEntry == nullptr) { - context_show_error(STR_INVALID_RIDE_TYPE, STR_CANT_EDIT_INVALID_RIDE_TYPE, ft); + ContextShowError(STR_INVALID_RIDE_TYPE, STR_CANT_EDIT_INVALID_RIDE_TYPE, ft); return 0; } if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) { ride->FormatNameTo(ft); - context_show_error(STR_CANT_START_CONSTRUCTION_ON, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING, ft); + ContextShowError(STR_CANT_START_CONSTRUCTION_ON, STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING, ft); return 0; } if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) { ride->FormatNameTo(ft); - context_show_error(STR_CANT_START_CONSTRUCTION_ON, STR_MUST_BE_CLOSED_FIRST, ft); + ContextShowError(STR_CANT_START_CONSTRUCTION_ON, STR_MUST_BE_CLOSED_FIRST, ft); return 0; } @@ -259,14 +259,14 @@ void Ride::RemovePeeps() auto location = GetStation(stationIndex).Exit.ToCoordsXYZD(); if (!location.IsNull()) { - auto direction = direction_reverse(location.direction); + auto direction = DirectionReverse(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 = DirectionReverse(exitPosition.direction); exitPosition.direction *= 8; } @@ -352,7 +352,7 @@ void ride_clear_blocked_tiles(Ride* ride) continue; // Unblock footpath element that is at same position - auto* footpathElement = map_get_footpath_element( + auto* footpathElement = MapGetFootpathElement( TileCoordsXYZ{ tilePos, trackElement->base_height }.ToCoordsXYZ()); if (footpathElement == nullptr) @@ -379,10 +379,10 @@ 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); + auto trackElement = MapGetTrackElementAtOfTypeSeq(location, type, 0); if (trackElement == nullptr) { - trackElement = map_get_track_element_at_of_type(location, type); + trackElement = MapGetTrackElementAtOfType(location, type); if (trackElement == nullptr) { return std::nullopt; @@ -391,33 +391,36 @@ std::optional GetTrackElementOriginAndApplyChanges( // 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(); + const auto* trackBlock = ted.GetBlockForSequence(sequence); + if (trackBlock == nullptr) + return std::nullopt; - CoordsXY offsets = { trackBlock[sequence].x, trackBlock[sequence].y }; + CoordsXY offsets = { trackBlock->x, trackBlock->y }; CoordsXY newCoords = location; - newCoords += offsets.Rotate(direction_reverse(mapDirection)); + newCoords += offsets.Rotate(DirectionReverse(mapDirection)); - auto retCoordsXYZ = CoordsXYZ{ newCoords.x, newCoords.y, location.z - trackBlock[sequence].z }; + auto retCoordsXYZ = CoordsXYZ{ newCoords.x, newCoords.y, location.z - trackBlock->z }; int32_t start_z = retCoordsXYZ.z; - retCoordsXYZ.z += trackBlock[0].z; - for (int32_t i = 0; trackBlock[i].index != 0xFF; ++i) + const auto block0 = ted.GetBlockForSequence(0); + assert(block0 != nullptr); + + retCoordsXYZ.z += block0->z; + for (int32_t i = 0; ted.Block[i].index != 0xFF; ++i) { CoordsXY cur = { retCoordsXYZ }; - offsets = { trackBlock[i].x, trackBlock[i].y }; + offsets = { ted.Block[i].x, ted.Block[i].y }; cur += offsets.Rotate(mapDirection); - int32_t cur_z = start_z + trackBlock[i].z; + int32_t cur_z = start_z + ted.Block[i].z; - map_invalidate_tile_full(cur); + MapInvalidateTileFull(cur); - trackElement = map_get_track_element_at_of_type_seq( - { cur, cur_z, static_cast(location.direction) }, type, trackBlock[i].index); + trackElement = MapGetTrackElementAtOfTypeSeq( + { cur, cur_z, static_cast(location.direction) }, type, ted.Block[i].index); if (trackElement == nullptr) { return std::nullopt; @@ -534,7 +537,7 @@ void ride_construction_remove_ghosts() { if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) { - ride_entrance_exit_remove_ghost(); + RideEntranceExitRemoveGhost(); _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT; } if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) @@ -563,7 +566,7 @@ void ride_construction_invalidate_current_track() case RideConstructionState::Back: if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) { - map_invalidate_tile_full(_currentTrackBegin.ToTileStart()); + MapInvalidateTileFull(_currentTrackBegin.ToTileStart()); } ride_construction_remove_ghosts(); break; @@ -574,7 +577,7 @@ void ride_construction_invalidate_current_track() { _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ARROW; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - map_invalidate_tile_full(_currentTrackBegin); + MapInvalidateTileFull(_currentTrackBegin); } ride_construction_remove_ghosts(); break; @@ -689,7 +692,7 @@ void ride_construction_set_default_next_piece() && ((slope != TRACK_SLOPE_DOWN_25 && slope != TRACK_SLOPE_DOWN_60) || gCheatsEnableChainLiftOnAllTrack); break; case RideConstructionState::Back: - direction = direction_reverse(_currentTrackPieceDirection); + direction = DirectionReverse(_currentTrackPieceDirection); if (!track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &xyElement, &z, &direction, false)) { ride_construction_reset_current_piece(); @@ -763,7 +766,7 @@ void ride_select_next_section() } // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); CoordsXYE inputElement, outputElement; inputElement.x = newCoords->x; @@ -777,7 +780,7 @@ void ride_select_next_section() if (!scenery_tool_is_active()) { // Set next element's height. - virtual_floor_set_height(tileElement->GetBaseZ()); + VirtualFloorSetHeight(tileElement->GetBaseZ()); } _currentTrackBegin = *newCoords; @@ -830,7 +833,7 @@ void ride_select_previous_section() } // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); track_begin_end trackBeginEnd; if (track_block_get_previous({ *newCoords, tileElement }, &trackBeginEnd)) @@ -844,7 +847,7 @@ void ride_select_previous_section() if (!scenery_tool_is_active()) { // Set previous element's height. - virtual_floor_set_height(trackBeginEnd.begin_element->GetBaseZ()); + VirtualFloorSetHeight(trackBeginEnd.begin_element->GetBaseZ()); } window_ride_construction_update_active_elements(); } @@ -971,7 +974,7 @@ static bool ride_modify_maze(const CoordsXYE& tileElement) gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); return true; } } @@ -1003,7 +1006,7 @@ bool ride_modify(const CoordsXYE& input) { Formatter ft; ride->FormatNameTo(ft); - context_show_error( + ContextShowError( STR_CANT_START_CONSTRUCTION_ON, STR_LOCAL_AUTHORITY_FORBIDS_DEMOLITION_OR_MODIFICATIONS_TO_THIS_RIDE, ft); return false; } @@ -1288,10 +1291,10 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC // search for TrackElement one tile over, shifted in the search direction auto nextLocation = entranceExitCoords; nextLocation += CoordsDirectionDelta[entranceExitCoords.direction]; - if (map_is_location_valid(nextLocation)) + if (MapIsLocationValid(nextLocation)) { // iterate over every element in the tile until we find what we want - auto* tileElement = map_get_first_element_at(nextLocation); + auto* tileElement = MapGetFirstElementAt(nextLocation); if (tileElement == nullptr) continue; do @@ -1306,7 +1309,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC if (trackElement->GetTrackType() == TrackElemType::Maze) { // if it's a maze, it can place the entrance and exit immediately - entranceExitCoords.direction = direction_reverse(entranceExitCoords.direction); + entranceExitCoords.direction = DirectionReverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; return entranceExitCoords; } @@ -1316,13 +1319,13 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC gRideEntranceExitPlaceStationIndex = trackElement->GetStationIndex(); // get the ride entrance's side relative to the TrackElement - Direction direction = (direction_reverse(entranceExitCoords.direction) - tileElement->GetDirection()) & 3; + Direction direction = (DirectionReverse(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); + entranceExitCoords.direction = DirectionReverse(entranceExitCoords.direction); gRideEntranceExitPlaceDirection = entranceExitCoords.direction; return entranceExitCoords; } @@ -1361,7 +1364,7 @@ void Ride::ValidateStations() location.x -= CoordsDirectionDelta[direction].x; location.y -= CoordsDirectionDelta[direction].y; } - tileElement = map_get_first_element_at(location); + tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) break; @@ -1418,7 +1421,7 @@ void Ride::ValidateStations() CoordsXYZ blockLocation = location + CoordsXYZ{ CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(direction), 0 }; bool trackFound = false; - tileElement = map_get_first_element_at(blockLocation); + tileElement = MapGetFirstElementAt(blockLocation); if (tileElement == nullptr) break; // find the target TrackElement on the tile it's supposed to appear on @@ -1490,7 +1493,7 @@ void Ride::ValidateStations() // if it's not a duplicate location CoordsXY location = locationCoords.ToCoordsXY(); - TileElement* tileElement = map_get_first_element_at(location); + TileElement* tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) continue; do @@ -1512,7 +1515,7 @@ void Ride::ValidateStations() // if there's no connected station, remove the ride entrance (see below) bool shouldRemove = true; - TileElement* trackElement = map_get_first_element_at(nextLocation); + TileElement* trackElement = MapGetFirstElementAt(nextLocation); if (trackElement == nullptr) continue; do @@ -1533,7 +1536,7 @@ void Ride::ValidateStations() 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; + Direction direction = (tileElement->GetDirection() - DirectionReverse(trackElement->GetDirection())) & 3; // if the ride entrance is not on a valid side, remove it ted = &GetTrackElementDescriptor(trackType); @@ -1572,12 +1575,12 @@ void Ride::ValidateStations() // 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); + FootpathQueueChainReset(); + MazeEntranceHedgeReplacement({ location, tileElement }); + FootpathRemoveEdgesAt(location, tileElement); + FootpathUpdateQueueChains(); + MapInvalidateTileFull(location); + TileElementRemove(tileElement); tileElement--; } } while (!(tileElement++)->IsLastForTile()); @@ -1614,7 +1617,7 @@ bool ride_select_forwards_from_back() ride_construction_invalidate_current_track(); int32_t z = _currentTrackBegin.z; - int32_t direction = direction_reverse(_currentTrackPieceDirection); + int32_t direction = DirectionReverse(_currentTrackPieceDirection); CoordsXYE next_track; if (track_block_get_next_from_zero(_currentTrackBegin, ride, direction, &next_track, &z, &direction, false)) { diff --git a/src/openrct2/ride/RideConstruction.h b/src/openrct2/ride/RideConstruction.h index 58bd9ce3be..731616754e 100644 --- a/src/openrct2/ride/RideConstruction.h +++ b/src/openrct2/ride/RideConstruction.h @@ -72,8 +72,8 @@ extern uint8_t gRideEntranceExitPlaceDirection; std::optional GetTrackElementOriginAndApplyChanges( const CoordsXYZD& location, track_type_t type, uint16_t extra_params, TileElement** output_element, uint16_t flags); -void ride_entrance_exit_place_provisional_ghost(); -void ride_entrance_exit_remove_ghost(); +void RideEntranceExitPlaceProvisionalGhost(); +void RideEntranceExitRemoveGhost(); void ride_restore_provisional_track_piece(); void ride_remove_provisional_track_piece(); diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index c2d458fa42..fe173bde03 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -271,73 +271,73 @@ enum enum ride_type_flags : uint64_t { - RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN = (1ULL << 0), - RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL = (1ULL << 1), - RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS = (1ULL << 2), - RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION = (1ULL << 3), // Set by flat rides, tower rides and shops/stalls. - RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION = (1ULL << 4), - RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS = (1ULL << 5), - RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER = (1ULL << 6), // used only by boat Hire and submarine ride - RIDE_TYPE_FLAG_HAS_G_FORCES = (1ULL << 7), - RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS = (1ULL << 8), // used by rides that can't have gaps, like those with a vertical tower, such + RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN = (1uLL << 0), + RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL = (1uLL << 1), + RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS = (1uLL << 2), + RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION = (1uLL << 3), // Set by flat rides, tower rides and shops/stalls. + RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION = (1uLL << 4), + RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS = (1uLL << 5), + RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER = (1uLL << 6), // used only by boat Hire and submarine ride + RIDE_TYPE_FLAG_HAS_G_FORCES = (1uLL << 7), + RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS = (1uLL << 8), // used by rides that can't have gaps, like those with a vertical tower, such // as the observation tower - RIDE_TYPE_FLAG_HAS_DATA_LOGGING = (1ULL << 9), - RIDE_TYPE_FLAG_HAS_DROPS = (1ULL << 10), - RIDE_TYPE_FLAG_NO_TEST_MODE = (1ULL << 11), - RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES = (1ULL << 12), // used by rides with two varieties, like the u and o + RIDE_TYPE_FLAG_HAS_DATA_LOGGING = (1uLL << 9), + RIDE_TYPE_FLAG_HAS_DROPS = (1uLL << 10), + RIDE_TYPE_FLAG_NO_TEST_MODE = (1uLL << 11), + RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES = (1uLL << 12), // used by rides with two varieties, like the u and o // shapes of the dinghy slide and the dry and submerged // track of the water coaster - RIDE_TYPE_FLAG_NO_VEHICLES = (1ULL << 13), // used only by maze, spiral slide and shops - RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS = (1ULL << 14), - RIDE_TYPE_FLAG_HAS_NO_TRACK = (1ULL << 15), - RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL = (1ULL << 16), // Set by flat rides where the vehicle is integral to the structure, like + RIDE_TYPE_FLAG_NO_VEHICLES = (1uLL << 13), // used only by maze, spiral slide and shops + RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS = (1uLL << 14), + RIDE_TYPE_FLAG_HAS_NO_TRACK = (1uLL << 15), + RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL = (1uLL << 16), // Set by flat rides where the vehicle is integral to the structure, like // Merry-go-round and swinging ships. (Contrast with rides like dodgems.) - RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY = (1ULL << 17), - RIDE_TYPE_FLAG_TRACK_NO_WALLS = (1ULL << 18), // if set, wall scenery can not share a tile with the ride's track - RIDE_TYPE_FLAG_FLAT_RIDE = (1ULL << 19), - RIDE_TYPE_FLAG_PEEP_WILL_RIDE_AGAIN = (1ULL << 20), // whether or not guests will go on the ride again if they liked it + RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY = (1uLL << 17), + RIDE_TYPE_FLAG_TRACK_NO_WALLS = (1uLL << 18), // if set, wall scenery can not share a tile with the ride's track + RIDE_TYPE_FLAG_FLAT_RIDE = (1uLL << 19), + RIDE_TYPE_FLAG_PEEP_WILL_RIDE_AGAIN = (1uLL << 20), // whether or not guests will go on the ride again if they liked it // (this is // usually applied to everything apart from transport rides) - RIDE_TYPE_FLAG_PEEP_SHOULD_GO_INSIDE_FACILITY = (1ULL << 21), // used by toilets and first aid to mark that peep should go + RIDE_TYPE_FLAG_PEEP_SHOULD_GO_INSIDE_FACILITY = (1uLL << 21), // used by toilets and first aid to mark that peep should go // inside the building (rather than 'buying' at the counter) - RIDE_TYPE_FLAG_IN_RIDE = (1ULL << 22), // peeps are "IN" (ride) rather than "ON" (ride) - RIDE_TYPE_FLAG_SELLS_FOOD = (1ULL << 23), - RIDE_TYPE_FLAG_SELLS_DRINKS = (1ULL << 24), - RIDE_TYPE_FLAG_IS_TOILET = (1ULL << 25), - RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS = (1ULL << 26), // whether or not vehicle colours can be set - RIDE_TYPE_FLAG_CHECK_FOR_STALLING = (1ULL << 27), - RIDE_TYPE_FLAG_HAS_TRACK = (1ULL << 28), - RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES = (1ULL << 29), // Only set by lift - RIDE_TYPE_FLAG_HAS_LARGE_CURVES = (1ULL << 30), // whether the ride supports large (45 degree turn) curves - RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR = (1ULL << 31), + RIDE_TYPE_FLAG_IN_RIDE = (1uLL << 22), // peeps are "IN" (ride) rather than "ON" (ride) + RIDE_TYPE_FLAG_SELLS_FOOD = (1uLL << 23), + RIDE_TYPE_FLAG_SELLS_DRINKS = (1uLL << 24), + RIDE_TYPE_FLAG_IS_TOILET = (1uLL << 25), + RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS = (1uLL << 26), // whether or not vehicle colours can be set + RIDE_TYPE_FLAG_CHECK_FOR_STALLING = (1uLL << 27), + RIDE_TYPE_FLAG_HAS_TRACK = (1uLL << 28), + RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES = (1uLL << 29), // Only set by lift + RIDE_TYPE_FLAG_HAS_LARGE_CURVES = (1uLL << 30), // whether the ride supports large (45 degree turn) curves + RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR = (1uLL << 31), - RIDE_TYPE_FLAG_ALLOW_DOORS_ON_TRACK = (1ULL << 32), - RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT = (1ULL << 33), - RIDE_TYPE_FLAG_ALLOW_MUSIC = (1ULL << 34), - RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE = (1ULL << 35), // Used by the Flying RC, Lay-down RC, Multi-dimension RC - RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES = (1ULL << 36), - RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT = (1ULL << 37), - RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS = (1ULL << 38), - RIDE_TYPE_FLAG_HAS_AIR_TIME = (1ULL << 39), - RIDE_TYPE_FLAG_SINGLE_SESSION = (1ULL << 40), - RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS = (1ULL << 41), - RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL = (1ULL << 42), - RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER = (1ULL << 43), - RIDE_TYPE_FLAG_TRANSPORT_RIDE = (1ULL << 44), - RIDE_TYPE_FLAG_INTERESTING_TO_LOOK_AT = (1ULL << 45), - RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT = (1ULL << 46), - RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED = (1ULL << 47), // This is only set on the Flying RC and its alternative type. + RIDE_TYPE_FLAG_ALLOW_DOORS_ON_TRACK = (1uLL << 32), + RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT = (1uLL << 33), + RIDE_TYPE_FLAG_ALLOW_MUSIC = (1uLL << 34), + RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE = (1uLL << 35), // Used by the Flying RC, Lay-down RC, Multi-dimension RC + RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES = (1uLL << 36), + RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT = (1uLL << 37), + RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS = (1uLL << 38), + RIDE_TYPE_FLAG_HAS_AIR_TIME = (1uLL << 39), + RIDE_TYPE_FLAG_SINGLE_SESSION = (1uLL << 40), + RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS = (1uLL << 41), + RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL = (1uLL << 42), + RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER = (1uLL << 43), + RIDE_TYPE_FLAG_TRANSPORT_RIDE = (1uLL << 44), + RIDE_TYPE_FLAG_INTERESTING_TO_LOOK_AT = (1uLL << 45), + RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT = (1uLL << 46), + RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED = (1uLL << 47), // This is only set on the Flying RC and its alternative type. - RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY = (1ULL << 48), - RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS = (1ULL << 49), - RIDE_TYPE_FLAG_IS_SUSPENDED = (1ULL << 50), - RIDE_TYPE_FLAG_HAS_LANDSCAPE_DOORS = (1ULL << 51), - RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT = (1ULL << 52), - RIDE_TYPE_FLAG_PEEP_CAN_USE_UMBRELLA = (1ULL << 53), - RIDE_TYPE_FLAG_IS_CASH_MACHINE = (1ULL << 54), - RIDE_TYPE_FLAG_HAS_ONE_STATION = (1ULL << 55), - RIDE_TYPE_FLAG_HAS_SEAT_ROTATION = (1ULL << 56), - RIDE_TYPE_FLAG_IS_FIRST_AID = (1ULL << 57), + RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY = (1uLL << 48), + RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS = (1uLL << 49), + RIDE_TYPE_FLAG_IS_SUSPENDED = (1uLL << 50), + RIDE_TYPE_FLAG_HAS_LANDSCAPE_DOORS = (1uLL << 51), + RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT = (1uLL << 52), + RIDE_TYPE_FLAG_PEEP_CAN_USE_UMBRELLA = (1uLL << 53), + RIDE_TYPE_FLAG_IS_CASH_MACHINE = (1uLL << 54), + RIDE_TYPE_FLAG_HAS_ONE_STATION = (1uLL << 55), + RIDE_TYPE_FLAG_HAS_SEAT_ROTATION = (1uLL << 56), + RIDE_TYPE_FLAG_IS_FIRST_AID = (1uLL << 57), }; // Set on ride types that have a main colour, additional colour and support colour. diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index 112331e274..8efbc8305f 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -20,6 +20,7 @@ // Set to 255 on all tracked ride entries static uint8_t constexpr NoFlatRideCars = 0xFF; +static ride_type_t constexpr RIDE_TYPE_NULL = 0xFF; struct RideNaming { @@ -86,6 +87,17 @@ struct rct_ride_entry { return GetCar(DefaultCar); } + + ride_type_t GetFirstNonNullRideType() const + { + for (const auto& currentRideType : ride_type) + { + if (currentRideType != RIDE_TYPE_NULL) + return currentRideType; + } + + return RIDE_TYPE_NULL; + } }; void set_vehicle_type_image_max_sizes(CarEntry* vehicle_type, int32_t num_images); diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 407f730df2..8164318822 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -154,24 +154,45 @@ static void ride_ratings_update_state(RideRatingUpdateState& state) } } +static RideId GetNextRideToUpdate(RideId currentRide) +{ + auto rm = GetRideManager(); + if (rm.size() == 0) + { + return RideId::GetNull(); + } + // Skip all empty ride ids + auto nextRide = std::next(rm.get(currentRide)); + // If at end, loop around + if (nextRide == rm.end()) + { + nextRide = rm.begin(); + } + return (*nextRide).id; +} + /** * * rct2: 0x006B5A5C */ static void ride_ratings_update_state_0(RideRatingUpdateState& state) { - auto nextRide = RideId::FromUnderlying(state.CurrentRide.ToUnderlying() + 1); - if (nextRide.ToUnderlying() >= OpenRCT2::Limits::MaxRidesInPark) + // It is possible that the current ride being calculated has + // been removed or due to import invalid. For both, reset + // ratings and start check at the start + if (get_ride(state.CurrentRide) == nullptr) { - nextRide = {}; + state.CurrentRide = {}; } - auto ride = get_ride(nextRide); - if (ride != nullptr && ride->status != RideStatus::Closed && !(ride->lifecycle_flags & RIDE_LIFECYCLE_FIXED_RATINGS)) + auto nextRideId = GetNextRideToUpdate(state.CurrentRide); + auto nextRide = get_ride(nextRideId); + if (nextRide != nullptr && nextRide->status != RideStatus::Closed + && !(nextRide->lifecycle_flags & RIDE_LIFECYCLE_FIXED_RATINGS)) { state.State = RIDE_RATINGS_STATE_INITIALISE; } - state.CurrentRide = nextRide; + state.CurrentRide = nextRideId; } /** @@ -209,7 +230,7 @@ static void ride_ratings_update_state_2(RideRatingUpdateState& state) auto loc = state.Proximity; track_type_t trackType = state.ProximityTrackType; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; @@ -315,7 +336,7 @@ static void ride_ratings_update_state_5(RideRatingUpdateState& state) auto loc = state.Proximity; track_type_t trackType = state.ProximityTrackType; - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) { state.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; @@ -417,10 +438,10 @@ static void ride_ratings_score_close_proximity_in_direction( RideRatingUpdateState& state, TileElement* inputTileElement, int32_t direction) { auto scorePos = CoordsXY{ CoordsXY{ state.Proximity } + CoordsDirectionDelta[direction] }; - if (!map_is_location_valid(scorePos)) + if (!MapIsLocationValid(scorePos)) return; - TileElement* tileElement = map_get_first_element_at(scorePos); + TileElement* tileElement = MapGetFirstElementAt(scorePos); if (tileElement == nullptr) return; do @@ -476,7 +497,7 @@ static void ride_ratings_score_close_proximity_in_direction( static void ride_ratings_score_close_proximity_loops_helper(RideRatingUpdateState& state, const CoordsXYE& coordsElement) { - TileElement* tileElement = map_get_first_element_at(coordsElement); + TileElement* tileElement = MapGetFirstElementAt(coordsElement); if (tileElement == nullptr) return; do @@ -544,7 +565,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til } state.ProximityTotal++; - TileElement* tileElement = map_get_first_element_at(state.Proximity); + TileElement* tileElement = MapGetFirstElementAt(state.Proximity); if (tileElement == nullptr) return; do @@ -1445,7 +1466,7 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride) location = ride->GetStation(stationIndex).Start; } - int32_t z = tile_element_height(location); + int32_t z = TileElementHeight(location); // Check if station is underground, returns a fixed mediocre score since you can't have scenery underground if (z > ride->GetStation(stationIndex).GetBaseZ()) @@ -1461,7 +1482,7 @@ static int32_t ride_ratings_get_scenery_score(Ride* ride) for (int32_t xx = std::max(tileLocation.x - 5, 0); xx <= std::min(tileLocation.x + 5, gMapSize.x - 1); xx++) { // Count scenery items on this tile - TileElement* tileElement = map_get_first_element_at(TileCoordsXY{ xx, yy }); + TileElement* tileElement = MapGetFirstElementAt(TileCoordsXY{ xx, yy }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index 5b18740308..0901968814 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -91,7 +91,7 @@ constexpr uint64_t GetAllShopItemsWithFlag(uint16_t flag) const auto& sid = ShopItems[i]; if (sid.HasFlag(flag)) { - ret |= (1ULL << i); + ret |= (1uLL << i); } } return ret; diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 63053f47eb..db893963f2 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -330,7 +330,7 @@ static void ride_invalidate_station_start(Ride* ride, StationIndex stationIndex, tileElement->AsTrack()->SetHasGreenLight(greenLight); // Invalidate map tile - map_invalidate_tile_zoom1({ startPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTileZoom1({ startPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); } TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex stationIndex) @@ -338,7 +338,7 @@ TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex auto stationStart = ride->GetStation(stationIndex).GetStart(); // Find the station track element - TileElement* tileElement = map_get_first_element_at(stationStart); + TileElement* tileElement = MapGetFirstElementAt(stationStart); if (tileElement == nullptr) return nullptr; do @@ -354,7 +354,7 @@ TileElement* ride_get_station_start_track_element(const Ride* ride, StationIndex TileElement* ride_get_station_exit_element(const CoordsXYZ& elementPos) { // Find the station track element - TileElement* tileElement = map_get_first_element_at(elementPos); + TileElement* tileElement = MapGetFirstElementAt(elementPos); if (tileElement == nullptr) return nullptr; do diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index d64354d4a8..2f2bcb1d05 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -72,7 +72,7 @@ int32_t track_is_connected_by_shape(TileElement* a, TileElement* b) static TileElement* find_station_element(const CoordsXYZD& loc, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return nullptr; do @@ -244,7 +244,7 @@ ResultWithMessage track_add_station_element(CoordsXYZD loc, RideId rideIndex, in } stationElement->AsTrack()->SetTrackType(targetTrackType); - map_invalidate_element(loc, stationElement); + MapInvalidateElement(loc, stationElement); if (stationBackLoc != loc) { @@ -275,7 +275,7 @@ ResultWithMessage track_remove_station_element(const CoordsXYZD& loc, RideId rid if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) { - TileElement* tileElement = map_get_track_element_at_with_direction_from_ride(loc, rideIndex); + TileElement* tileElement = MapGetTrackElementAtWithDirectionFromRide(loc, rideIndex); if (tileElement != nullptr) { if (flags & GAME_COMMAND_FLAG_APPLY) @@ -390,7 +390,7 @@ ResultWithMessage track_remove_station_element(const CoordsXYZD& loc, RideId rid } stationElement->AsTrack()->SetTrackType(targetTrackType); - map_invalidate_element(currentLoc, stationElement); + MapInvalidateElement(currentLoc, stationElement); } } @@ -669,9 +669,12 @@ std::optional GetTrackSegmentOrigin(const CoordsXYE& posEl) auto coords = CoordsXYZ(posEl.x, posEl.y, trackEl->GetBaseZ()); // Subtract the current sequence's offset - const auto* trackBlock = &ted.Block[trackEl->GetSequenceIndex()]; + const auto* trackBlock = ted.GetBlockForSequence(trackEl->GetSequenceIndex()); + if (trackBlock == nullptr) + return {}; + CoordsXY trackBlockOffset = { trackBlock->x, trackBlock->y }; - coords += trackBlockOffset.Rotate(direction_reverse(direction)); + coords += trackBlockOffset.Rotate(DirectionReverse(direction)); coords.z -= trackBlock->z; return CoordsXYZD(coords, direction); @@ -918,3 +921,20 @@ void TrackElement::SetHighlight(bool on) if (on) Flags2 |= TRACK_ELEMENT_FLAGS2_HIGHLIGHT; } + +bool TrackTypeMustBeMadeInvisible(ride_type_t rideType, track_type_t trackType, int32_t parkFileVersion) +{ + // Lots of Log Flumes exist where the downward slopes are simulated by using other track + // types like the Splash Boats, but not actually made invisible, because they never needed + // to be. + if (rideType == RIDE_TYPE_LOG_FLUME && parkFileVersion <= 15) + { + if (trackType == TrackElemType::Down25ToDown60 || trackType == TrackElemType::Down60 + || trackType == TrackElemType::Down60ToDown25) + { + return true; + } + } + + return false; +} diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index bfaa6f8f17..c8fd0f4e6b 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -634,3 +634,16 @@ ResultWithMessage track_remove_station_element(const CoordsXYZD& loc, RideId rid bool TrackTypeHasSpeedSetting(track_type_t trackType); std::optional GetTrackSegmentOrigin(const CoordsXYE& posEl); + +/** + * If new pieces get added to existing ride types, this could cause existing parks to change appearance, + * since the formerly unrendered pieces were not explicitly set invisible. + * To avoid this, this function will return true if the piece is question was added after the park was created, + * so that import code can properly set the visibility. + * + * @param rideType The OpenRCT2 ride type + * @param trackType The OpenRCT2 track type + * @param parkFileVersion The current park file version. Pass -1 when converting S4 or S6. + * @return + */ +bool TrackTypeMustBeMadeInvisible(ride_type_t rideType, track_type_t trackType, int32_t parkFileVersion = -1); diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index b391b83ca9..bc3308966c 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -7190,3 +7190,22 @@ namespace OpenRCT2 } // namespace TrackMetaData } // namespace OpenRCT2 + +const rct_preview_track* TrackElementDescriptor::GetBlockForSequence(uint8_t sequenceIndex) const +{ + const auto* trackBlock = Block; + if (trackBlock == nullptr) + return nullptr; + + // The sequence index may be higher than the amount of sequences actually present. + // We don’t know the amount of sequences present in the block upfront, but there is an end marker consisting of all 255s. + for (auto i = 0; i < sequenceIndex; i++) + { + trackBlock++; + + if (trackBlock == nullptr || trackBlock->index == 255) + return nullptr; + } + + return trackBlock; +} diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index ab52de58aa..29aa6e56d2 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -97,6 +97,15 @@ struct TrackElementDescriptor TrackComputeFunction VerticalFactor; TrackComputeFunction LateralFactor; + + /** + * Retrieves the block for the given sequence. This method safely handles + * out-of-bounds sequence indices. + * + * @param sequenceIndex + * @return The track block, or nullptr if it doesn’t exist. + */ + const rct_preview_track* GetBlockForSequence(uint8_t sequenceIndex) const; }; namespace OpenRCT2 diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 8a3b3fa08a..54002069da 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -289,7 +289,7 @@ StringId TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const Ride& CoordsXY mapLocation = location.ToCoordsXY(); - TileElement* tileElement = map_get_first_element_at(mapLocation); + TileElement* tileElement = MapGetFirstElementAt(mapLocation); if (tileElement == nullptr) continue; @@ -368,7 +368,7 @@ StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& r { for (; x < MAXIMUM_MAP_SIZE_BIG; x += COORDS_XY_STEP) { - auto tileElement = map_get_first_element_at(CoordsXY{ x, y }); + auto tileElement = MapGetFirstElementAt(CoordsXY{ x, y }); do { if (tileElement == nullptr) @@ -402,7 +402,7 @@ StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& r } CoordsXY entranceLoc = location.ToCoordsXY(); - auto tileElement = map_get_first_element_at(entranceLoc); + auto tileElement = MapGetFirstElementAt(entranceLoc); do { if (tileElement == nullptr) @@ -431,7 +431,7 @@ StringId TrackDesign::CreateTrackDesignMaze(TrackDesignState& tds, const Ride& r } CoordsXY exitLoc = location.ToCoordsXY(); - tileElement = map_get_first_element_at(exitLoc); + tileElement = MapGetFirstElementAt(exitLoc); if (tileElement == nullptr) return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY; do @@ -474,7 +474,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(CoordsXY{ tile.x, tile.y }); + tile.element = MapGetFirstElementAt(CoordsXY{ tile.x, tile.y }); do { if (tile.element == nullptr) @@ -890,7 +890,7 @@ static void TrackDesignMirrorRide(TrackDesign* td6) entrance.y = -entrance.y; if (entrance.direction & 1) { - entrance.direction = direction_reverse(entrance.direction); + entrance.direction = DirectionReverse(entrance.direction); } } } @@ -914,7 +914,7 @@ static void TrackDesignMirrorMaze(TrackDesign* td6) { if (maze.direction & 1) { - maze.direction = direction_reverse(maze.direction); + maze.direction = DirectionReverse(maze.direction); } continue; } @@ -990,7 +990,7 @@ static GameActions::Result TrackDesignPlaceSceneryElementRemoveGhost( uint8_t quadrant = (scenery.flags >> 2) + _currentTrackPieceDirection; quadrant &= 3; - auto* sceneryEntry = get_small_scenery_entry(entryInfo->Index); + auto* sceneryEntry = GetSmallSceneryEntry(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)) @@ -1251,7 +1251,7 @@ static GameActions::Result TrackDesignPlaceSceneryElement( return GameActions::Result(); } - auto* pathElement = map_get_path_element_at(TileCoordsXYZ{ CoordsXYZ{ mapCoord.x, mapCoord.y, z } }); + auto* pathElement = MapGetPathElementAt(TileCoordsXYZ{ CoordsXYZ{ mapCoord.x, mapCoord.y, z } }); if (pathElement == nullptr) { return GameActions::Result(); @@ -1259,8 +1259,8 @@ static GameActions::Result TrackDesignPlaceSceneryElement( if (tds.PlaceOperation == PTD_OPERATION_PLACE) { - footpath_queue_chain_reset(); - footpath_remove_edges_at(mapCoord, reinterpret_cast(pathElement)); + FootpathQueueChainReset(); + FootpathRemoveEdgesAt(mapCoord, reinterpret_cast(pathElement)); } flags = GAME_COMMAND_FLAG_APPLY; @@ -1280,8 +1280,8 @@ static GameActions::Result TrackDesignPlaceSceneryElement( if (tds.PlaceOperation == PTD_OPERATION_PLACE) { - footpath_connect_edges(mapCoord, reinterpret_cast(pathElement), flags); - footpath_update_queue_chains(); + FootpathConnectEdges(mapCoord, reinterpret_cast(pathElement), flags); + FootpathUpdateQueueChains(); } return GameActions::Result(); @@ -1350,7 +1350,7 @@ static GameActions::Result TrackDesignPlaceMaze(TrackDesignState& tds, TrackDesi if (tds.PlaceOperation == PTD_OPERATION_DRAW_OUTLINES) { gMapSelectionTiles.clear(); - gMapSelectArrowPosition = CoordsXYZ{ coords, tile_element_height(coords) }; + gMapSelectArrowPosition = CoordsXYZ{ coords, TileElementHeight(coords) }; gMapSelectArrowDirection = _currentTrackPieceDirection; } @@ -1511,12 +1511,12 @@ static GameActions::Result TrackDesignPlaceMaze(TrackDesignState& tds, TrackDesi if (tds.PlaceOperation == PTD_OPERATION_GET_PLACE_Z) { - if (!map_is_location_valid(mapCoord)) + if (!MapIsLocationValid(mapCoord)) { continue; } - auto surfaceElement = map_get_surface_element_at(mapCoord); + auto surfaceElement = MapGetSurfaceElementAt(mapCoord); if (surfaceElement == nullptr) continue; int16_t surfaceZ = surfaceElement->GetBaseZ(); @@ -1564,7 +1564,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi if (tds.PlaceOperation == PTD_OPERATION_DRAW_OUTLINES) { gMapSelectionTiles.clear(); - gMapSelectArrowPosition = CoordsXYZ{ origin, tile_element_height(origin) }; + gMapSelectArrowPosition = CoordsXYZ{ origin, TileElementHeight(origin) }; gMapSelectArrowDirection = _currentTrackPieceDirection; } @@ -1668,12 +1668,12 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi 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)) + if (!MapIsLocationValid(tile)) { continue; } - auto surfaceElement = map_get_surface_element_at(tile); + auto surfaceElement = MapGetSurfaceElementAt(tile); if (surfaceElement == nullptr) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE); @@ -1744,7 +1744,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi if (tds.PlaceOperation != PTD_OPERATION_PLACE_QUERY) { auto tile = CoordsXY{ newCoords } + CoordsDirectionDelta[rotation]; - TileElement* tile_element = map_get_first_element_at(tile); + TileElement* tile_element = MapGetFirstElementAt(tile); newCoords.z = tds.Origin.z / COORDS_Z_STEP; newCoords.z += entrance.z; if (tile_element == nullptr) @@ -1904,7 +1904,7 @@ static GameActions::Result TrackDesignPlaceVirtual( gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; gMapSelectFlags &= ~MAP_SELECT_FLAG_GREEN; - map_invalidate_map_selection_tiles(); + MapInvalidateMapSelectionTiles(); } auto res = GameActions::Result(); @@ -2166,7 +2166,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) { gCurrentRotation = i; - view.viewPos = translate_3d_to_2d_with_z(i, centre) - offset; + view.viewPos = Translate3DTo2DWithZ(i, centre) - offset; viewport_paint(&view, &dpi, { view.viewPos, view.viewPos + ScreenCoordsXY{ size_x, size_y } }); dpi.bits += TRACK_PREVIEW_IMAGE_SIZE; diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index f6a3c36bf3..16664f51f6 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -96,7 +96,7 @@ void track_design_save_select_tile_element( 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, result.Message, {}); + ContextShowError(STR_SAVE_TRACK_SCENERY_UNABLE_TO_SELECT_ADDITIONAL_ITEM_OF_SCENERY, result.Message, {}); } } } @@ -109,14 +109,14 @@ void track_design_save_select_tile_element( void track_design_save_select_nearby_scenery(RideId rideIndex) { tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (track_design_save_should_select_scenery_around(rideIndex, it.element)) { track_design_save_select_nearby_scenery_for_tile(rideIndex, it.x, it.y); } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); gfx_invalidate_screen(); } @@ -204,7 +204,7 @@ static void track_design_save_push_tile_element(const CoordsXY& loc, TileElement if (_trackSavedTileElements.size() < TRACK_MAX_SAVED_TILE_ELEMENTS) { _trackSavedTileElements.push_back(tileElement); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); } } @@ -276,7 +276,7 @@ static TrackDesignAddStatus track_design_save_add_large_scenery(const CoordsXY& auto direction = tileElement->GetDirection(); auto sequence = tileElement->GetSequenceIndex(); - auto sceneryOrigin = map_large_scenery_get_origin( + auto sceneryOrigin = MapLargeSceneryGetOrigin( { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); if (!sceneryOrigin.has_value()) { @@ -292,7 +292,7 @@ static TrackDesignAddStatus track_design_save_add_large_scenery(const CoordsXY& 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); + auto largeElement = MapGetLargeScenerySegment({ tileLoc, static_cast(direction) }, sequence); if (largeElement != nullptr) { if (sequence == 0) @@ -414,7 +414,7 @@ static TrackDesignAddStatus track_design_save_add_tile_element( */ static void track_design_save_pop_tile_element(const CoordsXY& loc, TileElement* tileElement) { - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); // Find index of map element to remove size_t removeIndex = SIZE_MAX; @@ -493,7 +493,7 @@ static void track_design_save_remove_large_scenery(const CoordsXY& loc, LargeSce auto direction = tileElement->GetDirection(); auto sequence = tileElement->GetSequenceIndex(); - auto sceneryOrigin = map_large_scenery_get_origin( + auto sceneryOrigin = MapLargeSceneryGetOrigin( { loc.x, loc.y, z << 3, static_cast(direction) }, sequence, nullptr); if (!sceneryOrigin) { @@ -509,7 +509,7 @@ static void track_design_save_remove_large_scenery(const CoordsXY& loc, LargeSce 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); + auto largeElement = MapGetLargeScenerySegment({ tileLoc, static_cast(direction) }, sequence); if (largeElement != nullptr) { if (sequence == 0) @@ -618,7 +618,7 @@ static void track_design_save_select_nearby_scenery_for_tile(RideId rideIndex, i { 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 }); + tileElement = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (tileElement == nullptr) continue; do diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 38bf03f4f7..614b11c7e7 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -17,6 +17,7 @@ #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../object/StationObject.h" +#include "../paint/Paint.SessionFlags.h" #include "../paint/Paint.h" #include "../paint/Supports.h" #include "../paint/tile_element/Paint.TileElement.h" @@ -262,7 +263,7 @@ bool track_paint_util_has_fence( } void track_paint_util_paint_floor( - paint_session& session, uint8_t edges, ImageId colourFlags, uint16_t height, const uint32_t floorSprites[4], + PaintSession& session, uint8_t edges, ImageId colourFlags, uint16_t height, const uint32_t floorSprites[4], const StationObject* stationStyle) { if (stationStyle != nullptr && stationStyle->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS) @@ -291,23 +292,23 @@ void track_paint_util_paint_floor( } void track_paint_util_paint_fences( - paint_session& session, uint8_t edges, const CoordsXY& position, const TrackElement& trackElement, const Ride& ride, - const ImageId& colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation) + PaintSession& session, uint8_t edges, const CoordsXY& position, const TrackElement& trackElement, const Ride& ride, + const ImageId colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation) { if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, position, trackElement, ride, rotation)) { PaintAddImageAsChild( - session, colourFlags.WithIndex(fenceSprites[3]), { 0, 0, height }, { 32, 1, 7 }, { 0, 2, height + 2 }); + session, colourFlags.WithIndex(fenceSprites[3]), { 0, 0, height }, { { 0, 2, height + 2 }, { 32, 1, 7 } }); } if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, position, trackElement, ride, rotation)) { PaintAddImageAsChild( - session, colourFlags.WithIndex(fenceSprites[0]), { 0, 0, height }, { 1, 32, 7 }, { 2, 0, height + 2 }); + session, colourFlags.WithIndex(fenceSprites[0]), { 0, 0, height }, { { 2, 0, height + 2 }, { 1, 32, 7 } }); } if (edges & EDGE_SE && track_paint_util_has_fence(EDGE_SE, position, trackElement, ride, rotation)) { PaintAddImageAsParent( - session, colourFlags.WithIndex(fenceSprites[1]), { 0, 0, height }, { 32, 1, 7 }, { 0, 30, height + 2 }); + session, colourFlags.WithIndex(fenceSprites[1]), { 0, 0, height }, { { 0, 30, height + 2 }, { 32, 1, 7 } }); } if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, position, trackElement, ride, rotation)) { @@ -329,31 +330,31 @@ bool track_paint_util_should_paint_supports(const CoordsXY& position) } static void track_paint_util_draw_station_impl( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, uint16_t coverHeight, + PaintSession& 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, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement) + PaintSession& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement) { track_paint_util_draw_station_impl(session, ride, direction, height, height, trackElement, 5, 7); } void track_paint_util_draw_station_2( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement, + PaintSession& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { track_paint_util_draw_station_impl(session, ride, direction, height, height, trackElement, fenceOffsetA, fenceOffsetB); } void track_paint_util_draw_station_3( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, uint16_t coverHeight, + PaintSession& session, const Ride& ride, Direction direction, uint16_t height, uint16_t coverHeight, const TrackElement& trackElement) { track_paint_util_draw_station_impl(session, ride, direction, height, coverHeight, trackElement, 5, 7); } static void track_paint_util_draw_station_impl( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, uint16_t coverHeight, + PaintSession& session, const Ride& ride, Direction direction, uint16_t height, uint16_t coverHeight, const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB) { CoordsXY position = session.MapPosition; @@ -556,7 +557,7 @@ static void track_paint_util_draw_station_impl( } void track_paint_util_draw_station_inverted( - paint_session& session, const Ride& ride, Direction direction, int32_t height, const TrackElement& trackElement, + PaintSession& session, const Ride& ride, Direction direction, int32_t height, const TrackElement& trackElement, uint8_t stationVariant) { CoordsXY position = session.MapPosition; @@ -759,13 +760,13 @@ void track_paint_util_draw_station_inverted( } bool track_paint_util_draw_station_covers( - paint_session& session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height) + PaintSession& session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height) { return track_paint_util_draw_station_covers_2(session, edge, hasFence, stationObject, height, STATION_VARIANT_BASIC); } bool track_paint_util_draw_station_covers_2( - paint_session& session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height, + PaintSession& session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height, uint8_t stationVariant) { if (stationObject == nullptr) @@ -831,7 +832,7 @@ bool track_paint_util_draw_station_covers_2( } void track_paint_util_draw_narrow_station_platform( - paint_session& session, const Ride& ride, Direction direction, int32_t height, int32_t zOffset, + PaintSession& session, const Ride& ride, Direction direction, int32_t height, int32_t zOffset, const TrackElement& trackElement) { CoordsXY position = session.MapPosition; @@ -880,7 +881,7 @@ void track_paint_util_draw_narrow_station_platform( } void track_paint_util_draw_pier( - paint_session& session, const Ride& ride, const StationObject* stationObj, const CoordsXY& position, Direction direction, + PaintSession& 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) @@ -929,23 +930,23 @@ void track_paint_util_draw_pier( } } -void track_paint_util_draw_station_metal_supports(paint_session& session, Direction direction, uint16_t height, ImageId colour) +void track_paint_util_draw_station_metal_supports(PaintSession& session, Direction direction, uint16_t height, ImageId colour) { track_paint_util_draw_station_metal_supports_2(session, direction, height, colour, 3); } void track_paint_util_draw_station_metal_supports_2( - paint_session& session, Direction direction, uint16_t height, ImageId colour, uint8_t type) + PaintSession& session, Direction direction, uint16_t height, ImageId colour, uint8_t type) { if (direction & 1) { - metal_a_supports_paint_setup(session, type, 6, 0, height, colour); - metal_a_supports_paint_setup(session, type, 7, 0, height, colour); + MetalASupportsPaintSetup(session, type, 6, 0, height, colour); + MetalASupportsPaintSetup(session, type, 7, 0, height, colour); } else { - metal_a_supports_paint_setup(session, type, 5, 0, height, colour); - metal_a_supports_paint_setup(session, type, 8, 0, height, colour); + MetalASupportsPaintSetup(session, type, 5, 0, height, colour); + MetalASupportsPaintSetup(session, type, 8, 0, height, colour); } } @@ -974,12 +975,12 @@ constexpr CoordsXY defaultRightHelixUpSmallQuarterBoundLengths[4][3][2] = { constexpr CoordsXYZ defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { { - { { 0, 6, 8 }, { 0, 0, 0 } }, + { { 0, 6, 0 }, { 0, 0, 0 } }, { { 16, 16, 0 }, { 0, 0, 0 } }, - { { 6, 0, 8 }, { 0, 0, 0 } }, + { { 6, 0, 0 }, { 0, 0, 0 } }, }, { - { { 6, 0, 8 }, { 0, 0, 0 } }, + { { 6, 0, 0 }, { 0, 0, 0 } }, { { 16, 0, 0 }, { 0, 0, 0 } }, { { 0, 6, 0 }, { 0, 27, 0 } }, }, @@ -989,7 +990,7 @@ constexpr CoordsXYZ defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { { { 0, 0, 0 }, { 27, 0, 0 } }, }, { - { { 6, 0, 8 }, { 27, 0, 0 } }, + { { 6, 0, 0 }, { 27, 0, 0 } }, { { 0, 16, 0 }, { 0, 0, 0 } }, { { 0, 6, 0 }, { 0, 0, 0 } }, }, @@ -1003,8 +1004,8 @@ static constexpr const int8_t right_helix_up_small_quarter_tiles_sprite_map[] = }; 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, - const ImageId& colourFlags, const uint32_t sprites[4][3][2], const CoordsXY offsets[4][3][2], + PaintSession& session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3][2], const CoordsXY offsets[4][3][2], const CoordsXY boundsLengths[4][3][2], const CoordsXYZ boundsOffsets[4][3][2]) { int32_t index = right_helix_up_small_quarter_tiles_sprite_map[trackSequence]; @@ -1039,14 +1040,14 @@ void track_paint_util_right_helix_up_small_quarter_tiles_paint( constexpr CoordsXYZ defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2] = { { - { { 0, 6, 8 }, { 0, 0, 0 } }, + { { 0, 6, 0 }, { 0, 0, 0 } }, { { 0, 16, 0 }, { 0, 0, 0 } }, { { 0, 0, 0 }, { 0, 0, 0 } }, { { 16, 0, 0 }, { 0, 0, 0 } }, - { { 6, 0, 8 }, { 0, 0, 0 } }, + { { 6, 0, 0 }, { 0, 0, 0 } }, }, { - { { 6, 0, 8 }, { 0, 0, 0 } }, + { { 6, 0, 0 }, { 0, 0, 0 } }, { { 16, 0, 0 }, { 0, 0, 0 } }, { { 0, 16, 0 }, { 0, 0, 0 } }, { { 0, 0, 0 }, { 0, 0, 0 } }, @@ -1060,7 +1061,7 @@ constexpr CoordsXYZ defaultRightHelixUpLargeQuarterBoundOffsets[4][5][2] = { { { 0, 0, 0 }, { 27, 0, 0 } }, }, { - { { 6, 0, 8 }, { 27, 0, 0 } }, + { { 6, 0, 0 }, { 27, 0, 0 } }, { { 0, 0, 0 }, { 0, 0, 0 } }, { { 16, 0, 0 }, { 0, 0, 0 } }, { { 0, 16, 0 }, { 0, 0, 0 } }, @@ -1103,8 +1104,8 @@ 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, - const ImageId& colourFlags, const uint32_t sprites[4][5][2], const CoordsXY offsets[4][5][2], + PaintSession& session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][5][2], const CoordsXY offsets[4][5][2], const CoordsXY boundsLengths[4][5][2], const CoordsXYZ boundsOffsets[4][5][2]) { int32_t index = right_helix_up_large_quarter_sprite_map[trackSequence]; @@ -1280,8 +1281,8 @@ 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, - const ImageId& colourFlags, const uint32_t sprites[4][4], const CoordsXY offsets[4][4], const CoordsXY boundsLengths[4][4], + PaintSession& session, const int8_t thickness[4][4], int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][4], const CoordsXY offsets[4][4], const CoordsXY boundsLengths[4][4], const CoordsXYZ boundsOffsets[4][4]) { int32_t index = eighth_to_diag_sprite_map[trackSequence]; @@ -1322,8 +1323,8 @@ static constexpr const int8_t diag_sprite_map[4][4] = { }; void track_paint_util_diag_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4], + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4], const CoordsXYZ boundsOffsets[4]) { int32_t index = diag_sprite_map[direction][trackSequence]; @@ -1444,8 +1445,8 @@ static constexpr const int8_t right_quarter_turn_5_tiles_sprite_map[] = { }; void track_paint_util_right_quarter_turn_5_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][5], const CoordsXY offsets[4][5], const CoordsXY boundsLengths[4][5], + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][5], const CoordsXY offsets[4][5], const CoordsXY boundsLengths[4][5], const CoordsXYZ boundsOffsets[4][5]) { int32_t index = right_quarter_turn_5_tiles_sprite_map[trackSequence]; @@ -1465,8 +1466,8 @@ void track_paint_util_right_quarter_turn_5_tiles_paint( } void track_paint_util_right_quarter_turn_5_tiles_paint_2( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[][5]) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[][5]) { int8_t sprite = right_quarter_turn_5_tiles_sprite_map[trackSequence]; if (sprite < 0) @@ -1474,7 +1475,7 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( return; } - const sprite_bb* spriteBB = &sprites[direction][sprite]; + const SpriteBb* spriteBB = &sprites[direction][sprite]; const auto imageId = colourFlags.WithIndex(spriteBB->sprite_id); const auto& offset = spriteBB->offset; const auto& bbOffset = spriteBB->bb_offset; @@ -1484,8 +1485,8 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2( } void track_paint_util_right_quarter_turn_5_tiles_paint_3( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[][5]) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[][5]) { int8_t sprite = right_quarter_turn_5_tiles_sprite_map[trackSequence]; if (sprite < 0) @@ -1493,35 +1494,35 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_3( return; } - const sprite_bb* spriteBB = &sprites[direction][sprite]; + const SpriteBb* spriteBB = &sprites[direction][sprite]; const auto imageId = colourFlags.WithIndex(spriteBB->sprite_id); 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( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType) { if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, tunnelType); + PaintUtilPushTunnelLeft(session, height, tunnelType); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, tunnelType); + PaintUtilPushTunnelRight(session, height, tunnelType); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, tunnelType); + PaintUtilPushTunnelLeft(session, height, tunnelType); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, tunnelType); + PaintUtilPushTunnelRight(session, height, tunnelType); } } void track_paint_util_right_quarter_turn_5_tiles_wooden_supports( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence) { if (trackSequence != 1 && trackSequence != 4) { @@ -1532,7 +1533,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]); + WoodenASupportsPaintSetup(session, supportType, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -1620,8 +1621,8 @@ static constexpr const int8_t right_quarter_turn_3_tiles_sprite_map[] = { }; void track_paint_util_right_quarter_turn_3_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3], const CoordsXY offsets[4][3], const CoordsXY boundsLengths[4][3], + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3], const CoordsXY offsets[4][3], const CoordsXY boundsLengths[4][3], const CoordsXYZ boundsOffsets[4][3]) { int32_t index = right_quarter_turn_3_tiles_sprite_map[trackSequence]; @@ -1641,16 +1642,16 @@ void track_paint_util_right_quarter_turn_3_tiles_paint( } void track_paint_util_right_quarter_turn_3_tiles_paint_2( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3]) + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3]) { track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset( session, thickness, height, direction, trackSequence, colourFlags, sprites, 0); } void track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3], int32_t heightOffset) + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3], int32_t heightOffset) { int8_t sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence]; if (sprite < 0) @@ -1737,15 +1738,15 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset( } void track_paint_util_right_quarter_turn_3_tiles_paint_3( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[4][3]) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[4][3]) { int8_t sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence]; if (sprite < 0) { return; } - const sprite_bb* spriteBB = &sprites[direction][sprite]; + const SpriteBb* spriteBB = &sprites[direction][sprite]; const auto& offset = spriteBB->offset; const auto& bbOffset = spriteBB->bb_offset; PaintAddImageAsParent( @@ -1754,8 +1755,8 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_3( } void track_paint_util_right_quarter_turn_3_tiles_paint_4( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[4][3]) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[4][3]) { int8_t sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence]; if (sprite < 0) @@ -1763,77 +1764,75 @@ void track_paint_util_right_quarter_turn_3_tiles_paint_4( return; } - const sprite_bb* spriteBB = &sprites[direction][sprite]; + const SpriteBb* spriteBB = &sprites[direction][sprite]; const auto imageId = colourFlags.WithIndex(spriteBB->sprite_id); 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( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType) { if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, tunnelType); + PaintUtilPushTunnelLeft(session, height, tunnelType); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height, tunnelType); + PaintUtilPushTunnelRight(session, height, tunnelType); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height, tunnelType); + PaintUtilPushTunnelLeft(session, height, tunnelType); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, tunnelType); + PaintUtilPushTunnelRight(session, height, tunnelType); } } void track_paint_util_right_quarter_turn_3_tiles_25_deg_up_tunnel( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, - uint8_t tunnelType3) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, uint8_t tunnelType3) { if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height - 8, tunnelType0); + PaintUtilPushTunnelLeft(session, height - 8, tunnelType0); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height + 8, tunnelType3); + PaintUtilPushTunnelRight(session, height + 8, tunnelType3); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height + 8, tunnelType3); + PaintUtilPushTunnelLeft(session, height + 8, tunnelType3); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height - 8, tunnelType0); + PaintUtilPushTunnelRight(session, height - 8, tunnelType0); } } void track_paint_util_right_quarter_turn_3_tiles_25_deg_down_tunnel( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, - uint8_t tunnelType3) + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, uint8_t tunnelType3) { if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height + 8, tunnelType0); + PaintUtilPushTunnelLeft(session, height + 8, tunnelType0); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height - 8, tunnelType3); + PaintUtilPushTunnelRight(session, height - 8, tunnelType3); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height - 8, tunnelType3); + PaintUtilPushTunnelLeft(session, height - 8, tunnelType3); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height + 8, tunnelType0); + PaintUtilPushTunnelRight(session, height + 8, tunnelType0); } } @@ -1845,16 +1844,16 @@ static constexpr const int8_t left_quarter_turn_3_tiles_sprite_map[] = { }; void track_paint_util_left_quarter_turn_3_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3]) + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3]) { track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset( session, thickness, height, direction, trackSequence, colourFlags, sprites, 0); } void track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3], int32_t heightOffset) + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3], int32_t heightOffset) { int8_t sprite = left_quarter_turn_3_tiles_sprite_map[trackSequence]; if (sprite < 0) @@ -1941,32 +1940,32 @@ void track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset( } void track_paint_util_left_quarter_turn_3_tiles_tunnel( - paint_session& session, int16_t height, uint8_t tunnelType, Direction direction, uint8_t trackSequence) + PaintSession& session, int16_t height, uint8_t tunnelType, Direction direction, uint8_t trackSequence) { if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, tunnelType); + PaintUtilPushTunnelLeft(session, height, tunnelType); } if (direction == 2 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height, tunnelType); + PaintUtilPushTunnelRight(session, height, tunnelType); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, tunnelType); + PaintUtilPushTunnelRight(session, height, tunnelType); } if (direction == 3 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height, tunnelType); + PaintUtilPushTunnelLeft(session, height, tunnelType); } } void track_paint_util_left_quarter_turn_1_tile_paint( - paint_session& session, int8_t thickness, int16_t height, int16_t boundBoxZOffset, Direction direction, - const ImageId& colourFlags, const uint32_t* sprites) + PaintSession& session, int8_t thickness, int16_t height, int16_t boundBoxZOffset, Direction direction, + const ImageId colourFlags, const uint32_t* sprites) { auto imageId = colourFlags.WithIndex(sprites[direction]); @@ -1992,7 +1991,7 @@ void track_paint_util_left_quarter_turn_1_tile_paint( } void track_paint_util_right_quarter_turn_1_tile_tunnel( - paint_session& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, + PaintSession& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, uint8_t endTunnel) { track_paint_util_left_quarter_turn_1_tile_tunnel( @@ -2000,25 +1999,25 @@ void track_paint_util_right_quarter_turn_1_tile_tunnel( } void track_paint_util_left_quarter_turn_1_tile_tunnel( - paint_session& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, + PaintSession& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, uint8_t endTunnel) { switch (direction) { case 0: - paint_util_push_tunnel_left(session, baseHeight + startOffset, startTunnel); + PaintUtilPushTunnelLeft(session, baseHeight + startOffset, startTunnel); break; case 2: - paint_util_push_tunnel_right(session, baseHeight + endOffset, endTunnel); + PaintUtilPushTunnelRight(session, baseHeight + endOffset, endTunnel); break; case 3: - paint_util_push_tunnel_right(session, baseHeight + startOffset, startTunnel); - paint_util_push_tunnel_left(session, baseHeight + endOffset, endTunnel); + PaintUtilPushTunnelRight(session, baseHeight + startOffset, startTunnel); + PaintUtilPushTunnelLeft(session, baseHeight + endOffset, endTunnel); break; } } -void track_paint_util_spinning_tunnel_paint(paint_session& session, int8_t thickness, int16_t height, Direction direction) +void track_paint_util_spinning_tunnel_paint(PaintSession& session, int8_t thickness, int16_t height, Direction direction) { int32_t frame = gCurrentTicks >> 2 & 3; auto colourFlags = session.TrackColours[SCHEME_SUPPORTS]; @@ -2032,11 +2031,11 @@ void track_paint_util_spinning_tunnel_paint(paint_session& session, int8_t thick auto imageId = colourFlags.WithIndex(trackSpritesGhostTrainSpinningTunnel[direction & 1][0][frame]); if (direction == 0 || direction == 2) { - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 28, 20, thickness }, { 2, 6, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 6, height }, { 28, 20, thickness } }); } else { - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 20, 28, thickness }, { 6, 2, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 6, 2, height }, { 20, 28, thickness } }); } imageId = colourFlags.WithIndex(trackSpritesGhostTrainSpinningTunnel[direction & 1][1][frame]); @@ -2051,7 +2050,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 TrackElement& trackElement) + PaintSession& 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 }, @@ -2067,29 +2066,29 @@ void track_paint_util_onride_photo_small_paint( { case 0: PaintAddImageAsParent(session, imageId, { 26, 0, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 26, 31, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 26, 28, height - 3 }, { 1, 1, 19 }); PaintAddImageAsParent(session, flashImageId, { 6, 0, height }, { 1, 1, 19 }); break; case 1: PaintAddImageAsParent(session, imageId, { 0, 6, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 31, 6, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 28, 6, height - 3 }, { 1, 1, 19 }); PaintAddImageAsParent(session, flashImageId, { 0, 26, height }, { 1, 1, 19 }); break; case 2: PaintAddImageAsParent(session, imageId, { 6, 0, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 6, 31, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, flashImageId, { 26, 31, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 6, 28, height - 3 }, { 1, 1, 19 }); + PaintAddImageAsParent(session, flashImageId, { 26, 28, height - 3 }, { 1, 1, 19 }); break; case 3: PaintAddImageAsParent(session, imageId, { 0, 26, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 31, 26, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, flashImageId, { 31, 6, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 28, 26, height - 3 }, { 1, 1, 19 }); + PaintAddImageAsParent(session, flashImageId, { 28, 6, height - 3 }, { 1, 1, 19 }); break; } } void track_paint_util_onride_photo_paint( - paint_session& session, Direction direction, int32_t height, const TrackElement& trackElement) + PaintSession& 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 }, @@ -2105,23 +2104,23 @@ void track_paint_util_onride_photo_paint( { case 0: PaintAddImageAsParent(session, imageId, { 26, 0, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 26, 31, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 26, 28, height - 3 }, { 1, 1, 19 }); PaintAddImageAsParent(session, flashImageId, { 6, 0, height }, { 1, 1, 19 }); break; case 1: PaintAddImageAsParent(session, imageId, { 0, 6, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 31, 6, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 28, 6, height - 3 }, { 1, 1, 19 }); PaintAddImageAsParent(session, flashImageId, { 0, 26, height }, { 1, 1, 19 }); break; case 2: PaintAddImageAsParent(session, imageId, { 6, 0, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 6, 31, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, flashImageId, { 26, 31, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 6, 28, height - 3 }, { 1, 1, 19 }); + PaintAddImageAsParent(session, flashImageId, { 26, 28, height - 3 }, { 1, 1, 19 }); break; case 3: PaintAddImageAsParent(session, imageId, { 0, 26, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, imageId, { 31, 26, height }, { 1, 1, 19 }); - PaintAddImageAsParent(session, flashImageId, { 31, 6, height }, { 1, 1, 19 }); + PaintAddImageAsParent(session, imageId, { 28, 26, height - 3 }, { 1, 1, 19 }); + PaintAddImageAsParent(session, flashImageId, { 28, 6, height - 3 }, { 1, 1, 19 }); break; } } @@ -2139,7 +2138,7 @@ static constexpr const uint16_t RightVerticalLoopSegments[] = { SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, }; -void track_paint_util_right_vertical_loop_segments(paint_session& session, Direction direction, uint8_t trackSequence) +void track_paint_util_right_vertical_loop_segments(PaintSession& session, Direction direction, uint8_t trackSequence) { if (trackSequence > 9) { @@ -2147,25 +2146,25 @@ void track_paint_util_right_vertical_loop_segments(paint_session& session, Direc return; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(RightVerticalLoopSegments[trackSequence], direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(RightVerticalLoopSegments[trackSequence], direction), 0xFFFF, 0); } -void track_paint_util_left_corkscrew_up_supports(paint_session& session, Direction direction, uint16_t height) +void track_paint_util_left_corkscrew_up_supports(PaintSession& session, Direction direction, uint16_t height) { // TODO: Figure out which of these looks best, and use one to keep a consistent world if (direction == 2) { - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction != 2) { - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); } } @@ -2173,7 +2172,7 @@ void track_paint_util_left_corkscrew_up_supports(paint_session& session, Directi * * rct2: 0x006C4794 */ -void PaintTrack(paint_session& session, Direction direction, int32_t height, const TrackElement& trackElement) +void PaintTrack(PaintSession& session, Direction direction, int32_t height, const TrackElement& trackElement) { RideId rideIndex = trackElement.GetRideIndex(); auto ride = get_ride(rideIndex); diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index dcd7cf9143..85c80981a9 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -282,122 +282,122 @@ extern const size_t MiniGolfPeepAnimationLengths[]; bool track_paint_util_has_fence( 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, ImageId colourFlags, uint16_t height, const uint32_t floorSprites[4], + PaintSession& session, uint8_t edges, ImageId 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 TrackElement& trackElement, const Ride& ride, - const ImageId& colourFlags, uint16_t height, const uint32_t fenceSprites[4], uint8_t rotation); + PaintSession& session, uint8_t edges, const CoordsXY& position, const TrackElement& trackElement, const Ride& ride, + const ImageId 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); + PaintSession& 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, + PaintSession& session, enum edge_t edge, bool hasFence, const StationObject* stationObject, uint16_t height, uint8_t stationVariant); void track_paint_util_draw_narrow_station_platform( - paint_session& session, const Ride& ride, Direction direction, int32_t height, int32_t zOffset, + PaintSession& session, const Ride& ride, Direction direction, int32_t height, int32_t zOffset, const TrackElement& trackElement); void track_paint_util_draw_station( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement); + PaintSession& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement); void track_paint_util_draw_station_2( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement, + PaintSession& session, const Ride& ride, Direction direction, uint16_t height, const TrackElement& trackElement, int32_t fenceOffsetA, int32_t fenceOffsetB); void track_paint_util_draw_station_3( - paint_session& session, const Ride& ride, Direction direction, uint16_t height, uint16_t coverHeight, + PaintSession& 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, const Ride& ride, Direction direction, int32_t height, const TrackElement& trackElement, + PaintSession& session, const Ride& ride, Direction direction, int32_t height, const TrackElement& trackElement, uint8_t stationVariant); bool track_paint_util_should_paint_supports(const CoordsXY& position); void track_paint_util_draw_pier( - paint_session& session, const Ride& ride, const StationObject* stationObject, const CoordsXY& position, Direction direction, + PaintSession& 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, ImageId colour); +void track_paint_util_draw_station_metal_supports(PaintSession& session, Direction direction, uint16_t height, ImageId colour); void track_paint_util_draw_station_metal_supports_2( - paint_session& session, Direction direction, uint16_t height, ImageId colour, uint8_t type); + PaintSession& session, Direction direction, uint16_t height, ImageId colour, uint8_t type); void track_paint_util_right_quarter_turn_5_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][5], const CoordsXY offsets[4][5], const CoordsXY boundsLengths[4][5], + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][5], const CoordsXY offsets[4][5], const CoordsXY boundsLengths[4][5], const CoordsXYZ boundsOffsets[4][5]); void track_paint_util_right_quarter_turn_5_tiles_paint_2( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[][5]); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[][5]); void track_paint_util_right_quarter_turn_5_tiles_paint_3( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[][5]); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[][5]); void track_paint_util_right_quarter_turn_5_tiles_tunnel( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType); void track_paint_util_right_quarter_turn_5_tiles_wooden_supports( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence); void track_paint_util_right_quarter_turn_3_tiles_25_deg_up_tunnel( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, uint8_t tunnelType3); void track_paint_util_right_quarter_turn_3_tiles_25_deg_down_tunnel( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType0, uint8_t tunnelType3); void track_paint_util_right_quarter_turn_3_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3], const CoordsXY offsets[4][3], const CoordsXY boundsLengths[4][3], + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3], const CoordsXY offsets[4][3], const CoordsXY boundsLengths[4][3], const CoordsXYZ boundsOffsets[4][3]); void track_paint_util_right_quarter_turn_3_tiles_paint_2( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3]); + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3]); void track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3], int32_t heightOffset); + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3], int32_t heightOffset); void track_paint_util_right_quarter_turn_3_tiles_paint_3( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[4][3]); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[4][3]); void track_paint_util_right_quarter_turn_3_tiles_paint_4( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId& colourFlags, - const sprite_bb sprites[4][3]); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags, + const SpriteBb sprites[4][3]); void track_paint_util_right_quarter_turn_3_tiles_tunnel( - paint_session& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType); + PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, uint8_t tunnelType); void track_paint_util_left_quarter_turn_3_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3]); + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3]); void track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4][3], int32_t heightOffset); + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3], int32_t heightOffset); void track_paint_util_left_quarter_turn_3_tiles_tunnel( - paint_session& session, int16_t height, uint8_t tunnelType, Direction direction, uint8_t trackSequence); + PaintSession& session, int16_t height, uint8_t tunnelType, Direction direction, uint8_t trackSequence); void track_paint_util_left_quarter_turn_1_tile_paint( - paint_session& session, int8_t thickness, int16_t height, int16_t boundBoxZOffset, Direction direction, - const ImageId& colourFlags, const uint32_t* sprites); -void track_paint_util_spinning_tunnel_paint(paint_session& session, int8_t thickness, int16_t height, Direction direction); + PaintSession& session, int8_t thickness, int16_t height, int16_t boundBoxZOffset, Direction direction, + const ImageId colourFlags, const uint32_t* sprites); +void track_paint_util_spinning_tunnel_paint(PaintSession& 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 TrackElement& trackElement); + PaintSession& 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 TrackElement& trackElement); + PaintSession& 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, - const ImageId& colourFlags, const uint32_t sprites[4][3][2], const CoordsXY offsets[4][3][2], + PaintSession& session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][3][2], const CoordsXY offsets[4][3][2], const CoordsXY boundsLengths[4][3][2], const CoordsXYZ boundsOffsets[4][3][2]); 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, - const ImageId& colourFlags, const uint32_t sprites[4][5][2], const CoordsXY offsets[4][5][2], + PaintSession& session, const int8_t thickness[2], int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][5][2], const CoordsXY offsets[4][5][2], const CoordsXY boundsLengths[4][5][2], const CoordsXYZ boundsOffsets[4][5][2]); 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, - const ImageId& colourFlags, const uint32_t sprites[4][4], const CoordsXY offsets[4][4], const CoordsXY boundsLengths[4][4], + PaintSession& session, const int8_t thickness[4][4], int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4][4], const CoordsXY offsets[4][4], const CoordsXY boundsLengths[4][4], const CoordsXYZ boundsOffsets[4][4]); void track_paint_util_diag_tiles_paint( - paint_session& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, - const ImageId& colourFlags, const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4], + PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence, + const ImageId colourFlags, const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4], const CoordsXYZ boundsOffsets[4]); void track_paint_util_left_quarter_turn_1_tile_tunnel( - paint_session& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, + PaintSession& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, uint8_t endTunnel); void track_paint_util_right_quarter_turn_1_tile_tunnel( - paint_session& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, + PaintSession& session, Direction direction, uint16_t baseHeight, int8_t startOffset, uint8_t startTunnel, int8_t endOffset, uint8_t endTunnel); -void track_paint_util_right_vertical_loop_segments(paint_session& session, Direction direction, uint8_t trackSequence); +void track_paint_util_right_vertical_loop_segments(PaintSession& session, Direction direction, uint8_t trackSequence); -void track_paint_util_left_corkscrew_up_supports(paint_session& session, Direction direction, uint16_t height); +void track_paint_util_left_corkscrew_up_supports(PaintSession& session, Direction direction, uint16_t height); using TRACK_PAINT_FUNCTION = void (*)( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& 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); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index eebcba6ebb..568181b484 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -91,72 +91,6 @@ static constexpr const OpenRCT2::Audio::SoundId _screamSet2[] = { OpenRCT2::Audio::SoundId::Scream6, }; -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[] = { @@ -856,7 +790,7 @@ OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) panX = g_music_tracking_viewport->zoom.ApplyInversedTo(panX); panX += g_music_tracking_viewport->pos.x; - uint16_t screenWidth = context_get_width(); + uint16_t screenWidth = ContextGetWidth(); if (screenWidth < 64) { screenWidth = 64; @@ -867,7 +801,7 @@ OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) panY = g_music_tracking_viewport->zoom.ApplyInversedTo(panY); panY += g_music_tracking_viewport->pos.y; - uint16_t screenHeight = context_get_height(); + uint16_t screenHeight = ContextGetHeight(); if (screenHeight < 64) { screenHeight = 64; @@ -898,7 +832,7 @@ OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) if (x != LOCATION_NULL) { - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // vehicle underground if (surfaceElement != nullptr && surfaceElement->GetBaseZ() > z) @@ -1047,6 +981,64 @@ static OpenRCT2::Audio::VehicleSound* vehicle_sounds_update_get_vehicle_sound(Op return nullptr; } +static bool IsLoopingSound(SoundId id) +{ + switch (id) + { + case SoundId::LiftClassic: + case SoundId::TrackFrictionClassicWood: + case SoundId::FrictionClassic: + case SoundId::LiftFrictionWheels: + case SoundId::GoKartEngine: + case SoundId::TrackFrictionTrain: + case SoundId::TrackFrictionWater: + case SoundId::LiftArrow: + case SoundId::LiftWood: + case SoundId::TrackFrictionWood: + case SoundId::LiftWildMouse: + case SoundId::LiftBM: + case SoundId::TrackFrictionBM: + case SoundId::LiftRMC: + case SoundId::TrackFrictionRMC: + return true; + default: + return false; + } +} + +static bool IsFixedFrequencySound(SoundId id) +{ + switch (id) + { + case SoundId::Scream1: + case SoundId::Scream2: + case SoundId::Scream3: + case SoundId::Scream4: + case SoundId::Scream5: + case SoundId::Scream6: + case SoundId::Scream7: + case SoundId::Scream8: + case SoundId::TrainWhistle: + case SoundId::TrainDeparting: + case SoundId::Tram: + return true; + default: + return false; + } +} + +static bool IsSpecialFrequencySound(SoundId id) +{ + switch (id) + { + case SoundId::TrackFrictionBM: + case SoundId::TrackFrictionRMC: + return true; + default: + return false; + } +} + enum class SoundType { TrackNoises, @@ -1057,7 +1049,7 @@ template static uint16_t SoundFrequency(const OpenRCT2::Audio::S { if constexpr (type == SoundType::TrackNoises) { - if (_soundParams[static_cast(id)][1] & 2) + if (IsSpecialFrequencySound(id)) { return (baseFrequency / 2) + 4000; } @@ -1065,7 +1057,7 @@ template static uint16_t SoundFrequency(const OpenRCT2::Audio::S } else { - if (_soundParams[static_cast(id)][1] & 1) + if (IsFixedFrequencySound(id)) { return 22050; } @@ -1075,7 +1067,7 @@ template static uint16_t SoundFrequency(const OpenRCT2::Audio::S template static bool ShouldUpdateChannelRate(const OpenRCT2::Audio::SoundId id) { - return type == SoundType::TrackNoises || !(_soundParams[static_cast(id)][1] & 1); + return type == SoundType::TrackNoises || !IsFixedFrequencySound(id); } template @@ -1105,7 +1097,7 @@ static void UpdateSound( if (sound.Id == OpenRCT2::Audio::SoundId::Null) { auto frequency = SoundFrequency(id, sound_params->frequency); - auto looping = _soundParams[static_cast(id)][0]; + auto looping = IsLoopingSound(id); auto pan = sound_params->pan_x; auto channel = CreateAudioChannel( id, looping, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), false); @@ -1737,13 +1729,13 @@ void Vehicle::UpdateMeasurements() return; } - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); // If vehicle above ground. if (surfaceElement != nullptr && surfaceElement->GetBaseZ() <= z) { // 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(CoordsXY{ x, y }); + auto tileElement = MapGetFirstElementAt(CoordsXY{ x, y }); if (tileElement == nullptr) return; @@ -2619,7 +2611,7 @@ static rct_synchronised_vehicle* _lastSynchronisedVehicle = nullptr; static bool try_add_synchronised_station(const CoordsXYZ& coords) { // make sure we are in map bounds - if (!map_is_location_valid(coords)) + if (!MapIsLocationValid(coords)) { return false; } @@ -2719,7 +2711,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex const auto& station = ride.GetStation(stationIndex); auto location = station.GetStart(); - auto tileElement = map_get_track_element_at(location); + auto tileElement = MapGetTrackElementAt(location); if (tileElement == nullptr) { return false; @@ -2753,7 +2745,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex // Other search direction. location = station.GetStart(); - direction = direction_reverse(direction) & 3; + direction = DirectionReverse(direction) & 3; spaceBetween = maxCheckDistance; while (_lastSynchronisedVehicle < &_synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT - 1]) { @@ -3027,7 +3019,7 @@ void Vehicle::TestReset() // Therefore, it will return true if anything is amiss. bool Vehicle::CurrentTowerElementIsTop() { - TileElement* tileElement = map_get_track_element_at_of_type(TrackLocation, GetTrackType()); + TileElement* tileElement = MapGetTrackElementAtOfType(TrackLocation, GetTrackType()); if (tileElement == nullptr) return true; @@ -3410,7 +3402,7 @@ void Vehicle::CheckIfMissing() curRide->lifecycle_flags |= RIDE_LIFECYCLE_HAS_STALLED_VEHICLE; - if (gConfigNotifications.ride_stalled_vehicles) + if (gConfigNotifications.RideStalledVehicles) { Formatter ft; ft.Add(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number); @@ -3957,7 +3949,7 @@ void Vehicle::UpdateArriving() return; } - auto trackElement = map_get_track_element_at(TrackLocation); + auto trackElement = MapGetTrackElementAt(TrackLocation); if (trackElement == nullptr) { @@ -4239,7 +4231,7 @@ void Vehicle::TryReconnectBoatToTrack(const CoordsXY& currentBoatLocation, const TrackLocation.x = trackCoords.x; TrackLocation.y = trackCoords.y; - auto trackElement = map_get_track_element_at(TrackLocation); + auto trackElement = MapGetTrackElementAt(TrackLocation); auto curRide = GetRide(); if (curRide != nullptr) @@ -4615,7 +4607,7 @@ void Vehicle::UpdateBoatLocation() */ static bool vehicle_boat_is_location_accessible(const CoordsXYZ& location) { - TileElement* tileElement = map_get_first_element_at(location); + TileElement* tileElement = MapGetFirstElementAt(location); if (tileElement == nullptr) return false; do @@ -5121,7 +5113,7 @@ void Vehicle::UpdateDoingCircusShow() */ static TileElement* vehicle_check_collision(const CoordsXYZ& vehiclePosition) { - TileElement* tileElement = map_get_first_element_at(vehiclePosition); + TileElement* tileElement = MapGetFirstElementAt(vehiclePosition); if (tileElement == nullptr) { return nullptr; @@ -5168,7 +5160,7 @@ static void ride_train_crash(Ride* ride, uint16_t numFatalities) if (numFatalities != 0) { - if (gConfigNotifications.ride_casualties) + if (gConfigNotifications.RideCasualties) { ride->FormatNameTo(ft); News::AddItemToQueue( @@ -5219,7 +5211,7 @@ void Vehicle::KillPassengers(Ride* curRide) { decrement_guests_in_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } peep_sprite_remove(curPeep); } @@ -5415,8 +5407,8 @@ void Vehicle::UpdateCrash() continue; } - int16_t height = tile_element_height(curPos); - int16_t waterHeight = tile_element_water_height(curPos); + int16_t height = TileElementHeight(curPos); + int16_t waterHeight = TileElementWaterHeight(curPos); int16_t zDiff; if (waterHeight != 0) { @@ -5442,7 +5434,7 @@ void Vehicle::UpdateCrash() 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(curPos)) + if (!MapIsLocationValid(curPos)) { curVehicle->CrashOnLand(); continue; @@ -5705,7 +5697,7 @@ void Vehicle::SetMapToolbar() const curRide->FormatStatusTo(ft); auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP); intent.putExtra(INTENT_EXTRA_FORMATTER, &ft); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -6127,7 +6119,7 @@ void Vehicle::CheckAndApplyBlockSectionStopSite() auto trackType = GetTrackType(); - TileElement* trackElement = map_get_track_element_at_of_type(TrackLocation, trackType); + TileElement* trackElement = MapGetTrackElementAtOfType(TrackLocation, trackType); if (trackElement == nullptr) { @@ -6221,7 +6213,7 @@ static void block_brakes_open_previous_section(Ride& ride, const CoordsXYZ& vehi location.z = trackBeginEnd.begin_z; tileElement = trackBeginEnd.begin_element; - //#2081: prevent infinite loop + // #2081: prevent infinite loop counter = !counter; if (counter) { @@ -6240,13 +6232,13 @@ static void block_brakes_open_previous_section(Ride& ride, const CoordsXYZ& vehi // Get the start of the track block instead of the end location = { trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z }; - auto trackElement = map_get_track_element_at(location); + auto trackElement = MapGetTrackElementAt(location); if (trackElement == nullptr) { return; } trackElement->SetBlockBrakeClosed(false); - map_invalidate_element(location, reinterpret_cast(trackElement)); + MapInvalidateElement(location, reinterpret_cast(trackElement)); auto trackType = trackElement->GetTrackType(); if (trackType == TrackElemType::BlockBrakes || trackType == TrackElemType::EndStation) @@ -6625,7 +6617,7 @@ void Vehicle::UpdateAnimationAnimalFlying() if (animation_frame == 0) { auto trackType = GetTrackType(); - TileElement* trackElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + TileElement* trackElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, trackType, 0); if (trackElement != nullptr && trackElement->AsTrack()->HasChain()) { // start flapping, bird @@ -6812,7 +6804,7 @@ void Vehicle::UpdateAdditionalAnimation() static void play_scenery_door_open_sound(const CoordsXYZ& loc, WallElement* tileElement) { auto* wallEntry = tileElement->GetEntry(); - int32_t doorSoundType = wall_entry_get_door_sound(wallEntry); + int32_t doorSoundType = WallEntryGetDoorSound(wallEntry); if (doorSoundType != 0) { auto soundId = DoorOpenSoundIds[doorSoundType - 1]; @@ -6830,7 +6822,7 @@ static void play_scenery_door_open_sound(const CoordsXYZ& loc, WallElement* tile static void play_scenery_door_close_sound(const CoordsXYZ& loc, WallElement* tileElement) { auto* wallEntry = tileElement->GetEntry(); - int32_t doorSoundType = wall_entry_get_door_sound(wallEntry); + int32_t doorSoundType = WallEntryGetDoorSound(wallEntry); if (doorSoundType != 0) { auto soundId = DoorCloseSoundIds[doorSoundType - 1]; @@ -6844,7 +6836,7 @@ static void play_scenery_door_close_sound(const CoordsXYZ& loc, WallElement* til template static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ& trackLocation, bool isLastVehicle) { - auto door = map_get_wall_element_at(doorLocation); + auto door = MapGetWallElementAt(doorLocation); if (door == nullptr) { return; @@ -6854,7 +6846,7 @@ static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ& { door->SetAnimationIsBackwards(isBackwards); door->SetAnimationFrame(1); - map_animation_create(MAP_ANIMATION_TYPE_WALL_DOOR, doorLocation); + MapAnimationCreate(MAP_ANIMATION_TYPE_WALL_DOOR, doorLocation); play_scenery_door_open_sound(trackLocation, door); } @@ -6917,7 +6909,7 @@ void Vehicle::UpdateLandscapeDoor() const } auto coords = CoordsXYZ{ x, y, TrackLocation.z }.ToTileStart(); - auto* tileElement = map_get_track_element_at_from_ride(coords, ride); + auto* tileElement = MapGetTrackElementAtFromRide(coords, ride); if (tileElement != nullptr && tileElement->GetType() == TileElementType::Track) { AnimateLandscapeDoor(tileElement->AsTrack(), next_vehicle_on_train.IsNull()); @@ -6949,7 +6941,7 @@ void Vehicle::UpdateGoKartAttemptSwitchLanes() if ((scenario_rand() & 0xFFFF) <= probability) { // This changes "riding left" to "moving to right lane" and "riding right" to "moving to left lane". - TrackSubposition = VehicleTrackSubposition{ static_cast(static_cast(TrackSubposition) + 2U) }; + TrackSubposition = VehicleTrackSubposition{ static_cast(static_cast(TrackSubposition) + 2u) }; } } @@ -6961,7 +6953,7 @@ static void trigger_on_ride_photo(const CoordsXYZ& loc, TileElement* tileElement { tileElement->AsTrack()->SetPhotoTimeout(); - map_animation_create(MAP_ANIMATION_TYPE_TRACK_ONRIDEPHOTO, { loc, tileElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_ONRIDEPHOTO, { loc, tileElement->GetBaseZ() }); } /** @@ -6976,7 +6968,7 @@ void Vehicle::UpdateSceneryDoorBackwards() const 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); + direction = DirectionReverse(direction); AnimateSceneryDoor({ wallCoords, static_cast(direction) }, TrackLocation, next_vehicle_on_train.IsNull()); } @@ -6990,7 +6982,7 @@ void Vehicle::UpdateLandscapeDoorBackwards() const } auto coords = CoordsXYZ{ TrackLocation, TrackLocation.z }; - auto* tileElement = map_get_track_element_at_from_ride(coords, ride); + auto* tileElement = MapGetTrackElementAtFromRide(coords, ride); if (tileElement != nullptr && tileElement->GetType() == TileElementType::Track) { AnimateLandscapeDoor(tileElement->AsTrack(), next_vehicle_on_train.IsNull()); @@ -7320,9 +7312,9 @@ void Vehicle::Sub6DBF3E() _vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_3; TileElement* tileElement = nullptr; - if (map_is_location_valid(TrackLocation)) + if (MapIsLocationValid(TrackLocation)) { - tileElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + tileElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, trackType, 0); } if (tileElement == nullptr) @@ -7399,7 +7391,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, Ride* cur CoordsXYZD location = {}; auto pitchAndRollEnd = TrackPitchAndRollEnd(trackType); - TileElement* tileElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + TileElement* tileElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, trackType, 0); if (tileElement == nullptr) { @@ -7423,7 +7415,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, Ride* cur OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::BlockBrakeRelease, TrackLocation); } } - map_invalidate_element(TrackLocation, tileElement); + MapInvalidateElement(TrackLocation, tileElement); block_brakes_open_previous_section(*curRide, TrackLocation, tileElement); } } @@ -7820,7 +7812,7 @@ static PitchAndRoll PitchAndRollEnd(Ride* curRide, bool useInvertedSprites, uint bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(uint16_t trackType, Ride* curRide, uint16_t* progress) { auto pitchAndRollStart = TrackPitchAndRollStart(trackType); - TileElement* tileElement = map_get_track_element_at_of_type_seq(TrackLocation, trackType, 0); + TileElement* tileElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, trackType, 0); if (tileElement == nullptr) return false; @@ -8238,7 +8230,7 @@ loc_6DC476: } } - tileElement = map_get_track_element_at_of_type_seq(TrackLocation, GetTrackType(), 0); + tileElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, GetTrackType(), 0); { CoordsXYE output; int32_t outZ{}; @@ -8282,7 +8274,7 @@ loc_6DC476: } if (TrackSubposition != VehicleTrackSubposition::MiniGolfStart9) { - TrackSubposition = VehicleTrackSubposition{ static_cast(static_cast(TrackSubposition) - 1U) }; + TrackSubposition = VehicleTrackSubposition{ static_cast(static_cast(TrackSubposition) - 1u) }; } } @@ -8455,7 +8447,7 @@ loc_6DCA9A: goto loc_6DCC2C; } - tileElement = map_get_track_element_at_of_type_seq(TrackLocation, GetTrackType(), 0); + tileElement = MapGetTrackElementAtOfTypeSeq(TrackLocation, GetTrackType(), 0); { track_begin_end trackBeginEnd; if (!track_block_get_previous({ TrackLocation, tileElement }, &trackBeginEnd)) @@ -9152,7 +9144,7 @@ void Vehicle::InvalidateWindow() { auto intent = Intent(INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW); intent.putExtra(INTENT_EXTRA_VEHICLE, this); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } void Vehicle::UpdateCrossings() const @@ -9182,8 +9174,7 @@ void Vehicle::UpdateCrossings() const int32_t direction{}; CoordsXYE xyElement = { frontVehicle->TrackLocation, - map_get_track_element_at_of_type_seq( - frontVehicle->TrackLocation, frontVehicle->GetTrackType(), 0) }; + MapGetTrackElementAtOfTypeSeq(frontVehicle->TrackLocation, frontVehicle->GetTrackType(), 0) }; int32_t curZ = frontVehicle->TrackLocation.z; if (xyElement.element != nullptr && status != Vehicle::Status::Arriving) @@ -9201,7 +9192,7 @@ void Vehicle::UpdateCrossings() const while (true) { - auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() })); + auto* pathElement = MapGetPathElementAt(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() })); auto curRide = GetRide(); // Many New Element parks have invisible rides hacked into the path. @@ -9254,7 +9245,7 @@ void Vehicle::UpdateCrossings() const } xyElement = { backVehicle->TrackLocation, - map_get_track_element_at_of_type_seq(backVehicle->TrackLocation, backVehicle->GetTrackType(), 0) }; + MapGetTrackElementAtOfTypeSeq(backVehicle->TrackLocation, backVehicle->GetTrackType(), 0) }; if (xyElement.element == nullptr) { return; @@ -9263,7 +9254,7 @@ void Vehicle::UpdateCrossings() const uint8_t freeCount = travellingForwards ? 3 : 1; while (freeCount-- > 0) { - auto* pathElement = map_get_path_element_at(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() })); + auto* pathElement = MapGetPathElementAt(TileCoordsXYZ(CoordsXYZ{ xyElement, xyElement.element->GetBaseZ() })); if (pathElement != nullptr) { pathElement->SetIsBlockedByVehicle(false); diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 63f920772f..761cf057ac 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -30,7 +30,7 @@ struct Ride; struct rct_ride_entry; struct CarEntry; class DataSerialiser; -struct paint_session; +struct PaintSession; struct GForces { @@ -270,7 +270,7 @@ struct Vehicle : EntityBase } void ApplyMass(int16_t appliedMass); void Serialise(DataSerialiser& stream); - void Paint(paint_session& session, int32_t imageDirection) const; + void Paint(PaintSession& session, int32_t imageDirection) const; friend void UpdateRotatingDefault(Vehicle& vehicle); friend void UpdateRotatingEnterprise(Vehicle& vehicle); @@ -507,6 +507,7 @@ enum FRICTION_SOUND_WATERSLIDE = 32, FRICTION_SOUND_WOOD_LARGE = 54, FRICTION_SOUND_STEEL_SMOOTH = 57, + FRICTION_SOUND_HYBRID = 65, FRICTION_SOUND_NONE = 255 }; diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index 139bee1cc4..d7a51caac8 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -939,7 +939,7 @@ const vehicle_boundbox VehicleBoundboxes[16][224] = { #pragma region VehiclePaintUtil static void PaintVehicleRiders( - paint_session& session, const Vehicle* vehicle, const CarEntry* carEntry, uint32_t baseImageId, int32_t z, + PaintSession& session, const Vehicle* vehicle, const CarEntry* carEntry, uint32_t baseImageId, int32_t z, const vehicle_boundbox& bb) { baseImageId += carEntry->NumCarImages; @@ -971,7 +971,7 @@ static void PaintVehicleRiders( // 6D5214 static void vehicle_sprite_paint( - paint_session& session, const Vehicle* vehicle, int32_t spriteNum, const vehicle_boundbox& bb, int32_t z, + PaintSession& session, const Vehicle* vehicle, int32_t spriteNum, const vehicle_boundbox& bb, int32_t z, const CarEntry* carEntry) { if (carEntry->draw_order >= std::size(VehicleBoundboxes)) @@ -1008,7 +1008,7 @@ static void vehicle_sprite_paint( // 6D520E static void VehicleSpritePaintWithSwinging( - paint_session& session, const Vehicle* vehicle, int32_t spriteNum, int32_t boundingBoxNum, int32_t z, + PaintSession& session, const Vehicle* vehicle, int32_t spriteNum, int32_t boundingBoxNum, int32_t z, const CarEntry* carEntry) { vehicle_sprite_paint( @@ -1017,7 +1017,7 @@ static void VehicleSpritePaintWithSwinging( } static void VehicleSpritePaintRestraints( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { int32_t boundingBoxNum = YawTo16(imageDirection); auto restraintFrame = ((vehicle->restraints_position - 64) / 64) * 4; @@ -1032,8 +1032,8 @@ static void VehicleSpritePaintRestraints( #pragma region FlatSlope // 6D51DE -static void VehicleSpriteFlatUnbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatUnbanked( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // Restraint animations are only drawn for vehicles that are in a cardinal direction (north, east, south, west) if (vehicle->restraints_position >= 64 && carEntry->GroupEnabled(SpriteGroupType::RestraintAnimation) @@ -1048,8 +1048,8 @@ static void VehicleSpriteFlatUnbanked( } // 6D4EE7 -static void vehicle_sprite_0_1( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::FlatBanked22)) { @@ -1059,13 +1059,13 @@ static void vehicle_sprite_0_1( } else { - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); } } // 6D4F34 -static void vehicle_sprite_0_2( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft45( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::FlatBanked45)) { @@ -1075,13 +1075,13 @@ static void vehicle_sprite_0_2( } else { - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); } } // 6D4F0C -static void vehicle_sprite_0_3( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::FlatBanked22)) { @@ -1091,13 +1091,13 @@ static void vehicle_sprite_0_3( } else { - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); } } // 6D4F5C -static void vehicle_sprite_0_4( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight45( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::FlatBanked45)) { @@ -1107,13 +1107,13 @@ static void vehicle_sprite_0_4( } else { - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); } } // 6D4F84 -static void vehicle_sprite_0_5( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft67( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1127,13 +1127,13 @@ static void vehicle_sprite_0_5( } else { - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } } // 6D4FE4 -static void vehicle_sprite_0_6( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft90( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1147,13 +1147,13 @@ static void vehicle_sprite_0_6( } else { - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } } // 6D5055 -static void vehicle_sprite_0_7( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft112( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1167,13 +1167,13 @@ static void vehicle_sprite_0_7( } else { - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } } // 6D50C6 -static void vehicle_sprite_0_8( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft135( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1187,13 +1187,13 @@ static void vehicle_sprite_0_8( } else { - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } } // 6D5137 -static void vehicle_sprite_0_9( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedLeft157( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1207,13 +1207,13 @@ static void vehicle_sprite_0_9( } else { - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } } // 6D4FB1 -static void vehicle_sprite_0_10( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight67( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1227,13 +1227,13 @@ static void vehicle_sprite_0_10( } else { - vehicle_sprite_0_4(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); } } // 6D501B -static void vehicle_sprite_0_11( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight90( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1247,13 +1247,13 @@ static void vehicle_sprite_0_11( } else { - vehicle_sprite_0_4(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); } } // 6D508C -static void vehicle_sprite_0_12( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight112( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1267,13 +1267,13 @@ static void vehicle_sprite_0_12( } else { - vehicle_sprite_0_4(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); } } // 6D50FD -static void vehicle_sprite_0_13( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight135( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1287,13 +1287,13 @@ static void vehicle_sprite_0_13( } else { - vehicle_sprite_0_4(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); } } // 6D516E -static void vehicle_sprite_0_14( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchFlatBankedRight157( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -1307,109 +1307,109 @@ static void vehicle_sprite_0_14( } else { - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } } // 6D4EE4 -static void vehicle_sprite_0_16( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUninvertedFlatBankedLeft22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; - vehicle_sprite_0_1(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft22(session, vehicle, imageDirection, z, carEntry); } // 6D4F31 -static void vehicle_sprite_0_17( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUninvertedFlatBankedLeft45( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); } // 6D4F09 -static void vehicle_sprite_0_18( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUninvertedFlatBankedRight22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; - vehicle_sprite_0_3(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight22(session, vehicle, imageDirection, z, carEntry); } // 6D4F59 -static void vehicle_sprite_0_19( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUninvertedFlatBankedRight45( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; - vehicle_sprite_0_4(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); } // 6D51D7 static void VehiclePitchFlat( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3DE4: switch (vehicle->bank_rotation) { case 0: - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); break; case 1: - vehicle_sprite_0_1(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft22(session, vehicle, imageDirection, z, carEntry); break; case 2: - vehicle_sprite_0_2(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); break; case 3: - vehicle_sprite_0_3(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight22(session, vehicle, imageDirection, z, carEntry); break; case 4: - vehicle_sprite_0_4(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); break; case 5: - vehicle_sprite_0_5(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft67(session, vehicle, imageDirection, z, carEntry); break; case 6: - vehicle_sprite_0_6(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft90(session, vehicle, imageDirection, z, carEntry); break; case 7: - vehicle_sprite_0_7(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft112(session, vehicle, imageDirection, z, carEntry); break; case 8: - vehicle_sprite_0_8(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft135(session, vehicle, imageDirection, z, carEntry); break; case 9: - vehicle_sprite_0_9(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedLeft157(session, vehicle, imageDirection, z, carEntry); break; case 10: - vehicle_sprite_0_10(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight67(session, vehicle, imageDirection, z, carEntry); break; case 11: - vehicle_sprite_0_11(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight90(session, vehicle, imageDirection, z, carEntry); break; case 12: - vehicle_sprite_0_12(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight112(session, vehicle, imageDirection, z, carEntry); break; case 13: - vehicle_sprite_0_13(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight135(session, vehicle, imageDirection, z, carEntry); break; case 14: - vehicle_sprite_0_14(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatBankedRight157(session, vehicle, imageDirection, z, carEntry); break; case 15: // what is roll 15? - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); break; case 16: - vehicle_sprite_0_16(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUninvertedFlatBankedLeft22(session, vehicle, imageDirection, z, carEntry); break; case 17: - vehicle_sprite_0_17(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUninvertedFlatBankedLeft45(session, vehicle, imageDirection, z, carEntry); break; case 18: - vehicle_sprite_0_18(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUninvertedFlatBankedRight22(session, vehicle, imageDirection, z, carEntry); break; case 19: - vehicle_sprite_0_19(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUninvertedFlatBankedRight45(session, vehicle, imageDirection, z, carEntry); break; } } @@ -1422,7 +1422,7 @@ static void VehiclePitchFlat( // 6D4614 static void VehiclePitchUp12Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12)) { @@ -1438,7 +1438,7 @@ static void VehiclePitchUp12Unbanked( // 6D4662 static void VehiclePitchUp12BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked22)) { @@ -1454,7 +1454,7 @@ static void VehiclePitchUp12BankedLeft22( // 6D46DB static void VehiclePitchUp12BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked45)) { @@ -1470,7 +1470,7 @@ static void VehiclePitchUp12BankedLeft45( // 6D467D static void VehiclePitchUp12BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked22)) { @@ -1486,7 +1486,7 @@ static void VehiclePitchUp12BankedRight22( // 6D46FD static void VehiclePitchUp12BankedRight45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked45)) { @@ -1502,7 +1502,7 @@ static void VehiclePitchUp12BankedRight45( // 6D460D static void VehiclePitchUp12( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3C04: switch (vehicle->bank_rotation) @@ -1545,7 +1545,7 @@ static void VehiclePitchUp12( // 6D4791 static void VehiclePitchUp25Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25)) { @@ -1561,7 +1561,7 @@ static void VehiclePitchUp25Unbanked( // 6D4833 static void VehiclePitchUp25BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked22)) { @@ -1577,7 +1577,7 @@ static void VehiclePitchUp25BankedLeft22( // 6D48D6 static void VehiclePitchUp25BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked45)) { @@ -1598,7 +1598,7 @@ static void VehiclePitchUp25BankedLeft45( // 6D4858 static void VehiclePitchUp25BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked22)) { @@ -1614,7 +1614,7 @@ static void VehiclePitchUp25BankedRight22( // 6D4910 static void VehiclePitchUp25BankedRight45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked45)) { @@ -1633,7 +1633,7 @@ static void VehiclePitchUp25BankedRight45( } static void VehiclePitchUp25BankedLeft67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked67)) { @@ -1648,7 +1648,7 @@ static void VehiclePitchUp25BankedLeft67( } static void VehiclePitchUp25BankedLeft90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked90)) { @@ -1663,7 +1663,7 @@ static void VehiclePitchUp25BankedLeft90( } static void VehiclePitchUp25BankedLeft112( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -1678,7 +1678,7 @@ static void VehiclePitchUp25BankedLeft112( } static void VehiclePitchUp25BankedLeft135( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -1693,7 +1693,7 @@ static void VehiclePitchUp25BankedLeft135( } static void VehiclePitchUp25BankedLeft157( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -1708,7 +1708,7 @@ static void VehiclePitchUp25BankedLeft157( } static void VehiclePitchUp25BankedRight67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked67)) { @@ -1723,7 +1723,7 @@ static void VehiclePitchUp25BankedRight67( } static void VehiclePitchUp25BankedRight90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked90)) { @@ -1738,7 +1738,7 @@ static void VehiclePitchUp25BankedRight90( } static void VehiclePitchUp25BankedRight112( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -1753,7 +1753,7 @@ static void VehiclePitchUp25BankedRight112( } static void VehiclePitchUp25BankedRight135( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -1768,7 +1768,7 @@ static void VehiclePitchUp25BankedRight135( } static void VehiclePitchUp25BankedRight157( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -1784,7 +1784,7 @@ static void VehiclePitchUp25BankedRight157( // 6D476C static void VehiclePitchUp25( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3CA4: switch (vehicle->bank_rotation) @@ -1860,7 +1860,7 @@ static void VehiclePitchUp25( // 6D49DC static void VehiclePitchUp42Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42)) { @@ -1875,7 +1875,7 @@ static void VehiclePitchUp42Unbanked( } static void VehiclePitchUp42BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked22)) { @@ -1890,7 +1890,7 @@ static void VehiclePitchUp42BankedLeft22( } static void VehiclePitchUp42BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked45)) { @@ -1905,7 +1905,7 @@ static void VehiclePitchUp42BankedLeft45( } static void VehiclePitchUp42BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked22)) { @@ -1920,7 +1920,7 @@ static void VehiclePitchUp42BankedRight22( } static void VehiclePitchUp42BankedRight45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked45)) { @@ -1935,7 +1935,7 @@ static void VehiclePitchUp42BankedRight45( } static void VehiclePitchUp42BankedLeft67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked67)) { @@ -1950,7 +1950,7 @@ static void VehiclePitchUp42BankedLeft67( } static void VehiclePitchUp42BankedLeft90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked90)) { @@ -1965,7 +1965,7 @@ static void VehiclePitchUp42BankedLeft90( } static void VehiclePitchUp42BankedRight67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked67)) { @@ -1980,7 +1980,7 @@ static void VehiclePitchUp42BankedRight67( } static void VehiclePitchUp42BankedRight90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked90)) { @@ -1996,7 +1996,7 @@ static void VehiclePitchUp42BankedRight90( // 6D49DC static void VehiclePitchUp42( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { switch (vehicle->bank_rotation) { @@ -2034,7 +2034,7 @@ static void VehiclePitchUp42( // 6D4A31 static void VehiclePitchUp60Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes60)) { @@ -2049,7 +2049,7 @@ static void VehiclePitchUp60Unbanked( } static void VehiclePitchUp60BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes60Banked22)) { @@ -2064,7 +2064,7 @@ static void VehiclePitchUp60BankedLeft22( } static void VehiclePitchUp60BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes60Banked22)) { @@ -2079,7 +2079,7 @@ static void VehiclePitchUp60BankedRight22( } static void VehiclePitchUp60( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { switch (vehicle->bank_rotation) { @@ -2105,7 +2105,7 @@ static void VehiclePitchUp60( // 6D463D static void VehiclePitchDown12Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12)) { @@ -2121,7 +2121,7 @@ static void VehiclePitchDown12Unbanked( // 6D469B static void VehiclePitchDown12BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked22)) { @@ -2137,7 +2137,7 @@ static void VehiclePitchDown12BankedLeft22( // 6D4722 static void VehiclePitchDown12BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked45)) { @@ -2153,7 +2153,7 @@ static void VehiclePitchDown12BankedLeft45( // 6D46B9 static void VehiclePitchDown12BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked22)) { @@ -2169,7 +2169,7 @@ static void VehiclePitchDown12BankedRight22( // 6D4747 static void VehiclePitchDown12BankedRight45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes12Banked45)) { @@ -2185,7 +2185,7 @@ static void VehiclePitchDown12BankedRight45( // 6D4636 static void VehiclePitchDown12( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3C54: switch (vehicle->bank_rotation) @@ -2262,7 +2262,7 @@ static void VehiclePitchDown12( // 6D47E4 static void VehiclePitchDown25Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25)) { @@ -2278,7 +2278,7 @@ static void VehiclePitchDown25Unbanked( // 6D4880 static void VehiclePitchDown25BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked22)) { @@ -2294,7 +2294,7 @@ static void VehiclePitchDown25BankedLeft22( // 6D4953 static void VehiclePitchDown25BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked45)) { @@ -2315,7 +2315,7 @@ static void VehiclePitchDown25BankedLeft45( // 6D48AB static void VehiclePitchDown25BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked22)) { @@ -2331,7 +2331,7 @@ static void VehiclePitchDown25BankedRight22( // 6D4996 static void VehiclePitchDown25BankedRight45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked45)) { @@ -2351,7 +2351,7 @@ static void VehiclePitchDown25BankedRight45( } static void VehiclePitchDown25BankedLeft67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked67)) { @@ -2366,7 +2366,7 @@ static void VehiclePitchDown25BankedLeft67( } static void VehiclePitchDown25BankedLeft90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked90)) { @@ -2381,7 +2381,7 @@ static void VehiclePitchDown25BankedLeft90( } static void VehiclePitchDown25BankedLeft11BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -2396,7 +2396,7 @@ static void VehiclePitchDown25BankedLeft11BankedLeft45( } static void VehiclePitchDown25BankedLeft135( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -2411,7 +2411,7 @@ static void VehiclePitchDown25BankedLeft135( } static void VehiclePitchDown25BankedLeft157( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -2426,7 +2426,7 @@ static void VehiclePitchDown25BankedLeft157( } static void VehiclePitchDown25BankedRight67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked67)) { @@ -2441,7 +2441,7 @@ static void VehiclePitchDown25BankedRight67( } static void VehiclePitchDown25BankedRight90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25Banked90)) { @@ -2456,7 +2456,7 @@ static void VehiclePitchDown25BankedRight90( } static void VehiclePitchDown25BankedRight11BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -2471,7 +2471,7 @@ static void VehiclePitchDown25BankedRight11BankedLeft45( } static void VehiclePitchDown25BankedRight135( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -2486,7 +2486,7 @@ static void VehiclePitchDown25BankedRight135( } static void VehiclePitchDown25BankedRight157( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes25InlineTwists)) { @@ -2502,7 +2502,7 @@ static void VehiclePitchDown25BankedRight157( // 6D47DD static void VehiclePitchDown25( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3CF4: switch (vehicle->bank_rotation) @@ -2578,7 +2578,7 @@ static void VehiclePitchDown25( // 6D4A05 static void VehiclePitchDown42Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42)) { @@ -2593,7 +2593,7 @@ static void VehiclePitchDown42Unbanked( } static void VehiclePitchDown42BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked22)) { @@ -2608,7 +2608,7 @@ static void VehiclePitchDown42BankedLeft22( } static void VehiclePitchDown42BankedLeft45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked45)) { @@ -2623,7 +2623,7 @@ static void VehiclePitchDown42BankedLeft45( } static void VehiclePitchDown42BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked22)) { @@ -2638,7 +2638,7 @@ static void VehiclePitchDown42BankedRight22( } static void VehiclePitchDown42BankedRight45( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked45)) { @@ -2653,7 +2653,7 @@ static void VehiclePitchDown42BankedRight45( } static void VehiclePitchDown42BankedLeft67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked67)) { @@ -2668,7 +2668,7 @@ static void VehiclePitchDown42BankedLeft67( } static void VehiclePitchDown42BankedLeft90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked90)) { @@ -2683,7 +2683,7 @@ static void VehiclePitchDown42BankedLeft90( } static void VehiclePitchDown42BankedRight67( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked67)) { @@ -2698,7 +2698,7 @@ static void VehiclePitchDown42BankedRight67( } static void VehiclePitchDown42BankedRight90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes42Banked90)) { @@ -2713,7 +2713,7 @@ static void VehiclePitchDown42BankedRight90( } static void VehiclePitchDown42( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { switch (vehicle->bank_rotation) { @@ -2751,7 +2751,7 @@ static void VehiclePitchDown42( // 6D4A59 static void VehiclePitchDown60Unbanked( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes60)) { @@ -2766,7 +2766,7 @@ static void VehiclePitchDown60Unbanked( } static void VehiclePitchDown60BankedLeft22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes60Banked22)) { @@ -2781,7 +2781,7 @@ static void VehiclePitchDown60BankedLeft22( } static void VehiclePitchDown60BankedRight22( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes60Banked22)) { @@ -2796,7 +2796,7 @@ static void VehiclePitchDown60BankedRight22( } static void VehiclePitchDown60( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { switch (vehicle->bank_rotation) { @@ -2820,7 +2820,7 @@ static void VehiclePitchDown60( // 6D4A81 static void VehiclePitchUp75( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes75)) { @@ -2836,7 +2836,7 @@ static void VehiclePitchUp75( // 6D4AE8 static void VehiclePitchUp90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes90)) { @@ -2856,7 +2856,7 @@ static void VehiclePitchUp90( // 6D4B57 static void VehiclePitchUp105( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::SlopesLoop)) { @@ -2872,7 +2872,7 @@ static void VehiclePitchUp105( // 6D4BB7 static void VehiclePitchUp120( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::SlopesLoop)) { @@ -2888,7 +2888,7 @@ static void VehiclePitchUp120( // 6D4C17 static void VehiclePitchUp135( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::SlopesLoop)) { @@ -2904,7 +2904,7 @@ static void VehiclePitchUp135( // 6D4C77 static void VehiclePitchUp150( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::SlopesLoop)) { @@ -2920,7 +2920,7 @@ static void VehiclePitchUp150( // 6D4CD7 static void VehiclePitchUp165( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::SlopesLoop)) { @@ -2940,7 +2940,7 @@ static void VehiclePitchUp165( // 6D4D37 static void VehiclePitchInverted( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::SlopeInverted)) { @@ -2960,7 +2960,7 @@ static void VehiclePitchInverted( // 6D4AA3 static void VehiclePitchDown75( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -2984,7 +2984,7 @@ static void VehiclePitchDown75( // 6D4B0D static void VehiclePitchDown90( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3012,7 +3012,7 @@ static void VehiclePitchDown90( // 6D4B80 static void VehiclePitchDown105( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3032,7 +3032,7 @@ static void VehiclePitchDown105( // 6D4BE0 static void VehiclePitchDown120( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3052,7 +3052,7 @@ static void VehiclePitchDown120( // 6D4C40 static void VehiclePitchDown135( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3072,7 +3072,7 @@ static void VehiclePitchDown135( // 6D4CA0 static void VehiclePitchDown150( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3092,7 +3092,7 @@ static void VehiclePitchDown150( // 6D4D00 static void VehiclePitchDown165( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3115,8 +3115,9 @@ static void VehiclePitchDown165( #pragma region CorkscrewSlopes // 6D51A5 -static void VehiclePitchCorkscrew( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +template +void VehiclePitchCorkscrew( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (vehicle->HasUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES)) { @@ -3124,15 +3125,13 @@ static void VehiclePitchCorkscrew( } if (carEntry->GroupEnabled(SpriteGroupType::Corkscrews)) { - // corkscrew slopes begin at pitch 24 and end at pitch 43 - int32_t corkscrewFrame = vehicle->Pitch - 24; int32_t boundingBoxNum = (YawTo4(imageDirection)) + corkscrewFrame * 4 + 144; int32_t spriteNum = carEntry->SpriteOffset(SpriteGroupType::Corkscrews, imageDirection, corkscrewFrame); VehicleSpritePaintWithSwinging(session, vehicle, spriteNum, boundingBoxNum, z, carEntry); } else { - VehicleSpriteFlatUnbanked(session, vehicle, imageDirection, z, carEntry); + VehiclePitchFlatUnbanked(session, vehicle, imageDirection, z, carEntry); } } @@ -3143,8 +3142,8 @@ static void VehiclePitchCorkscrew( #pragma region SlopeUp8 // 6D4D67 -static void vehicle_sprite_50_0( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUp8Unbanked( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes8)) { @@ -3159,8 +3158,8 @@ static void vehicle_sprite_50_0( } // 6D4DB5 -static void vehicle_sprite_50_1( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUp8BankedLeft22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes8Banked22)) { @@ -3170,13 +3169,13 @@ static void vehicle_sprite_50_1( } else { - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUp8Unbanked(session, vehicle, imageDirection, z, carEntry); } } // 6D4DD3 -static void vehicle_sprite_50_3( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchUp8BankedRight22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes8Banked22)) { @@ -3186,76 +3185,30 @@ static void vehicle_sprite_50_3( } else { - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUp8Unbanked(session, vehicle, imageDirection, z, carEntry); } } // 6D4D60 static void VehiclePitchUp8( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3D44: switch (vehicle->bank_rotation) { case 0: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUp8Unbanked(session, vehicle, imageDirection, z, carEntry); break; case 1: - vehicle_sprite_50_1(session, vehicle, imageDirection, z, carEntry); - break; - case 2: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); + case 16: + VehiclePitchUp8BankedLeft22(session, vehicle, imageDirection, z, carEntry); break; case 3: - vehicle_sprite_50_3(session, vehicle, imageDirection, z, carEntry); - break; - case 4: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 5: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 6: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 7: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 8: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 9: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 10: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 11: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 12: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 13: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 14: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 15: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; - case 16: - vehicle_sprite_50_1(session, vehicle, imageDirection, z, carEntry); - break; - case 17: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); - break; case 18: - vehicle_sprite_50_3(session, vehicle, imageDirection, z, carEntry); + VehiclePitchUp8BankedRight22(session, vehicle, imageDirection, z, carEntry); break; - case 19: - vehicle_sprite_50_0(session, vehicle, imageDirection, z, carEntry); + default: + VehiclePitchUp8Unbanked(session, vehicle, imageDirection, z, carEntry); break; } } @@ -3266,7 +3219,7 @@ static void VehiclePitchUp8( // 6D4E3A static void VehiclePitchUp16( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes16)) { @@ -3286,7 +3239,7 @@ static void VehiclePitchUp16( // 6D4E8F static void VehiclePitchUp50( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes50)) { @@ -3309,8 +3262,8 @@ static void VehiclePitchUp50( #pragma region SlopeDown8 // 6D4D90 -static void vehicle_sprite_53_0( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchDown8Unbanked( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes8)) { @@ -3325,8 +3278,8 @@ static void vehicle_sprite_53_0( } // 6D4DF4 -static void vehicle_sprite_53_1( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchDown8BankedLeft22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes8Banked22)) { @@ -3341,8 +3294,8 @@ static void vehicle_sprite_53_1( } // 6D4E15 -static void vehicle_sprite_53_3( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) +static void VehiclePitchDown8BankedRight22( + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes8Banked22)) { @@ -3358,70 +3311,24 @@ static void vehicle_sprite_53_3( // 6D4D89 static void VehiclePitchDown8( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { // 0x009A3D94: switch (vehicle->bank_rotation) { case 0: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); + VehiclePitchDown8Unbanked(session, vehicle, imageDirection, z, carEntry); break; case 1: - vehicle_sprite_53_1(session, vehicle, imageDirection, z, carEntry); - break; - case 2: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); + case 16: + VehiclePitchDown8BankedLeft22(session, vehicle, imageDirection, z, carEntry); break; case 3: - vehicle_sprite_53_3(session, vehicle, imageDirection, z, carEntry); - break; - case 4: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 5: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 6: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 7: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 8: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 9: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 10: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 11: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 12: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 13: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 14: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 15: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; - case 16: - vehicle_sprite_53_1(session, vehicle, imageDirection, z, carEntry); - break; - case 17: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); - break; case 18: - vehicle_sprite_53_3(session, vehicle, imageDirection, z, carEntry); + VehiclePitchDown8BankedRight22(session, vehicle, imageDirection, z, carEntry); break; - case 19: - vehicle_sprite_53_0(session, vehicle, imageDirection, z, carEntry); + default: + VehiclePitchDown8Unbanked(session, vehicle, imageDirection, z, carEntry); break; } } @@ -3432,7 +3339,7 @@ static void VehiclePitchDown8( // 6D4E63 static void VehiclePitchDown16( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes16)) { @@ -3452,7 +3359,7 @@ static void VehiclePitchDown16( // 6D4EB8 static void VehiclePitchDown50( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::Slopes50)) { @@ -3474,7 +3381,7 @@ static void VehiclePitchDown50( // 6D47DA static void VehiclePitchInvertingDown25( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; VehiclePitchDown25(session, vehicle, imageDirection, z, carEntry); @@ -3482,7 +3389,7 @@ static void VehiclePitchInvertingDown25( // 6D4A02 static void VehiclePitchInvertingDown42( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; VehiclePitchDown42(session, vehicle, imageDirection, z, carEntry); @@ -3490,7 +3397,7 @@ static void VehiclePitchInvertingDown42( // 6D4A56 static void VehiclePitchInvertingDown60( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { carEntry--; VehiclePitchDown60(session, vehicle, imageDirection, z, carEntry); @@ -3502,7 +3409,7 @@ static void VehiclePitchInvertingDown60( // 6D4773 static void VehiclePitchSpiralLift( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry) { if (carEntry->GroupEnabled(SpriteGroupType::CurvedLiftHill)) { @@ -3520,7 +3427,7 @@ static void VehiclePitchSpiralLift( // 0x009A3B14: using vehicle_sprite_func = void (*)( - paint_session& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry); + PaintSession& session, const Vehicle* vehicle, int32_t imageDirection, int32_t z, const CarEntry* carEntry); // clang-format off static constexpr const vehicle_sprite_func PaintFunctionsByPitch[] = { @@ -3548,26 +3455,26 @@ static constexpr const vehicle_sprite_func PaintFunctionsByPitch[] = { VehiclePitchDown135, VehiclePitchDown150, VehiclePitchDown165, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, - VehiclePitchCorkscrew, + VehiclePitchCorkscrew<0>, + VehiclePitchCorkscrew<1>, + VehiclePitchCorkscrew<2>, + VehiclePitchCorkscrew<3>, + VehiclePitchCorkscrew<4>, + VehiclePitchCorkscrew<5>, + VehiclePitchCorkscrew<6>, + VehiclePitchCorkscrew<7>, + VehiclePitchCorkscrew<8>, + VehiclePitchCorkscrew<9>, + VehiclePitchCorkscrew<10>, + VehiclePitchCorkscrew<11>, + VehiclePitchCorkscrew<12>, + VehiclePitchCorkscrew<13>, + VehiclePitchCorkscrew<14>, + VehiclePitchCorkscrew<15>, + VehiclePitchCorkscrew<16>, + VehiclePitchCorkscrew<17>, + VehiclePitchCorkscrew<18>, + VehiclePitchCorkscrew<19>, VehiclePitchFlat, // Half Helix Up Large VehiclePitchFlat, // Half Helix Up Small VehiclePitchFlat, // Half Helix Down Large @@ -3593,7 +3500,7 @@ static constexpr const vehicle_sprite_func PaintFunctionsByPitch[] = { * * rct2: 0x006D5600 */ -static void vehicle_visual_splash1_effect(paint_session& session, int32_t z, const Vehicle* vehicle) +static void vehicle_visual_splash1_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { if (vehicle->GetTrackType() != TrackElemType::Watersplash) { @@ -3611,16 +3518,16 @@ static void vehicle_visual_splash1_effect(paint_session& session, int32_t z, con { return; } - int32_t image_id = 29014 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_1_NE_0 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); - PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { 0, 0, 0 }, { 0, 0, z }); + PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 0, 0, 0 } }); } /** * * rct2: 0x006D5696 */ -static void vehicle_visual_splash2_effect(paint_session& session, int32_t z, const Vehicle* vehicle) +static void vehicle_visual_splash2_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { if (vehicle->sprite_direction & 7) { @@ -3634,16 +3541,16 @@ static void vehicle_visual_splash2_effect(paint_session& session, int32_t z, con { return; } - int32_t image_id = 29046 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_3_NE_0 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); - PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { 0, 0, 0 }, { 0, 0, z }); + PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 0, 0, 0 } }); } /** * * rct2: 0x006D57EE */ -static void vehicle_visual_splash3_effect(paint_session& session, int32_t z, const Vehicle* vehicle) +static void vehicle_visual_splash3_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { if (vehicle->sprite_direction & 7) { @@ -3657,16 +3564,16 @@ static void vehicle_visual_splash3_effect(paint_session& session, int32_t z, con { return; } - int32_t image_id = 29014 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_1_NE_0 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); - PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { 0, 0, 0 }, { 0, 0, z }); + PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 0, 0, 0 } }); } /** * * rct2: 0x006D5783 */ -static void vehicle_visual_splash4_effect(paint_session& session, int32_t z, const Vehicle* vehicle) +static void vehicle_visual_splash4_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { Vehicle* vehicle2 = GetEntity(vehicle->prev_vehicle_on_ride); if (vehicle2 == nullptr) @@ -3685,16 +3592,16 @@ static void vehicle_visual_splash4_effect(paint_session& session, int32_t z, con { return; } - int32_t image_id = 29078 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_5_NE_0 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); - PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { 1, 1, 0 }, { 0, 0, z }); + PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 1, 1, 0 } }); } /** * * rct2: 0x006D5701 */ -static void vehicle_visual_splash5_effect(paint_session& session, int32_t z, const Vehicle* vehicle) +static void vehicle_visual_splash5_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { Vehicle* vehicle2 = GetEntity(vehicle->prev_vehicle_on_ride); if (vehicle2 == nullptr) @@ -3717,12 +3624,12 @@ static void vehicle_visual_splash5_effect(paint_session& session, int32_t z, con { return; } - int32_t image_id = 29078 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_5_NE_0 + ((((vehicle->sprite_direction / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); - PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { 1, 1, 0 }, { 0, 0, z }); + PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 1, 1, 0 } }); } -void vehicle_visual_splash_effect(paint_session& session, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) +void vehicle_visual_splash_effect(PaintSession& session, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { switch (carEntry->effect_visual) { @@ -3751,7 +3658,7 @@ void vehicle_visual_splash_effect(paint_session& session, int32_t z, const Vehic * rct2: 0x006D45F8 */ void vehicle_visual_default( - paint_session& session, int32_t imageDirection, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) + PaintSession& session, int32_t imageDirection, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { if (vehicle->Pitch < std::size(PaintFunctionsByPitch)) { @@ -3759,13 +3666,14 @@ void vehicle_visual_default( } } -void Vehicle::Paint(paint_session& session, int32_t imageDirection) const +void Vehicle::Paint(PaintSession& session, int32_t imageDirection) const { const CarEntry* carEntry; if (IsCrashedVehicle) { - PaintAddImageAsParent(session, ImageId(22965 + animation_frame), { 0, 0, z }, { 1, 1, 0 }, { 0, 0, z + 2 }); + PaintAddImageAsParent( + session, ImageId(SPR_WATER_PARTICLES_DENSE_0 + animation_frame), { 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 0973c47ff3..ab6ac4320c 100644 --- a/src/openrct2/ride/VehiclePaint.h +++ b/src/openrct2/ride/VehiclePaint.h @@ -11,7 +11,7 @@ #include "../common.h" -struct paint_session; +struct PaintSession; struct CarEntry; struct Vehicle; @@ -28,33 +28,33 @@ struct vehicle_boundbox extern const vehicle_boundbox VehicleBoundboxes[16][224]; void vehicle_visual_default( - paint_session& session, int32_t imageDirection, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); + PaintSession& session, int32_t imageDirection, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_roto_drop( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void VehicleVisualObservationTower( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_river_rapids( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_reverser( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_splash_boats_or_water_coaster( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_launched_freefall( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); -void vehicle_visual_splash_effect(paint_session& session, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); +void vehicle_visual_splash_effect(PaintSession& session, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_virginia_reel( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_submarine( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry); void vehicle_visual_mini_golf_player( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle); + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle); void VehicleVisualMiniGolfBall( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle); + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle); diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 42949c423d..34928a8c67 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -164,7 +164,7 @@ enum SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_FRONT_SE_NE_PART_0 = 22333, }; -static ImageId air_powered_vertical_rc_get_support_colour(paint_session& session) +static ImageId air_powered_vertical_rc_get_support_colour(PaintSession& session) { auto colourFlags = session.TrackColours[SCHEME_SUPPORTS]; auto trackColour = session.TrackColours[SCHEME_TRACK]; @@ -177,7 +177,7 @@ static ImageId air_powered_vertical_rc_get_support_colour(paint_session& session /** rct2: 0x008AFAD4 */ static void air_powered_vertical_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -190,16 +190,16 @@ static void air_powered_vertical_rc_track_flat( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -216,21 +216,21 @@ static void air_powered_vertical_rc_track_station( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][0]), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 5, trackElement); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][5] = { + static constexpr const SpriteBb imageIds[4][5] = { { { SPR_AIR_POWERED_VERTICAL_RC_QUARTER_TURN_5_SW_SE_PART_0, { 0, 2, 0 }, { 0, 0, 0 }, { 32, 32, 2 } }, { SPR_AIR_POWERED_VERTICAL_RC_QUARTER_TURN_5_SW_SE_PART_1, { 0, 16, 0 }, { 0, 0, 0 }, { 32, 16, 2 } }, @@ -269,48 +269,46 @@ static void air_powered_vertical_rc_track_right_quarter_turn_5( switch (trackSequence) { case 0: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -319,7 +317,7 @@ static void air_powered_vertical_rc_track_left_quarter_turn_5( /** rct2: 0x008AFB74 */ static void air_powered_vertical_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -338,17 +336,17 @@ static void air_powered_vertical_rc_track_flat_to_left_bank( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AFB84 */ static void air_powered_vertical_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -367,16 +365,16 @@ static void air_powered_vertical_rc_track_flat_to_right_bank( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -384,17 +382,17 @@ static void air_powered_vertical_rc_track_left_bank_to_flat( /** rct2: 0x008AFBA4 */ static void air_powered_vertical_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][5] = { + static constexpr const SpriteBb imageIds[4][5] = { { { SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 3 } }, { SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_SW_SE_PART_1, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 3 } }, @@ -432,13 +430,13 @@ static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_FRONT_NW_SW_PART_4); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); } else if (direction == 3 && trackSequence == 0) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_FRONT_SE_NE_PART_0); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); } track_paint_util_right_quarter_turn_5_tiles_wooden_supports(session, height, direction, trackSequence); @@ -447,48 +445,46 @@ static void air_powered_vertical_rc_track_banked_right_quarter_turn_5( switch (trackSequence) { case 0: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -498,7 +494,7 @@ static void air_powered_vertical_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008AFBD4 */ static void air_powered_vertical_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -518,23 +514,23 @@ static void air_powered_vertical_rc_track_left_bank( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { air_powered_vertical_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -547,16 +543,16 @@ static void air_powered_vertical_rc_track_brakes( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_vertical_slope_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t trackImageIds[7][4] = { @@ -668,12 +664,12 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsChildRotated( session, direction, trackImageId, { 0, 0, height }, { 20, 32, bbHeight }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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 + supportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 1: case 2: @@ -696,15 +692,15 @@ static void air_powered_vertical_rc_track_vertical_slope_up( session, direction, trackImageId, { 0, 0, height }, { 32, 20, bbHeight }, { 0, 6, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (trackSequence == 0) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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 + supportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 4: if (isDirection03) @@ -724,12 +720,12 @@ static void air_powered_vertical_rc_track_vertical_slope_up( session, direction, supportsImageId, { 0, 0, height }, { 32, 20, bbHeight }, { 0, 6, height }); } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 5: - if (wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS])) + if (WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS])) { ImageId floorImageId; if (direction & 1) @@ -740,7 +736,7 @@ static void air_powered_vertical_rc_track_vertical_slope_up( { floorImageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_FLOOR_PLANKS); } - PaintAddImageAsParent(session, floorImageId, { 0, 0, height }, { 26, 26, 126 }, { 3, 3, height }); + PaintAddImageAsParent(session, floorImageId, { 0, 0, height }, { { 3, 3, height }, { 26, 26, 126 } }); PaintAddImageAsChildRotated( session, direction, supportsImageId, { 0, 0, height }, { 26, 26, 126 }, { 3, 3, height }); } @@ -749,8 +745,8 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsParentRotated( session, direction, supportsImageId, { 0, 0, height }, { 26, 26, 126 }, { 3, 3, height }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + supportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 6: if (isDirection03) @@ -767,18 +763,18 @@ static void air_powered_vertical_rc_track_vertical_slope_up( PaintAddImageAsChildRotated( session, direction, supportsImageId, { 0, 0, height }, { 1, 20, 126 }, { 27, 6, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_vertical_tunnel(session, height + 240); + PaintUtilSetVerticalTunnel(session, height + 240); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + supportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; } } static void air_powered_vertical_rc_track_vertical_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -806,16 +802,16 @@ static void air_powered_vertical_rc_track_vertical_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 2, 20, 79 }, { 30, 6, height }); } - paint_util_set_vertical_tunnel(session, height + 80); + PaintUtilSetVerticalTunnel(session, height + 80); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } static void air_powered_vertical_rc_track_vertical_top( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -870,7 +866,7 @@ static void air_powered_vertical_rc_track_vertical_top( { PaintAddImageAsParentRotated(session, direction, imageIdT, { 0, 0, height }, { 2, 20, 1 }, { 33, 6, height }); } - paint_util_set_vertical_tunnel(session, height + 80); + PaintUtilSetVerticalTunnel(session, height + 80); break; case 2: imageIdT = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][3]); @@ -882,7 +878,7 @@ static void air_powered_vertical_rc_track_vertical_top( { PaintAddImageAsParentRotated(session, direction, imageIdT, { 0, 0, height }, { 2, 20, 15 }, { 0, 6, height }); } - paint_util_set_vertical_tunnel(session, height + 80); + PaintUtilSetVerticalTunnel(session, height + 80); break; case 3: imageIdS = air_powered_vertical_rc_get_support_colour(session).WithIndex(imageIds[direction][4]); @@ -900,19 +896,19 @@ static void air_powered_vertical_rc_track_vertical_top( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } static void air_powered_vertical_rc_track_vertical_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { air_powered_vertical_rc_track_vertical_up(session, ride, trackSequence ^ 1, (direction + 2) & 3, height, trackElement); } static void air_powered_vertical_rc_track_vertical_slope_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { air_powered_vertical_rc_track_vertical_slope_up( @@ -920,7 +916,7 @@ static void air_powered_vertical_rc_track_vertical_slope_down( } static void air_powered_vertical_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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. @@ -934,23 +930,23 @@ static void air_powered_vertical_rc_track_booster( if (direction & 1) { auto imageId = colour.WithIndex(SPR_REVERSE_FREEFALL_RC_FLAT_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { auto imageId = colour.WithIndex(SPR_REVERSE_FREEFALL_RC_FLAT_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - 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); + WoodenASupportsPaintSetup(session, (direction & 1) ? 1 : 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void air_powered_vertical_rc_track_onride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -963,13 +959,13 @@ static void air_powered_vertical_rc_track_onride_photo( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_air_powered_vertical_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/AlpineCoaster.cpp b/src/openrct2/ride/coaster/AlpineCoaster.cpp index 74de1c3b39..e8b5d10605 100644 --- a/src/openrct2/ride/coaster/AlpineCoaster.cpp +++ b/src/openrct2/ride/coaster/AlpineCoaster.cpp @@ -27,7 +27,7 @@ namespace AlpineRC { static void TrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -57,7 +57,7 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -81,19 +81,19 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackStation( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -120,13 +120,13 @@ namespace AlpineRC { 32, 28, 2 }, { 0, 2, height }); track_paint_util_draw_station_metal_supports(session, direction, height, session.TrackColours[SCHEME_SUPPORTS]); 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void Track25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -158,7 +158,7 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -190,26 +190,26 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -239,7 +239,7 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -271,26 +271,26 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void Track25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -320,7 +320,7 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -352,47 +352,47 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void Track25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftQuarterTurn3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -425,20 +425,19 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -468,10 +467,9 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -501,28 +499,27 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -530,7 +527,7 @@ namespace AlpineRC } static void TrackLeftQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -563,20 +560,19 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -606,12 +602,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -641,13 +637,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -677,12 +672,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -712,28 +707,27 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -741,7 +735,7 @@ namespace AlpineRC } static void TrackLeftEighthToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -774,16 +768,16 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -813,12 +807,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -848,17 +842,15 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -868,7 +860,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 3)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -876,7 +868,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 7)), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -884,7 +876,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 11)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -892,22 +884,22 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 15)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightEighthToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -940,16 +932,16 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -979,12 +971,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1014,17 +1006,15 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1034,7 +1024,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 19)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1042,7 +1032,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 23)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1050,7 +1040,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 27)), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -1058,22 +1048,22 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 31)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftEighthToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1081,7 +1071,7 @@ namespace AlpineRC } static void TrackRightEighthToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1089,7 +1079,7 @@ namespace AlpineRC } static void TrackDiagFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1119,10 +1109,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1149,10 +1138,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1179,10 +1167,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1190,7 +1177,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1198,15 +1185,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_FLAT_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1216,7 +1203,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1224,29 +1211,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_FLAT_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiag25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1276,10 +1262,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1306,10 +1291,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1336,10 +1320,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1347,7 +1330,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1355,15 +1338,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1373,7 +1356,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1381,29 +1364,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiag25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1433,10 +1415,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1463,10 +1444,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1493,10 +1473,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1504,7 +1483,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1512,15 +1491,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 5)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1530,7 +1509,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1538,29 +1517,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 5)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1590,10 +1568,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1620,10 +1597,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1650,10 +1626,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1661,7 +1636,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1669,15 +1644,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1687,7 +1662,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1695,29 +1670,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1747,10 +1721,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1777,10 +1750,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1807,10 +1779,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1818,7 +1789,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1826,15 +1797,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 11)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1844,7 +1815,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1852,29 +1823,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 11)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1904,9 +1874,8 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -1933,9 +1902,8 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -1962,9 +1930,8 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -1972,7 +1939,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1980,15 +1947,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 7)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1998,7 +1965,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2006,30 +1973,29 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 7)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiag25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2059,10 +2025,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2089,10 +2054,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2119,10 +2083,9 @@ namespace AlpineRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2130,7 +2093,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2138,15 +2101,15 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 3)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2156,7 +2119,7 @@ namespace AlpineRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2164,29 +2127,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 3)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackFlatToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2220,18 +2182,18 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackFlatToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2267,32 +2229,32 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackLeftBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2332,25 +2294,25 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackRightBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2390,25 +2352,25 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void Track25DegUpToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2448,25 +2410,25 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void Track25DegUpToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2506,53 +2468,53 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackLeftBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2584,25 +2546,25 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2617,10 +2579,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2636,10 +2597,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2651,16 +2611,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2668,28 +2627,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 2)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagFlatToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2704,10 +2662,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2719,10 +2676,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2738,16 +2694,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2755,28 +2710,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 6)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagLeftBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2791,10 +2745,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2810,10 +2763,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2825,16 +2777,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2842,28 +2793,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 9)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagRightBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2878,10 +2828,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2893,10 +2842,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2912,16 +2860,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2929,28 +2876,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 4)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagLeftBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2965,10 +2911,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2984,10 +2929,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2999,16 +2943,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3016,28 +2959,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 12)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiagRightBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3052,10 +2994,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3067,10 +3008,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3086,16 +3026,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3103,28 +3042,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 16)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegUpToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3139,10 +3077,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -3158,10 +3095,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -3173,16 +3109,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3190,28 +3125,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 22)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiag25DegUpToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3226,10 +3160,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -3241,10 +3174,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -3260,16 +3192,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3277,28 +3208,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 26)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagLeftBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3313,9 +3243,8 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -3331,9 +3260,8 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -3345,15 +3273,14 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3361,29 +3288,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 29)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiagRightBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3398,9 +3324,8 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -3412,9 +3337,8 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -3430,15 +3354,14 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3446,29 +3369,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 24)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiag25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3483,10 +3405,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3502,10 +3423,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3517,16 +3437,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3534,28 +3453,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 19)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3570,10 +3488,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3585,10 +3502,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3604,16 +3520,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3621,28 +3536,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 14)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiagLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3657,10 +3571,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3672,10 +3585,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3687,16 +3599,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3704,28 +3615,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 31)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3740,10 +3650,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3755,10 +3664,9 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3770,16 +3678,15 @@ namespace AlpineRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3787,28 +3694,27 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 33)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftQuarterTurn3Bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3845,20 +3751,19 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3888,10 +3793,9 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3925,28 +3829,27 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn3Bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3954,7 +3857,7 @@ namespace AlpineRC } static void TrackBankedLeftQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3991,20 +3894,19 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4034,12 +3936,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4069,13 +3971,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4105,12 +4006,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4144,28 +4045,27 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackBankedRightQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -4173,7 +4073,7 @@ namespace AlpineRC } static void TrackLeftEighthBankToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4206,16 +4106,16 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4245,12 +4145,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4280,17 +4180,15 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4300,7 +4198,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 3)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4308,7 +4206,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 7)), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4316,7 +4214,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 11)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4324,22 +4222,22 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 15)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightEighthBankToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4372,16 +4270,16 @@ namespace AlpineRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4411,12 +4309,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4446,17 +4344,15 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4466,7 +4362,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 19)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4474,7 +4370,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 23)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4482,7 +4378,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 27)), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4490,22 +4386,22 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 31)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftEighthBankToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4513,7 +4409,7 @@ namespace AlpineRC } static void TrackRightEighthBankToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4521,7 +4417,7 @@ namespace AlpineRC } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4554,23 +4450,22 @@ namespace AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4600,28 +4495,27 @@ namespace AlpineRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4654,23 +4548,22 @@ namespace AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4680,7 +4573,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 9)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4688,7 +4581,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 11)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4696,7 +4589,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 13)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4704,29 +4597,28 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 15)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4734,7 +4626,7 @@ namespace AlpineRC } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4742,7 +4634,7 @@ namespace AlpineRC } static void TrackLeftQuarterTurn525DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4775,20 +4667,19 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -4818,12 +4709,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -4853,13 +4744,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -4889,12 +4779,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -4924,28 +4814,27 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightQuarterTurn525DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4978,20 +4867,19 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5021,12 +4909,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -5056,13 +4944,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -5092,12 +4979,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -5127,28 +5014,27 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftQuarterTurn525DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -5156,7 +5042,7 @@ namespace AlpineRC } static void TrackRightQuarterTurn525DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -5164,7 +5050,7 @@ namespace AlpineRC } static void TrackSBendLeft( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5193,17 +5079,16 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5212,14 +5097,14 @@ namespace AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 1)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 5)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 1, height - 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -5233,12 +5118,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5257,23 +5142,23 @@ namespace AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 1)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 5)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 1, height - 1, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5299,28 +5184,27 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackSBendRight( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5349,17 +5233,16 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5368,14 +5251,14 @@ namespace AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 9)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 13)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -5389,12 +5272,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5413,23 +5296,23 @@ namespace AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 9)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 13)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5455,28 +5338,27 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixUpSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5513,21 +5395,20 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5557,10 +5438,9 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5594,23 +5474,22 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5644,26 +5523,25 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5693,10 +5571,9 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5730,24 +5607,23 @@ namespace AlpineRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightHalfBankedHelixUpSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5784,21 +5660,20 @@ namespace AlpineRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5828,10 +5703,9 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5865,23 +5739,22 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5915,26 +5788,25 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5964,10 +5836,9 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6001,24 +5872,23 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixDownSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -6031,7 +5901,7 @@ namespace AlpineRC } static void TrackRightHalfBankedHelixDownSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -6044,7 +5914,7 @@ namespace AlpineRC } static void TrackLeftHalfBankedHelixUpLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6081,21 +5951,20 @@ namespace AlpineRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6125,12 +5994,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6160,13 +6029,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -6196,12 +6064,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6235,23 +6103,22 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6285,26 +6152,25 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -6334,12 +6200,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6369,13 +6235,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6405,12 +6270,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6444,23 +6309,22 @@ namespace AlpineRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightHalfBankedHelixUpLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6497,21 +6361,20 @@ namespace AlpineRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6541,12 +6404,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6576,13 +6439,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -6612,12 +6474,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6627,7 +6489,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 26)), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -6639,7 +6501,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 32)), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -6647,7 +6509,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 37)), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -6655,24 +6517,23 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 43)), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6706,26 +6567,25 @@ namespace AlpineRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -6755,12 +6615,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6790,13 +6650,12 @@ namespace AlpineRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6826,12 +6685,12 @@ namespace AlpineRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6845,7 +6704,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 32)), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -6853,7 +6712,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 37)), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -6861,7 +6720,7 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 43)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -6869,25 +6728,24 @@ namespace AlpineRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 26)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixDownLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -6900,7 +6758,7 @@ namespace AlpineRC } static void TrackRightHalfBankedHelixDownLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -6913,7 +6771,7 @@ namespace AlpineRC } static void TrackBrakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6933,18 +6791,18 @@ namespace AlpineRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6981,23 +6839,22 @@ namespace AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7027,28 +6884,27 @@ namespace AlpineRC { 6, 0, height }, { 20, 32, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 10, height - 6, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7085,23 +6941,22 @@ namespace AlpineRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7131,28 +6986,27 @@ namespace AlpineRC { 6, 0, height }, { 20, 32, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 10, height - 6, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7185,23 +7039,22 @@ namespace AlpineRC { 0, 6, height }, { 32, 20, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7235,28 +7088,27 @@ namespace AlpineRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7289,23 +7141,22 @@ namespace AlpineRC { 0, 6, height }, { 32, 20, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7339,22 +7190,21 @@ namespace AlpineRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, direction & 1 ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/BobsleighCoaster.cpp b/src/openrct2/ride/coaster/BobsleighCoaster.cpp index b3443ebfee..902f22f5eb 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _BobsleighBlockBrakeImages[NumOrthogonalDirectio /** rct2: 0x006FE5B4 */ static void bobsleigh_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -60,7 +60,7 @@ static void bobsleigh_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -88,17 +88,17 @@ static void bobsleigh_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void bobsleigh_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -116,14 +116,14 @@ static void bobsleigh_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE5C4 */ static void bobsleigh_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -165,7 +165,7 @@ static void bobsleigh_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -207,25 +207,25 @@ static void bobsleigh_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x006FE5D4 */ static void bobsleigh_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -267,7 +267,7 @@ static void bobsleigh_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -309,25 +309,25 @@ static void bobsleigh_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x006FE5E4 */ static void bobsleigh_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -369,7 +369,7 @@ static void bobsleigh_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -411,25 +411,25 @@ static void bobsleigh_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x006FE5F4 */ static void bobsleigh_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bobsleigh_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -437,7 +437,7 @@ static void bobsleigh_rc_track_25_deg_down( /** rct2: 0x006FE604 */ static void bobsleigh_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -445,7 +445,7 @@ static void bobsleigh_rc_track_flat_to_25_deg_down( /** rct2: 0x006FE614 */ static void bobsleigh_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -453,7 +453,7 @@ static void bobsleigh_rc_track_25_deg_down_to_flat( /** rct2: 0x006FE624 */ static void bobsleigh_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -494,17 +494,17 @@ static void bobsleigh_rc_track_left_quarter_turn_5( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -542,12 +542,11 @@ static void bobsleigh_rc_track_left_quarter_turn_5( { 32, 16, 0 }, { 0, 16, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -585,12 +584,12 @@ static void bobsleigh_rc_track_left_quarter_turn_5( { 16, 16, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -628,12 +627,11 @@ static void bobsleigh_rc_track_left_quarter_turn_5( { 16, 32, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -671,26 +669,26 @@ static void bobsleigh_rc_track_left_quarter_turn_5( { 30, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE634 */ static void bobsleigh_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -699,7 +697,7 @@ static void bobsleigh_rc_track_right_quarter_turn_5( /** rct2: 0x006FE644 */ static void bobsleigh_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -739,17 +737,17 @@ static void bobsleigh_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE654 */ static void bobsleigh_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -789,17 +787,17 @@ static void bobsleigh_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE664 */ static void bobsleigh_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -839,17 +837,17 @@ static void bobsleigh_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE674 */ static void bobsleigh_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -889,17 +887,17 @@ static void bobsleigh_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE684 */ static void bobsleigh_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -940,17 +938,17 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -988,12 +986,11 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( { 32, 16, 0 }, { 0, 16, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1031,12 +1028,12 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( { 16, 16, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1074,12 +1071,11 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( { 16, 32, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1117,26 +1113,26 @@ static void bobsleigh_rc_track_banked_left_quarter_turn_5( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE694 */ static void bobsleigh_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1145,7 +1141,7 @@ static void bobsleigh_rc_track_banked_right_quarter_turn_5( /** rct2: 0x006FE6A4 */ static void bobsleigh_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1185,24 +1181,24 @@ static void bobsleigh_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x006FE6B4 */ static void bobsleigh_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1242,24 +1238,24 @@ static void bobsleigh_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x006FE6C4 */ static void bobsleigh_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1299,24 +1295,24 @@ static void bobsleigh_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x006FE6D4 */ static void bobsleigh_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1356,24 +1352,24 @@ static void bobsleigh_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x006FE6E4 */ static void bobsleigh_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1381,7 +1377,7 @@ static void bobsleigh_rc_track_left_bank_to_25_deg_down( /** rct2: 0x006FE6F4 */ static void bobsleigh_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1389,7 +1385,7 @@ static void bobsleigh_rc_track_right_bank_to_25_deg_down( /** rct2: 0x006FE704 */ static void bobsleigh_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1397,7 +1393,7 @@ static void bobsleigh_rc_track_25_deg_down_to_left_bank( /** rct2: 0x006FE714 */ static void bobsleigh_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1405,7 +1401,7 @@ static void bobsleigh_rc_track_25_deg_down_to_right_bank( /** rct2: 0x006FE724 */ static void bobsleigh_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1445,17 +1441,17 @@ static void bobsleigh_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE734 */ static void bobsleigh_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bobsleigh_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1463,7 +1459,7 @@ static void bobsleigh_rc_track_right_bank( /** rct2: 0x006FE744 */ static void bobsleigh_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1504,14 +1500,14 @@ static void bobsleigh_rc_track_s_bend_left( { 32, 27, 0 }, { 0, 2, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1523,7 +1519,7 @@ static void bobsleigh_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14843), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1533,7 +1529,7 @@ static void bobsleigh_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14847), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1553,12 +1549,11 @@ static void bobsleigh_rc_track_s_bend_left( { 32, 26, 0 }, { 0, 6, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1586,7 +1581,7 @@ static void bobsleigh_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14843), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -1596,16 +1591,15 @@ static void bobsleigh_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14847), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1643,26 +1637,26 @@ static void bobsleigh_rc_track_s_bend_left( { 32, 27, 0 }, { 0, 2, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE754 */ static void bobsleigh_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1703,14 +1697,14 @@ static void bobsleigh_rc_track_s_bend_right( { 32, 27, 0 }, { 0, 2, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1722,7 +1716,7 @@ static void bobsleigh_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14851), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1732,7 +1726,7 @@ static void bobsleigh_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14855), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1752,12 +1746,11 @@ static void bobsleigh_rc_track_s_bend_right( { 32, 26, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1785,7 +1778,7 @@ static void bobsleigh_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14851), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -1795,16 +1788,15 @@ static void bobsleigh_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14855), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1842,26 +1834,26 @@ static void bobsleigh_rc_track_s_bend_right( { 32, 27, 0 }, { 0, 2, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE794 */ static void bobsleigh_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1902,17 +1894,17 @@ static void bobsleigh_rc_track_left_quarter_turn_3( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1950,9 +1942,9 @@ static void bobsleigh_rc_track_left_quarter_turn_3( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1990,26 +1982,26 @@ static void bobsleigh_rc_track_left_quarter_turn_3( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE7A4 */ static void bobsleigh_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2018,7 +2010,7 @@ static void bobsleigh_rc_track_right_quarter_turn_3( /** rct2: 0x006FE7B4 */ static void bobsleigh_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2059,17 +2051,17 @@ static void bobsleigh_rc_track_left_quarter_turn_3_bank( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2107,9 +2099,9 @@ static void bobsleigh_rc_track_left_quarter_turn_3_bank( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2147,26 +2139,26 @@ static void bobsleigh_rc_track_left_quarter_turn_3_bank( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE7C4 */ static void bobsleigh_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2175,7 +2167,7 @@ static void bobsleigh_rc_track_right_quarter_turn_3_bank( /** rct2: 0x006FE7D4 */ static void bobsleigh_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2216,18 +2208,18 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2265,9 +2257,9 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2305,20 +2297,20 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -2356,23 +2348,23 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2410,9 +2402,9 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( { 16, 16, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2450,22 +2442,22 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_small( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE7E4 */ static void bobsleigh_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2506,18 +2498,18 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2555,9 +2547,9 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( { 16, 16, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2595,20 +2587,20 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -2646,23 +2638,23 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2700,9 +2692,9 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2740,22 +2732,22 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_small( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE7F4 */ static void bobsleigh_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -2770,7 +2762,7 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_small( /** rct2: 0x006FE804 */ static void bobsleigh_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -2784,7 +2776,7 @@ static void bobsleigh_rc_track_right_half_banked_helix_down_small( /** rct2: 0x006FE814 */ static void bobsleigh_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2825,18 +2817,18 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2874,12 +2866,11 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 32, 16, 0 }, { 0, 16, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2917,12 +2908,12 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 16, 16, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -2960,12 +2951,11 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 16, 32, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3003,20 +2993,20 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3054,23 +3044,23 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3108,12 +3098,11 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 16, 32, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3151,12 +3140,12 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 16, 16, 0 }, { 0, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3194,12 +3183,11 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 32, 16, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3237,22 +3225,22 @@ static void bobsleigh_rc_track_left_half_banked_helix_up_large( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE824 */ static void bobsleigh_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3293,18 +3281,18 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3342,12 +3330,11 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 32, 16, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3385,12 +3372,12 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 16, 16, 0 }, { 0, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3428,12 +3415,11 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 16, 32, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3471,20 +3457,20 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3522,23 +3508,23 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 20, 32, 0 }, { 6, 0, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3576,12 +3562,11 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 16, 32, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3619,12 +3604,12 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 16, 16, 0 }, { 0, 0, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3662,12 +3647,11 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 32, 16, 0 }, { 0, 16, height + 27 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3705,22 +3689,22 @@ static void bobsleigh_rc_track_right_half_banked_helix_up_large( { 32, 20, 0 }, { 0, 6, height + 27 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x006FE834 */ static void bobsleigh_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -3735,7 +3719,7 @@ static void bobsleigh_rc_track_left_half_banked_helix_down_large( /** rct2: 0x006FE844 */ static void bobsleigh_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -3749,7 +3733,7 @@ static void bobsleigh_rc_track_right_half_banked_helix_down_large( /** rct2: 0x006FE854 */ static void bobsleigh_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3775,17 +3759,17 @@ static void bobsleigh_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FE864 */ static void bobsleigh_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -3814,16 +3798,16 @@ static void bobsleigh_rc_track_block_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void bobsleigh_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3831,8 +3815,8 @@ static void bobsleigh_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14572), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3843,8 +3827,8 @@ static void bobsleigh_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14573), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3855,8 +3839,8 @@ static void bobsleigh_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14572), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3868,8 +3852,8 @@ static void bobsleigh_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(14573), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3880,9 +3864,9 @@ static void bobsleigh_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_bobsleigh_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp index 4a908c1947..deea224fa9 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp @@ -34,7 +34,7 @@ static constexpr const uint32_t _BolligerMabillardBlockBrakeImages[NumOrthogonal template static void bolliger_mabillard_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -51,7 +51,7 @@ static void bolliger_mabillard_track_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -69,18 +69,18 @@ static void bolliger_mabillard_track_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -112,14 +112,14 @@ static void bolliger_mabillard_track_station( 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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -149,7 +149,7 @@ static void bolliger_mabillard_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -179,25 +179,25 @@ static void bolliger_mabillard_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -227,7 +227,7 @@ static void bolliger_mabillard_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -257,25 +257,25 @@ static void bolliger_mabillard_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } template static void bolliger_mabillard_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -305,7 +305,7 @@ static void bolliger_mabillard_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -335,25 +335,25 @@ static void bolliger_mabillard_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -389,7 +389,7 @@ static void bolliger_mabillard_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -425,25 +425,25 @@ static void bolliger_mabillard_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } template static void bolliger_mabillard_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -479,7 +479,7 @@ static void bolliger_mabillard_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -515,25 +515,25 @@ static void bolliger_mabillard_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } template static void bolliger_mabillard_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -563,7 +563,7 @@ static void bolliger_mabillard_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -593,25 +593,25 @@ static void bolliger_mabillard_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -619,7 +619,7 @@ static void bolliger_mabillard_track_25_deg_down( template static void bolliger_mabillard_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -627,7 +627,7 @@ static void bolliger_mabillard_track_60_deg_down( template static void bolliger_mabillard_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_to_flat( @@ -636,7 +636,7 @@ static void bolliger_mabillard_track_flat_to_25_deg_down( template static void bolliger_mabillard_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -645,7 +645,7 @@ static void bolliger_mabillard_track_25_deg_down_to_60_deg_down( template static void bolliger_mabillard_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -654,7 +654,7 @@ static void bolliger_mabillard_track_60_deg_down_to_25_deg_down( template static void bolliger_mabillard_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_25_deg_up( @@ -663,7 +663,7 @@ static void bolliger_mabillard_track_25_deg_down_to_flat( template static void bolliger_mabillard_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -692,17 +692,17 @@ static void bolliger_mabillard_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -728,12 +728,11 @@ static void bolliger_mabillard_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -759,12 +758,12 @@ static void bolliger_mabillard_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -790,12 +789,11 @@ static void bolliger_mabillard_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -821,26 +819,26 @@ static void bolliger_mabillard_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -850,7 +848,7 @@ static void bolliger_mabillard_track_right_quarter_turn_5( template static void bolliger_mabillard_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -884,17 +882,17 @@ static void bolliger_mabillard_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -928,17 +926,17 @@ static void bolliger_mabillard_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -972,17 +970,17 @@ static void bolliger_mabillard_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1016,17 +1014,17 @@ static void bolliger_mabillard_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1041,37 +1039,37 @@ static void bolliger_mabillard_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17290), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17284), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17289), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17274), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1097,12 +1095,11 @@ static void bolliger_mabillard_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1128,12 +1125,12 @@ static void bolliger_mabillard_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1159,12 +1156,11 @@ static void bolliger_mabillard_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1193,26 +1189,26 @@ static void bolliger_mabillard_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1222,7 +1218,7 @@ static void bolliger_mabillard_track_banked_right_quarter_turn_5( template static void bolliger_mabillard_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1256,24 +1252,24 @@ static void bolliger_mabillard_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1307,24 +1303,24 @@ static void bolliger_mabillard_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1358,24 +1354,24 @@ static void bolliger_mabillard_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1409,24 +1405,24 @@ static void bolliger_mabillard_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1435,7 +1431,7 @@ static void bolliger_mabillard_track_left_bank_to_25_deg_down( template static void bolliger_mabillard_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1444,7 +1440,7 @@ static void bolliger_mabillard_track_right_bank_to_25_deg_down( template static void bolliger_mabillard_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1453,7 +1449,7 @@ static void bolliger_mabillard_track_25_deg_down_to_left_bank( template static void bolliger_mabillard_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1462,7 +1458,7 @@ static void bolliger_mabillard_track_25_deg_down_to_right_bank( template static void bolliger_mabillard_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1490,17 +1486,17 @@ static void bolliger_mabillard_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1508,7 +1504,7 @@ static void bolliger_mabillard_track_right_bank( template static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1537,17 +1533,17 @@ static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1573,12 +1569,11 @@ static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1604,12 +1599,12 @@ static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1635,12 +1630,11 @@ static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1666,26 +1660,26 @@ static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1714,17 +1708,17 @@ static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1750,12 +1744,11 @@ static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1781,12 +1774,12 @@ static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1812,12 +1805,11 @@ static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1843,26 +1835,26 @@ static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1872,7 +1864,7 @@ static void bolliger_mabillard_track_left_quarter_turn_5_25_deg_down( template static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1882,7 +1874,7 @@ static void bolliger_mabillard_track_right_quarter_turn_5_25_deg_down( template static void bolliger_mabillard_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1911,14 +1903,14 @@ static void bolliger_mabillard_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1927,13 +1919,13 @@ static void bolliger_mabillard_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17309), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17313), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1946,12 +1938,11 @@ static void bolliger_mabillard_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1970,21 +1961,20 @@ static void bolliger_mabillard_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17309), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17313), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2010,26 +2000,26 @@ static void bolliger_mabillard_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2058,14 +2048,14 @@ static void bolliger_mabillard_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2074,13 +2064,13 @@ static void bolliger_mabillard_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17317), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17321), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2093,12 +2083,11 @@ static void bolliger_mabillard_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2117,21 +2106,20 @@ static void bolliger_mabillard_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17317), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17321), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2157,26 +2145,26 @@ static void bolliger_mabillard_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2188,37 +2176,36 @@ static void bolliger_mabillard_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17594), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17602), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17601), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17609), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2227,33 +2214,32 @@ static void bolliger_mabillard_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17595), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17603), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup(session, supportType, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17600), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17608), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2279,9 +2265,9 @@ static void bolliger_mabillard_track_left_vertical_loop( { 2, 16, 119 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2307,18 +2293,17 @@ static void bolliger_mabillard_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2344,12 +2329,11 @@ static void bolliger_mabillard_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2375,9 +2359,9 @@ static void bolliger_mabillard_track_left_vertical_loop( { 3, 16, 119 }, { 12, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2386,33 +2370,32 @@ static void bolliger_mabillard_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17600), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17608), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17595), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17603), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup(session, supportType, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2421,49 +2404,48 @@ static void bolliger_mabillard_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17601), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17609), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17594), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17602), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } template static void bolliger_mabillard_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2492,12 +2474,12 @@ static void bolliger_mabillard_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2506,28 +2488,28 @@ static void bolliger_mabillard_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17624), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17616), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17619), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17611), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2553,7 +2535,7 @@ static void bolliger_mabillard_track_right_vertical_loop( { 2, 16, 119 }, { 16, 0, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2579,13 +2561,13 @@ static void bolliger_mabillard_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2611,7 +2593,7 @@ static void bolliger_mabillard_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2637,7 +2619,7 @@ static void bolliger_mabillard_track_right_vertical_loop( { 4, 16, 119 }, { 10, 16, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2646,28 +2628,28 @@ static void bolliger_mabillard_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17619), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17611), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17624), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17616), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2693,17 +2675,17 @@ static void bolliger_mabillard_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2712,7 +2694,7 @@ static void bolliger_mabillard_track_right_vertical_loop( template static void bolliger_mabillard_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2741,17 +2723,17 @@ static void bolliger_mabillard_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2777,9 +2759,9 @@ static void bolliger_mabillard_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2805,26 +2787,26 @@ static void bolliger_mabillard_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2834,7 +2816,7 @@ static void bolliger_mabillard_track_right_quarter_turn_3( template static void bolliger_mabillard_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2866,17 +2848,17 @@ static void bolliger_mabillard_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2902,9 +2884,9 @@ static void bolliger_mabillard_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2933,26 +2915,26 @@ static void bolliger_mabillard_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2962,7 +2944,7 @@ static void bolliger_mabillard_track_right_quarter_turn_3_bank( template static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2991,20 +2973,20 @@ static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -3030,26 +3012,26 @@ static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3078,20 +3060,20 @@ static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -3100,46 +3082,46 @@ static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17365), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17367), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17369), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17371), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3149,7 +3131,7 @@ static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down( template static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3159,7 +3141,7 @@ static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down( template static void bolliger_mabillard_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3191,18 +3173,18 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3228,9 +3210,9 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3259,20 +3241,20 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3301,23 +3283,23 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3343,9 +3325,9 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3374,22 +3356,22 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3421,18 +3403,18 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3458,9 +3440,9 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3489,20 +3471,20 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3531,23 +3513,23 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3573,9 +3555,9 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3604,22 +3586,22 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3634,7 +3616,7 @@ static void bolliger_mabillard_track_left_half_banked_helix_down_small( template static void bolliger_mabillard_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3649,7 +3631,7 @@ static void bolliger_mabillard_track_right_half_banked_helix_down_small( template static void bolliger_mabillard_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3681,18 +3663,18 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3718,12 +3700,11 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3749,12 +3730,12 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3780,12 +3761,11 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3814,20 +3794,20 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3856,23 +3836,23 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3898,12 +3878,11 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3929,12 +3908,12 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3960,12 +3939,11 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3994,22 +3972,22 @@ static void bolliger_mabillard_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4041,18 +4019,18 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4078,12 +4056,11 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4109,12 +4086,12 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4140,12 +4117,11 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4154,7 +4130,7 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17412), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4163,34 +4139,34 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17428), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17422), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17427), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4219,23 +4195,23 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4261,12 +4237,11 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4292,12 +4267,12 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4323,12 +4298,11 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4340,42 +4314,42 @@ static void bolliger_mabillard_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17428), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17422), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17427), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17412), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4390,7 +4364,7 @@ static void bolliger_mabillard_track_left_half_banked_helix_down_large( template static void bolliger_mabillard_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4405,7 +4379,7 @@ static void bolliger_mabillard_track_right_half_banked_helix_down_large( template static void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4444,13 +4418,13 @@ static void bolliger_mabillard_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } template static void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4489,13 +4463,13 @@ static void bolliger_mabillard_track_right_quarter_turn_1_60_deg_up( break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } template static void bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -4504,7 +4478,7 @@ static void bolliger_mabillard_track_left_quarter_turn_1_60_deg_down( template static void bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -4513,7 +4487,7 @@ static void bolliger_mabillard_track_right_quarter_turn_1_60_deg_down( template static void bolliger_mabillard_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4533,17 +4507,17 @@ static void bolliger_mabillard_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4571,24 +4545,24 @@ static void bolliger_mabillard_track_25_deg_up_left_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4616,24 +4590,24 @@ static void bolliger_mabillard_track_25_deg_up_right_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4641,8 +4615,8 @@ static void bolliger_mabillard_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17146), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4650,8 +4624,8 @@ static void bolliger_mabillard_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, supportType, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17147), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4659,8 +4633,8 @@ static void bolliger_mabillard_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17146), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4668,22 +4642,22 @@ static void bolliger_mabillard_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, supportType, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17147), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_right_banked( @@ -4692,7 +4666,7 @@ static void bolliger_mabillard_track_25_deg_down_left_banked( template static void bolliger_mabillard_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_25_deg_up_left_banked( @@ -4701,7 +4675,7 @@ static void bolliger_mabillard_track_25_deg_down_right_banked( template static void bolliger_mabillard_track_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4730,10 +4704,10 @@ static void bolliger_mabillard_track_90_deg_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -4742,7 +4716,7 @@ static void bolliger_mabillard_track_90_deg_up( template static void bolliger_mabillard_track_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4750,7 +4724,7 @@ static void bolliger_mabillard_track_90_deg_down( template static void bolliger_mabillard_track_60_deg_up_to_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4781,12 +4755,12 @@ static void bolliger_mabillard_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: break; @@ -4795,7 +4769,7 @@ static void bolliger_mabillard_track_60_deg_up_to_90_deg_up( template static void bolliger_mabillard_track_90_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -4804,7 +4778,7 @@ static void bolliger_mabillard_track_90_deg_down_to_60_deg_down( template static void bolliger_mabillard_track_90_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4833,20 +4807,20 @@ static void bolliger_mabillard_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } template static void bolliger_mabillard_track_60_deg_down_to_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4877,11 +4851,11 @@ static void bolliger_mabillard_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: break; @@ -4890,7 +4864,7 @@ static void bolliger_mabillard_track_60_deg_down_to_90_deg_down( template static void bolliger_mabillard_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4919,14 +4893,14 @@ static void bolliger_mabillard_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4952,12 +4926,11 @@ static void bolliger_mabillard_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4983,15 +4956,15 @@ static void bolliger_mabillard_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5000,40 +4973,39 @@ static void bolliger_mabillard_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17549), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17553), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17557), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17561), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5062,14 +5034,14 @@ static void bolliger_mabillard_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5095,12 +5067,11 @@ static void bolliger_mabillard_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5126,15 +5097,15 @@ static void bolliger_mabillard_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5143,40 +5114,39 @@ static void bolliger_mabillard_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17533), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17537), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17541), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17545), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5186,7 +5156,7 @@ static void bolliger_mabillard_track_left_eighth_to_orthogonal( template static void bolliger_mabillard_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5196,7 +5166,7 @@ static void bolliger_mabillard_track_right_eighth_to_orthogonal( template static void bolliger_mabillard_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5225,14 +5195,14 @@ static void bolliger_mabillard_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5258,12 +5228,11 @@ static void bolliger_mabillard_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5289,15 +5258,15 @@ static void bolliger_mabillard_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5306,40 +5275,39 @@ static void bolliger_mabillard_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17581), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17585), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17589), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17593), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5368,14 +5336,14 @@ static void bolliger_mabillard_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5401,12 +5369,11 @@ static void bolliger_mabillard_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5432,15 +5399,15 @@ static void bolliger_mabillard_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5449,40 +5416,39 @@ static void bolliger_mabillard_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17565), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17569), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17573), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17577), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5492,7 +5458,7 @@ static void bolliger_mabillard_track_left_eighth_bank_to_orthogonal( template static void bolliger_mabillard_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5502,7 +5468,7 @@ static void bolliger_mabillard_track_right_eighth_bank_to_orthogonal( template static void bolliger_mabillard_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5530,9 +5496,9 @@ static void bolliger_mabillard_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5557,9 +5523,9 @@ static void bolliger_mabillard_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5584,9 +5550,9 @@ static void bolliger_mabillard_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5594,19 +5560,19 @@ static void bolliger_mabillard_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17859), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5615,32 +5581,32 @@ static void bolliger_mabillard_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17789), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5668,9 +5634,9 @@ static void bolliger_mabillard_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5695,9 +5661,9 @@ static void bolliger_mabillard_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5722,9 +5688,9 @@ static void bolliger_mabillard_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5732,19 +5698,19 @@ static void bolliger_mabillard_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17871), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5753,32 +5719,32 @@ static void bolliger_mabillard_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17801), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } template static void bolliger_mabillard_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5806,9 +5772,9 @@ static void bolliger_mabillard_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5833,9 +5799,9 @@ static void bolliger_mabillard_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5860,9 +5826,9 @@ static void bolliger_mabillard_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5870,23 +5836,19 @@ static void bolliger_mabillard_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17883), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5895,36 +5857,32 @@ static void bolliger_mabillard_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17813), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } template static void bolliger_mabillard_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5952,9 +5910,9 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5979,9 +5937,9 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6006,9 +5964,9 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6016,19 +5974,19 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17863), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6037,32 +5995,32 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17793), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6090,9 +6048,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6117,9 +6075,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6144,9 +6102,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6154,23 +6112,19 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17875), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6179,36 +6133,32 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17805), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6236,9 +6186,9 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6263,9 +6213,9 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6290,9 +6240,9 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6300,23 +6250,19 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17879), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6325,36 +6271,32 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17809), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6382,9 +6324,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6409,9 +6351,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6436,9 +6378,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6446,19 +6388,19 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17867), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6467,32 +6409,32 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17797), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6520,9 +6462,9 @@ static void bolliger_mabillard_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6547,9 +6489,9 @@ static void bolliger_mabillard_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6574,9 +6516,9 @@ static void bolliger_mabillard_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6584,19 +6526,19 @@ static void bolliger_mabillard_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17873), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6605,32 +6547,32 @@ static void bolliger_mabillard_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17803), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } template static void bolliger_mabillard_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6658,9 +6600,9 @@ static void bolliger_mabillard_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6685,9 +6627,9 @@ static void bolliger_mabillard_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6712,9 +6654,9 @@ static void bolliger_mabillard_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6722,23 +6664,19 @@ static void bolliger_mabillard_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17885), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6747,36 +6685,32 @@ static void bolliger_mabillard_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17815), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } template static void bolliger_mabillard_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6804,8 +6738,8 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6830,8 +6764,8 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6856,8 +6790,8 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6865,19 +6799,19 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17869), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6886,33 +6820,33 @@ static void bolliger_mabillard_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17799), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6940,9 +6874,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6967,9 +6901,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6994,9 +6928,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7004,23 +6938,19 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17881), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7029,36 +6959,32 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17811), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7086,9 +7012,9 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7113,9 +7039,9 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7140,9 +7066,9 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7150,19 +7076,19 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17877), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7171,32 +7097,32 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17807), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7224,9 +7150,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7251,9 +7177,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7278,9 +7204,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7288,19 +7214,19 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17865), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7309,32 +7235,32 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17795), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_diag_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7362,9 +7288,9 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7389,9 +7315,9 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7416,9 +7342,9 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7426,19 +7352,19 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17887), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7447,32 +7373,32 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17817), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } template static void bolliger_mabillard_track_diag_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7500,9 +7426,9 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7527,9 +7453,9 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7554,9 +7480,9 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7564,23 +7490,19 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17891), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7589,36 +7511,32 @@ static void bolliger_mabillard_track_diag_60_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17821), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_diag_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7646,9 +7564,9 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7673,9 +7591,9 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7700,9 +7618,9 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7710,23 +7628,19 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17893), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7735,36 +7649,32 @@ static void bolliger_mabillard_track_diag_flat_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( - session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17823), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( - session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( - session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_diag_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7792,9 +7702,9 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7819,9 +7729,9 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7846,9 +7756,9 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7856,19 +7766,19 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17889), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -7877,32 +7787,32 @@ static void bolliger_mabillard_track_diag_60_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17819), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } template static void bolliger_mabillard_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7916,9 +7826,9 @@ static void bolliger_mabillard_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7932,9 +7842,9 @@ static void bolliger_mabillard_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7945,39 +7855,39 @@ static void bolliger_mabillard_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17829), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7991,9 +7901,9 @@ static void bolliger_mabillard_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8004,9 +7914,9 @@ static void bolliger_mabillard_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8020,39 +7930,39 @@ static void bolliger_mabillard_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17834), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8066,9 +7976,9 @@ static void bolliger_mabillard_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8082,9 +7992,9 @@ static void bolliger_mabillard_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8095,39 +8005,39 @@ static void bolliger_mabillard_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17836), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8141,9 +8051,9 @@ static void bolliger_mabillard_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8154,9 +8064,9 @@ static void bolliger_mabillard_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8170,39 +8080,39 @@ static void bolliger_mabillard_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17831), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8216,9 +8126,9 @@ static void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8232,9 +8142,9 @@ static void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8245,39 +8155,39 @@ static void bolliger_mabillard_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17849), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8291,9 +8201,9 @@ static void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8304,9 +8214,9 @@ static void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8320,39 +8230,39 @@ static void bolliger_mabillard_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17854), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8366,9 +8276,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8382,9 +8292,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8395,39 +8305,39 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17839), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8441,9 +8351,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8454,9 +8364,9 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8470,39 +8380,39 @@ static void bolliger_mabillard_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17844), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } template static void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8516,8 +8426,8 @@ static void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8531,8 +8441,8 @@ static void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8543,39 +8453,39 @@ static void bolliger_mabillard_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17846), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8589,8 +8499,8 @@ static void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8601,8 +8511,8 @@ static void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8616,39 +8526,39 @@ static void bolliger_mabillard_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17841), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8662,9 +8572,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8678,9 +8588,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8691,39 +8601,39 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17856), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8737,9 +8647,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8750,9 +8660,9 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8766,39 +8676,39 @@ static void bolliger_mabillard_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17851), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8812,9 +8722,9 @@ static void bolliger_mabillard_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8825,9 +8735,9 @@ static void bolliger_mabillard_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8838,39 +8748,39 @@ static void bolliger_mabillard_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17825), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8884,9 +8794,9 @@ static void bolliger_mabillard_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8897,9 +8807,9 @@ static void bolliger_mabillard_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8910,39 +8820,39 @@ static void bolliger_mabillard_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17827), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8974,20 +8884,20 @@ static void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -9013,26 +8923,26 @@ static void bolliger_mabillard_track_left_bank_to_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } template static void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9064,20 +8974,20 @@ static void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_u { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -9086,46 +8996,46 @@ static void bolliger_mabillard_track_right_bank_to_right_quarter_turn_3_25_deg_u PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17715), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17717), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17719), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17721), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } template static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9137,40 +9047,40 @@ static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_ban PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17717), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17719), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17721), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17715), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -9199,26 +9109,26 @@ static void bolliger_mabillard_track_left_quarter_turn_3_25_deg_down_to_left_ban { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } template static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9247,20 +9157,20 @@ static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_b { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -9289,26 +9199,26 @@ static void bolliger_mabillard_track_right_quarter_turn_3_25_deg_down_to_right_b { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } template static void bolliger_mabillard_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -9331,17 +9241,17 @@ static void bolliger_mabillard_track_block_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9370,20 +9280,20 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -9409,26 +9319,26 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9457,20 +9367,20 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -9479,46 +9389,46 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18015), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18017), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18019), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18021), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -9528,7 +9438,7 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_3_25_deg_down( template static void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -9538,7 +9448,7 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_3_25_deg_down( template static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9567,17 +9477,17 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9603,12 +9513,11 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9634,12 +9543,12 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -9665,12 +9574,11 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -9696,26 +9604,26 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9744,17 +9652,17 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9780,12 +9688,11 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9811,12 +9718,12 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -9842,12 +9749,11 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -9873,26 +9779,26 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } template static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -9902,7 +9808,7 @@ static void bolliger_mabillard_track_left_banked_quarter_turn_5_25_deg_down( template static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -9912,7 +9818,7 @@ static void bolliger_mabillard_track_right_banked_quarter_turn_5_25_deg_down( template static void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9943,24 +9849,24 @@ static void bolliger_mabillard_track_25_deg_up_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9991,24 +9897,24 @@ static void bolliger_mabillard_track_25_deg_up_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10039,24 +9945,24 @@ static void bolliger_mabillard_track_left_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10087,24 +9993,24 @@ static void bolliger_mabillard_track_right_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10113,7 +10019,7 @@ static void bolliger_mabillard_track_25_deg_down_to_left_banked_25_deg_down( template static void bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10122,7 +10028,7 @@ static void bolliger_mabillard_track_25_deg_down_to_right_banked_25_deg_down( template static void bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10131,7 +10037,7 @@ static void bolliger_mabillard_track_left_banked_25_deg_down_to_25_deg_down( template static void bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10140,7 +10046,7 @@ static void bolliger_mabillard_track_right_banked_25_deg_down_to_25_deg_down( template static void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10168,24 +10074,24 @@ static void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10213,24 +10119,24 @@ static void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_up } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10258,24 +10164,24 @@ static void bolliger_mabillard_track_left_banked_25_deg_up_to_left_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10303,24 +10209,24 @@ static void bolliger_mabillard_track_right_banked_25_deg_up_to_right_banked_flat } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10329,7 +10235,7 @@ static void bolliger_mabillard_track_left_banked_flat_to_left_banked_25_deg_down template static void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10338,7 +10244,7 @@ static void bolliger_mabillard_track_right_banked_flat_to_right_banked_25_deg_do template static void bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10347,7 +10253,7 @@ static void bolliger_mabillard_track_left_banked_25_deg_down_to_left_banked_flat template static void bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10356,7 +10262,7 @@ static void bolliger_mabillard_track_right_banked_25_deg_down_to_right_banked_fl template static void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10387,24 +10293,24 @@ static void bolliger_mabillard_track_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10435,24 +10341,24 @@ static void bolliger_mabillard_track_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } template static void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10483,24 +10389,24 @@ static void bolliger_mabillard_track_left_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10531,24 +10437,24 @@ static void bolliger_mabillard_track_right_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } template static void bolliger_mabillard_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10557,7 +10463,7 @@ static void bolliger_mabillard_track_flat_to_left_banked_25_deg_down( template static void bolliger_mabillard_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10566,7 +10472,7 @@ static void bolliger_mabillard_track_flat_to_right_banked_25_deg_down( template static void bolliger_mabillard_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10575,7 +10481,7 @@ static void bolliger_mabillard_track_left_banked_25_deg_down_to_flat( template static void bolliger_mabillard_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10584,7 +10490,7 @@ static void bolliger_mabillard_track_right_banked_25_deg_down_to_flat( template static void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10619,10 +10525,10 @@ static void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( { 2, 20, 63 }, { 24, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -10631,7 +10537,7 @@ static void bolliger_mabillard_track_left_quarter_turn_1_90_deg_up( template static void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10666,10 +10572,10 @@ static void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( { 2, 20, 63 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -10678,7 +10584,7 @@ static void bolliger_mabillard_track_right_quarter_turn_1_90_deg_up( template static void bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10687,7 +10593,7 @@ static void bolliger_mabillard_track_left_quarter_turn_1_90_deg_down( template static void bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10697,7 +10603,7 @@ static void bolliger_mabillard_track_right_quarter_turn_1_90_deg_down( /* The following track elements used to be specific to the Vertical Roller Coaster */ template static void bolliger_mabillard_track_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -10731,7 +10637,7 @@ static void bolliger_mabillard_track_flat_to_60_deg_up( { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -10764,24 +10670,24 @@ static void bolliger_mabillard_track_flat_to_60_deg_up( { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } template static void bolliger_mabillard_track_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -10815,7 +10721,7 @@ static void bolliger_mabillard_track_60_deg_up_to_flat( { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -10848,24 +10754,24 @@ static void bolliger_mabillard_track_60_deg_up_to_flat( { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } template static void bolliger_mabillard_track_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_60_deg_up_to_flat( @@ -10874,7 +10780,7 @@ static void bolliger_mabillard_track_flat_to_60_deg_down( template static void bolliger_mabillard_track_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_flat_to_60_deg_up( @@ -10883,7 +10789,7 @@ static void bolliger_mabillard_track_60_deg_down_to_flat( template static void bolliger_mabillard_track_brake_for_drop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10915,24 +10821,24 @@ static void bolliger_mabillard_track_brake_for_drop( { 0, 4, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /* The following track elements used to be specific to the Steel Twister */ template static void bolliger_mabillard_track_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10961,14 +10867,14 @@ static void bolliger_mabillard_track_half_loop_up( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10977,29 +10883,29 @@ static void bolliger_mabillard_track_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17627), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17635), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup(session, supportType, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17632), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17640), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11025,12 +10931,11 @@ static void bolliger_mabillard_track_half_loop_up( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -11058,18 +10963,18 @@ static void bolliger_mabillard_track_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); @@ -11077,7 +10982,7 @@ static void bolliger_mabillard_track_half_loop_down( template static void bolliger_mabillard_track_left_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11111,9 +11016,9 @@ static void bolliger_mabillard_track_left_corkscrew_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11139,8 +11044,8 @@ static void bolliger_mabillard_track_left_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11167,28 +11072,28 @@ static void bolliger_mabillard_track_left_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup(session, supportType, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_right_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11217,15 +11122,15 @@ static void bolliger_mabillard_track_right_corkscrew_up( { 32, 20, 3 }, { 0, 6, height + 4 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11251,8 +11156,8 @@ static void bolliger_mabillard_track_right_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11279,28 +11184,28 @@ static void bolliger_mabillard_track_right_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup(session, supportType, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_left_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_right_corkscrew_up( @@ -11309,7 +11214,7 @@ static void bolliger_mabillard_track_left_corkscrew_down( template static void bolliger_mabillard_track_right_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_left_corkscrew_up( @@ -11318,7 +11223,7 @@ static void bolliger_mabillard_track_right_corkscrew_down( template static void bolliger_mabillard_track_flat_to_60_deg_up_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11349,15 +11254,15 @@ static void bolliger_mabillard_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11385,11 +11290,11 @@ static void bolliger_mabillard_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11417,11 +11322,11 @@ static void bolliger_mabillard_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -11449,20 +11354,20 @@ static void bolliger_mabillard_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } @@ -11470,7 +11375,7 @@ static void bolliger_mabillard_track_flat_to_60_deg_up_long_base( /** rct2: 0x008AC104 */ template static void bolliger_mabillard_track_60_deg_up_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11501,15 +11406,15 @@ static void bolliger_mabillard_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: switch (direction) @@ -11537,11 +11442,11 @@ static void bolliger_mabillard_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -11569,11 +11474,11 @@ static void bolliger_mabillard_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11601,27 +11506,27 @@ static void bolliger_mabillard_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } template static void bolliger_mabillard_track_60_deg_down_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -11630,7 +11535,7 @@ static void bolliger_mabillard_track_60_deg_down_to_flat_long_base( template static void bolliger_mabillard_track_flat_to_60_deg_down_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -11639,7 +11544,7 @@ static void bolliger_mabillard_track_flat_to_60_deg_down_long_base( template static void bolliger_mabillard_track_left_barrel_roll_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11654,7 +11559,7 @@ static void bolliger_mabillard_track_left_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17666), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 2, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11663,7 +11568,7 @@ static void bolliger_mabillard_track_left_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17669), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 3, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11672,7 +11577,7 @@ static void bolliger_mabillard_track_left_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17672), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11681,17 +11586,17 @@ static void bolliger_mabillard_track_left_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17675), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 0, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11729,12 +11634,11 @@ static void bolliger_mabillard_track_left_barrel_roll_up_to_down( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11775,23 +11679,23 @@ static void bolliger_mabillard_track_left_barrel_roll_up_to_down( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_right_barrel_roll_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11806,7 +11710,7 @@ static void bolliger_mabillard_track_right_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17678), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 0, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 0, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11815,7 +11719,7 @@ static void bolliger_mabillard_track_right_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17681), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 2, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 2, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11824,7 +11728,7 @@ static void bolliger_mabillard_track_right_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17684), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 3, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 3, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -11833,17 +11737,17 @@ static void bolliger_mabillard_track_right_barrel_roll_up_to_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17687), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup(session, supportType, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11881,12 +11785,11 @@ static void bolliger_mabillard_track_right_barrel_roll_up_to_down( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11927,23 +11830,23 @@ static void bolliger_mabillard_track_right_barrel_roll_up_to_down( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_left_barrel_roll_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -11952,7 +11855,7 @@ static void bolliger_mabillard_track_left_barrel_roll_down_to_up( template static void bolliger_mabillard_track_right_barrel_roll_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -11961,7 +11864,7 @@ static void bolliger_mabillard_track_right_barrel_roll_down_to_up( template static void bolliger_mabillard_track_powered_lift( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -11987,23 +11890,23 @@ static void bolliger_mabillard_track_powered_lift( { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } template static void bolliger_mabillard_track_left_large_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12032,14 +11935,14 @@ static void bolliger_mabillard_track_left_large_half_loop_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -12065,10 +11968,10 @@ static void bolliger_mabillard_track_left_large_half_loop_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + MetalASupportsPaintSetup(session, supportType, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -12094,12 +11997,11 @@ static void bolliger_mabillard_track_left_large_half_loop_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -12108,33 +12010,32 @@ static void bolliger_mabillard_track_left_large_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17735), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup(session, supportType, 5, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 5, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17742), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 200 }); - metal_a_supports_paint_setup(session, supportType, 6, 22, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 6, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17749), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 200 }); - metal_a_supports_paint_setup(session, supportType, 8, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 8, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17756), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup(session, supportType, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -12160,9 +12061,9 @@ static void bolliger_mabillard_track_left_large_half_loop_up( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -12188,12 +12089,11 @@ static void bolliger_mabillard_track_left_large_half_loop_up( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -12221,21 +12121,20 @@ static void bolliger_mabillard_track_left_large_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } template static void bolliger_mabillard_track_right_large_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12264,14 +12163,14 @@ static void bolliger_mabillard_track_right_large_half_loop_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -12297,10 +12196,10 @@ static void bolliger_mabillard_track_right_large_half_loop_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + MetalASupportsPaintSetup(session, supportType, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -12326,12 +12225,11 @@ static void bolliger_mabillard_track_right_large_half_loop_up( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -12340,33 +12238,32 @@ static void bolliger_mabillard_track_right_large_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17784), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup(session, supportType, 8, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 8, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17777), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 200 }); - metal_a_supports_paint_setup(session, supportType, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17770), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 200 }); - metal_a_supports_paint_setup(session, supportType, 5, 22, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 5, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17763), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup(session, supportType, 6, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 6, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -12392,9 +12289,9 @@ static void bolliger_mabillard_track_right_large_half_loop_up( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -12420,12 +12317,11 @@ static void bolliger_mabillard_track_right_large_half_loop_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -12453,21 +12349,20 @@ static void bolliger_mabillard_track_right_large_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } template static void bolliger_mabillard_track_right_large_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_right_large_half_loop_up( @@ -12476,7 +12371,7 @@ static void bolliger_mabillard_track_right_large_half_loop_down( template static void bolliger_mabillard_track_left_large_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bolliger_mabillard_track_left_large_half_loop_up( @@ -12485,7 +12380,7 @@ static void bolliger_mabillard_track_left_large_half_loop_down( template static void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12514,9 +12409,9 @@ static void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -12542,9 +12437,9 @@ static void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -12572,18 +12467,18 @@ static void bolliger_mabillard_track_90_deg_to_inverted_flat_quarter_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } template static void bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -12592,7 +12487,7 @@ static void bolliger_mabillard_track_inverted_flat_to_90_deg_quarter_loop_down( template void bolliger_mabillard_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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. @@ -12618,17 +12513,17 @@ void bolliger_mabillard_track_booster( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void bolliger_mabillard_track_left_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12657,17 +12552,16 @@ static void bolliger_mabillard_track_left_twist_down_to_up( { 32, 20, 3 }, { 0, 0, height + 6 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12693,12 +12587,11 @@ static void bolliger_mabillard_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12724,30 +12617,29 @@ static void bolliger_mabillard_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height - 32, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height - 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height - 32, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12776,17 +12668,16 @@ static void bolliger_mabillard_track_right_twist_down_to_up( { 32, 20, 3 }, { 0, 0, height + 6 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12812,12 +12703,11 @@ static void bolliger_mabillard_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12843,30 +12733,29 @@ static void bolliger_mabillard_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height - 16, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height - 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height - 16, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_left_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12895,18 +12784,17 @@ static void bolliger_mabillard_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 24, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 24, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12932,12 +12820,11 @@ static void bolliger_mabillard_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12963,29 +12850,28 @@ static void bolliger_mabillard_track_left_twist_up_to_down( { 32, 20, 3 }, { 0, 0, height + 6 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } template static void bolliger_mabillard_track_right_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13014,18 +12900,17 @@ static void bolliger_mabillard_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -13051,12 +12936,11 @@ static void bolliger_mabillard_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -13082,22 +12966,21 @@ static void bolliger_mabillard_track_right_twist_up_to_down( { 32, 20, 3 }, { 0, 0, height + 6 }); break; } - metal_a_supports_paint_setup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height - 16, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height - 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height - 16, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp index 80ab37856f..77f8ee3db8 100644 --- a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp @@ -228,7 +228,7 @@ enum }; static void classic_wooden_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { @@ -252,14 +252,14 @@ static void classic_wooden_rc_track_flat_to_left_bank( }; wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][1][2] = { @@ -285,28 +285,28 @@ static void classic_wooden_rc_track_flat_to_right_bank( }; wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][1][2] = { @@ -331,21 +331,21 @@ static void classic_wooden_rc_track_left_bank( } }; wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][1][2] = { @@ -371,21 +371,21 @@ static void classic_wooden_rc_track_left_bank_to_25_deg_up( }; wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void classic_wooden_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][1][2] = { @@ -412,21 +412,21 @@ static void classic_wooden_rc_track_right_bank_to_25_deg_up( wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void classic_wooden_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][1][2] = { @@ -453,21 +453,21 @@ static void classic_wooden_rc_track_25_deg_up_to_left_bank( wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void classic_wooden_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][1][2] = { @@ -494,49 +494,49 @@ static void classic_wooden_rc_track_25_deg_up_to_right_bank( wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void classic_wooden_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_25_deg_up_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_25_deg_up_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_right_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_left_bank_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][7][2] = { @@ -696,16 +696,15 @@ static void classic_wooden_rc_track_banked_right_quarter_turn_5( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(blockedSegments[trackSequence], direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments[trackSequence], direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -714,7 +713,7 @@ static void classic_wooden_rc_track_banked_left_quarter_turn_5( } static void classic_wooden_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -816,17 +815,16 @@ static void classic_wooden_rc_track_right_quarter_turn_3_bank( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(blockedSegments[trackSequence], direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments[trackSequence], direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -834,7 +832,7 @@ static void classic_wooden_rc_track_left_quarter_turn_3_bank( } static void classic_wooden_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][5][2] = { @@ -949,24 +947,23 @@ static void classic_wooden_rc_track_left_eighth_bank_to_diag( if (trackSequence == 0 && (direction == 0 || direction == 3)) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(blockedSegments[trackSequence], direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments[trackSequence], direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][5][2] = { @@ -1089,24 +1086,23 @@ static void classic_wooden_rc_track_right_eighth_bank_to_diag( if (trackSequence == 0 && (direction == 0 || direction == 3)) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(blockedSegments[trackSequence], direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments[trackSequence], direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1114,7 +1110,7 @@ static void classic_wooden_rc_track_left_eighth_bank_to_orthogonal( } static void classic_wooden_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1122,7 +1118,7 @@ static void classic_wooden_rc_track_right_eighth_bank_to_orthogonal( } static void classic_wooden_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1209,18 +1205,18 @@ static void classic_wooden_rc_track_diag_flat_to_left_bank( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1307,18 +1303,18 @@ static void classic_wooden_rc_track_diag_flat_to_right_bank( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_flat_to_right_bank( @@ -1326,14 +1322,14 @@ static void classic_wooden_rc_track_diag_left_bank_to_flat( } static void classic_wooden_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_flat_to_left_bank(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1420,25 +1416,25 @@ static void classic_wooden_rc_track_diag_left_bank( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classic_wooden_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_left_bank(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void classic_wooden_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1525,18 +1521,18 @@ static void classic_wooden_rc_track_diag_left_bank_to_25_deg_up( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void classic_wooden_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1623,18 +1619,18 @@ static void classic_wooden_rc_track_diag_right_bank_to_25_deg_up( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void classic_wooden_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1721,18 +1717,18 @@ static void classic_wooden_rc_track_diag_25_deg_up_to_left_bank( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void classic_wooden_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { static constexpr const sprite_bb_2 imageIds[4][4][2] = { @@ -1819,18 +1815,18 @@ static void classic_wooden_rc_track_diag_25_deg_up_to_right_bank( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][0], height); wooden_rc_track_paint_bb(session, &imageIds[direction][trackSequence][1], height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void classic_wooden_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_25_deg_up_to_right_bank( @@ -1838,7 +1834,7 @@ static void classic_wooden_rc_track_diag_left_bank_to_25_deg_down( } static void classic_wooden_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_25_deg_up_to_left_bank( @@ -1846,7 +1842,7 @@ static void classic_wooden_rc_track_diag_right_bank_to_25_deg_down( } static void classic_wooden_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_right_bank_to_25_deg_up( @@ -1854,7 +1850,7 @@ static void classic_wooden_rc_track_diag_25_deg_down_to_left_bank( } static void classic_wooden_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, Direction direction, int32_t height, const TrackElement& trackElement) { classic_wooden_rc_track_diag_left_bank_to_25_deg_up( diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index ff8a74cfd6..a570ca3793 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008AE6E0 */ static void compact_inverted_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -60,21 +60,21 @@ static void compact_inverted_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE950, 0x008AE960, 0x008AE970 */ static void compact_inverted_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -95,14 +95,14 @@ static void compact_inverted_rc_track_station( { 32, 20, 3 }, { 0, 6, height + 29 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 11); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE6F0 */ static void compact_inverted_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -158,26 +158,26 @@ static void compact_inverted_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -185,18 +185,18 @@ static void compact_inverted_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AE700 */ static void compact_inverted_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -253,20 +253,20 @@ static void compact_inverted_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } /** rct2: 0x008AE710 */ static void compact_inverted_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -322,26 +322,26 @@ static void compact_inverted_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -349,18 +349,18 @@ static void compact_inverted_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008AE720 */ static void compact_inverted_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -429,20 +429,20 @@ static void compact_inverted_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008AE730 */ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -510,26 +510,26 @@ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 70, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 70, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 70, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 70, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -537,18 +537,18 @@ static void compact_inverted_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008AE740 */ static void compact_inverted_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -604,26 +604,26 @@ static void compact_inverted_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -631,18 +631,18 @@ static void compact_inverted_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE750 */ static void compact_inverted_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -650,7 +650,7 @@ static void compact_inverted_rc_track_25_deg_down( /** rct2: 0x008AE760 */ static void compact_inverted_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -658,7 +658,7 @@ static void compact_inverted_rc_track_60_deg_down( /** rct2: 0x008AE770 */ static void compact_inverted_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -666,7 +666,7 @@ static void compact_inverted_rc_track_flat_to_25_deg_down( /** rct2: 0x008AE780 */ static void compact_inverted_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -674,7 +674,7 @@ static void compact_inverted_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008AE790 */ static void compact_inverted_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -682,7 +682,7 @@ static void compact_inverted_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008AE7A0 */ static void compact_inverted_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -690,7 +690,7 @@ static void compact_inverted_rc_track_25_deg_down_to_flat( /** rct2: 0x008AE7B0 */ static void compact_inverted_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -720,20 +720,20 @@ static void compact_inverted_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -759,12 +759,11 @@ static void compact_inverted_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -790,12 +789,12 @@ static void compact_inverted_rc_track_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -821,12 +820,11 @@ static void compact_inverted_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -853,29 +851,29 @@ static void compact_inverted_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AE7C0 */ static void compact_inverted_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -884,7 +882,7 @@ static void compact_inverted_rc_track_right_quarter_turn_5( /** rct2: 0x008AE7D0 */ static void compact_inverted_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -911,23 +909,23 @@ static void compact_inverted_rc_track_flat_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE7E0 */ static void compact_inverted_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -954,23 +952,23 @@ static void compact_inverted_rc_track_flat_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE7F0 */ static void compact_inverted_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -997,23 +995,23 @@ static void compact_inverted_rc_track_left_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE800 */ static void compact_inverted_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1040,23 +1038,23 @@ static void compact_inverted_rc_track_right_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE810 */ static void compact_inverted_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1086,20 +1084,20 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1125,12 +1123,11 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -1156,12 +1153,12 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -1187,12 +1184,11 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -1219,29 +1215,29 @@ static void compact_inverted_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AE820 */ static void compact_inverted_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1251,7 +1247,7 @@ static void compact_inverted_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008AE830 */ static void compact_inverted_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1278,28 +1274,28 @@ static void compact_inverted_rc_track_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1307,18 +1303,18 @@ static void compact_inverted_rc_track_left_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008AE840 */ static void compact_inverted_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1345,28 +1341,28 @@ static void compact_inverted_rc_track_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1374,18 +1370,18 @@ static void compact_inverted_rc_track_right_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008AE850 */ static void compact_inverted_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1412,28 +1408,28 @@ static void compact_inverted_rc_track_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1441,18 +1437,18 @@ static void compact_inverted_rc_track_25_deg_up_to_left_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE860 */ static void compact_inverted_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1479,28 +1475,28 @@ static void compact_inverted_rc_track_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1508,18 +1504,18 @@ static void compact_inverted_rc_track_25_deg_up_to_right_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE870 */ static void compact_inverted_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1527,7 +1523,7 @@ static void compact_inverted_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008AE880 */ static void compact_inverted_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1535,7 +1531,7 @@ static void compact_inverted_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008AE890 */ static void compact_inverted_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1543,7 +1539,7 @@ static void compact_inverted_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008AE8A0 */ static void compact_inverted_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1551,7 +1547,7 @@ static void compact_inverted_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008AE8B0 */ static void compact_inverted_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1578,23 +1574,23 @@ static void compact_inverted_rc_track_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE8C0 */ static void compact_inverted_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1602,7 +1598,7 @@ static void compact_inverted_rc_track_right_bank( /** rct2: 0x008AE8D0 */ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1632,20 +1628,20 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -1671,12 +1667,11 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -1702,12 +1697,12 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -1733,12 +1728,11 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -1765,29 +1759,29 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AE8E0 */ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1817,20 +1811,20 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -1856,12 +1850,11 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -1887,12 +1880,12 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -1918,12 +1911,11 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -1950,29 +1942,29 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AE8F0 */ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1982,7 +1974,7 @@ static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008AE900 */ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1992,7 +1984,7 @@ static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008AE910 */ static void compact_inverted_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2022,16 +2014,16 @@ static void compact_inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2058,24 +2050,23 @@ static void compact_inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2102,24 +2093,23 @@ static void compact_inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2146,28 +2136,28 @@ static void compact_inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AE920 */ static void compact_inverted_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2197,16 +2187,16 @@ static void compact_inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2233,24 +2223,23 @@ static void compact_inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2277,24 +2266,23 @@ static void compact_inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2321,28 +2309,28 @@ static void compact_inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AE930 */ static void compact_inverted_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2372,37 +2360,37 @@ static void compact_inverted_rc_track_left_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -2428,8 +2416,8 @@ static void compact_inverted_rc_track_left_vertical_loop( { 2, 2, 3 }, { 29, 20, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -2455,9 +2443,9 @@ static void compact_inverted_rc_track_left_vertical_loop( { 2, 2, 119 }, { 29, 29, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2483,18 +2471,17 @@ static void compact_inverted_rc_track_left_vertical_loop( { 2, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 6: switch (direction) @@ -2520,12 +2507,11 @@ static void compact_inverted_rc_track_left_vertical_loop( { 2, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 7: switch (direction) @@ -2551,9 +2537,9 @@ static void compact_inverted_rc_track_left_vertical_loop( { 32, 2, 119 }, { 0, -6, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2579,8 +2565,8 @@ static void compact_inverted_rc_track_left_vertical_loop( { 32, 2, 63 }, { 0, 29, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: switch (direction) @@ -2607,28 +2593,28 @@ static void compact_inverted_rc_track_left_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2636,20 +2622,20 @@ static void compact_inverted_rc_track_left_vertical_loop( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_INVERTED_4); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_INVERTED_4); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AE940 */ static void compact_inverted_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2679,37 +2665,37 @@ static void compact_inverted_rc_track_right_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -2735,8 +2721,8 @@ static void compact_inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 29, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -2762,9 +2748,9 @@ static void compact_inverted_rc_track_right_vertical_loop( { 5, 2, 119 }, { 16, 29, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2790,18 +2776,17 @@ static void compact_inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 6: switch (direction) @@ -2827,12 +2812,11 @@ static void compact_inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 7: switch (direction) @@ -2858,9 +2842,9 @@ static void compact_inverted_rc_track_right_vertical_loop( { 4, 2, 119 }, { 10, 0, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2886,8 +2870,8 @@ static void compact_inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: switch (direction) @@ -2914,28 +2898,28 @@ static void compact_inverted_rc_track_right_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2943,20 +2927,20 @@ static void compact_inverted_rc_track_right_vertical_loop( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_INVERTED_4); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_INVERTED_4); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AE980 */ static void compact_inverted_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2986,20 +2970,20 @@ static void compact_inverted_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3025,9 +3009,9 @@ static void compact_inverted_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -3054,29 +3038,29 @@ static void compact_inverted_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AE990 */ static void compact_inverted_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3085,7 +3069,7 @@ static void compact_inverted_rc_track_right_quarter_turn_3( /** rct2: 0x008AE9A0 */ static void compact_inverted_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3115,20 +3099,20 @@ static void compact_inverted_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3154,9 +3138,9 @@ static void compact_inverted_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -3183,29 +3167,29 @@ static void compact_inverted_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AE9B0 */ static void compact_inverted_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3214,7 +3198,7 @@ static void compact_inverted_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008AE9C0 */ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3244,23 +3228,23 @@ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3287,29 +3271,29 @@ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AE9D0 */ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3339,23 +3323,23 @@ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3382,29 +3366,29 @@ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AE9E0 */ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3414,7 +3398,7 @@ static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008AE9F0 */ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3424,7 +3408,7 @@ static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008AEA00 */ static void compact_inverted_rc_track_left_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3454,19 +3438,18 @@ static void compact_inverted_rc_track_left_twist_down_to_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3492,12 +3475,11 @@ static void compact_inverted_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3523,30 +3505,29 @@ static void compact_inverted_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEA10 */ static void compact_inverted_rc_track_right_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3576,19 +3557,18 @@ static void compact_inverted_rc_track_right_twist_down_to_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3614,12 +3594,11 @@ static void compact_inverted_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3645,30 +3624,29 @@ static void compact_inverted_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEA20 */ static void compact_inverted_rc_track_left_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3697,18 +3675,17 @@ static void compact_inverted_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3734,12 +3711,11 @@ static void compact_inverted_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3766,31 +3742,30 @@ static void compact_inverted_rc_track_left_twist_up_to_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEA30 */ static void compact_inverted_rc_track_right_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3819,18 +3794,17 @@ static void compact_inverted_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3856,12 +3830,11 @@ static void compact_inverted_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3888,31 +3861,30 @@ static void compact_inverted_rc_track_right_twist_up_to_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEA40 */ static void compact_inverted_rc_track_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3942,33 +3914,33 @@ static void compact_inverted_rc_track_half_loop_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -3994,8 +3966,8 @@ static void compact_inverted_rc_track_half_loop_up( { 2, 2, 3 }, { 29, 20, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4021,12 +3993,11 @@ static void compact_inverted_rc_track_half_loop_up( { 2, 2, 119 }, { 29, 29, height + 2 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -4054,18 +4025,18 @@ static void compact_inverted_rc_track_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AEA50 */ static void compact_inverted_rc_track_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); @@ -4073,7 +4044,7 @@ static void compact_inverted_rc_track_half_loop_down( /** rct2: 0x008AEA60 */ static void compact_inverted_rc_track_left_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4103,19 +4074,19 @@ static void compact_inverted_rc_track_left_corkscrew_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -4141,8 +4112,8 @@ static void compact_inverted_rc_track_left_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 24 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4168,30 +4139,30 @@ static void compact_inverted_rc_track_left_corkscrew_up( { 20, 32, 3 }, { 6, 0, height + 39 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 40, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 40, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AEA70 */ static void compact_inverted_rc_track_right_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4221,19 +4192,19 @@ static void compact_inverted_rc_track_right_corkscrew_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -4259,8 +4230,8 @@ static void compact_inverted_rc_track_right_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 24 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4286,30 +4257,30 @@ static void compact_inverted_rc_track_right_corkscrew_up( { 20, 32, 3 }, { 6, 0, height + 39 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 40, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 40, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AEA80 */ static void compact_inverted_rc_track_left_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); @@ -4317,7 +4288,7 @@ static void compact_inverted_rc_track_left_corkscrew_down( /** rct2: 0x008AEA90 */ static void compact_inverted_rc_track_right_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); @@ -4325,7 +4296,7 @@ static void compact_inverted_rc_track_right_corkscrew_down( /** rct2: 0x008AEAD0 */ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4364,13 +4335,13 @@ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008AEAB0 */ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4410,13 +4381,13 @@ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up( } track_paint_util_right_quarter_turn_1_tile_tunnel( session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008AEAC0 */ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -4425,7 +4396,7 @@ static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008AEAE0 */ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -4434,7 +4405,7 @@ static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008AEAA0 */ static void compact_inverted_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4453,21 +4424,21 @@ static void compact_inverted_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AEAF0 */ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4497,20 +4468,20 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4536,12 +4507,11 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4567,12 +4537,12 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -4598,12 +4568,11 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4630,29 +4599,29 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEB00 */ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4682,20 +4651,20 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4721,12 +4690,11 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4752,12 +4720,12 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -4783,12 +4751,11 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4815,29 +4782,29 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEB10 */ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4867,20 +4834,20 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4906,12 +4873,11 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4937,12 +4903,12 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -4968,12 +4934,11 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -5000,29 +4965,29 @@ static void compact_inverted_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEB20 */ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5052,20 +5017,20 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5091,12 +5056,11 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -5122,12 +5086,12 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -5153,12 +5117,11 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -5185,29 +5148,29 @@ static void compact_inverted_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEB30 */ static void compact_inverted_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5215,9 +5178,9 @@ static void compact_inverted_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26555), { 0, 0, height + 29 }, { 32, 20, 3 }, @@ -5226,9 +5189,9 @@ static void compact_inverted_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26556), { 0, 0, height + 29 }, { 32, 20, 3 }, @@ -5237,9 +5200,9 @@ static void compact_inverted_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26555), { 0, 0, height + 29 }, { 32, 20, 3 }, @@ -5248,9 +5211,9 @@ static void compact_inverted_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26556), { 0, 0, height + 29 }, { 32, 20, 3 }, @@ -5258,14 +5221,14 @@ static void compact_inverted_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008AEDB0 */ static void compact_inverted_rc_track_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5323,10 +5286,10 @@ static void compact_inverted_rc_track_90_deg_up( break; } } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -5335,7 +5298,7 @@ static void compact_inverted_rc_track_90_deg_up( /** rct2: 0x008AEDC0 */ static void compact_inverted_rc_track_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { compact_inverted_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5343,7 +5306,7 @@ static void compact_inverted_rc_track_90_deg_down( /** rct2: 0x008AED70 */ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5403,12 +5366,12 @@ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: break; @@ -5417,7 +5380,7 @@ static void compact_inverted_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008AED80 */ static void compact_inverted_rc_track_90_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5425,7 +5388,7 @@ static void compact_inverted_rc_track_90_deg_down_to_60_deg_down( /** rct2: 0x008AED90 */ static void compact_inverted_rc_track_90_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -5483,20 +5446,20 @@ static void compact_inverted_rc_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_INVERTED_5); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_INVERTED_5); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } /** rct2: 0x008AEDA0 */ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5556,11 +5519,11 @@ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -5569,7 +5532,7 @@ static void compact_inverted_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008AEB40 */ static void compact_inverted_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5599,16 +5562,16 @@ static void compact_inverted_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5634,12 +5597,11 @@ static void compact_inverted_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5665,15 +5627,15 @@ static void compact_inverted_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -5700,39 +5662,38 @@ static void compact_inverted_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEB50 */ static void compact_inverted_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5762,16 +5723,16 @@ static void compact_inverted_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5797,12 +5758,11 @@ static void compact_inverted_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5828,15 +5788,15 @@ static void compact_inverted_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -5863,39 +5823,38 @@ static void compact_inverted_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEB60 */ static void compact_inverted_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5904,7 +5863,7 @@ static void compact_inverted_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008AEB70 */ static void compact_inverted_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5913,7 +5872,7 @@ static void compact_inverted_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008AED30 */ static void compact_inverted_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5943,16 +5902,16 @@ static void compact_inverted_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5978,12 +5937,11 @@ static void compact_inverted_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -6009,15 +5967,15 @@ static void compact_inverted_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -6044,39 +6002,39 @@ static void compact_inverted_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AED40 */ static void compact_inverted_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6106,16 +6064,16 @@ static void compact_inverted_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -6141,12 +6099,11 @@ static void compact_inverted_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -6172,15 +6129,15 @@ static void compact_inverted_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -6207,39 +6164,39 @@ static void compact_inverted_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AED50 */ static void compact_inverted_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6249,7 +6206,7 @@ static void compact_inverted_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008AED60 */ static void compact_inverted_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6258,7 +6215,7 @@ static void compact_inverted_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008AEB80 */ static void compact_inverted_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6286,9 +6243,9 @@ static void compact_inverted_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6313,9 +6270,9 @@ static void compact_inverted_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6340,9 +6297,9 @@ static void compact_inverted_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6368,36 +6325,36 @@ static void compact_inverted_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEBB0 */ static void compact_inverted_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6425,9 +6382,9 @@ static void compact_inverted_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6452,9 +6409,9 @@ static void compact_inverted_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6479,9 +6436,9 @@ static void compact_inverted_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6507,36 +6464,36 @@ static void compact_inverted_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AEC10 */ static void compact_inverted_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6550,9 +6507,9 @@ static void compact_inverted_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: switch (direction) @@ -6563,9 +6520,9 @@ static void compact_inverted_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: switch (direction) @@ -6576,9 +6533,9 @@ static void compact_inverted_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: switch (direction) @@ -6590,36 +6547,36 @@ static void compact_inverted_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } } /** rct2: 0x008AEB90 */ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6647,9 +6604,9 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6674,9 +6631,9 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6701,9 +6658,9 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6729,36 +6686,36 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AEBF0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6772,9 +6729,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -6785,9 +6742,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -6798,9 +6755,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -6812,36 +6769,36 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AEC00 */ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6855,9 +6812,9 @@ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -6868,9 +6825,9 @@ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -6881,9 +6838,9 @@ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -6895,36 +6852,36 @@ static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AEBA0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6952,9 +6909,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6979,9 +6936,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7006,9 +6963,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7034,36 +6991,36 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AEBE0 */ static void compact_inverted_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7091,9 +7048,9 @@ static void compact_inverted_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7118,9 +7075,9 @@ static void compact_inverted_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7145,9 +7102,9 @@ static void compact_inverted_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7173,36 +7130,36 @@ static void compact_inverted_rc_track_diag_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AEC40 */ static void compact_inverted_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7216,9 +7173,9 @@ static void compact_inverted_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: switch (direction) @@ -7229,9 +7186,9 @@ static void compact_inverted_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: switch (direction) @@ -7242,9 +7199,9 @@ static void compact_inverted_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: switch (direction) @@ -7256,36 +7213,36 @@ static void compact_inverted_rc_track_diag_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } } /** rct2: 0x008AEBC0 */ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7313,8 +7270,8 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7339,8 +7296,8 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7365,8 +7322,8 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7392,36 +7349,36 @@ static void compact_inverted_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AEC20 */ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7435,9 +7392,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -7448,9 +7405,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -7461,9 +7418,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -7475,36 +7432,36 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AEC30 */ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7518,9 +7475,9 @@ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -7531,9 +7488,9 @@ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -7544,9 +7501,9 @@ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -7558,36 +7515,36 @@ static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008AEBD0 */ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7615,9 +7572,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7642,9 +7599,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7669,9 +7626,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7697,36 +7654,36 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AEC70 */ static void compact_inverted_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7740,9 +7697,9 @@ static void compact_inverted_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7753,9 +7710,9 @@ static void compact_inverted_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7766,9 +7723,9 @@ static void compact_inverted_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7780,37 +7737,37 @@ static void compact_inverted_rc_track_diag_flat_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEC80 */ static void compact_inverted_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7824,9 +7781,9 @@ static void compact_inverted_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7837,9 +7794,9 @@ static void compact_inverted_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7850,9 +7807,9 @@ static void compact_inverted_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7864,37 +7821,37 @@ static void compact_inverted_rc_track_diag_flat_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEC90 */ static void compact_inverted_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7908,9 +7865,9 @@ static void compact_inverted_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7921,9 +7878,9 @@ static void compact_inverted_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7934,9 +7891,9 @@ static void compact_inverted_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7948,37 +7905,37 @@ static void compact_inverted_rc_track_diag_left_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AECA0 */ static void compact_inverted_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7992,9 +7949,9 @@ static void compact_inverted_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8005,9 +7962,9 @@ static void compact_inverted_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8018,9 +7975,9 @@ static void compact_inverted_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -8032,37 +7989,37 @@ static void compact_inverted_rc_track_diag_right_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AECD0 */ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8076,9 +8033,9 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -8089,9 +8046,9 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -8102,9 +8059,9 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -8116,36 +8073,36 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AECE0 */ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8159,9 +8116,9 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -8172,9 +8129,9 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -8185,9 +8142,9 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -8199,36 +8156,36 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AECB0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8242,9 +8199,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -8255,9 +8212,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8268,9 +8225,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8282,36 +8239,36 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AECC0 */ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8325,9 +8282,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -8338,9 +8295,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8351,9 +8308,9 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8365,36 +8322,36 @@ static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AECF0 */ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8408,8 +8365,8 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8420,8 +8377,8 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8432,8 +8389,8 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8445,36 +8402,36 @@ static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AED00 */ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8488,8 +8445,8 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8500,8 +8457,8 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8512,8 +8469,8 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8525,36 +8482,36 @@ static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AED10 */ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8568,9 +8525,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -8581,9 +8538,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -8594,9 +8551,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -8608,36 +8565,36 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AED20 */ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8651,9 +8608,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -8664,9 +8621,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -8677,9 +8634,9 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -8691,36 +8648,36 @@ static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AEC50 */ static void compact_inverted_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8734,9 +8691,9 @@ static void compact_inverted_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8747,9 +8704,9 @@ static void compact_inverted_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8760,9 +8717,9 @@ static void compact_inverted_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -8774,37 +8731,37 @@ static void compact_inverted_rc_track_diag_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEC60 */ static void compact_inverted_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8818,9 +8775,9 @@ static void compact_inverted_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8831,9 +8788,9 @@ static void compact_inverted_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8844,9 +8801,9 @@ static void compact_inverted_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -8858,37 +8815,37 @@ static void compact_inverted_rc_track_diag_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AEAA0 */ static void compact_inverted_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8907,16 +8864,16 @@ static void compact_inverted_rc_track_block_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_compact_inverted_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp index 4c239a10b2..f9e020ca5d 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _CorkscrewRCBlockBrakeImages[NumOrthogonalDirect /** rct2: 0x008A7AF8 */ static void corkscrew_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -62,7 +62,7 @@ static void corkscrew_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -84,18 +84,18 @@ static void corkscrew_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7D68, 0x008A7D78, 0x008A7D88 */ static void corkscrew_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -123,14 +123,14 @@ static void corkscrew_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_2(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7B08 */ static void corkscrew_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -160,7 +160,7 @@ static void corkscrew_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -190,25 +190,25 @@ static void corkscrew_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A7B18 */ static void corkscrew_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -238,7 +238,7 @@ static void corkscrew_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -268,25 +268,25 @@ static void corkscrew_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A7B28 */ static void corkscrew_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -316,7 +316,7 @@ static void corkscrew_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -346,25 +346,25 @@ static void corkscrew_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A7B38 */ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -400,7 +400,7 @@ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -436,25 +436,25 @@ static void corkscrew_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A7B48 */ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -490,7 +490,7 @@ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -526,25 +526,25 @@ static void corkscrew_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A7B58 */ static void corkscrew_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -574,7 +574,7 @@ static void corkscrew_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -604,25 +604,25 @@ static void corkscrew_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A7B68 */ static void corkscrew_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { corkscrew_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -630,7 +630,7 @@ static void corkscrew_rc_track_25_deg_down( /** rct2: 0x008A7B78 */ static void corkscrew_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { corkscrew_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -638,7 +638,7 @@ static void corkscrew_rc_track_60_deg_down( /** rct2: 0x008A7B88 */ static void corkscrew_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -646,7 +646,7 @@ static void corkscrew_rc_track_flat_to_25_deg_down( /** rct2: 0x008A7B98 */ static void corkscrew_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -654,7 +654,7 @@ static void corkscrew_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A7BA8 */ static void corkscrew_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -662,7 +662,7 @@ static void corkscrew_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A7BB8 */ static void corkscrew_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -670,7 +670,7 @@ static void corkscrew_rc_track_25_deg_down_to_flat( /** rct2: 0x008A7BC8 */ static void corkscrew_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -699,17 +699,17 @@ static void corkscrew_rc_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -735,12 +735,11 @@ static void corkscrew_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -766,12 +765,12 @@ static void corkscrew_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -797,12 +796,11 @@ static void corkscrew_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -828,26 +826,26 @@ static void corkscrew_rc_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7BD8 */ static void corkscrew_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -856,7 +854,7 @@ static void corkscrew_rc_track_right_quarter_turn_5( /** rct2: 0x008A7BE8 */ static void corkscrew_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -890,17 +888,17 @@ static void corkscrew_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7BF8 */ static void corkscrew_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -934,17 +932,17 @@ static void corkscrew_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7C08 */ static void corkscrew_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -978,17 +976,17 @@ static void corkscrew_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7C18 */ static void corkscrew_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1022,17 +1020,17 @@ static void corkscrew_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7C28 */ static void corkscrew_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1064,17 +1062,17 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1100,12 +1098,11 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1131,12 +1128,12 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1162,12 +1159,11 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1196,26 +1192,26 @@ static void corkscrew_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7C38 */ static void corkscrew_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1224,7 +1220,7 @@ static void corkscrew_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008A7C48 */ static void corkscrew_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1258,24 +1254,24 @@ static void corkscrew_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A7C58 */ static void corkscrew_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1309,24 +1305,24 @@ static void corkscrew_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A7C68 */ static void corkscrew_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1360,24 +1356,24 @@ static void corkscrew_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A7C78 */ static void corkscrew_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1411,24 +1407,24 @@ static void corkscrew_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A7C88 */ static void corkscrew_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1436,7 +1432,7 @@ static void corkscrew_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008A7C98 */ static void corkscrew_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1444,7 +1440,7 @@ static void corkscrew_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008A7CA8 */ static void corkscrew_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1452,7 +1448,7 @@ static void corkscrew_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008A7CB8 */ static void corkscrew_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1460,7 +1456,7 @@ static void corkscrew_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008A7CC8 */ static void corkscrew_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1488,17 +1484,17 @@ static void corkscrew_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7CD8 */ static void corkscrew_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { corkscrew_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1506,7 +1502,7 @@ static void corkscrew_rc_track_right_bank( /** rct2: 0x008A7CE8 */ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1535,17 +1531,17 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1571,12 +1567,11 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1602,12 +1597,12 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1633,12 +1628,11 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1664,26 +1658,26 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7CF8 */ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1712,17 +1706,17 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1748,12 +1742,11 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1779,12 +1772,12 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1810,12 +1803,11 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1841,26 +1833,26 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7D08 */ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1869,7 +1861,7 @@ static void corkscrew_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008A7D18 */ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1878,7 +1870,7 @@ static void corkscrew_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008A7D28 */ static void corkscrew_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1907,14 +1899,14 @@ static void corkscrew_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1923,14 +1915,14 @@ static void corkscrew_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16403), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16407), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1944,12 +1936,11 @@ static void corkscrew_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1968,23 +1959,22 @@ static void corkscrew_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16403), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16407), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2010,26 +2000,26 @@ static void corkscrew_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7D38 */ static void corkscrew_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2058,14 +2048,14 @@ static void corkscrew_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2074,14 +2064,14 @@ static void corkscrew_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16411), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16415), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2095,12 +2085,11 @@ static void corkscrew_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2119,23 +2108,22 @@ static void corkscrew_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16411), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16415), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2161,26 +2149,26 @@ static void corkscrew_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7D48 */ static void corkscrew_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2192,41 +2180,40 @@ static void corkscrew_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16562), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16570), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16569), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16577), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2235,37 +2222,36 @@ static void corkscrew_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16563), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16571), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16568), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16576), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2291,9 +2277,9 @@ static void corkscrew_rc_track_left_vertical_loop( { 2, 16, 119 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2319,18 +2305,17 @@ static void corkscrew_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2356,12 +2341,11 @@ static void corkscrew_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2387,9 +2371,9 @@ static void corkscrew_rc_track_left_vertical_loop( { 3, 16, 119 }, { 12, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2398,37 +2382,36 @@ static void corkscrew_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16568), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16576), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16563), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16571), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2437,53 +2420,52 @@ static void corkscrew_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16569), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16577), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16562), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16570), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A7D58 */ static void corkscrew_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2512,12 +2494,12 @@ static void corkscrew_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2526,32 +2508,32 @@ static void corkscrew_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16592), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16584), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16587), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16579), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2577,7 +2559,7 @@ static void corkscrew_rc_track_right_vertical_loop( { 2, 16, 119 }, { 16, 0, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2603,13 +2585,13 @@ static void corkscrew_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2635,7 +2617,7 @@ static void corkscrew_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2661,7 +2643,7 @@ static void corkscrew_rc_track_right_vertical_loop( { 4, 16, 119 }, { 10, 16, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2670,32 +2652,32 @@ static void corkscrew_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16587), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16579), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16592), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16584), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2721,17 +2703,17 @@ static void corkscrew_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2740,7 +2722,7 @@ static void corkscrew_rc_track_right_vertical_loop( /** rct2: 0x008A7D98 */ static void corkscrew_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2769,17 +2751,17 @@ static void corkscrew_rc_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2805,9 +2787,9 @@ static void corkscrew_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2833,26 +2815,26 @@ static void corkscrew_rc_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7DA8 */ static void corkscrew_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2861,7 +2843,7 @@ static void corkscrew_rc_track_right_quarter_turn_3( /** rct2: 0x008A7DB8 */ static void corkscrew_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2893,17 +2875,17 @@ static void corkscrew_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2929,9 +2911,9 @@ static void corkscrew_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2960,26 +2942,26 @@ static void corkscrew_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7DC8 */ static void corkscrew_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2988,7 +2970,7 @@ static void corkscrew_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008A7DD8 */ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3017,20 +2999,20 @@ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -3056,26 +3038,26 @@ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7DE8 */ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3104,20 +3086,20 @@ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -3126,50 +3108,50 @@ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16531), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16533), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16535), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16537), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7DF8 */ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3178,7 +3160,7 @@ static void corkscrew_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008A7E08 */ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3187,7 +3169,7 @@ static void corkscrew_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008A7E18 */ static void corkscrew_rc_track_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3216,14 +3198,14 @@ static void corkscrew_rc_track_half_loop_up( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -3232,33 +3214,33 @@ static void corkscrew_rc_track_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16595), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16603), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16600), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16608), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3284,12 +3266,11 @@ static void corkscrew_rc_track_half_loop_up( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -3317,18 +3298,18 @@ static void corkscrew_rc_track_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7E28 */ static void corkscrew_rc_track_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { corkscrew_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); @@ -3336,7 +3317,7 @@ static void corkscrew_rc_track_half_loop_down( /** rct2: 0x008A7E38 */ static void corkscrew_rc_track_left_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3370,9 +3351,9 @@ static void corkscrew_rc_track_left_corkscrew_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3398,8 +3379,8 @@ static void corkscrew_rc_track_left_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3426,29 +3407,28 @@ static void corkscrew_rc_track_left_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7E48 */ static void corkscrew_rc_track_right_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3477,15 +3457,15 @@ static void corkscrew_rc_track_right_corkscrew_up( { 32, 20, 3 }, { 0, 6, height + 4 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3511,8 +3491,8 @@ static void corkscrew_rc_track_right_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3539,29 +3519,28 @@ static void corkscrew_rc_track_right_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7E58 */ static void corkscrew_rc_track_left_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { corkscrew_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); @@ -3569,7 +3548,7 @@ static void corkscrew_rc_track_left_corkscrew_down( /** rct2: 0x008A7E68 */ static void corkscrew_rc_track_right_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { corkscrew_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); @@ -3577,7 +3556,7 @@ static void corkscrew_rc_track_right_corkscrew_down( /** rct2: 0x008A7E78 */ static void corkscrew_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3609,18 +3588,18 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3646,9 +3625,9 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3677,20 +3656,20 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3719,23 +3698,23 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3761,9 +3740,9 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3792,22 +3771,22 @@ static void corkscrew_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7E88 */ static void corkscrew_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3839,18 +3818,18 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3876,9 +3855,9 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3907,20 +3886,20 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3949,23 +3928,23 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3991,9 +3970,9 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4022,22 +4001,22 @@ static void corkscrew_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7E98 */ static void corkscrew_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -4052,7 +4031,7 @@ static void corkscrew_rc_track_left_half_banked_helix_down_small( /** rct2: 0x008A7EA8 */ static void corkscrew_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -4066,7 +4045,7 @@ static void corkscrew_rc_track_right_half_banked_helix_down_small( /** rct2: 0x008A7EB8 */ static void corkscrew_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4098,18 +4077,18 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4135,12 +4114,11 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4166,12 +4144,12 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4197,12 +4175,11 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4231,20 +4208,20 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4273,23 +4250,23 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4315,12 +4292,11 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4346,12 +4322,12 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4377,12 +4353,11 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4411,22 +4386,22 @@ static void corkscrew_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7EC8 */ static void corkscrew_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4458,18 +4433,18 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4495,12 +4470,11 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4526,12 +4500,12 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4557,12 +4531,11 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4591,20 +4564,20 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4633,23 +4606,23 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4675,12 +4648,11 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4706,12 +4678,12 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4737,12 +4709,11 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4771,22 +4742,22 @@ static void corkscrew_rc_track_right_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7ED8 */ static void corkscrew_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4801,7 +4772,7 @@ static void corkscrew_rc_track_left_half_banked_helix_down_large( /** rct2: 0x008A7EE8 */ static void corkscrew_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4815,7 +4786,7 @@ static void corkscrew_rc_track_right_half_banked_helix_down_large( /** rct2: 0x008A7F18 */ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4854,13 +4825,13 @@ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A7EF8 */ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4899,13 +4870,13 @@ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up( break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A7F08 */ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -4913,7 +4884,7 @@ static void corkscrew_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008A7F28 */ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -4921,7 +4892,7 @@ static void corkscrew_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008A7F38 */ static void corkscrew_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4941,17 +4912,17 @@ static void corkscrew_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7F48 */ static void corkscrew_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4959,8 +4930,8 @@ static void corkscrew_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16224), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4968,8 +4939,8 @@ static void corkscrew_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16225), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4977,8 +4948,8 @@ static void corkscrew_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16224), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4986,22 +4957,22 @@ static void corkscrew_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16225), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A8198 */ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5032,16 +5003,15 @@ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5069,12 +5039,11 @@ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5102,12 +5071,11 @@ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -5135,28 +5103,27 @@ static void corkscrew_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } /** rct2: 0x008A81A8 */ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5187,16 +5154,15 @@ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: switch (direction) @@ -5224,12 +5190,11 @@ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -5257,12 +5222,11 @@ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5290,28 +5254,27 @@ static void corkscrew_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } /** rct2: 0x008A81B8 */ static void corkscrew_rc_track_60_deg_down_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); @@ -5319,7 +5282,7 @@ static void corkscrew_rc_track_60_deg_down_to_flat_long_base( /** rct2: 0x008A81C8 */ static void corkscrew_rc_track_flat_to_60_deg_down_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); @@ -5327,7 +5290,7 @@ static void corkscrew_rc_track_flat_to_60_deg_down_long_base( /** rct2: 0x008A7F68 */ static void corkscrew_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5356,14 +5319,14 @@ static void corkscrew_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5389,12 +5352,11 @@ static void corkscrew_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5420,15 +5382,15 @@ static void corkscrew_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5437,44 +5399,43 @@ static void corkscrew_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16743), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16747), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16751), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16755), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7F78 */ static void corkscrew_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5503,14 +5464,14 @@ static void corkscrew_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5536,12 +5497,11 @@ static void corkscrew_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5567,15 +5527,15 @@ static void corkscrew_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5584,44 +5544,43 @@ static void corkscrew_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16727), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16731), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16735), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16739), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7F88 */ static void corkscrew_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5630,7 +5589,7 @@ static void corkscrew_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008A7F98 */ static void corkscrew_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5639,7 +5598,7 @@ static void corkscrew_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008A7FA8 */ static void corkscrew_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5668,14 +5627,14 @@ static void corkscrew_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5701,12 +5660,11 @@ static void corkscrew_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5732,15 +5690,15 @@ static void corkscrew_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5749,44 +5707,43 @@ static void corkscrew_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16775), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16779), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16783), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16787), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7FB8 */ static void corkscrew_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5815,14 +5772,14 @@ static void corkscrew_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5848,12 +5805,11 @@ static void corkscrew_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5879,15 +5835,15 @@ static void corkscrew_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5896,44 +5852,43 @@ static void corkscrew_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16759), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16763), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16767), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16771), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7FC8 */ static void corkscrew_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5942,7 +5897,7 @@ static void corkscrew_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008A7FD8 */ static void corkscrew_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5951,7 +5906,7 @@ static void corkscrew_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008A7F58 */ static void corkscrew_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5979,9 +5934,9 @@ static void corkscrew_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6006,9 +5961,9 @@ static void corkscrew_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6033,9 +5988,9 @@ static void corkscrew_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6043,22 +5998,22 @@ static void corkscrew_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16697), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6068,36 +6023,36 @@ static void corkscrew_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16635), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A8008 */ static void corkscrew_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6125,9 +6080,9 @@ static void corkscrew_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6152,9 +6107,9 @@ static void corkscrew_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6179,9 +6134,9 @@ static void corkscrew_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6189,22 +6144,22 @@ static void corkscrew_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16709), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6214,36 +6169,36 @@ static void corkscrew_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16647), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A8068 */ static void corkscrew_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6271,9 +6226,9 @@ static void corkscrew_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6298,9 +6253,9 @@ static void corkscrew_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6325,9 +6280,9 @@ static void corkscrew_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6335,22 +6290,22 @@ static void corkscrew_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16721), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6360,36 +6315,36 @@ static void corkscrew_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16659), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A7FE8 */ static void corkscrew_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6417,9 +6372,9 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6444,9 +6399,9 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6471,9 +6426,9 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6481,22 +6436,22 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16701), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6506,36 +6461,36 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16639), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8048 */ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6563,9 +6518,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6590,9 +6545,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6617,9 +6572,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6627,22 +6582,22 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16713), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6652,36 +6607,36 @@ static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16651), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A8058 */ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6709,9 +6664,9 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6736,9 +6691,9 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6763,9 +6718,9 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6773,22 +6728,22 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16717), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6798,36 +6753,36 @@ static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16655), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7FF8 */ static void corkscrew_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6855,9 +6810,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6882,9 +6837,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6909,9 +6864,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6919,22 +6874,22 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16705), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6944,36 +6899,36 @@ static void corkscrew_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16643), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A8038 */ static void corkscrew_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7001,9 +6956,9 @@ static void corkscrew_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7028,9 +6983,9 @@ static void corkscrew_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7055,9 +7010,9 @@ static void corkscrew_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7065,22 +7020,22 @@ static void corkscrew_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16711), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7090,36 +7045,36 @@ static void corkscrew_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16649), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A8098 */ static void corkscrew_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7147,9 +7102,9 @@ static void corkscrew_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7174,9 +7129,9 @@ static void corkscrew_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7201,9 +7156,9 @@ static void corkscrew_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7211,22 +7166,22 @@ static void corkscrew_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16723), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7236,36 +7191,36 @@ static void corkscrew_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16661), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A8018 */ static void corkscrew_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7293,8 +7248,8 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7319,8 +7274,8 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7345,8 +7300,8 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7354,22 +7309,22 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16707), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7379,37 +7334,37 @@ static void corkscrew_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16645), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A8078 */ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7437,9 +7392,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7464,9 +7419,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7491,9 +7446,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7501,22 +7456,22 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16719), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7526,36 +7481,36 @@ static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16657), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A8088 */ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7583,9 +7538,9 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7610,9 +7565,9 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7637,9 +7592,9 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7647,22 +7602,22 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16715), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7672,36 +7627,36 @@ static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16653), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A8028 */ static void corkscrew_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7729,9 +7684,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7756,9 +7711,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7783,9 +7738,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7793,22 +7748,22 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16703), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7818,36 +7773,36 @@ static void corkscrew_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16641), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A80C8 */ static void corkscrew_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7861,9 +7816,9 @@ static void corkscrew_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7877,9 +7832,9 @@ static void corkscrew_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7890,43 +7845,43 @@ static void corkscrew_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16667), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A80D8 */ static void corkscrew_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7940,9 +7895,9 @@ static void corkscrew_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7953,9 +7908,9 @@ static void corkscrew_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7969,43 +7924,43 @@ static void corkscrew_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16672), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A80E8 */ static void corkscrew_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8019,9 +7974,9 @@ static void corkscrew_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8035,9 +7990,9 @@ static void corkscrew_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8048,43 +8003,43 @@ static void corkscrew_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16674), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A80F8 */ static void corkscrew_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8098,9 +8053,9 @@ static void corkscrew_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8111,9 +8066,9 @@ static void corkscrew_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8127,43 +8082,43 @@ static void corkscrew_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16669), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A8128 */ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8177,9 +8132,9 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8193,9 +8148,9 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8206,43 +8161,43 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16687), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8138 */ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8256,9 +8211,9 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8269,9 +8224,9 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8285,43 +8240,43 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16692), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8108 */ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8335,9 +8290,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8351,9 +8306,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8364,43 +8319,43 @@ static void corkscrew_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16677), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A8118 */ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8414,9 +8369,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8427,9 +8382,9 @@ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8443,43 +8398,43 @@ static void corkscrew_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16682), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A8148 */ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8493,8 +8448,8 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8508,8 +8463,8 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8520,43 +8475,43 @@ static void corkscrew_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16684), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A8158 */ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8570,8 +8525,8 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8582,8 +8537,8 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8597,43 +8552,43 @@ static void corkscrew_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16679), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A8168 */ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8647,9 +8602,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8663,9 +8618,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8676,43 +8631,43 @@ static void corkscrew_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16694), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8178 */ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8726,9 +8681,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8739,9 +8694,9 @@ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8755,43 +8710,43 @@ static void corkscrew_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16689), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A80A8 */ static void corkscrew_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8805,9 +8760,9 @@ static void corkscrew_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8818,9 +8773,9 @@ static void corkscrew_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8831,43 +8786,43 @@ static void corkscrew_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16663), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A80B8 */ static void corkscrew_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8881,9 +8836,9 @@ static void corkscrew_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8894,9 +8849,9 @@ static void corkscrew_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8907,58 +8862,58 @@ static void corkscrew_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16665), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A8188 */ static void corkscrew_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_CorkscrewRCBlockBrakeImages[direction][isClosed]), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void corkscrew_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!is_csg_loaded()) @@ -8995,16 +8950,16 @@ static void corkscrew_rc_track_booster( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void corkscrew_rc_track_left_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9033,18 +8988,17 @@ static void corkscrew_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9070,12 +9024,11 @@ static void corkscrew_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9101,30 +9054,29 @@ static void corkscrew_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 26, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 26, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void corkscrew_rc_track_right_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9153,18 +9105,17 @@ static void corkscrew_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9190,12 +9141,11 @@ static void corkscrew_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9221,30 +9171,29 @@ static void corkscrew_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 26, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 26, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void corkscrew_rc_track_left_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9273,19 +9222,18 @@ static void corkscrew_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9311,12 +9259,11 @@ static void corkscrew_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9342,29 +9289,28 @@ static void corkscrew_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 26, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 26, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void corkscrew_rc_track_right_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9393,19 +9339,18 @@ static void corkscrew_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9431,12 +9376,11 @@ static void corkscrew_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9462,23 +9406,22 @@ static void corkscrew_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 26, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height - 26, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 26, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp index d0f253e5e5..7369a76ff9 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -21,7 +21,7 @@ /** rct2: 0x007C6FF4 */ static void flying_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -53,7 +53,7 @@ static void flying_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -76,14 +76,14 @@ static void flying_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -124,22 +124,22 @@ static void flying_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C7244, 0x007C7254, 0x007C7264 */ static void flying_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -190,14 +190,14 @@ static void flying_rc_track_station( 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x007C7004 */ static void flying_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -256,20 +256,20 @@ static void flying_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -326,26 +326,26 @@ static void flying_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -353,19 +353,19 @@ static void flying_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x007C7014 */ static void flying_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -395,20 +395,20 @@ static void flying_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } else { @@ -437,21 +437,21 @@ static void flying_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } /** rct2: 0x007C7024 */ static void flying_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -510,20 +510,20 @@ static void flying_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -580,26 +580,26 @@ static void flying_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -607,19 +607,19 @@ static void flying_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x007C7034 */ static void flying_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -655,20 +655,20 @@ static void flying_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else { @@ -703,21 +703,21 @@ static void flying_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C7044 */ static void flying_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -753,20 +753,20 @@ static void flying_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else { @@ -800,26 +800,26 @@ static void flying_rc_track_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 71, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 71, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 71, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 71, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -827,19 +827,19 @@ static void flying_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C7054 */ static void flying_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -898,20 +898,20 @@ static void flying_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -968,26 +968,26 @@ static void flying_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -995,19 +995,19 @@ static void flying_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x007C7064 */ static void flying_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1015,7 +1015,7 @@ static void flying_rc_track_25_deg_down( /** rct2: 0x007C7074 */ static void flying_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1023,7 +1023,7 @@ static void flying_rc_track_60_deg_down( /** rct2: 0x007C7084 */ static void flying_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1031,7 +1031,7 @@ static void flying_rc_track_flat_to_25_deg_down( /** rct2: 0x007C7094 */ static void flying_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1039,7 +1039,7 @@ static void flying_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x007C70A4 */ static void flying_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1047,7 +1047,7 @@ static void flying_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x007C70B4 */ static void flying_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1055,7 +1055,7 @@ static void flying_rc_track_25_deg_down_to_flat( /** rct2: 0x007C70C4 */ static void flying_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1086,19 +1086,18 @@ static void flying_rc_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1124,12 +1123,12 @@ static void flying_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1155,13 +1154,12 @@ static void flying_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1187,12 +1185,12 @@ static void flying_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1218,21 +1216,20 @@ static void flying_rc_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1265,21 +1262,20 @@ static void flying_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1305,12 +1301,12 @@ static void flying_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1336,13 +1332,12 @@ static void flying_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1368,12 +1363,12 @@ static void flying_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1400,23 +1395,22 @@ static void flying_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1424,7 +1418,7 @@ static void flying_rc_track_left_quarter_turn_5( /** rct2: 0x007C70D4 */ static void flying_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1433,7 +1427,7 @@ static void flying_rc_track_right_quarter_turn_5( /** rct2: 0x007C70E4 */ static void flying_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1469,13 +1463,13 @@ static void flying_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1503,24 +1497,24 @@ static void flying_rc_track_flat_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C70F4 */ static void flying_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1556,13 +1550,13 @@ static void flying_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1590,24 +1584,24 @@ static void flying_rc_track_flat_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C7104 */ static void flying_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1643,13 +1637,13 @@ static void flying_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1677,24 +1671,24 @@ static void flying_rc_track_left_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C7114 */ static void flying_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1730,13 +1724,13 @@ static void flying_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1764,24 +1758,24 @@ static void flying_rc_track_right_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C7124 */ static void flying_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1815,19 +1809,18 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1853,12 +1846,12 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1884,13 +1877,12 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1916,12 +1908,12 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1950,21 +1942,20 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1997,21 +1988,20 @@ static void flying_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2037,12 +2027,12 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2068,13 +2058,12 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -2100,12 +2089,12 @@ static void flying_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2132,23 +2121,22 @@ static void flying_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -2156,7 +2144,7 @@ static void flying_rc_track_banked_left_quarter_turn_5( /** rct2: 0x007C7134 */ static void flying_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2165,7 +2153,7 @@ static void flying_rc_track_banked_right_quarter_turn_5( /** rct2: 0x007C7144 */ static void flying_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2201,20 +2189,20 @@ static void flying_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -2242,28 +2230,28 @@ static void flying_rc_track_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2271,19 +2259,19 @@ static void flying_rc_track_left_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x007C7154 */ static void flying_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2319,20 +2307,20 @@ static void flying_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -2360,28 +2348,28 @@ static void flying_rc_track_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2389,19 +2377,19 @@ static void flying_rc_track_right_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x007C7164 */ static void flying_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2437,20 +2425,20 @@ static void flying_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -2478,28 +2466,28 @@ static void flying_rc_track_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2507,19 +2495,19 @@ static void flying_rc_track_25_deg_up_to_left_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x007C7174 */ static void flying_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2555,20 +2543,20 @@ static void flying_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -2596,28 +2584,28 @@ static void flying_rc_track_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2625,19 +2613,19 @@ static void flying_rc_track_25_deg_up_to_right_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x007C7184 */ static void flying_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2645,7 +2633,7 @@ static void flying_rc_track_left_bank_to_25_deg_down( /** rct2: 0x007C7194 */ static void flying_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2653,7 +2641,7 @@ static void flying_rc_track_right_bank_to_25_deg_down( /** rct2: 0x007C71A4 */ static void flying_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2661,7 +2649,7 @@ static void flying_rc_track_25_deg_down_to_left_bank( /** rct2: 0x007C71B4 */ static void flying_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2669,7 +2657,7 @@ static void flying_rc_track_25_deg_down_to_right_bank( /** rct2: 0x007C71C4 */ static void flying_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2699,13 +2687,13 @@ static void flying_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -2733,24 +2721,24 @@ static void flying_rc_track_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C71D4 */ static void flying_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2758,7 +2746,7 @@ static void flying_rc_track_right_bank( /** rct2: 0x007C71E4 */ static void flying_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2789,19 +2777,18 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2827,12 +2814,12 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -2858,13 +2845,12 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -2890,12 +2876,12 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -2921,21 +2907,20 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -2968,21 +2953,20 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3008,12 +2992,12 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3039,13 +3023,12 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3071,12 +3054,12 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3103,23 +3086,22 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3127,7 +3109,7 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x007C71F4 */ static void flying_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3158,19 +3140,18 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3196,12 +3177,12 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3227,13 +3208,12 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3259,12 +3239,12 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3290,21 +3270,20 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3337,21 +3316,20 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3377,12 +3355,12 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3408,13 +3386,12 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3440,12 +3417,12 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3472,23 +3449,22 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3496,7 +3472,7 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x007C7204 */ static void flying_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -3505,7 +3481,7 @@ static void flying_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x007C7214 */ static void flying_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -3514,7 +3490,7 @@ static void flying_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x007C7224 */ static void flying_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3545,16 +3521,15 @@ static void flying_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3563,14 +3538,14 @@ static void flying_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17309), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17313), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3584,12 +3559,12 @@ static void flying_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3608,23 +3583,23 @@ static void flying_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17309), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17313), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3650,21 +3625,20 @@ static void flying_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3697,17 +3671,16 @@ static void flying_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3734,24 +3707,24 @@ static void flying_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3778,24 +3751,24 @@ static void flying_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3822,22 +3795,21 @@ static void flying_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3845,7 +3817,7 @@ static void flying_rc_track_s_bend_left( /** rct2: 0x007C7234 */ static void flying_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3876,16 +3848,15 @@ static void flying_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3894,14 +3865,14 @@ static void flying_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17317), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17321), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3915,12 +3886,12 @@ static void flying_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3939,23 +3910,23 @@ static void flying_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17317), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17321), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3981,21 +3952,20 @@ static void flying_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4028,17 +3998,16 @@ static void flying_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4065,24 +4034,24 @@ static void flying_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4109,24 +4078,24 @@ static void flying_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4153,22 +4122,21 @@ static void flying_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4176,7 +4144,7 @@ static void flying_rc_track_s_bend_right( /** rct2: 0x007C7274 */ static void flying_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -4207,19 +4175,18 @@ static void flying_rc_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4245,10 +4212,9 @@ static void flying_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4274,21 +4240,20 @@ static void flying_rc_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4321,21 +4286,20 @@ static void flying_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4361,10 +4325,9 @@ static void flying_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4391,23 +4354,22 @@ static void flying_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4415,7 +4377,7 @@ static void flying_rc_track_left_quarter_turn_3( /** rct2: 0x007C7284 */ static void flying_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4424,7 +4386,7 @@ static void flying_rc_track_right_quarter_turn_3( /** rct2: 0x007C7294 */ static void flying_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -4458,19 +4420,18 @@ static void flying_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4496,10 +4457,9 @@ static void flying_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4528,21 +4488,20 @@ static void flying_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4575,21 +4534,20 @@ static void flying_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4615,10 +4573,9 @@ static void flying_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4645,23 +4602,22 @@ static void flying_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4669,7 +4625,7 @@ static void flying_rc_track_left_quarter_turn_3_bank( /** rct2: 0x007C72A4 */ static void flying_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4678,7 +4634,7 @@ static void flying_rc_track_right_quarter_turn_3_bank( /** rct2: 0x007C72B4 */ static void flying_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -4709,22 +4665,21 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4750,21 +4705,20 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -4797,24 +4751,23 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4841,23 +4794,22 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -4865,7 +4817,7 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x007C72C4 */ static void flying_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -4896,22 +4848,21 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4920,44 +4871,43 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17365), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17367), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17369), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17371), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -4990,24 +4940,23 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5034,23 +4983,22 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -5058,7 +5006,7 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x007C72D4 */ static void flying_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5067,7 +5015,7 @@ static void flying_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x007C72E4 */ static void flying_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5076,7 +5024,7 @@ static void flying_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x007C7314 */ static void flying_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5108,19 +5056,19 @@ static void flying_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5146,9 +5094,9 @@ static void flying_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5177,21 +5125,21 @@ static void flying_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5220,24 +5168,24 @@ static void flying_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5263,9 +5211,9 @@ static void flying_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5294,23 +5242,23 @@ static void flying_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7324 */ static void flying_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5342,19 +5290,19 @@ static void flying_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5380,9 +5328,9 @@ static void flying_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5411,21 +5359,21 @@ static void flying_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5454,24 +5402,24 @@ static void flying_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5497,9 +5445,9 @@ static void flying_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5528,23 +5476,23 @@ static void flying_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7334 */ static void flying_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -5558,7 +5506,7 @@ static void flying_rc_track_left_half_banked_helix_down_small( /** rct2: 0x007C7344 */ static void flying_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -5572,7 +5520,7 @@ static void flying_rc_track_right_half_banked_helix_down_small( /** rct2: 0x007C7354 */ static void flying_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5604,19 +5552,19 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5642,12 +5590,11 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5673,12 +5620,12 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -5704,12 +5651,11 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5738,21 +5684,21 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5781,24 +5727,24 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -5824,12 +5770,11 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -5855,12 +5800,12 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -5886,12 +5831,11 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -5920,23 +5864,23 @@ static void flying_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7364 */ static void flying_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5968,19 +5912,19 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6006,12 +5950,11 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6037,12 +5980,12 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -6068,12 +6011,11 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6102,21 +6044,21 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6145,24 +6087,24 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -6188,12 +6130,11 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6219,12 +6160,12 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6250,12 +6191,11 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6284,23 +6224,23 @@ static void flying_rc_track_right_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7374 */ static void flying_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -6314,7 +6254,7 @@ static void flying_rc_track_left_half_banked_helix_down_large( /** rct2: 0x007C7384 */ static void flying_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -6328,7 +6268,7 @@ static void flying_rc_track_right_half_banked_helix_down_large( /** rct2: 0x007C73B4 */ static void flying_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6409,13 +6349,13 @@ static void flying_rc_track_left_quarter_turn_1_60_deg_up( } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x007C7394 */ static void flying_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6495,13 +6435,13 @@ static void flying_rc_track_right_quarter_turn_1_60_deg_up( } } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x007C73A4 */ static void flying_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -6509,7 +6449,7 @@ static void flying_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x007C73C4 */ static void flying_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -6517,7 +6457,7 @@ static void flying_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x007C73D4 */ static void flying_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6539,13 +6479,13 @@ static void flying_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -6565,21 +6505,21 @@ static void flying_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } static void flying_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6589,14 +6529,27 @@ static void flying_rc_track_booster( } else { - // Should not occur, except when converting from other coaster types. - flying_rc_track_brakes(session, ride, trackSequence, direction, height, trackElement); + const auto imageId = (direction & 1) ? SPR_G2_BM_INVERT_BOOSTER_2 : SPR_G2_BM_INVERT_BOOSTER_1; + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { 0, 0, height + 24 }, { 32, 20, 1 }, + { 0, 6, height + 22 }); + + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); + } + + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C7674 */ static void flying_rc_track_left_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6626,20 +6579,20 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -6665,12 +6618,11 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -6696,12 +6648,12 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -6727,12 +6679,11 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -6759,29 +6710,29 @@ static void flying_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 53, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_SQUARE_INVERTED_9); break; case 3: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x007C7684 */ static void flying_rc_track_right_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6811,20 +6762,20 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -6850,12 +6801,11 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -6881,12 +6831,12 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -6912,12 +6862,11 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -6944,29 +6893,29 @@ static void flying_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 53, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_SQUARE_INVERTED_9); break; case 1: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x007C7694 */ static void flying_rc_track_left_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6996,20 +6945,20 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 53, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7035,12 +6984,11 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7066,12 +7014,12 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -7097,12 +7045,11 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -7129,29 +7076,29 @@ static void flying_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x007C76A4 */ static void flying_rc_track_right_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7181,20 +7128,20 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 53, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7220,12 +7167,11 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7251,12 +7197,12 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -7282,12 +7228,11 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -7314,29 +7259,29 @@ static void flying_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x007C78B4 */ static void flying_rc_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7366,20 +7311,20 @@ static void flying_rc_track_25_deg_up_left_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -7407,26 +7352,26 @@ static void flying_rc_track_25_deg_up_left_banked( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7434,19 +7379,19 @@ static void flying_rc_track_25_deg_up_left_banked( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C78C4 */ static void flying_rc_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7476,20 +7421,20 @@ static void flying_rc_track_25_deg_up_right_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -7517,26 +7462,26 @@ static void flying_rc_track_25_deg_up_right_banked( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7544,19 +7489,19 @@ static void flying_rc_track_25_deg_up_right_banked( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C73E4 */ static void flying_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7566,9 +7511,9 @@ static void flying_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17146), { 0, 0, height }, { 32, 20, 0 }, @@ -7577,9 +7522,9 @@ static void flying_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17147), { 0, 0, height }, { 32, 20, 0 }, @@ -7588,9 +7533,9 @@ static void flying_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17146), { 0, 0, height }, { 32, 20, 0 }, @@ -7599,9 +7544,9 @@ static void flying_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17147), { 0, 0, height }, { 32, 20, 0 }, @@ -7609,9 +7554,9 @@ static void flying_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -7620,9 +7565,9 @@ static void flying_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27129), { 0, 0, height + 24 }, @@ -7631,9 +7576,9 @@ static void flying_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27130), { 0, 0, height + 24 }, @@ -7642,9 +7587,9 @@ static void flying_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27129), { 0, 0, height + 24 }, @@ -7653,9 +7598,9 @@ static void flying_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27130), { 0, 0, height + 24 }, @@ -7663,15 +7608,15 @@ static void flying_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x007C78D4 */ static void flying_rc_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -7679,7 +7624,7 @@ static void flying_rc_track_25_deg_down_left_banked( /** rct2: 0x007C78E4 */ static void flying_rc_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -7687,7 +7632,7 @@ static void flying_rc_track_25_deg_down_right_banked( /** rct2: 0x007C7404 */ static void flying_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7718,15 +7663,15 @@ static void flying_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7752,12 +7697,12 @@ static void flying_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7783,17 +7728,15 @@ static void flying_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7802,37 +7745,37 @@ static void flying_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17549), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17553), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17557), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17561), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -7865,16 +7808,16 @@ static void flying_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7900,12 +7843,12 @@ static void flying_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7931,17 +7874,15 @@ static void flying_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7968,32 +7909,32 @@ static void flying_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8001,7 +7942,7 @@ static void flying_rc_track_left_eighth_to_diag( /** rct2: 0x007C7414 */ static void flying_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8032,15 +7973,15 @@ static void flying_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8066,12 +8007,12 @@ static void flying_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8097,17 +8038,15 @@ static void flying_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8116,37 +8055,37 @@ static void flying_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17533), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17537), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17541), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17545), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8179,16 +8118,16 @@ static void flying_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8214,12 +8153,12 @@ static void flying_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8245,17 +8184,15 @@ static void flying_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8282,32 +8219,32 @@ static void flying_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8315,7 +8252,7 @@ static void flying_rc_track_right_eighth_to_diag( /** rct2: 0x007C7424 */ static void flying_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8324,7 +8261,7 @@ static void flying_rc_track_left_eighth_to_orthogonal( /** rct2: 0x007C7434 */ static void flying_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8333,7 +8270,7 @@ static void flying_rc_track_right_eighth_to_orthogonal( /** rct2: 0x007C7444 */ static void flying_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8364,15 +8301,15 @@ static void flying_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8398,12 +8335,12 @@ static void flying_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8429,17 +8366,15 @@ static void flying_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8448,37 +8383,37 @@ static void flying_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17581), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17585), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17589), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17593), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8511,17 +8446,16 @@ static void flying_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8547,12 +8481,12 @@ static void flying_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8578,17 +8512,15 @@ static void flying_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8615,32 +8547,32 @@ static void flying_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8648,7 +8580,7 @@ static void flying_rc_track_left_eighth_bank_to_diag( /** rct2: 0x007C7454 */ static void flying_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8679,15 +8611,15 @@ static void flying_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8713,12 +8645,12 @@ static void flying_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8744,17 +8676,15 @@ static void flying_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8763,37 +8693,37 @@ static void flying_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17565), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17569), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17573), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17577), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8826,17 +8756,16 @@ static void flying_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8862,12 +8791,12 @@ static void flying_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8893,17 +8822,15 @@ static void flying_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8930,32 +8857,32 @@ static void flying_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8963,7 +8890,7 @@ static void flying_rc_track_right_eighth_bank_to_diag( /** rct2: 0x007C7464 */ static void flying_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8972,7 +8899,7 @@ static void flying_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x007C7474 */ static void flying_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8981,7 +8908,7 @@ static void flying_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x007C73F4 */ static void flying_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9011,10 +8938,9 @@ static void flying_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9039,10 +8965,9 @@ static void flying_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9067,10 +8992,9 @@ static void flying_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9078,22 +9002,22 @@ static void flying_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17859), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9103,30 +9027,29 @@ static void flying_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17789), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -9157,10 +9080,9 @@ static void flying_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9185,10 +9107,9 @@ static void flying_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9213,10 +9134,9 @@ static void flying_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9242,30 +9162,29 @@ static void flying_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -9273,7 +9192,7 @@ static void flying_rc_track_diag_flat( /** rct2: 0x007C74A4 */ static void flying_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9303,10 +9222,9 @@ static void flying_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9331,10 +9249,9 @@ static void flying_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9359,10 +9276,9 @@ static void flying_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9370,22 +9286,22 @@ static void flying_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17871), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9395,30 +9311,29 @@ static void flying_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17801), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -9449,10 +9364,9 @@ static void flying_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9477,10 +9391,9 @@ static void flying_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9505,10 +9418,9 @@ static void flying_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9534,30 +9446,29 @@ static void flying_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -9565,7 +9476,7 @@ static void flying_rc_track_diag_25_deg_up( /** rct2: 0x007C7504 */ static void flying_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9595,10 +9506,9 @@ static void flying_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9623,10 +9533,9 @@ static void flying_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9651,10 +9560,9 @@ static void flying_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9662,22 +9570,22 @@ static void flying_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17883), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9687,30 +9595,29 @@ static void flying_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17813), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -9727,10 +9634,9 @@ static void flying_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -9741,10 +9647,9 @@ static void flying_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -9755,10 +9660,9 @@ static void flying_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -9770,30 +9674,29 @@ static void flying_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -9801,7 +9704,7 @@ static void flying_rc_track_diag_60_deg_up( /** rct2: 0x007C7484 */ static void flying_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9831,10 +9734,9 @@ static void flying_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9859,10 +9761,9 @@ static void flying_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9887,10 +9788,9 @@ static void flying_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9898,22 +9798,22 @@ static void flying_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17863), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9923,30 +9823,29 @@ static void flying_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17793), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -9977,10 +9876,9 @@ static void flying_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10005,10 +9903,9 @@ static void flying_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10033,10 +9930,9 @@ static void flying_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10062,30 +9958,29 @@ static void flying_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -10093,7 +9988,7 @@ static void flying_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x007C74E4 */ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10123,10 +10018,9 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10151,10 +10045,9 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10179,10 +10072,9 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10190,22 +10082,22 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17875), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10215,30 +10107,29 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17805), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10255,10 +10146,9 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -10269,10 +10159,9 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -10283,10 +10172,9 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -10298,30 +10186,29 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10329,7 +10216,7 @@ static void flying_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x007C74F4 */ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10359,10 +10246,9 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10387,10 +10273,9 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10415,10 +10300,9 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10426,22 +10310,22 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17879), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10451,30 +10335,29 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17809), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10491,10 +10374,9 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -10505,10 +10387,9 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -10519,10 +10400,9 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -10534,30 +10414,29 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10565,7 +10444,7 @@ static void flying_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x007C7494 */ static void flying_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10595,10 +10474,9 @@ static void flying_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10623,10 +10501,9 @@ static void flying_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10651,10 +10528,9 @@ static void flying_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10662,22 +10538,22 @@ static void flying_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17867), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10687,30 +10563,29 @@ static void flying_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17797), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10741,10 +10616,9 @@ static void flying_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10769,10 +10643,9 @@ static void flying_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10797,10 +10670,9 @@ static void flying_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10826,30 +10698,29 @@ static void flying_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10857,7 +10728,7 @@ static void flying_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x007C74D4 */ static void flying_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10887,10 +10758,9 @@ static void flying_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10915,10 +10785,9 @@ static void flying_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10943,10 +10812,9 @@ static void flying_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10954,22 +10822,22 @@ static void flying_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17873), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10979,30 +10847,29 @@ static void flying_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17803), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -11019,10 +10886,9 @@ static void flying_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -11033,10 +10899,9 @@ static void flying_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -11047,10 +10912,9 @@ static void flying_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11062,30 +10926,29 @@ static void flying_rc_track_diag_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -11093,7 +10956,7 @@ static void flying_rc_track_diag_25_deg_down( /** rct2: 0x007C7534 */ static void flying_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11123,10 +10986,9 @@ static void flying_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -11151,10 +11013,9 @@ static void flying_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -11179,10 +11040,9 @@ static void flying_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -11190,22 +11050,22 @@ static void flying_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17885), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11215,30 +11075,29 @@ static void flying_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17815), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -11255,10 +11114,9 @@ static void flying_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -11269,10 +11127,9 @@ static void flying_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -11283,10 +11140,9 @@ static void flying_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -11298,30 +11154,29 @@ static void flying_rc_track_diag_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -11329,7 +11184,7 @@ static void flying_rc_track_diag_60_deg_down( /** rct2: 0x007C74B4 */ static void flying_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11359,9 +11214,8 @@ static void flying_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -11386,9 +11240,8 @@ static void flying_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -11413,9 +11266,8 @@ static void flying_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -11423,22 +11275,22 @@ static void flying_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17869), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11448,29 +11300,28 @@ static void flying_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17799), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -11487,9 +11338,8 @@ static void flying_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11500,9 +11350,8 @@ static void flying_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11513,9 +11362,8 @@ static void flying_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11527,25 +11375,24 @@ static void flying_rc_track_diag_flat_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11553,12 +11400,12 @@ static void flying_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007C7514 */ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11588,10 +11435,9 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -11616,10 +11462,9 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -11644,10 +11489,9 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -11655,22 +11499,22 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17881), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11680,30 +11524,29 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17811), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11720,10 +11563,9 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -11734,10 +11576,9 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11748,10 +11589,9 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -11763,30 +11603,29 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11794,7 +11633,7 @@ static void flying_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x007C7524 */ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11824,10 +11663,9 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -11852,10 +11690,9 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -11880,10 +11717,9 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -11891,22 +11727,22 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17877), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11916,30 +11752,29 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17807), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11956,10 +11791,9 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -11970,10 +11804,9 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11984,10 +11817,9 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -11999,30 +11831,29 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -12030,7 +11861,7 @@ static void flying_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x007C74C4 */ static void flying_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12060,10 +11891,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -12088,10 +11918,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -12116,10 +11945,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -12127,22 +11955,22 @@ static void flying_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17865), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -12152,30 +11980,29 @@ static void flying_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17795), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12192,10 +12019,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12206,10 +12032,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12220,10 +12045,9 @@ static void flying_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12235,30 +12059,29 @@ static void flying_rc_track_diag_25_deg_down_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12266,7 +12089,7 @@ static void flying_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x007C7564 */ static void flying_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12282,10 +12105,9 @@ static void flying_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12299,10 +12121,9 @@ static void flying_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12313,38 +12134,36 @@ static void flying_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17829), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12361,10 +12180,9 @@ static void flying_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12375,10 +12193,9 @@ static void flying_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12389,10 +12206,9 @@ static void flying_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12404,31 +12220,30 @@ static void flying_rc_track_diag_flat_to_left_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12436,7 +12251,7 @@ static void flying_rc_track_diag_flat_to_left_bank( /** rct2: 0x007C7574 */ static void flying_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12452,10 +12267,9 @@ static void flying_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12466,10 +12280,9 @@ static void flying_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12483,38 +12296,36 @@ static void flying_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17834), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12531,10 +12342,9 @@ static void flying_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12545,10 +12355,9 @@ static void flying_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12559,10 +12368,9 @@ static void flying_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12574,31 +12382,30 @@ static void flying_rc_track_diag_flat_to_right_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12606,7 +12413,7 @@ static void flying_rc_track_diag_flat_to_right_bank( /** rct2: 0x007C7584 */ static void flying_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12622,10 +12429,9 @@ static void flying_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12639,10 +12445,9 @@ static void flying_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12653,38 +12458,36 @@ static void flying_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17836), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12701,10 +12504,9 @@ static void flying_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12715,10 +12517,9 @@ static void flying_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12729,10 +12530,9 @@ static void flying_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12744,31 +12544,30 @@ static void flying_rc_track_diag_left_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12776,7 +12575,7 @@ static void flying_rc_track_diag_left_bank_to_flat( /** rct2: 0x007C7594 */ static void flying_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12792,10 +12591,9 @@ static void flying_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12806,10 +12604,9 @@ static void flying_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12823,38 +12620,36 @@ static void flying_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17831), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12871,10 +12666,9 @@ static void flying_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12885,10 +12679,9 @@ static void flying_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12899,10 +12692,9 @@ static void flying_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12914,31 +12706,30 @@ static void flying_rc_track_diag_right_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12946,7 +12737,7 @@ static void flying_rc_track_diag_right_bank_to_flat( /** rct2: 0x007C75C4 */ static void flying_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12962,10 +12753,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12979,10 +12769,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12993,38 +12782,36 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17849), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13041,10 +12828,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13055,10 +12841,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13069,10 +12854,9 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13084,30 +12868,29 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13115,7 +12898,7 @@ static void flying_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x007C75D4 */ static void flying_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13131,10 +12914,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13145,10 +12927,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13162,38 +12943,36 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17854), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13210,10 +12989,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13224,10 +13002,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13238,10 +13015,9 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13253,30 +13029,29 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13284,7 +13059,7 @@ static void flying_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x007C75A4 */ static void flying_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13300,10 +13075,9 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13317,10 +13091,9 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13331,38 +13104,36 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17839), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13379,10 +13150,9 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13393,10 +13163,9 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13407,10 +13176,9 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -13422,30 +13190,29 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13453,7 +13220,7 @@ static void flying_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x007C75B4 */ static void flying_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13469,10 +13236,9 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13483,10 +13249,9 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13500,38 +13265,36 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17844), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13548,10 +13311,9 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13562,10 +13324,9 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13576,10 +13337,9 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -13591,30 +13351,29 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13622,7 +13381,7 @@ static void flying_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x007C75E4 */ static void flying_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13638,9 +13397,8 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13654,9 +13412,8 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13667,36 +13424,34 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17846), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -13713,9 +13468,8 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13726,9 +13480,8 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13739,9 +13492,8 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13753,25 +13505,24 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -13779,12 +13530,12 @@ static void flying_rc_track_diag_left_bank_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007C75F4 */ static void flying_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13800,9 +13551,8 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13813,9 +13563,8 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13829,36 +13578,34 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17841), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -13875,9 +13622,8 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13888,9 +13634,8 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13901,9 +13646,8 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13915,25 +13659,24 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -13941,12 +13684,12 @@ static void flying_rc_track_diag_right_bank_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007C7604 */ static void flying_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13962,10 +13705,9 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13979,10 +13721,9 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13993,38 +13734,36 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17856), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -14041,10 +13780,9 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -14055,10 +13793,9 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -14069,10 +13806,9 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -14084,30 +13820,29 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -14115,7 +13850,7 @@ static void flying_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x007C7614 */ static void flying_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -14131,10 +13866,9 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -14145,10 +13879,9 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -14162,38 +13895,36 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17851), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -14210,10 +13941,9 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -14224,10 +13954,9 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -14238,10 +13967,9 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -14253,30 +13981,29 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -14284,7 +14011,7 @@ static void flying_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x007C7544 */ static void flying_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -14300,10 +14027,9 @@ static void flying_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14314,10 +14040,9 @@ static void flying_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14328,38 +14053,36 @@ static void flying_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17825), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14376,10 +14099,9 @@ static void flying_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14390,10 +14112,9 @@ static void flying_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14404,10 +14125,9 @@ static void flying_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -14419,31 +14139,30 @@ static void flying_rc_track_diag_left_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14451,7 +14170,7 @@ static void flying_rc_track_diag_left_bank( /** rct2: 0x007C7554 */ static void flying_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -14467,10 +14186,9 @@ static void flying_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14481,10 +14199,9 @@ static void flying_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14495,38 +14212,36 @@ static void flying_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17827), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14543,10 +14258,9 @@ static void flying_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14557,10 +14271,9 @@ static void flying_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14571,10 +14284,9 @@ static void flying_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -14586,31 +14298,30 @@ static void flying_rc_track_diag_right_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14618,7 +14329,7 @@ static void flying_rc_track_diag_right_bank( /** rct2: 0x007C7624 */ static void flying_rc_track_left_flyer_twist_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14647,18 +14358,17 @@ static void flying_rc_track_left_flyer_twist_up( { 32, 20, 3 }, { 0, 6, height + 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14684,12 +14394,11 @@ static void flying_rc_track_left_flyer_twist_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14716,31 +14425,30 @@ static void flying_rc_track_left_flyer_twist_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7634 */ static void flying_rc_track_right_flyer_twist_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14769,18 +14477,17 @@ static void flying_rc_track_right_flyer_twist_up( { 32, 20, 3 }, { 0, 6, height + 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14806,12 +14513,11 @@ static void flying_rc_track_right_flyer_twist_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14838,31 +14544,30 @@ static void flying_rc_track_right_flyer_twist_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7644 */ static void flying_rc_track_left_flyer_twist_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14892,19 +14597,18 @@ static void flying_rc_track_left_flyer_twist_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14930,12 +14634,11 @@ static void flying_rc_track_left_flyer_twist_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14961,30 +14664,29 @@ static void flying_rc_track_left_flyer_twist_down( { 32, 20, 3 }, { 0, 6, height + 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C7654 */ static void flying_rc_track_right_flyer_twist_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15014,19 +14716,18 @@ static void flying_rc_track_right_flyer_twist_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -15052,12 +14753,11 @@ static void flying_rc_track_right_flyer_twist_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -15083,30 +14783,29 @@ static void flying_rc_track_right_flyer_twist_down( { 32, 20, 3 }, { 0, 6, height + 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height - 5, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007C72F4 */ static void flying_rc_track_flyer_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15135,15 +14834,15 @@ static void flying_rc_track_flyer_half_loop_up( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -15152,33 +14851,33 @@ static void flying_rc_track_flyer_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17627), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17635), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17632), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17640), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -15204,12 +14903,11 @@ static void flying_rc_track_flyer_half_loop_up( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -15237,18 +14935,18 @@ static void flying_rc_track_flyer_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x007C7304 */ static void flying_rc_track_flyer_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15279,11 +14977,11 @@ static void flying_rc_track_flyer_half_loop_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -15309,12 +15007,11 @@ static void flying_rc_track_flyer_half_loop_down( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 2: switch (direction) @@ -15323,33 +15020,33 @@ static void flying_rc_track_flyer_half_loop_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17627), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17635), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17632), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(17640), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -15375,22 +15072,22 @@ static void flying_rc_track_flyer_half_loop_down( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x007C7664 */ static void flying_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -15410,12 +15107,11 @@ static void flying_rc_track_block_brakes( { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -15435,22 +15131,22 @@ static void flying_rc_track_block_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x007C76B4 */ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -15481,22 +15177,21 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -15522,21 +15217,20 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -15569,24 +15263,23 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -15613,23 +15306,22 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } @@ -15637,7 +15329,7 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x007C76C4 */ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -15668,22 +15360,21 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -15692,44 +15383,43 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18015), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18017), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18019), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18021), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -15762,24 +15452,23 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -15806,23 +15495,22 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } @@ -15830,7 +15518,7 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x007C76D4 */ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -15840,7 +15528,7 @@ static void flying_rc_track_left_banked_quarter_turn_3_25_deg_down( /** rct2: 0x007C76E4 */ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -15850,7 +15538,7 @@ static void flying_rc_track_right_banked_quarter_turn_3_25_deg_down( /** rct2: 0x007C76F4 */ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -15881,19 +15569,18 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -15919,12 +15606,12 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -15950,13 +15637,12 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -15982,12 +15668,12 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -16013,21 +15699,20 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -16060,21 +15745,20 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -16100,12 +15784,12 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -16131,13 +15815,12 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -16163,12 +15846,12 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -16195,23 +15878,22 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } @@ -16219,7 +15901,7 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x007C7704 */ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -16250,19 +15932,18 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -16288,12 +15969,12 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -16319,13 +16000,12 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -16351,12 +16031,12 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -16382,21 +16062,20 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -16429,21 +16108,20 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -16469,12 +16147,12 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -16500,13 +16178,12 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -16532,12 +16209,12 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -16564,23 +16241,22 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } @@ -16588,7 +16264,7 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x007C7714 */ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -16598,7 +16274,7 @@ static void flying_rc_track_left_banked_quarter_turn_5_25_deg_down( /** rct2: 0x007C7724 */ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -16608,7 +16284,7 @@ static void flying_rc_track_right_banked_quarter_turn_5_25_deg_down( /** rct2: 0x007C7734 */ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -16641,20 +16317,20 @@ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -16682,26 +16358,26 @@ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -16709,19 +16385,19 @@ static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C7744 */ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -16754,20 +16430,20 @@ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -16795,26 +16471,26 @@ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -16822,19 +16498,19 @@ static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C7754 */ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -16867,20 +16543,20 @@ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -16908,26 +16584,26 @@ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -16935,19 +16611,19 @@ static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C7764 */ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -16980,20 +16656,20 @@ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -17021,26 +16697,26 @@ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17048,19 +16724,19 @@ static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x007C7774 */ static void flying_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -17069,7 +16745,7 @@ static void flying_rc_track_25_deg_down_to_left_banked_25_deg_down( /** rct2: 0x007C7784 */ static void flying_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -17077,7 +16753,7 @@ static void flying_rc_track_25_deg_down_to_right_banked_25_deg_down( /** rct2: 0x007C7794 */ static void flying_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -17086,7 +16762,7 @@ static void flying_rc_track_left_banked_25_deg_down_to_25_deg_down( /** rct2: 0x007C77A4 */ static void flying_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -17094,7 +16770,7 @@ static void flying_rc_track_right_banked_25_deg_down_to_25_deg_down( /** rct2: 0x007C77B4 */ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17124,20 +16800,20 @@ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -17165,26 +16841,26 @@ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17192,19 +16868,19 @@ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x007C77C4 */ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17234,20 +16910,20 @@ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -17275,26 +16951,26 @@ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17302,19 +16978,19 @@ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x007C77F4 */ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17344,20 +17020,20 @@ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -17385,26 +17061,26 @@ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17412,19 +17088,19 @@ static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x007C7804 */ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17454,20 +17130,20 @@ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -17495,26 +17171,26 @@ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17522,19 +17198,19 @@ static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x007C7814 */ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -17543,7 +17219,7 @@ static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_down( /** rct2: 0x007C7824 */ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -17552,7 +17228,7 @@ static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_down( /** rct2: 0x007C77D4 */ static void flying_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -17561,7 +17237,7 @@ static void flying_rc_track_left_banked_25_deg_down_to_left_banked_flat( /** rct2: 0x007C77E4 */ static void flying_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -17570,7 +17246,7 @@ static void flying_rc_track_right_banked_25_deg_down_to_right_banked_flat( /** rct2: 0x007C7834 */ static void flying_rc_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17603,20 +17279,20 @@ static void flying_rc_track_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -17644,26 +17320,26 @@ static void flying_rc_track_flat_to_left_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17671,19 +17347,19 @@ static void flying_rc_track_flat_to_left_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x007C7844 */ static void flying_rc_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17716,20 +17392,20 @@ static void flying_rc_track_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -17757,26 +17433,26 @@ static void flying_rc_track_flat_to_right_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 49, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17784,19 +17460,19 @@ static void flying_rc_track_flat_to_right_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x007C7854 */ static void flying_rc_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17829,20 +17505,20 @@ static void flying_rc_track_left_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -17870,26 +17546,26 @@ static void flying_rc_track_left_banked_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -17897,19 +17573,19 @@ static void flying_rc_track_left_banked_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x007C7864 */ static void flying_rc_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -17942,20 +17618,20 @@ static void flying_rc_track_right_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -17983,26 +17659,26 @@ static void flying_rc_track_right_banked_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 47, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -18010,19 +17686,19 @@ static void flying_rc_track_right_banked_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x007C7874 */ static void flying_rc_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -18030,7 +17706,7 @@ static void flying_rc_track_flat_to_left_banked_25_deg_down( /** rct2: 0x007C7884 */ static void flying_rc_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -18038,7 +17714,7 @@ static void flying_rc_track_flat_to_right_banked_25_deg_down( /** rct2: 0x007C7894 */ static void flying_rc_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -18046,14 +17722,14 @@ static void flying_rc_track_left_banked_25_deg_down_to_flat( /** rct2: 0x007C78A4 */ static void flying_rc_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void flying_rc_track_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18086,10 +17762,10 @@ static void flying_rc_track_90_deg_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -18097,14 +17773,14 @@ static void flying_rc_track_90_deg_up( } static void flying_rc_track_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void flying_rc_track_60_deg_up_to_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18137,12 +17813,12 @@ static void flying_rc_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: break; @@ -18150,14 +17826,14 @@ static void flying_rc_track_60_deg_up_to_90_deg_up( } static void flying_rc_track_90_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_60_deg_up_to_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void flying_rc_track_90_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18188,19 +17864,19 @@ static void flying_rc_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } static void flying_rc_track_60_deg_down_to_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18233,11 +17909,11 @@ static void flying_rc_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: break; @@ -18245,7 +17921,7 @@ static void flying_rc_track_60_deg_down_to_90_deg_down( } static void flying_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -18274,9 +17950,9 @@ static void flying_rc_track_90_deg_to_inverted_flat_quarter_loop_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -18302,9 +17978,9 @@ static void flying_rc_track_90_deg_to_inverted_flat_quarter_loop_up( { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -18332,24 +18008,24 @@ static void flying_rc_track_90_deg_to_inverted_flat_quarter_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void flying_rc_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_90_deg_to_inverted_flat_quarter_loop_up(session, ride, 2 - trackSequence, direction, height, trackElement); } static void flying_rc_track_flat_to_60_deg_up_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18359,7 +18035,7 @@ static void flying_rc_track_flat_to_60_deg_up_long_base( } static void flying_rc_track_60_deg_up_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18369,7 +18045,7 @@ static void flying_rc_track_60_deg_up_to_flat_long_base( } static void flying_rc_track_60_deg_down_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18379,7 +18055,7 @@ static void flying_rc_track_60_deg_down_to_flat_long_base( } static void flying_rc_track_flat_to_60_deg_down_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -18388,7 +18064,7 @@ static void flying_rc_track_flat_to_60_deg_down_long_base( session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void flying_rc_track_half_loop_inverted_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -18418,33 +18094,33 @@ static void flying_rc_track_half_loop_inverted_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -18470,8 +18146,8 @@ static void flying_rc_track_half_loop_inverted_up( { 2, 2, 3 }, { 29, 20, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -18497,12 +18173,11 @@ static void flying_rc_track_half_loop_inverted_up( { 2, 2, 119 }, { 29, 29, height + 2 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -18530,22 +18205,494 @@ static void flying_rc_track_half_loop_inverted_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void flying_rc_track_half_loop_uninverted_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { flying_rc_track_half_loop_inverted_up(session, ride, 3 - trackSequence, direction, height, trackElement); } +static void flying_rc_track_left_flying_large_half_loop_inverted_up( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + switch (trackSequence) + { + case 0: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27639), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27646), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27653), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27660), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + } + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27640), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27647), { 0, 0, height - 4 }, + { 32, 20, 9 }, { 0, 6, height + 29 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27654), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27661), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); + break; + case 2: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27641), { 0, 0, height - 4 }, + { 24, 16, 3 }, { 8, 0, height + 40 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27648), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 0, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27655), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 16, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27662), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 16, height + 70 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); + break; + case 3: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27642), { 0, 0, height - 4 }, + { 8, 16, 3 }, { 24, 0, height + 29 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27649), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 0, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27656), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 16, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27663), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 16, height + 100 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); + break; + case 4: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27643), { 0, 0, height - 4 }, + { 2, 2, 3 }, { 30, 30, height + 80 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27650), { 0, 0, height - 4 }, + { 16, 16, 0 }, { 0, 16, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27657), { 0, 0, height - 4 }, + { 16, 16, 0 }, { 0, 0, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27664), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 0, height + 90 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); + break; + case 5: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27644), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 16, height }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27651), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 16, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27658), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 0, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27665), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 0, height + 140 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); + break; + case 6: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27645), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 16, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27652), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 16, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27659), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 0, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27666), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 0, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); + break; + } +} + +static void flying_rc_track_right_flying_large_half_loop_inverted_up( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + switch (trackSequence) + { + case 0: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27688), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27681), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27674), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27667), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + } + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27689), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27682), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27675), { 0, 0, height - 4 }, + { 32, 20, 19 }, { 0, 6, height + 29 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27668), { 0, 0, height - 4 }, + { 32, 20, 3 }, { 0, 6, height + 29 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); + break; + case 2: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27690), { 0, 0, height - 4 }, + { 32, 16, 3 }, { 0, 16, height + 70 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27683), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 16, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27676), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 0, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27669), { 0, 0, height - 4 }, + { 32, 16, 3 }, { 0, 0, height + 70 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); + break; + case 3: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27691), { 0, 0, height - 4 }, + { 32, 16, 3 }, { 0, 16, height + 100 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27684), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 16, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27677), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 0, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27670), { 0, 0, height - 4 }, + { 32, 16, 3 }, { 0, 0, height + 100 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); + break; + case 4: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27692), { 0, 0, height - 4 }, + { 16, 16, 3 }, { 16, 7, height + 90 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27685), { 0, 0, height - 4 }, + { 16, 16, 0 }, { 0, -7, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27678), { 0, 0, height - 4 }, + { 16, 16, 0 }, { -7, 16, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27671), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 23, height + 110 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); + break; + case 5: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27693), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 7, height + 140 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27686), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 0, height }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27679), { 0, 0, height - 4 }, + { 32, 16, 0 }, { 0, 16, height }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27672), { 0, 0, height - 4 }, + { 2, 16, 3 }, { 30, 16, height + 140 }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); + break; + case 6: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27694), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 0, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27687), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 0, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27680), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 16, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27673), { 0, 0, height - 4 }, + { 32, 24, 0 }, { 0, 16, height + 32 }); + MetalASupportsPaintSetup( + session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 24, session.TrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); + break; + } +} + +static void flying_rc_track_left_flying_large_half_loop_uninverted_down( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + flying_rc_track_left_flying_large_half_loop_inverted_up(session, ride, 6 - trackSequence, direction, height, trackElement); +} + +static void flying_rc_track_right_flying_large_half_loop_uninverted_down( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + flying_rc_track_right_flying_large_half_loop_inverted_up(session, ride, 6 - trackSequence, direction, height, trackElement); +} + TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int32_t trackType) { switch (trackType) @@ -18876,6 +19023,14 @@ TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int32_t trackType) return flying_rc_track_half_loop_inverted_up; case TrackElemType::FlyerHalfLoopUninvertedDown: return flying_rc_track_half_loop_uninverted_down; + case TrackElemType::LeftFlyerLargeHalfLoopInvertedUp: + return flying_rc_track_left_flying_large_half_loop_inverted_up; + case TrackElemType::RightFlyerLargeHalfLoopInvertedUp: + return flying_rc_track_right_flying_large_half_loop_inverted_up; + case TrackElemType::LeftFlyerLargeHalfLoopUninvertedDown: + return flying_rc_track_left_flying_large_half_loop_uninverted_down; + case TrackElemType::RightFlyerLargeHalfLoopUninvertedDown: + return flying_rc_track_right_flying_large_half_loop_uninverted_down; } - return nullptr; + return get_track_paint_function_bolliger_mabillard(trackType); } diff --git a/src/openrct2/ride/coaster/GigaCoaster.cpp b/src/openrct2/ride/coaster/GigaCoaster.cpp index 1f5c68870b..9a87815fdc 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -41,7 +41,7 @@ static constexpr const uint32_t _GigaCoasterBrakeImages[NumOrthogonalDirections] /** rct2: 0x008AD674 */ static void giga_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -63,7 +63,7 @@ static void giga_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else if (trackElement.HasChain()) @@ -93,7 +93,7 @@ static void giga_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -115,17 +115,17 @@ static void giga_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void giga_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -153,14 +153,14 @@ static void giga_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_2(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD684 */ static void giga_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -190,7 +190,7 @@ static void giga_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else if (trackElement.HasChain()) @@ -220,7 +220,7 @@ static void giga_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -250,25 +250,25 @@ static void giga_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AD694 */ static void giga_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -298,7 +298,7 @@ static void giga_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -328,25 +328,25 @@ static void giga_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008AD6A4 */ static void giga_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -376,7 +376,7 @@ static void giga_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else if (trackElement.HasChain()) @@ -406,7 +406,7 @@ static void giga_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -436,25 +436,25 @@ static void giga_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AD6B4 */ static void giga_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -490,7 +490,7 @@ static void giga_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -526,25 +526,25 @@ static void giga_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AD6C4 */ static void giga_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -580,7 +580,7 @@ static void giga_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -616,25 +616,25 @@ static void giga_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AD6D4 */ static void giga_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasCableLift()) @@ -664,7 +664,7 @@ static void giga_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else if (trackElement.HasChain()) @@ -694,7 +694,7 @@ static void giga_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -724,25 +724,25 @@ static void giga_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AD6E4 */ static void giga_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { giga_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -750,7 +750,7 @@ static void giga_rc_track_25_deg_down( /** rct2: 0x008AD6F4 */ static void giga_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { giga_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -758,7 +758,7 @@ static void giga_rc_track_60_deg_down( /** rct2: 0x008AD704 */ static void giga_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -766,7 +766,7 @@ static void giga_rc_track_flat_to_25_deg_down( /** rct2: 0x008AD714 */ static void giga_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -774,7 +774,7 @@ static void giga_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008AD724 */ static void giga_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -782,7 +782,7 @@ static void giga_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008AD734 */ static void giga_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -790,7 +790,7 @@ static void giga_rc_track_25_deg_down_to_flat( /** rct2: 0x008AD744 */ static void giga_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -819,17 +819,17 @@ static void giga_rc_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -855,12 +855,11 @@ static void giga_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -886,12 +885,12 @@ static void giga_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -917,12 +916,11 @@ static void giga_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -948,26 +946,26 @@ static void giga_rc_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD754 */ static void giga_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -976,7 +974,7 @@ static void giga_rc_track_right_quarter_turn_5( /** rct2: 0x008AD764 */ static void giga_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1010,17 +1008,17 @@ static void giga_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD774 */ static void giga_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1054,17 +1052,17 @@ static void giga_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD784 */ static void giga_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1098,17 +1096,17 @@ static void giga_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD794 */ static void giga_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1142,17 +1140,17 @@ static void giga_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD7A4 */ static void giga_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1184,17 +1182,17 @@ static void giga_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1220,12 +1218,11 @@ static void giga_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1251,12 +1248,12 @@ static void giga_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1282,12 +1279,11 @@ static void giga_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1316,26 +1312,26 @@ static void giga_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD7B4 */ static void giga_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1344,7 +1340,7 @@ static void giga_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008AD7C4 */ static void giga_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1378,24 +1374,24 @@ static void giga_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AD7D4 */ static void giga_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1429,24 +1425,24 @@ static void giga_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AD7E4 */ static void giga_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1480,24 +1476,24 @@ static void giga_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AD7F4 */ static void giga_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1531,24 +1527,24 @@ static void giga_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AD804 */ static void giga_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1556,7 +1552,7 @@ static void giga_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008AD814 */ static void giga_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1564,7 +1560,7 @@ static void giga_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008AD824 */ static void giga_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1572,7 +1568,7 @@ static void giga_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008AD834 */ static void giga_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1580,7 +1576,7 @@ static void giga_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008AD844 */ static void giga_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1608,17 +1604,17 @@ static void giga_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD854 */ static void giga_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { giga_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1626,7 +1622,7 @@ static void giga_rc_track_right_bank( /** rct2: 0x008AD864 */ static void giga_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1655,17 +1651,17 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1691,12 +1687,11 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1722,12 +1717,12 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1753,12 +1748,11 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1784,26 +1778,26 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AD874 */ static void giga_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1832,17 +1826,17 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1868,12 +1862,11 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1899,12 +1892,12 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1930,12 +1923,11 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1961,26 +1953,26 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AD884 */ static void giga_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1989,7 +1981,7 @@ static void giga_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008AD894 */ static void giga_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1998,7 +1990,7 @@ static void giga_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008AD8A4 */ static void giga_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2027,14 +2019,14 @@ static void giga_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2043,14 +2035,14 @@ static void giga_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18239), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18243), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2064,12 +2056,11 @@ static void giga_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2088,23 +2079,22 @@ static void giga_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18239), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18243), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2130,26 +2120,26 @@ static void giga_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD8B4 */ static void giga_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2178,14 +2168,14 @@ static void giga_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2194,14 +2184,14 @@ static void giga_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18247), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18251), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2215,12 +2205,11 @@ static void giga_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2239,23 +2228,22 @@ static void giga_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18247), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18251), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2281,26 +2269,26 @@ static void giga_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD8F4 */ static void giga_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2329,17 +2317,17 @@ static void giga_rc_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2365,9 +2353,9 @@ static void giga_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2393,26 +2381,26 @@ static void giga_rc_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD904 */ static void giga_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2421,7 +2409,7 @@ static void giga_rc_track_right_quarter_turn_3( /** rct2: 0x008AD914 */ static void giga_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2453,17 +2441,17 @@ static void giga_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2489,9 +2477,9 @@ static void giga_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2520,26 +2508,26 @@ static void giga_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD924 */ static void giga_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2548,7 +2536,7 @@ static void giga_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008AD934 */ static void giga_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2577,20 +2565,20 @@ static void giga_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2616,26 +2604,26 @@ static void giga_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AD944 */ static void giga_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2664,20 +2652,20 @@ static void giga_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2686,50 +2674,50 @@ static void giga_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18295), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18297), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18299), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18301), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AD954 */ static void giga_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2738,7 +2726,7 @@ static void giga_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008AD964 */ static void giga_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2747,7 +2735,7 @@ static void giga_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008AD974 */ static void giga_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2779,18 +2767,18 @@ static void giga_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2816,9 +2804,9 @@ static void giga_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2847,20 +2835,20 @@ static void giga_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -2889,23 +2877,23 @@ static void giga_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2931,9 +2919,9 @@ static void giga_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2962,22 +2950,22 @@ static void giga_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD984 */ static void giga_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3009,18 +2997,18 @@ static void giga_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3046,9 +3034,9 @@ static void giga_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3077,20 +3065,20 @@ static void giga_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3119,23 +3107,23 @@ static void giga_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3161,9 +3149,9 @@ static void giga_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3192,22 +3180,22 @@ static void giga_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD994 */ static void giga_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3221,7 +3209,7 @@ static void giga_rc_track_left_half_banked_helix_down_small( /** rct2: 0x008AD9A4 */ static void giga_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3235,7 +3223,7 @@ static void giga_rc_track_right_half_banked_helix_down_small( /** rct2: 0x008AD9B4 */ static void giga_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3267,18 +3255,18 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3304,12 +3292,11 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3335,12 +3322,12 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3366,12 +3353,11 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3400,20 +3386,20 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3442,23 +3428,23 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3484,12 +3470,11 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3515,12 +3500,12 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3546,12 +3531,11 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3580,22 +3564,22 @@ static void giga_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD9C4 */ static void giga_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3627,18 +3611,18 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3664,12 +3648,11 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3695,12 +3678,12 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3726,12 +3709,11 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3740,7 +3722,7 @@ static void giga_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18342), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3750,37 +3732,37 @@ static void giga_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18358), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18352), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18357), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3809,23 +3791,23 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3851,12 +3833,11 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3882,12 +3863,12 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3913,12 +3894,11 @@ static void giga_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3930,46 +3910,46 @@ static void giga_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18358), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18352), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18357), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18342), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AD9D4 */ static void giga_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -3983,7 +3963,7 @@ static void giga_rc_track_left_half_banked_helix_down_large( /** rct2: 0x008AD9E4 */ static void giga_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -3997,7 +3977,7 @@ static void giga_rc_track_right_half_banked_helix_down_large( /** rct2: 0x008ADA14 */ static void giga_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4036,13 +4016,13 @@ static void giga_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008AD9F4 */ static void giga_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4081,13 +4061,13 @@ static void giga_rc_track_right_quarter_turn_1_60_deg_up( break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008ADA04 */ static void giga_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -4095,7 +4075,7 @@ static void giga_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008ADA24 */ static void giga_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -4103,7 +4083,7 @@ static void giga_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008ADA34 */ static void giga_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4129,17 +4109,17 @@ static void giga_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008ADC84 */ static void giga_rc_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4167,24 +4147,24 @@ static void giga_rc_track_25_deg_up_left_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADC94 */ static void giga_rc_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4212,24 +4192,24 @@ static void giga_rc_track_25_deg_up_right_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADA44 */ static void giga_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4237,8 +4217,8 @@ static void giga_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18074), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4246,8 +4226,8 @@ static void giga_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18075), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4255,8 +4235,8 @@ static void giga_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18074), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4264,22 +4244,22 @@ static void giga_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18075), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ADCA4 */ static void giga_rc_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4287,7 +4267,7 @@ static void giga_rc_track_25_deg_down_left_banked( /** rct2: 0x008ADCB4 */ static void giga_rc_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4295,7 +4275,7 @@ static void giga_rc_track_25_deg_down_right_banked( /** rct2: 0x008ADED4 */ static void giga_rc_track_flat_to_60_deg_up_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4328,7 +4308,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -4359,17 +4339,17 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasCableLift()) @@ -4399,7 +4379,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -4430,13 +4410,13 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasCableLift()) @@ -4466,7 +4446,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -4497,13 +4477,13 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasCableLift()) @@ -4533,7 +4513,7 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -4564,29 +4544,29 @@ static void giga_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } /** rct2: 0x008ADEE4 */ static void giga_rc_track_60_deg_up_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4617,16 +4597,15 @@ static void giga_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: switch (direction) @@ -4654,12 +4633,11 @@ static void giga_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -4687,12 +4665,11 @@ static void giga_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4720,28 +4697,27 @@ static void giga_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } /** rct2: 0x008ADEF4 */ static void giga_rc_track_60_deg_down_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); @@ -4749,7 +4725,7 @@ static void giga_rc_track_60_deg_down_to_flat_long_base( /** rct2: 0x008ADF04 */ static void giga_rc_track_flat_to_60_deg_down_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); @@ -4757,7 +4733,7 @@ static void giga_rc_track_flat_to_60_deg_down_long_base( /** rct2: 0x008ADF14 */ static void giga_rc_track_cable_lift_hill( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4788,20 +4764,19 @@ static void giga_rc_track_cable_lift_hill( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -4829,20 +4804,19 @@ static void giga_rc_track_cable_lift_hill( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 2: switch (direction) @@ -4876,20 +4850,19 @@ static void giga_rc_track_cable_lift_hill( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -4917,27 +4890,26 @@ static void giga_rc_track_cable_lift_hill( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008ADA64 */ static void giga_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4966,14 +4938,14 @@ static void giga_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4999,12 +4971,11 @@ static void giga_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5030,15 +5001,15 @@ static void giga_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5047,44 +5018,43 @@ static void giga_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18417), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18421), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18425), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18429), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADA74 */ static void giga_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5113,14 +5083,14 @@ static void giga_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5146,12 +5116,11 @@ static void giga_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5177,15 +5146,15 @@ static void giga_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5194,44 +5163,43 @@ static void giga_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18401), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18405), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18409), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18413), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADA84 */ static void giga_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5240,7 +5208,7 @@ static void giga_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008ADA94 */ static void giga_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5249,7 +5217,7 @@ static void giga_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008ADAA4 */ static void giga_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5278,14 +5246,14 @@ static void giga_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5311,12 +5279,11 @@ static void giga_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5342,15 +5309,15 @@ static void giga_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5359,44 +5326,43 @@ static void giga_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18449), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18453), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18457), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18461), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADAB4 */ static void giga_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5425,14 +5391,14 @@ static void giga_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5458,12 +5424,11 @@ static void giga_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5489,15 +5454,15 @@ static void giga_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5506,44 +5471,43 @@ static void giga_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18433), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18437), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18441), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18445), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADAC4 */ static void giga_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5552,7 +5516,7 @@ static void giga_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008ADAD4 */ static void giga_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5561,7 +5525,7 @@ static void giga_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008ADA54 */ static void giga_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5589,9 +5553,9 @@ static void giga_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5616,9 +5580,9 @@ static void giga_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5643,9 +5607,9 @@ static void giga_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5653,22 +5617,22 @@ static void giga_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18525), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5678,36 +5642,36 @@ static void giga_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18463), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADB04 */ static void giga_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5735,9 +5699,9 @@ static void giga_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5762,9 +5726,9 @@ static void giga_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5789,9 +5753,9 @@ static void giga_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5799,22 +5763,22 @@ static void giga_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18537), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5824,36 +5788,36 @@ static void giga_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18475), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008ADB64 */ static void giga_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5867,9 +5831,9 @@ static void giga_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -5880,9 +5844,9 @@ static void giga_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -5893,43 +5857,43 @@ static void giga_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18487), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008ADAE4 */ static void giga_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5957,9 +5921,9 @@ static void giga_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5984,9 +5948,9 @@ static void giga_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6011,9 +5975,9 @@ static void giga_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6021,22 +5985,22 @@ static void giga_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18529), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6046,36 +6010,36 @@ static void giga_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18467), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008ADB44 */ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6089,9 +6053,9 @@ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6102,9 +6066,9 @@ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6115,43 +6079,43 @@ static void giga_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18479), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADB54 */ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6165,9 +6129,9 @@ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6178,9 +6142,9 @@ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6191,43 +6155,43 @@ static void giga_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18483), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADAF4 */ static void giga_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6255,9 +6219,9 @@ static void giga_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6282,9 +6246,9 @@ static void giga_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6309,9 +6273,9 @@ static void giga_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6319,22 +6283,22 @@ static void giga_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18533), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6344,36 +6308,36 @@ static void giga_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18471), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008ADB34 */ static void giga_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6401,9 +6365,9 @@ static void giga_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6428,9 +6392,9 @@ static void giga_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6455,9 +6419,9 @@ static void giga_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6465,22 +6429,22 @@ static void giga_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18539), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6490,36 +6454,36 @@ static void giga_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18477), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008ADB94 */ static void giga_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6533,9 +6497,9 @@ static void giga_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -6546,9 +6510,9 @@ static void giga_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -6559,43 +6523,43 @@ static void giga_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18489), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008ADB14 */ static void giga_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6623,8 +6587,8 @@ static void giga_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6649,8 +6613,8 @@ static void giga_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6675,8 +6639,8 @@ static void giga_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6684,22 +6648,22 @@ static void giga_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18535), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6709,37 +6673,37 @@ static void giga_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18473), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADB74 */ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6753,9 +6717,9 @@ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6766,9 +6730,9 @@ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6779,43 +6743,43 @@ static void giga_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18485), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADB84 */ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6829,9 +6793,9 @@ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6842,9 +6806,9 @@ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6855,43 +6819,43 @@ static void giga_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18481), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADB24 */ static void giga_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6919,9 +6883,9 @@ static void giga_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6946,9 +6910,9 @@ static void giga_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6973,9 +6937,9 @@ static void giga_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6983,22 +6947,22 @@ static void giga_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18531), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7008,36 +6972,36 @@ static void giga_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18469), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008ADBC4 */ static void giga_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7051,9 +7015,9 @@ static void giga_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7067,9 +7031,9 @@ static void giga_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7080,43 +7044,43 @@ static void giga_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18495), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADBD4 */ static void giga_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7130,9 +7094,9 @@ static void giga_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7143,9 +7107,9 @@ static void giga_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7159,43 +7123,43 @@ static void giga_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18500), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADBE4 */ static void giga_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7209,9 +7173,9 @@ static void giga_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7225,9 +7189,9 @@ static void giga_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7238,43 +7202,43 @@ static void giga_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18502), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADBF4 */ static void giga_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7288,9 +7252,9 @@ static void giga_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7301,9 +7265,9 @@ static void giga_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7317,43 +7281,43 @@ static void giga_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18497), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADC24 */ static void giga_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7367,9 +7331,9 @@ static void giga_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7383,9 +7347,9 @@ static void giga_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7396,43 +7360,43 @@ static void giga_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18515), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008ADC34 */ static void giga_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7446,9 +7410,9 @@ static void giga_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7459,9 +7423,9 @@ static void giga_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7475,43 +7439,43 @@ static void giga_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18520), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008ADC04 */ static void giga_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7525,9 +7489,9 @@ static void giga_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -7541,9 +7505,9 @@ static void giga_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -7554,43 +7518,43 @@ static void giga_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18505), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008ADC14 */ static void giga_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7604,9 +7568,9 @@ static void giga_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -7617,9 +7581,9 @@ static void giga_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -7633,43 +7597,43 @@ static void giga_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18510), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008ADC44 */ static void giga_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7683,8 +7647,8 @@ static void giga_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7698,8 +7662,8 @@ static void giga_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7710,43 +7674,43 @@ static void giga_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18512), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADC54 */ static void giga_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7760,8 +7724,8 @@ static void giga_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7772,8 +7736,8 @@ static void giga_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7787,43 +7751,43 @@ static void giga_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18507), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADC64 */ static void giga_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7837,9 +7801,9 @@ static void giga_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7853,9 +7817,9 @@ static void giga_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7866,43 +7830,43 @@ static void giga_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18522), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008ADC74 */ static void giga_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7916,9 +7880,9 @@ static void giga_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7929,9 +7893,9 @@ static void giga_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7945,43 +7909,43 @@ static void giga_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18517), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008ADBA4 */ static void giga_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7995,9 +7959,9 @@ static void giga_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8008,9 +7972,9 @@ static void giga_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8021,43 +7985,43 @@ static void giga_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18491), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADBB4 */ static void giga_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8071,9 +8035,9 @@ static void giga_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8084,9 +8048,9 @@ static void giga_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8097,43 +8061,43 @@ static void giga_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18493), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008ADEC4 */ static void giga_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -8146,17 +8110,17 @@ static void giga_rc_track_block_brakes( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008ADCC4 */ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8185,20 +8149,20 @@ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -8224,26 +8188,26 @@ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADCD4 */ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8272,20 +8236,20 @@ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -8294,50 +8258,50 @@ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18645), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18647), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18649), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18651), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADCE4 */ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -8347,7 +8311,7 @@ static void giga_rc_track_left_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008ADCF4 */ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -8356,7 +8320,7 @@ static void giga_rc_track_right_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008ADD04 */ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8385,17 +8349,17 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8421,12 +8385,11 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8452,12 +8415,12 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8483,12 +8446,11 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8514,26 +8476,26 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADD14 */ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8562,17 +8524,17 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8598,12 +8560,11 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8629,12 +8590,12 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8660,12 +8621,11 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8691,26 +8651,26 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008ADD24 */ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8720,7 +8680,7 @@ static void giga_rc_track_left_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008ADD34 */ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8729,7 +8689,7 @@ static void giga_rc_track_right_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008ADD44 */ static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8760,24 +8720,24 @@ static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADD54 */ static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8808,24 +8768,24 @@ static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADD64 */ static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8856,24 +8816,24 @@ static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADD74 */ static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8904,24 +8864,24 @@ static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ADD84 */ static void giga_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8929,7 +8889,7 @@ static void giga_rc_track_25_deg_down_to_left_banked_25_deg_down( /** rct2: 0x008ADD94 */ static void giga_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8937,7 +8897,7 @@ static void giga_rc_track_25_deg_down_to_right_banked_25_deg_down( /** rct2: 0x008ADDA4 */ static void giga_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8945,7 +8905,7 @@ static void giga_rc_track_left_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008ADDB4 */ static void giga_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8953,7 +8913,7 @@ static void giga_rc_track_right_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008ADDC4 */ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8981,24 +8941,24 @@ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ADDD4 */ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9026,24 +8986,24 @@ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ADE04 */ static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9071,24 +9031,24 @@ static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ADE14 */ static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9116,24 +9076,24 @@ static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ADE24 */ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9142,7 +9102,7 @@ static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_down( /** rct2: 0x008ADE34 */ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9151,7 +9111,7 @@ static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_down( /** rct2: 0x008ADDE4 */ static void giga_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9160,7 +9120,7 @@ static void giga_rc_track_left_banked_25_deg_down_to_left_banked_flat( /** rct2: 0x008ADDF4 */ static void giga_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9169,7 +9129,7 @@ static void giga_rc_track_right_banked_25_deg_down_to_right_banked_flat( /** rct2: 0x008ADE44 */ static void giga_rc_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9200,24 +9160,24 @@ static void giga_rc_track_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ADE54 */ static void giga_rc_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9248,24 +9208,24 @@ static void giga_rc_track_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ADE64 */ static void giga_rc_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9296,24 +9256,24 @@ static void giga_rc_track_left_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ADE74 */ static void giga_rc_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9344,24 +9304,24 @@ static void giga_rc_track_right_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ADE84 */ static void giga_rc_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9369,7 +9329,7 @@ static void giga_rc_track_flat_to_left_banked_25_deg_down( /** rct2: 0x008ADE94 */ static void giga_rc_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9377,7 +9337,7 @@ static void giga_rc_track_flat_to_right_banked_25_deg_down( /** rct2: 0x008ADEA4 */ static void giga_rc_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9385,14 +9345,14 @@ static void giga_rc_track_left_banked_25_deg_down_to_flat( /** rct2: 0x008ADEB4 */ static void giga_rc_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void giga_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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. @@ -9418,12 +9378,12 @@ static void giga_rc_track_booster( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_giga_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp index 5d917faf75..00d9fc792a 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x0087694C */ static void heartline_twister_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -34,7 +34,7 @@ static void heartline_twister_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21356), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -43,7 +43,7 @@ static void heartline_twister_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21357), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -52,7 +52,7 @@ static void heartline_twister_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21360), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -61,7 +61,7 @@ static void heartline_twister_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21361), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -77,7 +77,7 @@ static void heartline_twister_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21296), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: @@ -87,17 +87,17 @@ static void heartline_twister_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21297), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - 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 + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void heartline_twister_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -115,14 +115,14 @@ static void heartline_twister_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0087695C */ static void heartline_twister_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -136,7 +136,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21382), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -145,7 +145,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21383), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -154,7 +154,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21384), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -163,7 +163,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21385), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -178,7 +178,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21326), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -187,7 +187,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21327), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -196,7 +196,7 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21328), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -205,25 +205,25 @@ static void heartline_twister_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21329), { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008769FC */ static void heartline_twister_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -237,7 +237,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21406), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -246,7 +246,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21407), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -255,7 +255,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21408), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 23, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -264,7 +264,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21409), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -279,7 +279,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21350), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -288,7 +288,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21351), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -297,7 +297,7 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21352), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 23, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -306,25 +306,25 @@ static void heartline_twister_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21353), { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x0087696C */ static void heartline_twister_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -338,7 +338,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21366), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -347,7 +347,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21367), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -356,7 +356,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21368), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -365,7 +365,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21369), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -380,7 +380,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21310), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -389,7 +389,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21311), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -398,7 +398,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21312), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -407,25 +407,25 @@ static void heartline_twister_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21313), { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008769BC */ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -439,7 +439,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21390), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -448,7 +448,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21391), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -457,7 +457,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21392), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 15, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -466,7 +466,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21393), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -481,7 +481,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21334), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -490,7 +490,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21335), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -499,7 +499,7 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21336), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 15, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -508,25 +508,25 @@ static void heartline_twister_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21337), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008769CC */ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -540,7 +540,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21398), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -549,7 +549,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21399), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -558,7 +558,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21400), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 19, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 19, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -567,7 +567,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21401), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -582,7 +582,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21342), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -591,7 +591,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21343), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -600,7 +600,7 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21344), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 19, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 19, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -609,25 +609,25 @@ static void heartline_twister_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21345), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x0087697C */ static void heartline_twister_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -641,7 +641,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21374), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -650,7 +650,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21375), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -659,7 +659,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21376), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -668,7 +668,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21377), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -683,7 +683,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21318), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -692,7 +692,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21319), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -701,7 +701,7 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21320), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -710,25 +710,25 @@ static void heartline_twister_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21321), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0087698C */ static void heartline_twister_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { heartline_twister_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -736,7 +736,7 @@ static void heartline_twister_rc_track_25_deg_down( /** rct2: 0x00876A0C */ static void heartline_twister_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { heartline_twister_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -744,7 +744,7 @@ static void heartline_twister_rc_track_60_deg_down( /** rct2: 0x0087699C */ static void heartline_twister_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -752,7 +752,7 @@ static void heartline_twister_rc_track_flat_to_25_deg_down( /** rct2: 0x008769DC */ static void heartline_twister_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -760,7 +760,7 @@ static void heartline_twister_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008769EC */ static void heartline_twister_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -768,7 +768,7 @@ static void heartline_twister_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008769AC */ static void heartline_twister_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -776,7 +776,7 @@ static void heartline_twister_rc_track_25_deg_down_to_flat( /** rct2: 0x00876A6C */ static void heartline_twister_rc_track_heartline_transfer_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -791,7 +791,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21310), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -800,7 +800,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21311), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -809,7 +809,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21312), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -818,19 +818,19 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21313), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -848,7 +848,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21312), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 6, 5, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -863,7 +863,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21313), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 7, 6, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -878,7 +878,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21310), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 6, 7, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -893,11 +893,11 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21311), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 7, 8, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -909,7 +909,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21302), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -918,7 +918,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21303), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -927,7 +927,7 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21304), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -936,11 +936,11 @@ static void heartline_twister_rc_track_heartline_transfer_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21305), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -980,21 +980,21 @@ static void heartline_twister_rc_track_heartline_transfer_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height - 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 16, TUNNEL_0); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00876A7C */ static void heartline_twister_rc_track_heartline_transfer_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1037,14 +1037,14 @@ static void heartline_twister_rc_track_heartline_transfer_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height - 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 16, TUNNEL_0); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1062,7 +1062,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21312), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 6, 5, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1077,7 +1077,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21313), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 7, 6, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1092,7 +1092,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21310), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 6, 7, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1107,11 +1107,11 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21311), { 0, 0, height + 16 }, { 32, 1, 34 }, { 0, 27, height + 16 }); - wooden_a_supports_paint_setup(session, 7, 8, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height + 8, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1123,7 +1123,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21302), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1132,7 +1132,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21303), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1141,7 +1141,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21304), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1150,11 +1150,11 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21305), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1166,7 +1166,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21310), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1175,7 +1175,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21311), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1184,7 +1184,7 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21312), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1193,26 +1193,26 @@ static void heartline_twister_rc_track_heartline_transfer_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21313), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 23 }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00876A4C */ static void heartline_twister_rc_track_left_heartline_roll( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1227,7 +1227,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21422), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1236,7 +1236,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21425), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1245,7 +1245,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21428), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1254,12 +1254,12 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21431), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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 + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1271,7 +1271,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21423), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1280,7 +1280,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21426), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1289,7 +1289,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21429), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1298,11 +1298,11 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21432), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1314,7 +1314,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21424), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1323,7 +1323,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21427), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1332,7 +1332,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21430), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1341,11 +1341,11 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21433), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1357,7 +1357,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21430), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1366,7 +1366,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21433), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1375,7 +1375,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21424), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1384,11 +1384,11 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21427), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1400,7 +1400,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21429), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1409,7 +1409,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21432), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1418,7 +1418,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21423), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1427,11 +1427,11 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21426), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1443,7 +1443,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21428), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1452,7 +1452,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21431), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1461,7 +1461,7 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21422), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1470,19 +1470,19 @@ static void heartline_twister_rc_track_left_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21425), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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 + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00876A5C */ static void heartline_twister_rc_track_right_heartline_roll( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1497,7 +1497,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21446), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1506,7 +1506,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21449), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1515,7 +1515,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21452), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1524,12 +1524,12 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21455), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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 + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1541,7 +1541,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21447), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1550,7 +1550,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21450), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1559,7 +1559,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21453), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1568,11 +1568,11 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21456), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1584,7 +1584,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21448), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1593,7 +1593,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21451), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1602,7 +1602,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21454), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1611,11 +1611,11 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21457), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1627,7 +1627,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21454), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1636,7 +1636,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21457), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1645,7 +1645,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21448), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1654,11 +1654,11 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21451), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1670,7 +1670,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21453), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1679,7 +1679,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21456), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1688,7 +1688,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21447), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1697,11 +1697,11 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21450), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1713,7 +1713,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21452), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1722,7 +1722,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21455), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1731,7 +1731,7 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21446), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1740,12 +1740,12 @@ static void heartline_twister_rc_track_right_heartline_roll( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21449), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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 + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index e0c526071c..a32b4805fc 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -26,7 +26,7 @@ namespace HybridRC { - static ImageId GetTrackColour(paint_session& session) + static ImageId GetTrackColour(PaintSession& session) { if (session.TrackColours[SCHEME_TRACK].ToUInt32() == 0x21600000) return session.TrackColours[SCHEME_TRACK]; // TODO dirty hack @@ -35,7 +35,7 @@ namespace HybridRC } static void TrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -50,14 +50,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_FLAT + (direction & 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackStation( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -80,17 +80,17 @@ namespace HybridRC { 0, 6, height + 3 }); } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); 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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void Track25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -105,21 +105,21 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE + direction + 8), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -159,21 +159,21 @@ namespace HybridRC session.WoodenSupportsPrependTo = ps; } - wooden_a_supports_paint_setup(session, direction & 1, 21 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void TrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -188,21 +188,21 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE + direction), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void Track25DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -269,21 +269,21 @@ namespace HybridRC break; } } - wooden_a_supports_paint_setup(session, direction & 1, 13 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void Track60DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -351,21 +351,21 @@ namespace HybridRC break; } } - wooden_a_supports_paint_setup(session, direction & 1, 17 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void Track25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -380,63 +380,63 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE + direction + 4), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void Track25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -464,9 +464,9 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(imageIds[direction]), { 0, 0, height }, { boundBoxLengths[direction].x, boundBoxLengths[direction].y, boundBoxLengths[direction].z }, { boundBoxOffsets[direction].x, boundBoxOffsets[direction].y, boundBoxOffsets[direction].z }); - paint_util_set_vertical_tunnel(session, height + 32); - 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); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -474,14 +474,14 @@ namespace HybridRC } static void Track90DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegUpTo90DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -510,14 +510,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(imageIds[direction]), { 0, 0, height }, { boundBoxLengths[direction].x, boundBoxLengths[direction].y, boundBoxLengths[direction].z }, { boundBoxOffsets[direction].x, boundBoxOffsets[direction].y, boundBoxOffsets[direction].z }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_vertical_tunnel(session, height + 56); - 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); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: break; @@ -525,14 +525,14 @@ namespace HybridRC } static void Track90DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const CoordsXYZ boundBoxOffsets[4] = { @@ -561,18 +561,18 @@ namespace HybridRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_SQUARE_8); 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 + 80, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } static void Track60DegDownTo90DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -603,10 +603,10 @@ namespace HybridRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: break; @@ -614,7 +614,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -626,36 +626,36 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 3), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 6), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 9), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -664,31 +664,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 1), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 4), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 7), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 10), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -697,44 +696,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 2), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 5), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 8), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE + 11), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -742,7 +741,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -754,38 +753,38 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 5), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 10), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 15), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -794,33 +793,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 1), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 6), { 0, 0, height }, { 36, 16, 3 }, { 0, 4, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 11), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 16), { 0, 0, height }, { 32, 14, 3 }, { 0, 18, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -829,39 +828,39 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 2), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 7), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 12), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 17), { 0, 0, height }, { 33, 33, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -870,33 +869,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 3), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 8), { 0, 0, height }, { 16, 36, 3 }, { 4, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 13), { 0, 0, height }, { 16, 32, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 18), { 0, 0, height }, { 14, 32, 3 }, { 18, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -905,44 +904,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 4), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 9), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 14), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE + 19), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -950,7 +949,7 @@ namespace HybridRC } static void TrackLeftEighthToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -962,33 +961,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 4), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 8), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 12), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -997,29 +996,29 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 1), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 5), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 9), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 13), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1028,48 +1027,48 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 2), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 6), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 10), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 14), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1095,14 +1094,14 @@ namespace HybridRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightEighthToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1114,33 +1113,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 16), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 20), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 24), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 28), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1149,29 +1148,29 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 17), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 21), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 25), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 29), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1180,48 +1179,48 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 18), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 22), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 26), { 0, 0, height }, { 28, 28, 3 }, { 4, 4, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE + 30), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1247,14 +1246,14 @@ namespace HybridRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftEighthToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1262,7 +1261,7 @@ namespace HybridRC } static void TrackRightEighthToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1270,7 +1269,7 @@ namespace HybridRC } static void TrackDiagFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1299,10 +1298,9 @@ namespace HybridRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1314,7 +1312,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_LIFT_TRACK_FLAT_DIAGONAL + 0), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1332,20 +1330,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1374,20 +1372,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1413,14 +1411,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiag25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1449,8 +1447,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1479,20 +1477,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1521,20 +1519,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1560,14 +1558,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiag25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1596,8 +1594,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1626,20 +1624,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1668,20 +1666,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1707,14 +1705,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1743,8 +1741,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1773,20 +1771,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1815,20 +1813,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1854,14 +1852,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1890,8 +1888,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1920,20 +1918,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1962,20 +1960,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2001,14 +1999,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2037,7 +2035,7 @@ namespace HybridRC break; } } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2066,19 +2064,19 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2107,19 +2105,19 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2145,15 +2143,15 @@ namespace HybridRC break; } } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiag25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2182,8 +2180,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2212,20 +2210,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2254,20 +2252,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2293,14 +2291,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2329,8 +2327,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2359,20 +2357,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2401,20 +2399,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2440,14 +2438,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } static void TrackDiag25DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2476,8 +2474,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2506,20 +2504,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2548,20 +2546,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2587,14 +2585,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2623,8 +2621,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2653,20 +2651,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2695,20 +2693,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2734,14 +2732,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2770,8 +2768,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2800,20 +2798,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2842,20 +2840,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2881,14 +2879,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } static void TrackDiag25DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2917,8 +2915,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2947,20 +2945,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2989,20 +2987,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3028,14 +3026,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3064,8 +3062,8 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3094,20 +3092,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3136,20 +3134,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3175,14 +3173,14 @@ namespace HybridRC 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackFlatToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3214,14 +3212,14 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackFlatToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3253,28 +3251,28 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackLeftBankToflat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToflat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3306,21 +3304,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackRightBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3352,21 +3350,21 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void Track25DegUpToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3398,21 +3396,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void Track25DegUpToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3444,49 +3442,49 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackLeftBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftbank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3518,21 +3516,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackRightbank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftbank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3547,8 +3545,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3567,20 +3565,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3595,20 +3593,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3620,14 +3618,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagFlatToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3642,8 +3640,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3658,20 +3656,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3690,20 +3688,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3715,14 +3713,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagLeftBankToflat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3737,8 +3735,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3757,20 +3755,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3785,20 +3783,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3810,14 +3808,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagRightBankToflat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3832,8 +3830,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3848,20 +3846,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3880,20 +3878,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3905,14 +3903,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagLeftBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3927,8 +3925,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3947,20 +3945,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3975,20 +3973,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4000,14 +3998,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiagRightBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4022,8 +4020,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4038,20 +4036,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4070,20 +4068,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4095,14 +4093,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegUpToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4117,8 +4115,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4137,20 +4135,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4165,20 +4163,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4190,14 +4188,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiag25DegUpToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4212,8 +4210,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4228,20 +4226,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4260,20 +4258,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4285,14 +4283,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagLeftBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4307,7 +4305,7 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4326,19 +4324,19 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4353,19 +4351,19 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4377,15 +4375,15 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiagRightBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4400,7 +4398,7 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4415,19 +4413,19 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4446,19 +4444,19 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4470,15 +4468,15 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiag25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4493,8 +4491,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4513,20 +4511,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4541,20 +4539,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4566,14 +4564,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4588,8 +4586,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4604,20 +4602,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4636,20 +4634,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4661,14 +4659,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiagLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4683,8 +4681,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4703,20 +4701,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4731,20 +4729,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4756,14 +4754,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4778,8 +4776,8 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4794,20 +4792,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4826,20 +4824,20 @@ namespace HybridRC switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_b_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_b_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_b_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4851,14 +4849,14 @@ namespace HybridRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftQuarterTurn3Bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4873,7 +4871,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 1), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4882,30 +4880,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 5), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 9), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 13), { 0, 0, height }, { 26, 32, 3 }, { 6, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4914,31 +4912,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 2), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 6), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 10), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 14), { 0, 0, height }, { 22, 22, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4947,7 +4944,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 3), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4956,7 +4953,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 8), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4965,32 +4962,32 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 12), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_CURVE_BANKED + 15), { 0, 0, height }, { 32, 26, 3 }, { 6, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn3Bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4998,7 +4995,7 @@ namespace HybridRC } static void TrackBankedLeftQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5013,7 +5010,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 1), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5022,32 +5019,32 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 7), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 14), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 20), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5056,33 +5053,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 2), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 8), { 0, 0, height }, { 48, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 15), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 21), { 0, 0, height }, { 32, 14, 3 }, { 0, 18, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5091,7 +5088,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 3), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5100,33 +5097,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 10), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 16), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 22), { 0, 0, height }, { 38, 38, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -5135,33 +5132,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 4), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 11), { 0, 0, height }, { 16, 48, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 17), { 0, 0, height }, { 16, 32, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 23), { 0, 0, height }, { 14, 32, 3 }, { 18, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5170,7 +5167,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 5), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5179,7 +5176,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 13), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5188,32 +5185,32 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 19), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_MEDIUM_CURVE_BANKED + 24), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackBankedRightQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -5221,7 +5218,7 @@ namespace HybridRC } static void TrackLeftEighthBankToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5236,7 +5233,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 1), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5245,27 +5242,27 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 6), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 12), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 16), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5274,7 +5271,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 2), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5283,23 +5280,23 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 8), { 0, 0, height }, { 34, 16, 0 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 13), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 17), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5308,48 +5305,48 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 3), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 9), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 14), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 18), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5378,14 +5375,14 @@ namespace HybridRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightEighthBankToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5397,13 +5394,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 20), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 24), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5412,7 +5409,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 29), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5421,15 +5418,15 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 36), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5438,13 +5435,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 21), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 25), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5453,17 +5450,17 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 31), { 0, 0, height }, { 34, 16, 0 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 37), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5472,48 +5469,48 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 22), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 26), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 32), { 0, 0, height }, { 28, 28, 0 }, { 4, 4, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_CURVE_BANKED + 38), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5544,14 +5541,14 @@ namespace HybridRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftEighthBankToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5559,7 +5556,7 @@ namespace HybridRC } static void TrackRightEighthBankToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5567,7 +5564,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5579,57 +5576,56 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 0), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 2), { 0, 6, height }, { 34, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 4), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 6), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5638,44 +5634,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 1), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 3), { 6, 0, height }, { 20, 34, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 5), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 7), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5687,57 +5683,56 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 8), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 10), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 12), { 0, 6, height }, { 34, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 14), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5746,44 +5741,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 9), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 11), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 13), { 6, 0, height }, { 20, 34, 3 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 15), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5791,7 +5786,7 @@ namespace HybridRC } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5799,7 +5794,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn5Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5811,38 +5806,38 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 5), { 0, 0, height }, { 34, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 10), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 15), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5851,33 +5846,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 1), { 0, 0, height }, { 32, 16, 3 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 6), { 0, 0, height }, { 32, 16, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 11), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 16), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -5886,39 +5881,39 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 2), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 7), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 12), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 17), { 0, 0, height }, { 16, 16, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -5927,33 +5922,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 3), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 8), { 0, 0, height }, { 16, 32, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 13), { 0, 0, height }, { 16, 32, 3 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 18), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -5962,44 +5957,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 4), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 9), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 14), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 19), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightQuarterTurn5Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6011,38 +6006,38 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 20), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 25), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 30), { 0, 0, height }, { 34, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 35), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6051,33 +6046,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 21), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 26), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 31), { 0, 0, height }, { 32, 16, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 36), { 0, 0, height }, { 32, 16, 3 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -6086,39 +6081,39 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 22), { 0, 0, height }, { 16, 16, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 27), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 32), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 37), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -6127,33 +6122,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 23), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 28), { 0, 0, height }, { 16, 32, 3 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 33), { 0, 0, height }, { 16, 32, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 38), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -6162,44 +6157,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 24), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 29), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 34), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 39), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftQuarterTurn5Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -6207,7 +6202,7 @@ namespace HybridRC } static void TrackRightQuarterTurn5Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -6215,7 +6210,7 @@ namespace HybridRC } static void TrackLeftQuarterTurn1Tile60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6227,7 +6222,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 1), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6236,7 +6231,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 3), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6245,7 +6240,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 5), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6254,16 +6249,16 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 7), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void TrackRightQuarterTurn1Tile60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6275,7 +6270,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 9), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6284,7 +6279,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 11), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6293,7 +6288,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 13), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6302,31 +6297,31 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_STEEP_SMALL_CURVE + 15), { 0, 0, height }, { 28, 28, 1 }, { 2, 2, height + 99 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } track_paint_util_right_quarter_turn_1_tile_tunnel( session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void TrackLeftQuarterTurn1Tile60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn1Tile60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftQuarterTurn1Tile60DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn1Tile90DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6361,9 +6356,9 @@ namespace HybridRC { 0, 0, height }, { 2, 20, 63 }, { 24, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -6371,7 +6366,7 @@ namespace HybridRC } static void TrackRightQuarterTurn1Tile90DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6406,9 +6401,9 @@ namespace HybridRC { 0, 0, height }, { 2, 20, 63 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -6416,21 +6411,21 @@ namespace HybridRC } static void TrackLeftQuarterTurn1Tile90DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn1Tile90DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftQuarterTurn1Tile90DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void Track25DegUpToLeftBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6459,21 +6454,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track25DegUpToRightBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6502,21 +6497,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackLeftBanked25DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6545,21 +6540,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackRightBanked25DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6588,49 +6583,49 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackLeftBanked25DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6662,21 +6657,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackRightBankedFlatToRightBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6708,21 +6703,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackLeftBanked25DegUpToLeftBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6754,21 +6749,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackRightBanked25DegUpToRightBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6800,49 +6795,49 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackLeftBankedFlatToLeftBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankedFlatToRightBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToRightBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegUpLeftBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6868,21 +6863,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track25DegUpRightBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6908,35 +6903,35 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track25DegDownLeftBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownRightBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToLeftBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6965,21 +6960,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackFlatToRightBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7008,21 +7003,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackLeftBanked25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7051,21 +7046,21 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackRightBanked25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7094,49 +7089,49 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height + 3 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackFlatToLeftBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToRightBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7149,7 +7144,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 0), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7160,53 +7155,52 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 3), { 0, 6, height }, { 34, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 6), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 9), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -7216,7 +7210,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 1), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7227,7 +7221,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 5), { 6, 0, height }, { 1, 34, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7238,33 +7232,33 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 8), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 10), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightBankedQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7277,14 +7271,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 11), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 13), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7295,46 +7289,45 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 17), { 0, 6, height }, { 34, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 20), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -7344,7 +7337,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 12), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7355,7 +7348,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 15), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7366,33 +7359,33 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 19), { 6, 0, height }, { 1, 34, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 21), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftBankedQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -7400,7 +7393,7 @@ namespace HybridRC } static void TrackRightBankedQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -7408,7 +7401,7 @@ namespace HybridRC } static void TrackLeftBankedQuarterTurn5Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7421,7 +7414,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7432,34 +7425,34 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 6), { 0, 0, height }, { 34, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 15), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 21), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -7469,7 +7462,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 1), { 0, 0, height }, { 32, 16, 3 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7480,29 +7473,29 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 8), { 0, 0, height }, { 1, 1, 34 }, { 30, 30, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 16), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 22), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -7512,7 +7505,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 2), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7523,35 +7516,35 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 10), { 0, 0, height }, { 1, 1, 34 }, { 30, 30, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 17), { 0, 0, height }, { 1, 1, 3 }, { 64, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 23), { 0, 0, height }, { 16, 16, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -7561,7 +7554,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 3), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7572,29 +7565,29 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 12), { 0, 0, height }, { 1, 1, 34 }, { 30, 30, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 18), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 24), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -7604,7 +7597,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 4), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7615,7 +7608,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 14), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7626,33 +7619,33 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 20), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 25), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightBankedQuarterTurn5Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7665,14 +7658,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 26), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 31), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7683,27 +7676,27 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 38), { 0, 0, height }, { 34, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 47), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -7713,14 +7706,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 27), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 32), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7731,22 +7724,22 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 40), { 0, 0, height }, { 1, 1, 34 }, { 30, 30, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 48), { 0, 0, height }, { 32, 16, 3 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -7756,14 +7749,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 28), { 0, 0, height }, { 16, 16, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 33), { 0, 0, height }, { 1, 1, 3 }, { 64, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7774,28 +7767,28 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 42), { 0, 0, height }, { 1, 1, 34 }, { 30, 30, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 49), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -7805,14 +7798,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 29), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 34), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7823,22 +7816,22 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 44), { 0, 0, height }, { 1, 1, 34 }, { 30, 30, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 50), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -7848,7 +7841,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 30), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7859,7 +7852,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 36), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7870,33 +7863,33 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 46), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 51), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftBankedQuarterTurn5Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -7904,7 +7897,7 @@ namespace HybridRC } static void TrackRightBankedQuarterTurn5Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -7912,7 +7905,7 @@ namespace HybridRC } static void TrackSBendLeft( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7924,33 +7917,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 4), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 3), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 7), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7959,33 +7952,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 1), { 0, 0, height }, { 32, 26, 3 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 5), { 0, 0, height }, { 34, 26, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 2), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 6), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7994,33 +7987,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 2), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 6), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 1), { 0, 0, height }, { 32, 26, 3 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 5), { 0, 0, height }, { 34, 26, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8029,44 +8022,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 3), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 7), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 0), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 4), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackSBendRight( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8078,33 +8071,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 8), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 12), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 11), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 15), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8113,33 +8106,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 9), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 13), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 10), { 0, 0, height }, { 34, 26, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 14), { 0, 0, height }, { 32, 26, 3 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8148,33 +8141,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 10), { 0, 0, height }, { 34, 26, 3 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 14), { 0, 0, height }, { 32, 26, 3 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 9), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 13), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8183,44 +8176,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 11), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 15), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 8), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_S_BEND + 12), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixUpSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8235,7 +8228,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 1), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8244,45 +8237,45 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 5), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 9), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 13), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8291,31 +8284,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 2), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 6), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 10), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 14), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8324,7 +8316,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 3), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8333,7 +8325,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 8), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8342,26 +8334,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 12), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 15), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8370,7 +8362,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 13), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8379,7 +8371,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 1), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8388,44 +8380,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 5), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 9), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -8434,31 +8426,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 14), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 2), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 6), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 10), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -8467,13 +8458,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 15), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 3), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8482,7 +8473,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 8), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8491,21 +8482,21 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 12), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightHalfBankedHelixUpSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8517,13 +8508,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 16), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 19), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8532,7 +8523,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 24), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8541,33 +8532,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 29), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8576,31 +8567,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 17), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 20), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 25), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 30), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8609,7 +8599,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 18), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8618,7 +8608,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 22), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8627,26 +8617,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 27), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 31), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8655,7 +8645,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 19), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8664,7 +8654,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 24), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8673,44 +8663,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 29), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 16), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -8719,31 +8709,30 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 20), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 25), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 30), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 17), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -8755,7 +8744,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 22), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8764,33 +8753,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 27), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 31), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_SMALL_HELIX + 18), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixDownSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -8803,7 +8792,7 @@ namespace HybridRC } static void TrackRightHalfBankedHelixDownSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -8816,7 +8805,7 @@ namespace HybridRC } static void TrackLeftHalfBankedHelixUpLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8831,7 +8820,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 1), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8840,32 +8829,32 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 7), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 14), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 20), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8874,33 +8863,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 2), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 8), { 0, 0, height }, { 33, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 15), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 21), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8909,7 +8898,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 3), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8918,33 +8907,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 10), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 16), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 22), { 0, 0, height }, { 34, 34, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -8953,33 +8942,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 4), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 11), { 0, 0, height }, { 16, 33, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 17), { 0, 0, height }, { 16, 32, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 23), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -8988,7 +8977,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 5), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8997,7 +8986,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 13), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9006,26 +8995,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 19), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 24), { 0, 0, height }, { 28, 32, 3 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -9034,7 +9023,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 20), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9043,7 +9032,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 1), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9052,31 +9041,31 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 7), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 14), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -9085,33 +9074,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 21), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 2), { 0, 0, height }, { 16, 32, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 8), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 15), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -9120,13 +9109,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 22), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 3), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9135,27 +9124,27 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 10), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 16), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -9164,33 +9153,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 23), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 4), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 11), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 17), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -9199,13 +9188,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 24), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 5), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9214,7 +9203,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 13), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -9223,21 +9212,21 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 19), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightHalfBankedHelixUpLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9249,13 +9238,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 25), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 30), { 0, 0, height }, { 32, 32, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9264,7 +9253,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 37), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -9273,20 +9262,20 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 45), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9295,33 +9284,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 26), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 31), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 38), { 0, 0, height }, { 33, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 46), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -9330,13 +9319,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 27), { 0, 0, height }, { 34, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 32), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9345,27 +9334,27 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 40), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 47), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -9374,33 +9363,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 28), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 33), { 0, 0, height }, { 16, 32, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 41), { 0, 0, height }, { 16, 33, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 48), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -9409,7 +9398,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 29), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9418,7 +9407,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 35), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9427,26 +9416,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 43), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 49), { 0, 0, height }, { 32, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -9455,7 +9444,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 30), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9464,7 +9453,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 37), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9473,31 +9462,31 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 45), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 25), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -9506,33 +9495,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 31), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 38), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 46), { 0, 0, height }, { 16, 32, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 26), { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -9541,7 +9530,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 32), { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9550,33 +9539,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 40), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 28 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 47), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 27), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -9585,33 +9574,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 33), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 41), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 28 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 48), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 28), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -9623,7 +9612,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 35), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -9632,33 +9621,33 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 43), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 49), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_LARGE_HELIX + 29), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixDownLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -9671,7 +9660,7 @@ namespace HybridRC } static void TrackRightHalfBankedHelixDownLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -9684,7 +9673,7 @@ namespace HybridRC } static void TrackLeftBarrelRollUpToDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9725,13 +9714,13 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 40 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9769,9 +9758,9 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 40 }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -9812,21 +9801,21 @@ namespace HybridRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackRightBarrelRollUpToDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9867,13 +9856,13 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 40 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9911,9 +9900,9 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 40 }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -9951,38 +9940,38 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 56 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackLeftBarrelRollDownToUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBarrelRollDownToUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10020,12 +10009,12 @@ namespace HybridRC if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -10057,13 +10046,13 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_general_support_height(session, height + 48, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10104,25 +10093,25 @@ namespace HybridRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackRightZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10159,12 +10148,12 @@ namespace HybridRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -10196,13 +10185,13 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 40 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10243,39 +10232,39 @@ namespace HybridRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackLeftZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftZeroGRollUp(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightZeroGRollUp(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftLargeZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10312,12 +10301,12 @@ namespace HybridRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -10352,10 +10341,10 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -10393,14 +10382,14 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_general_support_height(session, height + 64, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -10441,25 +10430,25 @@ namespace HybridRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackRightLargeZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10496,12 +10485,12 @@ namespace HybridRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -10536,10 +10525,10 @@ namespace HybridRC { 0, 0, height }, { 32, 0, 96 }, { 0, 30, height }); break; } - 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(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -10578,13 +10567,13 @@ namespace HybridRC break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -10625,39 +10614,39 @@ namespace HybridRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackLeftLargeZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftLargeZeroGRollUp(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightLargeZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightLargeZeroGRollUp(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegToInvertedFlatQuarterLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10698,8 +10687,8 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 48 }, { 0, 32, height + 8 }); 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 + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -10737,9 +10726,9 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 64 }, { 0, 32, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -10777,39 +10766,39 @@ namespace HybridRC { 0, 0, height }, { 32, 1, 32 }, { 0, 32, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackInvertedFlatTo90DegQuarterLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, trackElement); } static void Trackbrakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_BRAKE + (direction & 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackOnRidePhoto( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintAddImageAsParentRotated( @@ -10818,14 +10807,14 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_FLAT + (direction & 1)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackFlatTo60DegUpLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10854,14 +10843,14 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilPushTunnelRotated(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 + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -10887,10 +10876,10 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10916,10 +10905,10 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -10945,25 +10934,25 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, direction & 1, 62 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_SQUARE_8); 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 + 80, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } static void Track60DegUpToFlatLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10992,14 +10981,14 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: switch (direction) @@ -11025,10 +11014,10 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -11054,10 +11043,10 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11083,85 +11072,85 @@ namespace HybridRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, direction & 1, 78 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); 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 + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackFlatTo60DegDownLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlatLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackBlockBrakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_BLOCK_BRAKE + (direction & 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void Trackbooster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_BOOSTER + (direction & 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void Trackpowered_lift( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_POWERED_LIFT + direction), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11173,7 +11162,7 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 0), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11182,51 +11171,50 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 3), { 0, 6, height }, { 34, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 5), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 7), { 0, 6, height }, { 32, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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 + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11235,44 +11223,44 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 1), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 4), { 6, 0, height }, { 20, 34, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 6), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 8), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); 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 + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11284,14 +11272,14 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 9), { 0, 6, height }, { 32, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 11), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11302,46 +11290,45 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 14), { 0, 6, height }, { 34, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 16), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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 + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11351,47 +11338,47 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 10), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 12), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 15), { 6, 0, height }, { 20, 34, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 17), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); 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 + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11404,60 +11391,59 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 12), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 15), { 0, 6, height }, { 34, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 17), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 10), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11467,7 +11453,7 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 11), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -11478,39 +11464,39 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 14), { 6, 0, height }, { 1, 34, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 16), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 9), { 6, 0, height }, { 32, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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 + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11522,57 +11508,56 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 8), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 1), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 4), { 0, 6, height }, { 34, 20, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 6), { 0, 6, height }, { 32, 20, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11581,13 +11566,13 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 7), { 6, 0, height }, { 32, 32, 3 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 0), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11596,26 +11581,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 3), { 6, 0, height }, { 1, 34, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 5), { 6, 0, height }, { 20, 32, 3 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); 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 + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 61f4d89754..869ace00a5 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x00890CB4 */ static void inverted_hairpin_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -68,21 +68,21 @@ static void inverted_hairpin_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00890D84, 0x00890D94, 0x00890DA4 */ static void inverted_hairpin_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -103,14 +103,14 @@ static void inverted_hairpin_rc_track_station( { 32, 20, 1 }, { 0, 6, height + 24 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 11); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00890CC4 */ static void inverted_hairpin_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -166,26 +166,26 @@ static void inverted_hairpin_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -193,18 +193,18 @@ static void inverted_hairpin_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00890CD4 */ static void inverted_hairpin_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -261,20 +261,20 @@ static void inverted_hairpin_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x00890CE4 */ static void inverted_hairpin_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -330,26 +330,26 @@ static void inverted_hairpin_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -357,18 +357,18 @@ static void inverted_hairpin_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x00890CF4 */ static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -437,20 +437,20 @@ static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x00890D04 */ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -518,26 +518,26 @@ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -545,18 +545,18 @@ static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x00890D14 */ static void inverted_hairpin_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -612,26 +612,26 @@ static void inverted_hairpin_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -639,18 +639,18 @@ static void inverted_hairpin_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x00890D24 */ static void inverted_hairpin_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_hairpin_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -658,7 +658,7 @@ static void inverted_hairpin_rc_track_25_deg_down( /** rct2: 0x00890D34 */ static void inverted_hairpin_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_hairpin_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -666,7 +666,7 @@ static void inverted_hairpin_rc_track_60_deg_down( /** rct2: 0x00890D44 */ static void inverted_hairpin_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -674,7 +674,7 @@ static void inverted_hairpin_rc_track_flat_to_25_deg_down( /** rct2: 0x00890D54 */ static void inverted_hairpin_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -682,7 +682,7 @@ static void inverted_hairpin_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x00890D64 */ static void inverted_hairpin_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -690,7 +690,7 @@ static void inverted_hairpin_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x00890D74 */ static void inverted_hairpin_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -698,7 +698,7 @@ static void inverted_hairpin_rc_track_25_deg_down_to_flat( /** rct2: 0x00890DB4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -728,20 +728,20 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -767,9 +767,9 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -796,29 +796,29 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00890DC4 */ static void inverted_hairpin_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -827,7 +827,7 @@ static void inverted_hairpin_rc_track_right_quarter_turn_3( /** rct2: 0x00890DD4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -857,23 +857,23 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -900,29 +900,29 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x00890DE4 */ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -952,23 +952,23 @@ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -995,29 +995,29 @@ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x00890DF4 */ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1027,7 +1027,7 @@ static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x00890E04 */ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1037,7 +1037,7 @@ static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x00890E64 */ static void inverted_hairpin_rc_track_left_quarter_turn_1( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1064,30 +1064,29 @@ static void inverted_hairpin_rc_track_left_quarter_turn_1( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_0); - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00890E74 */ static void inverted_hairpin_rc_track_right_quarter_turn_1( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -1095,7 +1094,7 @@ static void inverted_hairpin_rc_track_right_quarter_turn_1( /** rct2: 0x00890E24 */ static void inverted_hairpin_rc_track_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -1164,20 +1163,20 @@ static void inverted_hairpin_rc_track_flat_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x00890E34 */ static void inverted_hairpin_rc_track_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -1245,42 +1244,42 @@ static void inverted_hairpin_rc_track_60_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00890E44 */ static void inverted_hairpin_rc_track_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1288,7 +1287,7 @@ static void inverted_hairpin_rc_track_flat_to_60_deg_down( /** rct2: 0x00890E54 */ static void inverted_hairpin_rc_track_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1296,7 +1295,7 @@ static void inverted_hairpin_rc_track_60_deg_down_to_flat( /** rct2: 0x00890E14 */ static void inverted_hairpin_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1315,21 +1314,21 @@ static void inverted_hairpin_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00890E84 */ static void inverted_hairpin_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1348,16 +1347,16 @@ static void inverted_hairpin_rc_track_block_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_inverted_hairpin_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index d9dac5279a..48b4e1aff3 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008B0460 */ static void inverted_impulse_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -39,21 +39,21 @@ static void inverted_impulse_rc_track_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008B0470, 0x008B0480, 0x008B0490 */ static void inverted_impulse_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -74,14 +74,14 @@ static void inverted_impulse_rc_track_station( { 32, 20, 3 }, { 0, 6, height + 29 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 11); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008B04A0 */ static void inverted_impulse_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -108,26 +108,26 @@ static void inverted_impulse_rc_track_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -135,18 +135,18 @@ static void inverted_impulse_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008B04B0 */ static void inverted_impulse_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -174,20 +174,20 @@ static void inverted_impulse_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } /** rct2: 0x008B04C0 */ static void inverted_impulse_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -214,42 +214,42 @@ static void inverted_impulse_rc_track_flat_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008B04D0 */ static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -283,20 +283,20 @@ static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008B04E0 */ static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -330,20 +330,20 @@ static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008B04F0 */ static void inverted_impulse_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -370,42 +370,42 @@ static void inverted_impulse_rc_track_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008B0500 */ static void inverted_impulse_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_impulse_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -413,7 +413,7 @@ static void inverted_impulse_rc_track_25_deg_down( /** rct2: 0x008B0510 */ static void inverted_impulse_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_impulse_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -421,7 +421,7 @@ static void inverted_impulse_rc_track_60_deg_down( /** rct2: 0x008B0520 */ static void inverted_impulse_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -429,7 +429,7 @@ static void inverted_impulse_rc_track_flat_to_25_deg_down( /** rct2: 0x008B0530 */ static void inverted_impulse_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -437,7 +437,7 @@ static void inverted_impulse_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008B0540 */ static void inverted_impulse_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -445,7 +445,7 @@ static void inverted_impulse_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008B0550 */ static void inverted_impulse_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -453,7 +453,7 @@ static void inverted_impulse_rc_track_25_deg_down_to_flat( /** rct2: 0x008B05A0 */ static void inverted_impulse_rc_track_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -482,10 +482,10 @@ static void inverted_impulse_rc_track_90_deg_up( { 32, 20, 3 }, { 0, 6, height + 61 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -494,7 +494,7 @@ static void inverted_impulse_rc_track_90_deg_up( /** rct2: 0x008B05B0 */ static void inverted_impulse_rc_track_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_impulse_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -502,7 +502,7 @@ static void inverted_impulse_rc_track_90_deg_down( /** rct2: 0x008B0560 */ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -533,12 +533,12 @@ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: break; @@ -547,7 +547,7 @@ static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008B0570 */ static void inverted_impulse_rc_track_90_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -555,7 +555,7 @@ static void inverted_impulse_rc_track_90_deg_down_to_60_deg_down( /** rct2: 0x008B0580 */ static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -584,20 +584,20 @@ static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_INVERTED_5); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_INVERTED_5); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } /** rct2: 0x008B0590 */ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -628,11 +628,11 @@ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -641,7 +641,7 @@ static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008B05C0 */ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -679,10 +679,10 @@ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( { 32, 2, 31 }, { 0, 4, height + 11 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -691,7 +691,7 @@ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up( /** rct2: 0x008B05D0 */ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -729,10 +729,10 @@ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( { 32, 20, 3 }, { 0, 6, height + 125 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -741,7 +741,7 @@ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up( /** rct2: 0x008B05E0 */ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -750,7 +750,7 @@ static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_down( /** rct2: 0x008B05F0 */ static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( diff --git a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp index 58a095f56d..73122405f7 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008A92E8 */ static void inverted_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -60,20 +60,20 @@ static void inverted_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A9558, 0x008A9568, 0x008A9578 */ static void inverted_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -94,14 +94,14 @@ static void inverted_rc_track_station( { 32, 20, 3 }, { 0, 6, height + 29 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 3); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A92F8 */ static void inverted_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -157,26 +157,26 @@ static void inverted_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -184,18 +184,18 @@ static void inverted_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9308 */ static void inverted_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -223,20 +223,20 @@ static void inverted_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } /** rct2: 0x008A9318 */ static void inverted_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -292,26 +292,26 @@ static void inverted_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -319,18 +319,18 @@ static void inverted_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A9328 */ static void inverted_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -364,20 +364,20 @@ static void inverted_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008A9338 */ static void inverted_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -410,26 +410,26 @@ static void inverted_rc_track_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -437,18 +437,18 @@ static void inverted_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008A9348 */ static void inverted_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -504,26 +504,26 @@ static void inverted_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -531,18 +531,18 @@ static void inverted_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A9358 */ static void inverted_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -550,7 +550,7 @@ static void inverted_rc_track_25_deg_down( /** rct2: 0x008A9368 */ static void inverted_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -558,7 +558,7 @@ static void inverted_rc_track_60_deg_down( /** rct2: 0x008A9378 */ static void inverted_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -566,7 +566,7 @@ static void inverted_rc_track_flat_to_25_deg_down( /** rct2: 0x008A9388 */ static void inverted_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -574,7 +574,7 @@ static void inverted_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A9398 */ static void inverted_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -582,7 +582,7 @@ static void inverted_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A93A8 */ static void inverted_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -590,7 +590,7 @@ static void inverted_rc_track_25_deg_down_to_flat( /** rct2: 0x008A93B8 */ static void inverted_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -620,20 +620,19 @@ static void inverted_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -659,12 +658,11 @@ static void inverted_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -690,12 +688,12 @@ static void inverted_rc_track_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -721,12 +719,11 @@ static void inverted_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -753,29 +750,28 @@ static void inverted_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A93C8 */ static void inverted_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -784,7 +780,7 @@ static void inverted_rc_track_right_quarter_turn_5( /** rct2: 0x008A93D8 */ static void inverted_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -811,22 +807,22 @@ static void inverted_rc_track_flat_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A93E8 */ static void inverted_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -853,22 +849,22 @@ static void inverted_rc_track_flat_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A93F8 */ static void inverted_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -895,22 +891,22 @@ static void inverted_rc_track_left_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A9408 */ static void inverted_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -937,22 +933,22 @@ static void inverted_rc_track_right_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A9418 */ static void inverted_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -982,20 +978,19 @@ static void inverted_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1021,12 +1016,11 @@ static void inverted_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -1052,12 +1046,12 @@ static void inverted_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -1083,12 +1077,11 @@ static void inverted_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -1115,29 +1108,28 @@ static void inverted_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9428 */ static void inverted_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1146,7 +1138,7 @@ static void inverted_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008A9438 */ static void inverted_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1173,28 +1165,28 @@ static void inverted_rc_track_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1202,18 +1194,18 @@ static void inverted_rc_track_left_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A9448 */ static void inverted_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1240,28 +1232,28 @@ static void inverted_rc_track_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1269,18 +1261,18 @@ static void inverted_rc_track_right_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A9458 */ static void inverted_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1307,28 +1299,28 @@ static void inverted_rc_track_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1336,18 +1328,18 @@ static void inverted_rc_track_25_deg_up_to_left_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A9468 */ static void inverted_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1374,28 +1366,28 @@ static void inverted_rc_track_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1403,18 +1395,18 @@ static void inverted_rc_track_25_deg_up_to_right_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A9478 */ static void inverted_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1422,7 +1414,7 @@ static void inverted_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008A9488 */ static void inverted_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1430,7 +1422,7 @@ static void inverted_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008A9498 */ static void inverted_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1438,7 +1430,7 @@ static void inverted_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008A94A8 */ static void inverted_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1446,7 +1438,7 @@ static void inverted_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008A94B8 */ static void inverted_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1473,22 +1465,22 @@ static void inverted_rc_track_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A94C8 */ static void inverted_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1496,7 +1488,7 @@ static void inverted_rc_track_right_bank( /** rct2: 0x008A94D8 */ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1526,20 +1518,19 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -1565,12 +1556,11 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -1596,12 +1586,12 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -1627,12 +1617,11 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -1659,29 +1648,28 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A94E8 */ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1711,20 +1699,19 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -1750,12 +1737,11 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -1781,12 +1767,12 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -1812,12 +1798,11 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -1844,29 +1829,28 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A94F8 */ static void inverted_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1875,7 +1859,7 @@ static void inverted_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008A9508 */ static void inverted_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1884,7 +1868,7 @@ static void inverted_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008A9518 */ static void inverted_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1914,16 +1898,15 @@ static void inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1950,24 +1933,23 @@ static void inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1994,24 +1976,23 @@ static void inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2038,28 +2019,27 @@ static void inverted_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9528 */ static void inverted_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2089,16 +2069,15 @@ static void inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2125,24 +2104,23 @@ static void inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2169,24 +2147,23 @@ static void inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2213,28 +2190,27 @@ static void inverted_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9538 */ static void inverted_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2264,37 +2240,37 @@ static void inverted_rc_track_left_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -2320,8 +2296,8 @@ static void inverted_rc_track_left_vertical_loop( { 2, 2, 3 }, { 29, 20, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -2347,9 +2323,9 @@ static void inverted_rc_track_left_vertical_loop( { 2, 2, 119 }, { 29, 29, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2375,18 +2351,17 @@ static void inverted_rc_track_left_vertical_loop( { 2, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 6: switch (direction) @@ -2412,12 +2387,11 @@ static void inverted_rc_track_left_vertical_loop( { 2, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 7: switch (direction) @@ -2443,9 +2417,9 @@ static void inverted_rc_track_left_vertical_loop( { 32, 2, 119 }, { 0, -6, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2471,8 +2445,8 @@ static void inverted_rc_track_left_vertical_loop( { 32, 2, 63 }, { 0, 29, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: switch (direction) @@ -2499,28 +2473,28 @@ static void inverted_rc_track_left_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2528,20 +2502,20 @@ static void inverted_rc_track_left_vertical_loop( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_INVERTED_4); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_INVERTED_4); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A9548 */ static void inverted_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2571,37 +2545,37 @@ static void inverted_rc_track_right_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -2627,8 +2601,8 @@ static void inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 29, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -2654,9 +2628,9 @@ static void inverted_rc_track_right_vertical_loop( { 5, 2, 119 }, { 16, 29, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2682,18 +2656,17 @@ static void inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 6: switch (direction) @@ -2719,12 +2692,11 @@ static void inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 0, height - 6 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 7: switch (direction) @@ -2750,9 +2722,9 @@ static void inverted_rc_track_right_vertical_loop( { 4, 2, 119 }, { 10, 0, height + 2 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2778,8 +2750,8 @@ static void inverted_rc_track_right_vertical_loop( { 32, 2, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: switch (direction) @@ -2806,28 +2778,28 @@ static void inverted_rc_track_right_vertical_loop( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2835,20 +2807,20 @@ static void inverted_rc_track_right_vertical_loop( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_INVERTED_4); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_INVERTED_4); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A9588 */ static void inverted_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2878,20 +2850,19 @@ static void inverted_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2917,9 +2888,9 @@ static void inverted_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2946,29 +2917,28 @@ static void inverted_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9598 */ static void inverted_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2977,7 +2947,7 @@ static void inverted_rc_track_right_quarter_turn_3( /** rct2: 0x008A95A8 */ static void inverted_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3007,20 +2977,19 @@ static void inverted_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3046,9 +3015,9 @@ static void inverted_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -3075,29 +3044,28 @@ static void inverted_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A95B8 */ static void inverted_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3106,7 +3074,7 @@ static void inverted_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008A95C8 */ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3136,23 +3104,22 @@ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3179,29 +3146,28 @@ static void inverted_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A95D8 */ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3231,23 +3197,22 @@ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3274,29 +3239,28 @@ static void inverted_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A95E8 */ static void inverted_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3305,7 +3269,7 @@ static void inverted_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008A95F8 */ static void inverted_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3314,7 +3278,7 @@ static void inverted_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008A9608 */ static void inverted_rc_track_left_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3344,19 +3308,17 @@ static void inverted_rc_track_left_twist_down_to_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3382,12 +3344,11 @@ static void inverted_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3413,29 +3374,28 @@ static void inverted_rc_track_left_twist_down_to_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9618 */ static void inverted_rc_track_right_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3465,19 +3425,17 @@ static void inverted_rc_track_right_twist_down_to_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3503,12 +3461,11 @@ static void inverted_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3534,29 +3491,28 @@ static void inverted_rc_track_right_twist_down_to_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9628 */ static void inverted_rc_track_left_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3585,17 +3541,16 @@ static void inverted_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3621,12 +3576,11 @@ static void inverted_rc_track_left_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3653,31 +3607,29 @@ static void inverted_rc_track_left_twist_up_to_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9638 */ static void inverted_rc_track_right_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3706,17 +3658,16 @@ static void inverted_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3742,12 +3693,11 @@ static void inverted_rc_track_right_twist_up_to_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3774,31 +3724,29 @@ static void inverted_rc_track_right_twist_up_to_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9648 */ static void inverted_rc_track_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3828,33 +3776,33 @@ static void inverted_rc_track_half_loop_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -3880,8 +3828,8 @@ static void inverted_rc_track_half_loop_up( { 2, 2, 3 }, { 29, 20, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -3907,12 +3855,11 @@ static void inverted_rc_track_half_loop_up( { 2, 2, 119 }, { 29, 29, height + 2 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -3940,18 +3887,18 @@ static void inverted_rc_track_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A9658 */ static void inverted_rc_track_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); @@ -3959,7 +3906,7 @@ static void inverted_rc_track_half_loop_down( /** rct2: 0x008A9668 */ static void inverted_rc_track_left_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3989,19 +3936,18 @@ static void inverted_rc_track_left_corkscrew_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -4027,8 +3973,8 @@ static void inverted_rc_track_left_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 24 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4054,30 +4000,29 @@ static void inverted_rc_track_left_corkscrew_up( { 20, 32, 3 }, { 6, 0, height + 39 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 40, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 40, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A9678 */ static void inverted_rc_track_right_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4107,19 +4052,18 @@ static void inverted_rc_track_right_corkscrew_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -4145,8 +4089,8 @@ static void inverted_rc_track_right_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 24 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4172,30 +4116,29 @@ static void inverted_rc_track_right_corkscrew_up( { 20, 32, 3 }, { 6, 0, height + 39 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 40, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height + 40, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 40, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A9688 */ static void inverted_rc_track_left_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); @@ -4203,7 +4146,7 @@ static void inverted_rc_track_left_corkscrew_down( /** rct2: 0x008A9698 */ static void inverted_rc_track_right_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { inverted_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); @@ -4211,7 +4154,7 @@ static void inverted_rc_track_right_corkscrew_down( /** rct2: 0x008A96D8 */ static void inverted_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4250,13 +4193,13 @@ static void inverted_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A96B8 */ static void inverted_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4296,13 +4239,13 @@ static void inverted_rc_track_right_quarter_turn_1_60_deg_up( } track_paint_util_right_quarter_turn_1_tile_tunnel( session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A96C8 */ static void inverted_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -4310,7 +4253,7 @@ static void inverted_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008A96E8 */ static void inverted_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -4318,7 +4261,7 @@ static void inverted_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008A96A8 */ static void inverted_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4337,20 +4280,20 @@ static void inverted_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A96F8 */ static void inverted_rc_track_left_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4380,20 +4323,19 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4419,12 +4361,11 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4450,12 +4391,12 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -4481,12 +4422,11 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4513,29 +4453,28 @@ static void inverted_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9708 */ static void inverted_rc_track_right_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4565,20 +4504,19 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4604,12 +4542,11 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4635,12 +4572,12 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -4666,12 +4603,11 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4698,29 +4634,28 @@ static void inverted_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9718 */ static void inverted_rc_track_left_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4750,20 +4685,19 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4789,12 +4723,11 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4820,12 +4753,12 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -4851,12 +4784,11 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4883,29 +4815,28 @@ static void inverted_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9728 */ static void inverted_rc_track_right_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4935,20 +4866,19 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4974,12 +4904,11 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -5005,12 +4934,12 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -5036,12 +4965,11 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -5068,29 +4996,28 @@ static void inverted_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9A38 */ static void inverted_rc_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5117,26 +5044,26 @@ static void inverted_rc_track_25_deg_up_left_banked( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5144,18 +5071,18 @@ static void inverted_rc_track_25_deg_up_left_banked( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9A48 */ static void inverted_rc_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5182,26 +5109,26 @@ static void inverted_rc_track_25_deg_up_right_banked( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5209,18 +5136,18 @@ static void inverted_rc_track_25_deg_up_right_banked( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9738 */ static void inverted_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5228,8 +5155,8 @@ static void inverted_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27129), { 0, 0, height + 29 }, { 32, 20, 3 }, { 0, 6, height + 29 }); @@ -5237,8 +5164,8 @@ static void inverted_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27130), { 0, 0, height + 29 }, { 32, 20, 3 }, { 0, 6, height + 29 }); @@ -5246,8 +5173,8 @@ static void inverted_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27129), { 0, 0, height + 29 }, { 32, 20, 3 }, { 0, 6, height + 29 }); @@ -5255,22 +5182,22 @@ static void inverted_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27130), { 0, 0, height + 29 }, { 32, 20, 3 }, { 0, 6, height + 29 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A9A58 */ static void inverted_rc_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5278,7 +5205,7 @@ static void inverted_rc_track_25_deg_down_left_banked( /** rct2: 0x008A9A68 */ static void inverted_rc_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5286,7 +5213,7 @@ static void inverted_rc_track_25_deg_down_right_banked( /** rct2: 0x008A9748 */ static void inverted_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5316,16 +5243,15 @@ static void inverted_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5351,12 +5277,11 @@ static void inverted_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5382,15 +5307,15 @@ static void inverted_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -5417,39 +5342,38 @@ static void inverted_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9758 */ static void inverted_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5479,16 +5403,15 @@ static void inverted_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5514,12 +5437,11 @@ static void inverted_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5545,15 +5467,15 @@ static void inverted_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -5580,39 +5502,38 @@ static void inverted_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9768 */ static void inverted_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5621,7 +5542,7 @@ static void inverted_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008A9778 */ static void inverted_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5630,7 +5551,7 @@ static void inverted_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008A9938 */ static void inverted_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5660,16 +5581,15 @@ static void inverted_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5695,12 +5615,11 @@ static void inverted_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5726,15 +5645,15 @@ static void inverted_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -5761,39 +5680,39 @@ static void inverted_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9948 */ static void inverted_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5823,16 +5742,15 @@ static void inverted_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5858,12 +5776,11 @@ static void inverted_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5889,15 +5806,15 @@ static void inverted_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -5924,39 +5841,39 @@ static void inverted_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9958 */ static void inverted_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5965,7 +5882,7 @@ static void inverted_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008A9968 */ static void inverted_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5974,7 +5891,7 @@ static void inverted_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008A9788 */ static void inverted_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6002,9 +5919,9 @@ static void inverted_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6029,9 +5946,9 @@ static void inverted_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6056,9 +5973,9 @@ static void inverted_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6084,36 +6001,36 @@ static void inverted_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A97B8 */ static void inverted_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6141,9 +6058,9 @@ static void inverted_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6168,9 +6085,9 @@ static void inverted_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6195,9 +6112,9 @@ static void inverted_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6223,36 +6140,36 @@ static void inverted_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A9818 */ static void inverted_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6266,9 +6183,9 @@ static void inverted_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: switch (direction) @@ -6279,9 +6196,9 @@ static void inverted_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: switch (direction) @@ -6292,9 +6209,9 @@ static void inverted_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: switch (direction) @@ -6306,36 +6223,36 @@ static void inverted_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 32, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 36, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 32, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 36, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } } /** rct2: 0x008A9798 */ static void inverted_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6363,9 +6280,9 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6390,9 +6307,9 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6417,9 +6334,9 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6445,36 +6362,36 @@ static void inverted_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A97F8 */ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6488,9 +6405,9 @@ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -6501,9 +6418,9 @@ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -6514,9 +6431,9 @@ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -6528,36 +6445,36 @@ static void inverted_rc_track_diag_25_deg_up_to_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A9808 */ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6571,9 +6488,9 @@ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -6584,9 +6501,9 @@ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -6597,9 +6514,9 @@ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -6611,36 +6528,36 @@ static void inverted_rc_track_diag_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A97A8 */ static void inverted_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6668,9 +6585,9 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6695,9 +6612,9 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6722,9 +6639,9 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6750,36 +6667,36 @@ static void inverted_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A97E8 */ static void inverted_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6807,9 +6724,9 @@ static void inverted_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6834,9 +6751,9 @@ static void inverted_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6861,9 +6778,9 @@ static void inverted_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6889,36 +6806,36 @@ static void inverted_rc_track_diag_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A9848 */ static void inverted_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6932,9 +6849,9 @@ static void inverted_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: switch (direction) @@ -6945,9 +6862,9 @@ static void inverted_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: switch (direction) @@ -6958,9 +6875,9 @@ static void inverted_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: switch (direction) @@ -6972,36 +6889,36 @@ static void inverted_rc_track_diag_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 24, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 28, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 24, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 28, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } } /** rct2: 0x008A97C8 */ static void inverted_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7029,8 +6946,8 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7055,8 +6972,8 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7081,8 +6998,8 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7108,36 +7025,36 @@ static void inverted_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9828 */ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7151,9 +7068,9 @@ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -7164,9 +7081,9 @@ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -7177,9 +7094,9 @@ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -7191,36 +7108,36 @@ static void inverted_rc_track_diag_25_deg_down_to_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A9838 */ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7234,9 +7151,9 @@ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -7247,9 +7164,9 @@ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -7260,9 +7177,9 @@ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -7274,36 +7191,36 @@ static void inverted_rc_track_diag_60_deg_down_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A97D8 */ static void inverted_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7331,9 +7248,9 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7358,9 +7275,9 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7385,9 +7302,9 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7413,36 +7330,36 @@ static void inverted_rc_track_diag_25_deg_down_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A9878 */ static void inverted_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7456,9 +7373,9 @@ static void inverted_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7469,9 +7386,9 @@ static void inverted_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7482,9 +7399,9 @@ static void inverted_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7496,37 +7413,37 @@ static void inverted_rc_track_diag_flat_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9888 */ static void inverted_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7540,9 +7457,9 @@ static void inverted_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7553,9 +7470,9 @@ static void inverted_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7566,9 +7483,9 @@ static void inverted_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7580,37 +7497,37 @@ static void inverted_rc_track_diag_flat_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9898 */ static void inverted_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7624,9 +7541,9 @@ static void inverted_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7637,9 +7554,9 @@ static void inverted_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7650,9 +7567,9 @@ static void inverted_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7664,37 +7581,37 @@ static void inverted_rc_track_diag_left_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A98A8 */ static void inverted_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7708,9 +7625,9 @@ static void inverted_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7721,9 +7638,9 @@ static void inverted_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7734,9 +7651,9 @@ static void inverted_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7748,37 +7665,37 @@ static void inverted_rc_track_diag_right_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A98D8 */ static void inverted_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7792,9 +7709,9 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -7805,9 +7722,9 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -7818,9 +7735,9 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -7832,36 +7749,36 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A98E8 */ static void inverted_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7875,9 +7792,9 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -7888,9 +7805,9 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -7901,9 +7818,9 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -7915,36 +7832,36 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A98B8 */ static void inverted_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7958,9 +7875,9 @@ static void inverted_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -7971,9 +7888,9 @@ static void inverted_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -7984,9 +7901,9 @@ static void inverted_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -7998,36 +7915,36 @@ static void inverted_rc_track_diag_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A98C8 */ static void inverted_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8041,9 +7958,9 @@ static void inverted_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -8054,9 +7971,9 @@ static void inverted_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8067,9 +7984,9 @@ static void inverted_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8081,36 +7998,36 @@ static void inverted_rc_track_diag_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A98F8 */ static void inverted_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8124,8 +8041,8 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8136,8 +8053,8 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8148,8 +8065,8 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8161,36 +8078,36 @@ static void inverted_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9908 */ static void inverted_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8204,8 +8121,8 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8216,8 +8133,8 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8228,8 +8145,8 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8241,36 +8158,36 @@ static void inverted_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9918 */ static void inverted_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8284,9 +8201,9 @@ static void inverted_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -8297,9 +8214,9 @@ static void inverted_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -8310,9 +8227,9 @@ static void inverted_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -8324,36 +8241,36 @@ static void inverted_rc_track_diag_25_deg_down_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A9928 */ static void inverted_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8367,9 +8284,9 @@ static void inverted_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -8380,9 +8297,9 @@ static void inverted_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -8393,9 +8310,9 @@ static void inverted_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 37 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -8407,36 +8324,36 @@ static void inverted_rc_track_diag_25_deg_down_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A9858 */ static void inverted_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8450,9 +8367,9 @@ static void inverted_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8463,9 +8380,9 @@ static void inverted_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8476,9 +8393,9 @@ static void inverted_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -8490,37 +8407,37 @@ static void inverted_rc_track_diag_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9868 */ static void inverted_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8534,9 +8451,9 @@ static void inverted_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8547,9 +8464,9 @@ static void inverted_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8560,9 +8477,9 @@ static void inverted_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -8574,37 +8491,37 @@ static void inverted_rc_track_diag_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A9978 */ static void inverted_rc_track_left_large_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8635,11 +8552,11 @@ static void inverted_rc_track_left_large_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8665,9 +8582,9 @@ static void inverted_rc_track_left_large_half_loop_up( { 32, 20, 3 }, { 0, 6, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8693,12 +8610,11 @@ static void inverted_rc_track_left_large_half_loop_up( { 30, 16, height + 70 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -8724,12 +8640,11 @@ static void inverted_rc_track_left_large_half_loop_up( { 30, 16, height + 100 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -8755,9 +8670,9 @@ static void inverted_rc_track_left_large_half_loop_up( { 30, 0, height + 90 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -8783,12 +8698,11 @@ static void inverted_rc_track_left_large_half_loop_up( { 30, 0, height + 140 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -8797,48 +8711,47 @@ static void inverted_rc_track_left_large_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27645), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 32 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27652), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27659), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27666), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 32 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } /** rct2: 0x008A9988 */ static void inverted_rc_track_right_large_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8869,11 +8782,11 @@ static void inverted_rc_track_right_large_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8899,9 +8812,9 @@ static void inverted_rc_track_right_large_half_loop_up( { 32, 20, 3 }, { 0, 6, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8927,12 +8840,11 @@ static void inverted_rc_track_right_large_half_loop_up( { 32, 16, 3 }, { 0, 0, height + 70 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -8958,12 +8870,11 @@ static void inverted_rc_track_right_large_half_loop_up( { 32, 16, 3 }, { 0, 0, height + 100 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -8989,9 +8900,9 @@ static void inverted_rc_track_right_large_half_loop_up( { 30, 16, height + 110 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -9017,12 +8928,11 @@ static void inverted_rc_track_right_large_half_loop_up( { 30, 16, height + 140 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -9031,48 +8941,47 @@ static void inverted_rc_track_right_large_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27694), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 32 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27687), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27680), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(27673), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 32 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } /** rct2: 0x008A9998 */ static void inverted_rc_track_right_large_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 6 - trackSequence, direction, height, trackElement); @@ -9080,7 +8989,7 @@ static void inverted_rc_track_right_large_half_loop_down( /** rct2: 0x008A99A8 */ static void inverted_rc_track_left_large_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 6 - trackSequence, direction, height, trackElement); @@ -9088,7 +8997,7 @@ static void inverted_rc_track_left_large_half_loop_down( /** rct2: 0x008A96A8 */ static void inverted_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9107,20 +9016,20 @@ static void inverted_rc_track_block_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A9A78 */ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9150,23 +9059,22 @@ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9193,29 +9101,28 @@ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A9A88 */ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9245,23 +9152,22 @@ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9288,29 +9194,28 @@ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A9A98 */ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -9320,7 +9225,7 @@ static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008A9AA8 */ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -9330,7 +9235,7 @@ static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008A9BB8 */ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9360,20 +9265,19 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -9399,12 +9303,11 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -9430,12 +9333,12 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -9461,12 +9364,11 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -9493,29 +9395,28 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A9BC8 */ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9545,20 +9446,19 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -9584,12 +9484,11 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -9615,12 +9514,12 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -9646,12 +9545,11 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -9678,29 +9576,28 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A9BD8 */ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -9710,7 +9607,7 @@ static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008A9BE8 */ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -9720,7 +9617,7 @@ static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008A9AB8 */ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9747,26 +9644,26 @@ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9774,18 +9671,18 @@ static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9AC8 */ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9812,26 +9709,26 @@ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9839,18 +9736,18 @@ static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9AD8 */ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9877,26 +9774,26 @@ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9904,18 +9801,18 @@ static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9AE8 */ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9942,26 +9839,26 @@ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9969,18 +9866,18 @@ static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A9AF8 */ static void inverted_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9989,7 +9886,7 @@ static void inverted_rc_track_25_deg_down_to_left_banked_25_deg_down( /** rct2: 0x008A9B08 */ static void inverted_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9998,7 +9895,7 @@ static void inverted_rc_track_25_deg_down_to_right_banked_25_deg_down( /** rct2: 0x008A9B18 */ static void inverted_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10007,7 +9904,7 @@ static void inverted_rc_track_left_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008A9B28 */ static void inverted_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10016,7 +9913,7 @@ static void inverted_rc_track_right_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008A9B38 */ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10043,26 +9940,26 @@ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10070,18 +9967,18 @@ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A9B48 */ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10108,26 +10005,26 @@ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10135,18 +10032,18 @@ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A9B58 */ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10173,26 +10070,26 @@ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10200,18 +10097,18 @@ static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A9B68 */ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10238,26 +10135,26 @@ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10265,18 +10162,18 @@ static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A9B78 */ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10285,7 +10182,7 @@ static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_down( /** rct2: 0x008A9B88 */ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10294,7 +10191,7 @@ static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_down( /** rct2: 0x008A9B98 */ static void inverted_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10303,7 +10200,7 @@ static void inverted_rc_track_left_banked_25_deg_down_to_left_banked_flat( /** rct2: 0x008A9BA8 */ static void inverted_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -10312,7 +10209,7 @@ static void inverted_rc_track_right_banked_25_deg_down_to_right_banked_flat( /** rct2: 0x008A99B8 */ static void inverted_rc_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10339,26 +10236,26 @@ static void inverted_rc_track_flat_to_left_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10366,18 +10263,18 @@ static void inverted_rc_track_flat_to_left_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A99C8 */ static void inverted_rc_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10404,26 +10301,26 @@ static void inverted_rc_track_flat_to_right_banked_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10431,18 +10328,18 @@ static void inverted_rc_track_flat_to_right_banked_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A99D8 */ static void inverted_rc_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10469,26 +10366,26 @@ static void inverted_rc_track_left_banked_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10496,18 +10393,18 @@ static void inverted_rc_track_left_banked_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A99E8 */ static void inverted_rc_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10534,26 +10431,26 @@ static void inverted_rc_track_right_banked_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10561,18 +10458,18 @@ static void inverted_rc_track_right_banked_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A99F8 */ static void inverted_rc_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -10580,7 +10477,7 @@ static void inverted_rc_track_flat_to_left_banked_25_deg_down( /** rct2: 0x008A9A08 */ static void inverted_rc_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -10588,7 +10485,7 @@ static void inverted_rc_track_flat_to_right_banked_25_deg_down( /** rct2: 0x008A9A18 */ static void inverted_rc_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -10596,12 +10493,34 @@ static void inverted_rc_track_left_banked_25_deg_down_to_flat( /** rct2: 0x008A9A28 */ static void inverted_rc_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } +// Added by OpenRCT2 + +static void inverted_rc_track_booster( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + const auto imageId = (direction & 1) ? SPR_G2_BM_INVERT_BOOSTER_2 : SPR_G2_BM_INVERT_BOOSTER_1; + PaintAddImageAsParentRotated( + session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { 0, 0, height + 29 }, { 32, 20, 1 }, + { 0, 6, height + 29 }); + + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + } + + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); +} + TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int32_t trackType) { switch (trackType) @@ -10896,6 +10815,9 @@ TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int32_t trackType) return inverted_rc_track_left_banked_25_deg_down_to_flat; case TrackElemType::RightBankedDown25ToFlat: return inverted_rc_track_right_banked_25_deg_down_to_flat; + + case TrackElemType::Booster: + return inverted_rc_track_booster; } return nullptr; } diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 8cded14288..8a53f3d90a 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -605,37 +605,6 @@ enum SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_E_W = 28380, SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_S_N = 28381, SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_E_W_PART_0_2 = 28382, - - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_SW_NE = SPR_G2_BEGIN + 33, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NW_SE = SPR_G2_BEGIN + 34, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NE_SW = SPR_G2_BEGIN + 35, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_SE_NW = SPR_G2_BEGIN + 36, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NW_SE_PART_0_2 = SPR_G2_BEGIN + 37, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NE_SW_PART_0_2 = SPR_G2_BEGIN + 38, - - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_SW_NE = SPR_G2_BEGIN + 45, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NW_SE = SPR_G2_BEGIN + 46, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NE_SW = SPR_G2_BEGIN + 47, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_SE_NW = SPR_G2_BEGIN + 48, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NW_SE_PART_0_2 = SPR_G2_BEGIN + 49, - SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NE_SW_PART_0_2 = SPR_G2_BEGIN + 50, - - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_SW_NE = SPR_G2_BEGIN + 39, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NW_SE = SPR_G2_BEGIN + 40, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NE_SW = SPR_G2_BEGIN + 41, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_SE_NW = SPR_G2_BEGIN + 42, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NW_SE_PART_0_2 = SPR_G2_BEGIN + 43, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NE_SW_PART_0_2 = SPR_G2_BEGIN + 44, - - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_SW_NE = SPR_G2_BEGIN + 51, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NW_SE = SPR_G2_BEGIN + 52, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NE_SW = SPR_G2_BEGIN + 53, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_SE_NW = SPR_G2_BEGIN + 54, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NW_SE_PART_0_2 = SPR_G2_BEGIN + 55, - SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NE_SW_PART_0_2 = SPR_G2_BEGIN + 56, - - SPR_JUNIOR_RC_BOOSTER_NW_SE = SPR_G2_BEGIN + 83, - SPR_JUNIOR_RC_BOOSTER_NE_SW = SPR_G2_BEGIN + 84, }; static constexpr const uint32_t junior_rc_track_pieces_flat[3][4] = { @@ -1844,27 +1813,27 @@ static constexpr const uint32_t junior_rc_track_pieces_diag_60_deg_down_to_25_de }; void junior_rc_paint_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_flat[EnumValue(chainType)][direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } void junior_rc_paint_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, bool drawBlockBrake) { ImageId imageId; @@ -1875,7 +1844,7 @@ void junior_rc_paint_station( { // height -= 2 (height - 2) imageId = session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_B_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { { 0, 2, height }, { 32, 28, 1 } }); // height += 2 (height) if (trackElement.GetTrackType() == TrackElemType::EndStation && drawBlockBrake) @@ -1886,18 +1855,18 @@ void junior_rc_paint_station( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_station[false][direction]); } - PaintAddImageAsChild(session, imageId, { 0, 6, height }, { 32, 20, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 6, height }, { { 0, 0, height }, { 32, 20, 1 } }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else if (direction == 1 || direction == 3) { // height -= 2 (height - 2) imageId = session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_B_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { { 2, 0, height }, { 28, 32, 1 } }); // height += 2 (height) if (trackElement.GetTrackType() == TrackElemType::EndStation && drawBlockBrake) @@ -1908,21 +1877,21 @@ void junior_rc_paint_station( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_station[false][direction]); } - PaintAddImageAsChild(session, imageId, { 6, 0, height }, { 20, 32, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 6, 0, height }, { { 0, 0, height }, { 20, 32, 1 } }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } void junior_rc_paint_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex( @@ -1931,21 +1900,21 @@ void junior_rc_paint_track_25_deg_up( int8_t tunnelHeights[4] = { -8, 8, 8, -8 }; uint8_t tunnelType[4] = { TUNNEL_1, TUNNEL_2, TUNNEL_2, TUNNEL_1 }; - paint_util_push_tunnel_rotated(session, direction, height + tunnelHeights[direction], tunnelType[direction]); + PaintUtilPushTunnelRotated(session, direction, height + tunnelHeights[direction], tunnelType[direction]); if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t supportType = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } void junior_rc_paint_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex( @@ -1954,27 +1923,27 @@ void junior_rc_paint_track_flat_to_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t supportType = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; uint16_t ax = (direction == 0) ? 5 : 3; - metal_a_supports_paint_setup(session, supportType, 4, ax, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, ax, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } void junior_rc_paint_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex( @@ -1996,22 +1965,22 @@ void junior_rc_paint_track_25_deg_up_to_flat( if (direction & 1) { - paint_util_push_tunnel_right(session, tunnelHeight, tunnelType); + PaintUtilPushTunnelRight(session, tunnelHeight, tunnelType); } else { - paint_util_push_tunnel_left(session, tunnelHeight, tunnelType); + PaintUtilPushTunnelLeft(session, tunnelHeight, tunnelType); } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t supportType = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static constexpr const int8_t junior_rc_track_right_quarter_turn_5_tiles_support_height_offset[][7] = { @@ -2022,7 +1991,7 @@ static constexpr const int8_t junior_rc_track_right_quarter_turn_5_tiles_support }; static void junior_rc_right_quarter_turn_5_tiles_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -2034,12 +2003,12 @@ static void junior_rc_right_quarter_turn_5_tiles_paint_setup( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; case 6: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 0, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; @@ -2047,55 +2016,53 @@ static void junior_rc_right_quarter_turn_5_tiles_paint_setup( if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint8_t junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { @@ -2104,7 +2071,7 @@ static constexpr const uint8_t junior_rc_left_quarter_turn_5_tiles_to_right_turn /* rct2: 0x0051917A */ static void junior_rc_left_quarter_turn_5_tiles_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -2115,7 +2082,7 @@ static void junior_rc_left_quarter_turn_5_tiles_paint_setup( * rct2: 0x008AAFC0, 0x00521593, 0x005216A1, 0x005217AF, 0x00521884 */ static void junior_rc_flat_to_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -2123,15 +2090,15 @@ static void junior_rc_flat_to_left_bank_paint_setup( image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_flat_to_left_bank[direction][0]); if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); - paint_util_push_tunnel_right(session, height, 0); + PaintUtilPushTunnelRight(session, height, 0); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); - paint_util_push_tunnel_left(session, height, 0); + PaintUtilPushTunnelLeft(session, height, 0); } if (junior_rc_track_pieces_flat_to_left_bank[direction][1] != 0) @@ -2140,30 +2107,30 @@ static void junior_rc_flat_to_left_bank_paint_setup( if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); } } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** * rct2: 0x008AAFD0, 0x00521959, 0x00521A2E, 0x00521B03, 0x00521C11 */ static void junior_rc_flat_to_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -2171,15 +2138,15 @@ static void junior_rc_flat_to_right_bank_paint_setup( image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_flat_to_right_bank[direction][0]); if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); - paint_util_push_tunnel_right(session, height, 0); + PaintUtilPushTunnelRight(session, height, 0); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); - paint_util_push_tunnel_left(session, height, 0); + PaintUtilPushTunnelLeft(session, height, 0); } if (junior_rc_track_pieces_flat_to_right_bank[direction][1] != 0) @@ -2188,34 +2155,34 @@ static void junior_rc_flat_to_right_bank_paint_setup( if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); } } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void junior_rc_left_bank_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void junior_rc_right_bank_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -2285,7 +2252,7 @@ static constexpr const CoordsXYZ junior_rc_banked_right_quarter_turn_5_tiles_bou /* rct2: 0x008AB010, 0x0052304C */ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t thickness = 1; @@ -2301,24 +2268,24 @@ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( if (direction == 1 && trackSequence == 6) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_BANKED_QUARTER_TURN_5_TILES_NW_SW_PART_4_2); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); } else if (direction == 3 && trackSequence == 0) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_BANKED_QUARTER_TURN_5_TILES_SE_NE_PART_0_2); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); } int32_t supportHeight = height; switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; case 6: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 0, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; @@ -2326,60 +2293,58 @@ static void junior_rc_banked_right_quarter_turn_5_tiles_paint_setup( if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /* rct2: 0x008AB000 */ static void junior_rc_banked_left_quarter_turn_5_tiles_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -2391,7 +2356,7 @@ static void junior_rc_banked_left_quarter_turn_5_tiles_paint_setup( * rct2: 0x008AB020, 0x00522073, 0x00522182, 0x00522291, 0x00522367 */ static void junior_rc_left_bank_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -2399,11 +2364,11 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup( image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_left_banked_to_25_deg_up[direction][0]); if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); } if (junior_rc_track_pieces_left_banked_to_25_deg_up[direction][1] != 0) @@ -2412,46 +2377,46 @@ static void junior_rc_left_bank_to_25_deg_up_paint_setup( if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); } } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** * rct2: 0x008AB030, 0x0052243D, 0x00522513, 0x005225E9, 0x005226F8 */ static void junior_rc_right_bank_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -2459,11 +2424,11 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup( image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_right_banked_to_25_deg_up[direction][0]); if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); } if (junior_rc_track_pieces_right_banked_to_25_deg_up[direction][1] != 0) @@ -2472,46 +2437,46 @@ static void junior_rc_right_bank_to_25_deg_up_paint_setup( if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); } } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** * rct2: 0x008AB040, 0x00522807, 0x0052291A, 0x00522A2D, 0x00522B07 */ static void junior_rc_25_deg_up_to_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -2532,15 +2497,15 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup( image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_25_deg_up_to_left_bank[direction][0]); if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); - paint_util_push_tunnel_right(session, tunnelHeight, tunnelType); + PaintUtilPushTunnelRight(session, tunnelHeight, tunnelType); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); - paint_util_push_tunnel_left(session, tunnelHeight, tunnelType); + PaintUtilPushTunnelLeft(session, tunnelHeight, tunnelType); } if (junior_rc_track_pieces_25_deg_up_to_left_bank[direction][1] != 0) @@ -2549,30 +2514,30 @@ static void junior_rc_25_deg_up_to_left_bank_paint_setup( if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); } } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** * rct2: 0x008AB050, 0x00522BE1, 0x00522CBB, 0x00522D95, 0x00522EA8 */ static void junior_rc_25_deg_up_to_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -2593,15 +2558,15 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup( image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_25_deg_up_to_right_bank[direction][0]); if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); - paint_util_push_tunnel_right(session, tunnelHeight, tunnelType); + PaintUtilPushTunnelRight(session, tunnelHeight, tunnelType); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); - paint_util_push_tunnel_left(session, tunnelHeight, tunnelType); + PaintUtilPushTunnelLeft(session, tunnelHeight, tunnelType); } if (junior_rc_track_pieces_25_deg_up_to_right_bank[direction][1] != 0) @@ -2610,30 +2575,30 @@ static void junior_rc_25_deg_up_to_right_bank_paint_setup( if (direction & 1) { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); } else { - PaintAddImageAsParent(session, image_id, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); + PaintAddImageAsParent(session, image_id, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); } } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** * rct2: 0x008AB060 */ static void junior_rc_left_bank_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -2643,7 +2608,7 @@ static void junior_rc_left_bank_to_25_deg_down_paint_setup( * rct2: 0x008AB070 */ static void junior_rc_right_bank_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -2653,7 +2618,7 @@ static void junior_rc_right_bank_to_25_deg_down_paint_setup( * rct2: 0x008AB080 */ static void junior_rc_25_deg_down_to_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -2663,7 +2628,7 @@ static void junior_rc_25_deg_down_to_left_bank_paint_setup( * rct2: 0x008AB090 */ static void junior_rc_25_deg_down_to_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -2687,48 +2652,48 @@ 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; image_id = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_left_bank[direction]); PaintAddImageAsParent( - session, image_id, { 0, 0, height }, junior_rc_left_bank_bound_lengths[direction], - { junior_rc_left_bank_bound_offsets[direction], height }); + session, image_id, { 0, 0, height }, + { { junior_rc_left_bank_bound_offsets[direction], height }, junior_rc_left_bank_bound_lengths[direction] }); if (direction & 1) { - paint_util_push_tunnel_right(session, height, 0); + PaintUtilPushTunnelRight(session, height, 0); } else { - paint_util_push_tunnel_left(session, height, 0); + PaintUtilPushTunnelLeft(session, height, 0); } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** * rct2: 0x008AB0B0 */ static void junior_rc_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_left_bank_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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( @@ -2740,12 +2705,12 @@ void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, (direction == 0 || direction == 3) ? 10 : 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 6: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, supportSpecial[direction], height, session.TrackColours[SCHEME_SUPPORTS]); break; @@ -2753,62 +2718,60 @@ void junior_rc_paint_track_left_quarter_turn_5_tiles_25_deg_up( if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); } if (direction == 2 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); } if (direction == 3 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_C0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_C0, direction), 0xFFFF, 0); break; } if (trackSequence == 3) { - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } else { - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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( @@ -2820,12 +2783,12 @@ void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, supportSpecial[direction], height, session.TrackColours[SCHEME_SUPPORTS]); break; case 6: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; @@ -2833,63 +2796,61 @@ void junior_rc_paint_track_right_quarter_turn_5_tiles_25_deg_up( if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } if (trackSequence == 3) { - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } else { - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /* rct2: 0x008AAE10, 0x00519D88, 0x00519DAC, 0x00519DD0, 0x00519DF4 */ static void junior_rc_left_quarter_turn_5_tiles_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -2900,7 +2861,7 @@ static void junior_rc_left_quarter_turn_5_tiles_25_deg_up_paint_setup( /* rct2: 0x008AAE20, 0x00519E18, 0x0051A148, 0x0051A452, 0x0051A738 */ static void junior_rc_right_quarter_turn_5_tiles_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -2911,7 +2872,7 @@ static void junior_rc_right_quarter_turn_5_tiles_25_deg_up_paint_setup( /* rct2: 0x008AAE30, 0x0051AA42, 0x0051AA68, 0x0051AA8C, 0x0051AAB0 */ static void junior_rc_left_quarter_turn_5_tiles_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -2921,7 +2882,7 @@ static void junior_rc_left_quarter_turn_5_tiles_25_deg_down_paint_setup( /* rct2: 0x008AAE40, 0x0051AAD4, 0x0051AE04, 0x0051B10E, 0x0051B3F4 */ static void junior_rc_right_quarter_turn_5_tiles_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -2931,7 +2892,7 @@ static void junior_rc_right_quarter_turn_5_tiles_25_deg_down_paint_setup( /* rct2: 0x008AAE50, 0x0051B6FE, 0x0051B946, 0x0051BB8E, 0x0051BBA8 */ static void junior_rc_s_bend_left_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -2970,19 +2931,19 @@ static void junior_rc_s_bend_left_paint_setup( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2990,22 +2951,19 @@ static void junior_rc_s_bend_left_paint_setup( { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -3026,14 +2984,14 @@ static void junior_rc_s_bend_left_paint_setup( blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, (direction & 1)), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, (direction & 1)), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /* rct2: 0x008AAE60, 0x0051BBC0, 0x0051BE06, 0x0051C04E, 0x0051C068 */ static void junior_rc_s_bend_right_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -3072,19 +3030,19 @@ static void junior_rc_s_bend_right_paint_setup( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -3092,22 +3050,19 @@ static void junior_rc_s_bend_right_paint_setup( { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -3128,14 +3083,14 @@ static void junior_rc_s_bend_right_paint_setup( blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, (direction & 1)), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, (direction & 1)), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AAEB0, 0x0051C0E0, 0x0051C2C1, 0x0051C47F, 0x0051C61D */ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -3152,7 +3107,7 @@ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( { case 0: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, supportType[(direction & 1)][trackSequence], 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3170,14 +3125,14 @@ static void junior_rc_right_quarter_turn_3_tiles_paint_setup( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AAEA0 */ static void junior_rc_left_quarter_turn_3_tiles_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3232,7 +3187,7 @@ static constexpr const CoordsXYZ junior_rc_right_quarter_turn_3_tiles_bank_offse /** rct2: 0x008AA0D0, 0x00523EA0, 0x005240CC, 0x0052430F, 0x00524500*/ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t thickness[4][4] = { @@ -3251,12 +3206,12 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( if (direction == 1 && trackSequence == 3) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_NW_SW_PART_2_2); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); } else if (direction == 3 && trackSequence == 0) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_BANKED_QUARTER_TURN_3_TILES_SE_NE_PART_0_2); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); } uint8_t supportType[2][4] = { @@ -3267,7 +3222,7 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( { case 0: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, supportType[(direction & 1)][trackSequence], 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3285,19 +3240,18 @@ static void junior_rc_right_quarter_turn_3_tiles_bank_paint_setup( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto imageId = ImageId(0); CoordsXY offset; - CoordsXY boundsLength; - CoordsXY boundsOffset; + BoundBoxXY bb; switch (trackSequence) { @@ -3305,40 +3259,40 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_up[EnumValue(chainType)][direction][0]); offset = defaultRightQuarterTurn3TilesOffsets[direction][0]; - boundsLength = defaultRightQuarterTurn3TilesBoundLengths[direction][0]; - boundsOffset = offset; + bb.length = defaultRightQuarterTurn3TilesBoundLengths[direction][0]; + bb.offset = offset; break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_up[EnumValue(chainType)][direction][1]); offset = defaultRightQuarterTurn3TilesOffsets[direction][2]; - boundsLength = defaultRightQuarterTurn3TilesBoundLengths[direction][2]; - boundsOffset = offset; + bb.length = defaultRightQuarterTurn3TilesBoundLengths[direction][2]; + bb.offset = offset; break; } if (imageId.GetIndex() != 0) { - PaintAddImageAsParent(session, imageId, { offset, height }, { boundsLength, 1 }, { boundsOffset, height }); + PaintAddImageAsParent(session, imageId, { offset, height }, { { bb.offset, height }, { bb.length, 1 } }); } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); } uint8_t supportType[2][4] = { @@ -3349,7 +3303,7 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( { case 0: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, supportType[(direction & 1)][trackSequence], 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3364,22 +3318,21 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_up( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); if (trackSequence == 0 || trackSequence == 3) - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); else - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto imageId = ImageId(0); CoordsXY offset; - CoordsXY boundsLength; - CoordsXY boundsOffset; + BoundBoxXY bb; switch (trackSequence) { @@ -3387,41 +3340,40 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_down[EnumValue(chainType)][direction][0]); offset = defaultRightQuarterTurn3TilesOffsets[direction][0]; - boundsLength = defaultRightQuarterTurn3TilesBoundLengths[direction][0]; - boundsOffset = offset; + bb.length = defaultRightQuarterTurn3TilesBoundLengths[direction][0]; + bb.offset = offset; break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( junior_rc_track_pieces_right_quarter_turn_3_tiles_25_deg_down[EnumValue(chainType)][direction][1]); offset = defaultRightQuarterTurn3TilesOffsets[direction][2]; - boundsLength = defaultRightQuarterTurn3TilesBoundLengths[direction][2]; - boundsOffset = offset; + bb.length = defaultRightQuarterTurn3TilesBoundLengths[direction][2]; + bb.offset = offset; break; } if (imageId.GetIndex() != 0) { - PaintAddImageAsParent( - session, imageId, { offset, height }, { boundsLength.x, boundsLength.y, 1 }, { boundsOffset, height }); + PaintAddImageAsParent(session, imageId, { offset, height }, { { bb.offset, height }, { bb.length, 1 } }); } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); } static constexpr uint8_t supportType[2][4] = { @@ -3432,7 +3384,7 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( { case 0: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, supportType[(direction & 1)][trackSequence], 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3447,17 +3399,17 @@ void junior_rc_paint_track_right_quarter_turn_3_tiles_25_deg_down( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); if (trackSequence == 0 || trackSequence == 3) - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); else - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AA0C0 */ static void junior_rc_left_quarter_turn_3_tiles_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3467,7 +3419,7 @@ static void junior_rc_left_quarter_turn_3_tiles_bank_paint_setup( /** rct2: 0x008AAED0, 0x0051C83C, 0x0051C9EC, 0x0051CB76, 0x0051CCDC*/ static void junior_rc_right_quarter_turn_3_tiles_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -3478,7 +3430,7 @@ static void junior_rc_right_quarter_turn_3_tiles_25_deg_up_paint_setup( /** rct2: 0x008AAEF0, 0x0051CEC8, 0x0051D078, 0x0051D202, 0x0051D368*/ static void junior_rc_right_quarter_turn_3_tiles_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -3496,7 +3448,7 @@ static constexpr const uint8_t junior_rc_left_quarter_turn_3_tiles_to_right_turn /** rct2: 0x008AAEC0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -3506,7 +3458,7 @@ static void junior_rc_left_quarter_turn_3_tiles_25_deg_up_paint_setup( /** rct2: 0x008AAEE0 */ static void junior_rc_left_quarter_turn_3_tiles_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -3516,7 +3468,7 @@ static void junior_rc_left_quarter_turn_3_tiles_25_deg_down_paint_setup( /** rct2: 0x008AB0F0, 0x0052B3A4, 0x0052B5F8, 0x0052B863, 0x0052BA78 */ static void junior_rc_right_half_banked_helix_up_small_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t thickness[2] = { 1, 26 }; @@ -3534,35 +3486,35 @@ static void junior_rc_right_half_banked_helix_up_small_paint_setup( if (trackSequence == 0) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); } else if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -3578,13 +3530,13 @@ static void junior_rc_right_half_banked_helix_up_small_paint_setup( blockedSegments = SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB110, 0x0052BD80, 0x0052BFD4, 0x0052C23B, 0x0052C450 */ static void junior_rc_right_half_banked_helix_down_small_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t thickness[2] = { 1, 26 }; @@ -3602,35 +3554,35 @@ static void junior_rc_right_half_banked_helix_down_small_paint_setup( if (trackSequence == 0) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } else if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); } int32_t blockedSegments = 0; @@ -3646,13 +3598,13 @@ static void junior_rc_right_half_banked_helix_down_small_paint_setup( blockedSegments = SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB0E0 */ static void junior_rc_left_half_banked_helix_up_small_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence > 3) @@ -3668,7 +3620,7 @@ static void junior_rc_left_half_banked_helix_up_small_paint_setup( /** rct2: 0x008AB100 */ static void junior_rc_left_half_banked_helix_down_small_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence > 3) @@ -3684,7 +3636,7 @@ static void junior_rc_left_half_banked_helix_down_small_paint_setup( /** rct2: 0x008AB130, 0x0052C7BC, 0x0052CB6B, 0x0052CF32, 0x0052D2B3 */ static void junior_rc_right_half_banked_helix_up_large_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t thickness[2] = { 1, 26 }; @@ -3702,75 +3654,73 @@ static void junior_rc_right_half_banked_helix_up_large_paint_setup( if (trackSequence == 0) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); } else if (trackSequence == 6) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB150, 0x0052D778, 0x0052DB27, 0x0052DEEA, 0x0052E26B */ static void junior_rc_right_half_banked_helix_down_large_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t thickness[2] = { 1, 26 }; @@ -3788,75 +3738,73 @@ static void junior_rc_right_half_banked_helix_down_large_paint_setup( if (trackSequence == 0) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); } else if (trackSequence == 6) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK : METAL_SUPPORTS_FORK_ALT, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB120 */ static void junior_rc_left_half_banked_helix_up_large_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence > 6) @@ -3872,7 +3820,7 @@ static void junior_rc_left_half_banked_helix_up_large_paint_setup( /** rct2: 0x008AB140 */ static void junior_rc_left_half_banked_helix_down_large_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence > 6) @@ -3890,7 +3838,7 @@ static void junior_rc_left_half_banked_helix_down_large_paint_setup( * rct2: 0x008AAF00, 0x0051851C, 0x005185D8 */ static void junior_rc_brake_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -3900,31 +3848,31 @@ static void junior_rc_brake_paint_setup( { PaintAddImageAsParent(session, image_id, { 6, 0, height }, { 20, 32, 1 }); - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } else { PaintAddImageAsParent(session, image_id, { 0, 6, height }, { 32, 20, 1 }); - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** * rct2: 0x008AB280, 0x00518694, 0x00518759 */ static void junior_rc_block_brake_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId image_id; @@ -3936,29 +3884,29 @@ static void junior_rc_block_brake_paint_setup( { PaintAddImageAsParent(session, image_id, { 6, 0, height }, { 20, 32, 1 }); - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } else { PaintAddImageAsParent(session, image_id, { 0, 6, height }, { 32, 20, 1 }); - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (track_paint_util_should_paint_supports(session.MapPosition)) { int32_t edi = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, edi, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AAF80 */ static void junior_rc_left_eighth_to_diag_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -3969,31 +3917,29 @@ static void junior_rc_left_eighth_to_diag_paint_setup( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 4: if (direction == 0) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -4016,13 +3962,13 @@ static void junior_rc_left_eighth_to_diag_paint_setup( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AAF90 */ static void junior_rc_right_eighth_to_diag_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -4033,31 +3979,29 @@ static void junior_rc_right_eighth_to_diag_paint_setup( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 4: if (direction == 0) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -4080,13 +4024,13 @@ static void junior_rc_right_eighth_to_diag_paint_setup( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AAFA0 */ static void junior_rc_left_eighth_to_orthogonal_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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 }; @@ -4096,7 +4040,7 @@ static void junior_rc_left_eighth_to_orthogonal_paint_setup( /** rct2: 0x008AAFB0 */ static void junior_rc_right_eighth_to_orthogonal_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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 }; @@ -4187,7 +4131,7 @@ static constexpr const int8_t junior_rc_left_eighth_to_diag_bank_thickness[4][4] /** rct2: 0x008AB160 */ static void junior_rc_left_eighth_to_diag_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -4198,31 +4142,29 @@ static void junior_rc_left_eighth_to_diag_bank_paint_setup( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 4: if (direction == 0) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -4245,8 +4187,8 @@ static void junior_rc_left_eighth_to_diag_bank_paint_setup( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const CoordsXY junior_rc_right_eighth_to_diag_bank_bound_lengths[4][4] = { @@ -4332,7 +4274,7 @@ static constexpr const int8_t junior_rc_right_eighth_to_diag_bank_thickness[4][4 /** rct2: 0x008AB170 */ static void junior_rc_right_eighth_to_diag_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_eighth_to_diag_tiles_paint( @@ -4343,31 +4285,29 @@ static void junior_rc_right_eighth_to_diag_bank_paint_setup( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 4: if (direction == 0) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -4390,13 +4330,13 @@ static void junior_rc_right_eighth_to_diag_bank_paint_setup( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB180 */ static void junior_rc_left_eighth_to_orthogonal_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; @@ -4406,7 +4346,7 @@ static void junior_rc_left_eighth_to_orthogonal_bank_paint_setup( /** rct2: 0x008AB190 */ static void junior_rc_right_eighth_to_orthogonal_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; @@ -4429,7 +4369,7 @@ static constexpr const uint8_t junior_rc_diag_support_segment[] = { }; void junior_rc_paint_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4438,18 +4378,18 @@ void junior_rc_paint_track_diag_flat( if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } void junior_rc_paint_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4458,18 +4398,18 @@ void junior_rc_paint_track_diag_25_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 8, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } void junior_rc_paint_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4479,18 +4419,18 @@ void junior_rc_paint_track_diag_flat_to_25_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } void junior_rc_paint_track_diag_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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 @@ -4503,18 +4443,18 @@ void junior_rc_paint_track_diag_flat_to_60_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height + 6, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } void junior_rc_paint_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4524,18 +4464,18 @@ void junior_rc_paint_track_diag_25_deg_up_to_flat( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } void junior_rc_paint_track_diag_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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 @@ -4548,18 +4488,18 @@ void junior_rc_paint_track_diag_60_deg_up_to_flat( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height + 13, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } void junior_rc_paint_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4569,18 +4509,18 @@ void junior_rc_paint_track_diag_25_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 8, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } void junior_rc_paint_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4590,18 +4530,18 @@ void junior_rc_paint_track_diag_flat_to_25_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } void junior_rc_paint_track_diag_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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 @@ -4614,18 +4554,18 @@ void junior_rc_paint_track_diag_flat_to_60_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height + 7, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } void junior_rc_paint_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -4635,18 +4575,18 @@ void junior_rc_paint_track_diag_25_deg_down_to_flat( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } void junior_rc_paint_track_diag_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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 @@ -4659,19 +4599,19 @@ void junior_rc_paint_track_diag_60_deg_down_to_flat( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AAF10 */ static void junior_rc_diag_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4682,7 +4622,7 @@ static void junior_rc_diag_flat_paint_setup( /** rct2: 0x008AAF40 */ static void junior_rc_diag_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4693,7 +4633,7 @@ static void junior_rc_diag_25_deg_up_paint_setup( /** rct2: 0x008AAF20 */ static void junior_rc_diag_flat_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4703,7 +4643,7 @@ static void junior_rc_diag_flat_to_25_deg_up_paint_setup( } static void junior_rc_diag_flat_to_60_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4714,7 +4654,7 @@ static void junior_rc_diag_flat_to_60_deg_up_paint_setup( /** rct2: 0x008AAF30 */ static void junior_rc_diag_25_deg_up_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4724,7 +4664,7 @@ static void junior_rc_diag_25_deg_up_to_flat_paint_setup( } static void junior_rc_diag_60_deg_up_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4735,7 +4675,7 @@ static void junior_rc_diag_60_deg_up_to_flat_paint_setup( /** rct2: 0x008AAF70 */ static void junior_rc_diag_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4746,7 +4686,7 @@ static void junior_rc_diag_25_deg_down_paint_setup( /** rct2: 0x008AAF50 */ static void junior_rc_diag_flat_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4756,7 +4696,7 @@ static void junior_rc_diag_flat_to_25_deg_down_paint_setup( } static void junior_rc_diag_flat_to_60_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4767,7 +4707,7 @@ static void junior_rc_diag_flat_to_60_deg_down_paint_setup( /** rct2: 0x008AAF60 */ static void junior_rc_diag_25_deg_down_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4777,7 +4717,7 @@ static void junior_rc_diag_25_deg_down_to_flat_paint_setup( } static void junior_rc_diag_60_deg_down_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -4788,7 +4728,7 @@ static void junior_rc_diag_60_deg_down_to_flat_paint_setup( /** rct2: 0x008AB1C0 */ static void junior_rc_diag_flat_to_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4799,23 +4739,23 @@ static void junior_rc_diag_flat_to_left_bank_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_FLAT_TO_LEFT_BANK_W_E_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 27 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB1D0 */ static void junior_rc_diag_flat_to_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4826,23 +4766,23 @@ static void junior_rc_diag_flat_to_right_bank_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_FLAT_TO_RIGHT_BANK_E_W_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 27 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB1E0 */ static void junior_rc_diag_left_bank_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4853,23 +4793,23 @@ static void junior_rc_diag_left_bank_to_flat_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_FLAT_TO_RIGHT_BANK_E_W_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 27 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB1F0 */ static void junior_rc_diag_right_bank_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4880,23 +4820,23 @@ static void junior_rc_diag_right_bank_to_flat_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_FLAT_TO_LEFT_BANK_W_E_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 27 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB220 */ static void junior_rc_diag_left_bank_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4907,23 +4847,23 @@ static void junior_rc_diag_left_bank_to_25_deg_up_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_LEFT_BANK_TO_25_DEG_UP_W_E_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AB230 */ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4934,23 +4874,23 @@ static void junior_rc_diag_right_bank_to_25_deg_up_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_E_W_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AB200 */ static void junior_rc_diag_25_deg_up_to_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4961,23 +4901,23 @@ static void junior_rc_diag_25_deg_up_to_left_bank_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_LEFT_BANK_W_E_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AB210 */ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -4988,23 +4928,23 @@ static void junior_rc_diag_25_deg_up_to_right_bank_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_RIGHT_BANK_E_W_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AB200 */ static void junior_rc_diag_left_bank_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -5015,23 +4955,23 @@ static void junior_rc_diag_left_bank_to_25_deg_down_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_RIGHT_BANK_E_W_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AB210 */ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -5042,23 +4982,23 @@ static void junior_rc_diag_right_bank_to_25_deg_down_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_25_DEG_UP_TO_LEFT_BANK_W_E_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AB220 */ static void junior_rc_diag_25_deg_down_to_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -5069,23 +5009,23 @@ static void junior_rc_diag_25_deg_down_to_left_bank_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_RIGHT_BANK_TO_25_DEG_UP_E_W_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AB230 */ static void junior_rc_diag_25_deg_down_to_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { track_paint_util_diag_tiles_paint( @@ -5096,18 +5036,18 @@ static void junior_rc_diag_25_deg_down_to_right_bank_paint_setup( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_DIAG_LEFT_BANK_TO_25_DEG_UP_W_E_PART_0_2); - PaintAddImageAsParent(session, imageId, { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); + PaintAddImageAsParent(session, imageId, { -16, -16, height }, { { -16, -16, height + 35 }, { 32, 32, 0 } }); } if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static constexpr const CoordsXYZ junior_rc_diag_left_bank_bound_offsets[4] = { @@ -5126,7 +5066,7 @@ static constexpr const CoordsXYZ junior_rc_diag_right_bank_bound_offsets[4] = { /** rct2: 0x008AB1A0 */ static void junior_rc_diag_left_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t thickness = direction == 0 ? 0 : 1; @@ -5137,19 +5077,19 @@ static void junior_rc_diag_left_bank_paint_setup( if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AB1B0 */ static void junior_rc_diag_right_bank_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t thickness = direction == 2 ? 0 : 1; @@ -5160,14 +5100,14 @@ static void junior_rc_diag_right_bank_paint_setup( if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const CoordsXY junior_rc_60_deg_up_bound_offsets[4] = { @@ -5199,7 +5139,7 @@ static constexpr const CoordsXY junior_rc_60_deg_up_bound_lengths[4] = { }; void junior_rc_paint_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto image_id = session.TrackColours[SCHEME_TRACK].WithIndex( @@ -5207,40 +5147,40 @@ void junior_rc_paint_track_60_deg_up( PaintAddImageAsParent( 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 }); + { { junior_rc_60_deg_up_bound_offsets[direction], height }, + { junior_rc_60_deg_up_bound_lengths[direction], junior_rc_60_deg_up_bound_thickness[direction] } }); switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 56, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 56, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 56, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 56, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } static constexpr int8_t support[4] = { 35, 29, 25, 32 }; if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, support[direction], height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void junior_rc_60_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5250,7 +5190,7 @@ static void junior_rc_60_deg_up_paint_setup( } static void junior_rc_60_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_60_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -5278,7 +5218,7 @@ static constexpr const CoordsXY junior_rc_25_deg_up_to_60_deg_up_bound_offsets[4 }; void junior_rc_paint_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto image_id = session.TrackColours[SCHEME_TRACK].WithIndex( @@ -5286,9 +5226,9 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( PaintAddImageAsParent( 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 }); + { { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0], 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] } }); if (junior_rc_track_pieces_25_deg_up_to_60_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5297,42 +5237,42 @@ void junior_rc_paint_track_25_deg_up_to_60_deg_up( PaintAddImageAsParent( 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 }); + { { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1], 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] } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } static constexpr int8_t support[4] = { 12, 12, 12, 14 }; if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, support[direction], height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void junior_rc_25_deg_up_to_60_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5342,14 +5282,14 @@ static void junior_rc_25_deg_up_to_60_deg_up_paint_setup( } static void junior_rc_60_deg_down_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); } void junior_rc_paint_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { auto image_id = session.TrackColours[SCHEME_TRACK].WithIndex( @@ -5357,9 +5297,9 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( PaintAddImageAsParent( 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 }); + { { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][0], 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] } }); if (junior_rc_track_pieces_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction][1] != 0) { @@ -5368,41 +5308,41 @@ void junior_rc_paint_track_60_deg_up_to_25_deg_up( PaintAddImageAsParent( 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 }); + { { junior_rc_25_deg_up_to_60_deg_up_bound_offsets[direction][1], 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] } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void junior_rc_60_deg_up_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5412,14 +5352,14 @@ static void junior_rc_60_deg_up_to_25_deg_up_paint_setup( } static void junior_rc_25_deg_down_to_60_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); } void junior_rc_paint_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5428,18 +5368,18 @@ void junior_rc_paint_track_diag_60_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 36, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } void junior_rc_paint_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5449,18 +5389,18 @@ void junior_rc_paint_track_diag_60_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 28, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5470,18 +5410,18 @@ void junior_rc_paint_track_diag_25_deg_up_to_60_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 16, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { if (direction == 1 && trackSequence == 3) @@ -5490,7 +5430,7 @@ void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( session, session.TrackColours[SCHEME_TRACK].WithIndex( junior_rc_track_pieces_diag_60_deg_up_to_25_deg_up[EnumValue(chainType)][direction]), - { -16, -16, height }, { 16, 16, 1 }, { 0, 0, height }); + { -16, -16, height }, { { 0, 0, height }, { 16, 16, 1 } }); } else { @@ -5502,18 +5442,18 @@ void junior_rc_paint_track_diag_60_deg_up_to_25_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 21, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { if (direction == 3 && trackSequence == 0) @@ -5522,7 +5462,7 @@ void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( session, session.TrackColours[SCHEME_TRACK].WithIndex( junior_rc_track_pieces_diag_25_deg_down_to_60_deg_down[EnumValue(chainType)][direction]), - { -16, -16, height }, { 16, 16, 1 }, { 0, 0, height }); + { -16, -16, height }, { { 0, 0, height }, { 16, 16, 1 } }); } else { @@ -5534,18 +5474,18 @@ void junior_rc_paint_track_diag_25_deg_down_to_60_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 17, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, JuniorRcChainType chainType) { track_paint_util_diag_tiles_paint( @@ -5555,18 +5495,18 @@ void junior_rc_paint_track_diag_60_deg_down_to_25_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, junior_rc_diag_support_segment[direction], 8, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = junior_rc_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void junior_rc_diag_60_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5576,7 +5516,7 @@ static void junior_rc_diag_60_deg_up_paint_setup( } static void junior_rc_diag_60_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5586,7 +5526,7 @@ static void junior_rc_diag_60_deg_down_paint_setup( } static void junior_rc_diag_25_deg_up_to_60_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5596,7 +5536,7 @@ static void junior_rc_diag_25_deg_up_to_60_deg_up_paint_setup( } static void junior_rc_diag_60_deg_up_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5606,7 +5546,7 @@ static void junior_rc_diag_60_deg_up_to_25_deg_up_paint_setup( } static void junior_rc_diag_25_deg_down_to_60_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5616,7 +5556,7 @@ static void junior_rc_diag_25_deg_down_to_60_deg_down_paint_setup( } static void junior_rc_diag_60_deg_down_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5661,7 +5601,7 @@ static constexpr const CoordsXY junior_rc_60_deg_up_to_flat_tile_offsets[4][2] = }; static void junior_rc_flat_to_60_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5670,8 +5610,9 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( PaintAddImageAsParent( 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 }); + { { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0], height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0], + junior_rc_flat_to_60_deg_up_bound_thickness[direction] } }); if (junior_rc_track_pieces_flat_to_60_deg_up[isChained][direction][1] != 0) { @@ -5680,48 +5621,49 @@ static void junior_rc_flat_to_60_deg_up_paint_setup( PaintAddImageAsParent( 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 }); + { { junior_rc_flat_to_60_deg_up_bound_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] } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_1); + PaintUtilPushTunnelRight(session, height, TUNNEL_1); break; } static constexpr int8_t support[4] = { 12, 12, 12, 14 }; if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, support[direction], height - 7, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void junior_rc_60_deg_down_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void junior_rc_60_deg_up_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5730,8 +5672,9 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( PaintAddImageAsParent( 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 }); + { { junior_rc_flat_to_60_deg_up_bound_offsets[direction][0], height }, + { junior_rc_flat_to_60_deg_up_bound_lengths[direction][0], + junior_rc_flat_to_60_deg_up_bound_thickness[direction] } }); if (junior_rc_track_pieces_60_deg_up_to_flat[isChained][direction][1] != 0) { @@ -5740,40 +5683,41 @@ static void junior_rc_60_deg_up_to_flat_paint_setup( PaintAddImageAsParent( 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 }); + { { junior_rc_flat_to_60_deg_up_bound_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] } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_1); + PaintUtilPushTunnelRight(session, height, TUNNEL_1); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK, 4, 20, height - 5, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void junior_rc_flat_to_60_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5781,7 +5725,7 @@ static void junior_rc_flat_to_60_deg_down_paint_setup( /* rct2: 0x00518394 */ static void junior_rc_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5792,7 +5736,7 @@ static void junior_rc_flat_paint_setup( /* rct2: 0x00515629, 0x00514D22, 0x005151B9 */ static void paint_junior_rc_station_track( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_paint_station(session, ride, trackSequence, direction, height, trackElement, true); @@ -5800,7 +5744,7 @@ static void paint_junior_rc_station_track( /* rct2: 0x0051881E */ static void junior_rc_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5811,7 +5755,7 @@ static void junior_rc_25_deg_up_paint_setup( /* rct2: 0x00518B42 */ static void junior_rc_flat_to_25_deg_up_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5822,7 +5766,7 @@ static void junior_rc_flat_to_25_deg_up_paint_setup( /* rct2: 0x00518E56 */ static void junior_rc_25_deg_up_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -5833,7 +5777,7 @@ static void junior_rc_25_deg_up_to_flat_paint_setup( /* rct2: 0x005189B0 */ static void junior_rc_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_25_deg_up_paint_setup(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5841,7 +5785,7 @@ static void junior_rc_25_deg_down_paint_setup( /* rct2: 0x00518FE8 */ static void junior_rc_flat_to_25_deg_down_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5849,14 +5793,14 @@ static void junior_rc_flat_to_25_deg_down_paint_setup( /* rct2: 0x00518CCC */ static void junior_rc_25_deg_down_to_flat_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void junior_rc_booster_paint_setup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction & 1) @@ -5865,7 +5809,7 @@ static void junior_rc_booster_paint_setup( session, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_BOOSTER_NE_SW), { 0, 0, height }, { 20, 32, 1 }); - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } else { @@ -5873,22 +5817,22 @@ static void junior_rc_booster_paint_setup( session, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_JUNIOR_RC_BOOSTER_NW_SE), { 0, 0, height }, { 32, 20, 1 }); - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (track_paint_util_should_paint_supports(session.MapPosition)) { uint8_t supportType = (direction & 1) ? METAL_SUPPORTS_FORK_ALT : METAL_SUPPORTS_FORK; - metal_a_supports_paint_setup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, supportType, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void junior_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(junior_rc_track_pieces_flat[0][direction]); @@ -5900,9 +5844,9 @@ static void junior_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height + photoCameraOffset }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 5, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 8, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); break; @@ -5910,9 +5854,9 @@ static void junior_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height + photoCameraOffset }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); break; @@ -5920,9 +5864,9 @@ static void junior_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height + photoCameraOffset }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 5, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 8, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); break; @@ -5930,17 +5874,17 @@ static void junior_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height + photoCameraOffset }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 6, height + photoCameraOffset, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48 + photoCameraOffset, 0x20); } /* 0x008AAA0C */ diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/JuniorRollerCoaster.h index 305ffd6bff..91c541587a 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.h @@ -19,97 +19,97 @@ enum class JuniorRcChainType : uint8_t }; struct Ride; -struct paint_session; +struct PaintSession; struct TrackElement; void junior_rc_paint_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, const TrackElement& trackElement, bool drawBlockBrake); void junior_rc_paint_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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, const Ride& ride, uint8_t trackSequence, uint8_t direction, uint16_t height, + PaintSession& 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 7885da61d9..ccff695f19 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x0082491C */ static void lay_down_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -52,7 +52,7 @@ static void lay_down_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -75,14 +75,14 @@ static void lay_down_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -123,22 +123,22 @@ static void lay_down_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824B8C, 0x00824B9C, 0x00824BAC */ static void lay_down_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.IsInverted()) @@ -161,7 +161,7 @@ static void lay_down_rc_track_station( { 32, 20, 1 }, { 0, 6, height + 24 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 11); track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } else { @@ -189,15 +189,15 @@ static void lay_down_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 11); track_paint_util_draw_station_2(session, ride, direction, height, trackElement, 9, 11); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0082492C */ static void lay_down_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -229,7 +229,7 @@ static void lay_down_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -260,21 +260,21 @@ static void lay_down_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -331,26 +331,26 @@ static void lay_down_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -358,19 +358,19 @@ static void lay_down_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x0082493C */ static void lay_down_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -402,7 +402,7 @@ static void lay_down_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -433,21 +433,21 @@ static void lay_down_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } else { @@ -476,21 +476,21 @@ static void lay_down_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } /** rct2: 0x0082494C */ static void lay_down_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -522,7 +522,7 @@ static void lay_down_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -553,21 +553,21 @@ static void lay_down_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -624,26 +624,26 @@ static void lay_down_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -651,19 +651,19 @@ static void lay_down_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x0082495C */ static void lay_down_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -701,7 +701,7 @@ static void lay_down_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -738,21 +738,21 @@ static void lay_down_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else { @@ -787,21 +787,21 @@ static void lay_down_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x0082496C */ static void lay_down_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -839,7 +839,7 @@ static void lay_down_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -876,21 +876,21 @@ static void lay_down_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else { @@ -924,26 +924,26 @@ static void lay_down_rc_track_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 65, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 65, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 65, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 65, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -951,19 +951,19 @@ static void lay_down_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x0082497C */ static void lay_down_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -995,7 +995,7 @@ static void lay_down_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -1026,21 +1026,21 @@ static void lay_down_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -1097,26 +1097,26 @@ static void lay_down_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1124,19 +1124,19 @@ static void lay_down_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x0082498C */ static void lay_down_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lay_down_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1144,7 +1144,7 @@ static void lay_down_rc_track_25_deg_down( /** rct2: 0x0082499C */ static void lay_down_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lay_down_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1152,7 +1152,7 @@ static void lay_down_rc_track_60_deg_down( /** rct2: 0x008249AC */ static void lay_down_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1160,7 +1160,7 @@ static void lay_down_rc_track_flat_to_25_deg_down( /** rct2: 0x008249BC */ static void lay_down_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1168,7 +1168,7 @@ static void lay_down_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008249CC */ static void lay_down_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1176,7 +1176,7 @@ static void lay_down_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008249DC */ static void lay_down_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1184,7 +1184,7 @@ static void lay_down_rc_track_25_deg_down_to_flat( /** rct2: 0x008249EC */ static void lay_down_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1215,19 +1215,18 @@ static void lay_down_rc_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1253,12 +1252,12 @@ static void lay_down_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1284,13 +1283,12 @@ static void lay_down_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1316,12 +1314,12 @@ static void lay_down_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1347,21 +1345,20 @@ static void lay_down_rc_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1394,21 +1391,20 @@ static void lay_down_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1434,12 +1430,12 @@ static void lay_down_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1465,13 +1461,12 @@ static void lay_down_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1497,12 +1492,12 @@ static void lay_down_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1529,23 +1524,22 @@ static void lay_down_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1553,7 +1547,7 @@ static void lay_down_rc_track_left_quarter_turn_5( /** rct2: 0x008249FC */ static void lay_down_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1562,7 +1556,7 @@ static void lay_down_rc_track_right_quarter_turn_5( /** rct2: 0x00824A0C */ static void lay_down_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1598,13 +1592,13 @@ static void lay_down_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1632,24 +1626,24 @@ static void lay_down_rc_track_flat_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824A1C */ static void lay_down_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1685,13 +1679,13 @@ static void lay_down_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1719,24 +1713,24 @@ static void lay_down_rc_track_flat_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824A2C */ static void lay_down_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1772,13 +1766,13 @@ static void lay_down_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1806,24 +1800,24 @@ static void lay_down_rc_track_left_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824A3C */ static void lay_down_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1859,13 +1853,13 @@ static void lay_down_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1893,24 +1887,24 @@ static void lay_down_rc_track_right_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824A4C */ static void lay_down_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1944,19 +1938,18 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1982,12 +1975,12 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2013,13 +2006,12 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -2045,12 +2037,12 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2079,21 +2071,20 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -2126,21 +2117,20 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2166,12 +2156,12 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2197,13 +2187,12 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -2229,12 +2218,12 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2261,23 +2250,22 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -2285,7 +2273,7 @@ static void lay_down_rc_track_banked_left_quarter_turn_5( /** rct2: 0x00824A5C */ static void lay_down_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2294,7 +2282,7 @@ static void lay_down_rc_track_banked_right_quarter_turn_5( /** rct2: 0x00824A6C */ static void lay_down_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2330,20 +2318,20 @@ static void lay_down_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -2371,28 +2359,28 @@ static void lay_down_rc_track_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2400,19 +2388,19 @@ static void lay_down_rc_track_left_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x00824A7C */ static void lay_down_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2448,20 +2436,20 @@ static void lay_down_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -2489,28 +2477,28 @@ static void lay_down_rc_track_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2518,19 +2506,19 @@ static void lay_down_rc_track_right_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x00824A8C */ static void lay_down_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2566,20 +2554,20 @@ static void lay_down_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -2607,28 +2595,28 @@ static void lay_down_rc_track_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2636,19 +2624,19 @@ static void lay_down_rc_track_25_deg_up_to_left_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x00824A9C */ static void lay_down_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2684,20 +2672,20 @@ static void lay_down_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -2725,28 +2713,28 @@ static void lay_down_rc_track_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2754,19 +2742,19 @@ static void lay_down_rc_track_25_deg_up_to_right_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x00824AAC */ static void lay_down_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2774,7 +2762,7 @@ static void lay_down_rc_track_left_bank_to_25_deg_down( /** rct2: 0x00824ABC */ static void lay_down_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2782,7 +2770,7 @@ static void lay_down_rc_track_right_bank_to_25_deg_down( /** rct2: 0x00824ACC */ static void lay_down_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2790,7 +2778,7 @@ static void lay_down_rc_track_25_deg_down_to_left_bank( /** rct2: 0x00824ADC */ static void lay_down_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2798,7 +2786,7 @@ static void lay_down_rc_track_25_deg_down_to_right_bank( /** rct2: 0x00824AEC */ static void lay_down_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2828,13 +2816,13 @@ static void lay_down_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -2862,24 +2850,24 @@ static void lay_down_rc_track_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824AFC */ static void lay_down_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lay_down_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2887,7 +2875,7 @@ static void lay_down_rc_track_right_bank( /** rct2: 0x00824B0C */ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2918,19 +2906,18 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2956,12 +2943,12 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -2987,13 +2974,12 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3019,12 +3005,12 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3050,21 +3036,20 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3097,21 +3082,20 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3137,12 +3121,12 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3168,13 +3152,12 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3200,12 +3183,12 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3232,23 +3215,22 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3256,7 +3238,7 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x00824B1C */ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3287,19 +3269,18 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3325,12 +3306,12 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3356,13 +3337,12 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3388,12 +3368,12 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3419,21 +3399,20 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3466,21 +3445,20 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3506,12 +3484,12 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -3537,13 +3515,12 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -3569,12 +3546,12 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -3601,23 +3578,22 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 43, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -3625,7 +3601,7 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x00824B2C */ static void lay_down_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -3634,7 +3610,7 @@ static void lay_down_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x00824B3C */ static void lay_down_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -3643,7 +3619,7 @@ static void lay_down_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x00824B4C */ static void lay_down_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3674,16 +3650,15 @@ static void lay_down_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3692,14 +3667,14 @@ static void lay_down_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16403), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16407), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3713,12 +3688,12 @@ static void lay_down_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3737,23 +3712,23 @@ static void lay_down_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16403), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16407), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3779,21 +3754,20 @@ static void lay_down_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3826,17 +3800,16 @@ static void lay_down_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3863,24 +3836,24 @@ static void lay_down_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3907,24 +3880,24 @@ static void lay_down_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3951,22 +3924,21 @@ static void lay_down_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3974,7 +3946,7 @@ static void lay_down_rc_track_s_bend_left( /** rct2: 0x00824B5C */ static void lay_down_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -4005,16 +3977,15 @@ static void lay_down_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4023,14 +3994,14 @@ static void lay_down_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16411), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16415), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4044,12 +4015,12 @@ static void lay_down_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4068,23 +4039,23 @@ static void lay_down_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16411), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16415), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4110,21 +4081,20 @@ static void lay_down_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4157,17 +4127,16 @@ static void lay_down_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4194,24 +4163,24 @@ static void lay_down_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4238,24 +4207,24 @@ static void lay_down_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4282,22 +4251,21 @@ static void lay_down_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4305,7 +4273,7 @@ static void lay_down_rc_track_s_bend_right( /** rct2: 0x00824B6C */ static void lay_down_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4317,41 +4285,40 @@ static void lay_down_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16562), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16570), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16569), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16577), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4360,37 +4327,36 @@ static void lay_down_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16563), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16571), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16568), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16576), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -4416,9 +4382,9 @@ static void lay_down_rc_track_left_vertical_loop( { 2, 16, 119 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -4444,18 +4410,17 @@ static void lay_down_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4481,12 +4446,11 @@ static void lay_down_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -4512,9 +4476,9 @@ static void lay_down_rc_track_left_vertical_loop( { 3, 16, 119 }, { 12, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -4523,37 +4487,36 @@ static void lay_down_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16568), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16576), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16563), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16571), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -4562,53 +4525,52 @@ static void lay_down_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16569), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16577), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16562), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16570), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x00824B7C */ static void lay_down_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4637,13 +4599,13 @@ static void lay_down_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4652,32 +4614,32 @@ static void lay_down_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16592), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16584), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16587), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16579), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -4703,7 +4665,7 @@ static void lay_down_rc_track_right_vertical_loop( { 2, 16, 119 }, { 16, 0, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -4729,13 +4691,13 @@ static void lay_down_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -4761,7 +4723,7 @@ static void lay_down_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -4787,7 +4749,7 @@ static void lay_down_rc_track_right_vertical_loop( { 4, 16, 119 }, { 10, 16, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -4796,32 +4758,32 @@ static void lay_down_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16587), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16579), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16592), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16584), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -4847,18 +4809,18 @@ static void lay_down_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4867,7 +4829,7 @@ static void lay_down_rc_track_right_vertical_loop( /** rct2: 0x00824BBC */ static void lay_down_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -4898,19 +4860,18 @@ static void lay_down_rc_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4936,10 +4897,9 @@ static void lay_down_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4965,21 +4925,20 @@ static void lay_down_rc_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5012,21 +4971,20 @@ static void lay_down_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5052,10 +5010,9 @@ static void lay_down_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5082,23 +5039,22 @@ static void lay_down_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5106,7 +5062,7 @@ static void lay_down_rc_track_left_quarter_turn_3( /** rct2: 0x00824BCC */ static void lay_down_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5115,7 +5071,7 @@ static void lay_down_rc_track_right_quarter_turn_3( /** rct2: 0x00824BDC */ static void lay_down_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5149,19 +5105,18 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5187,10 +5142,9 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5219,21 +5173,20 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5266,21 +5219,20 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5306,10 +5258,9 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5336,23 +5287,22 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5360,7 +5310,7 @@ static void lay_down_rc_track_left_quarter_turn_3_bank( /** rct2: 0x00824BEC */ static void lay_down_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5369,7 +5319,7 @@ static void lay_down_rc_track_right_quarter_turn_3_bank( /** rct2: 0x00824BFC */ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5400,22 +5350,21 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5441,21 +5390,20 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -5488,24 +5436,23 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5532,23 +5479,22 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -5556,7 +5502,7 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x00824C0C */ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5587,22 +5533,21 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5611,44 +5556,43 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16531), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16533), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16535), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16537), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -5681,24 +5625,23 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -5725,23 +5668,22 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 41, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -5749,7 +5691,7 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x00824C1C */ static void lay_down_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5758,7 +5700,7 @@ static void lay_down_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x00824C2C */ static void lay_down_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5767,7 +5709,7 @@ static void lay_down_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x00824C9C */ static void lay_down_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5799,19 +5741,19 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5837,9 +5779,9 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5868,21 +5810,21 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5911,24 +5853,24 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5954,9 +5896,9 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5985,23 +5927,23 @@ static void lay_down_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824CAC */ static void lay_down_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6033,19 +5975,19 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6071,9 +6013,9 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6102,21 +6044,21 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6145,24 +6087,24 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6188,9 +6130,9 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6219,23 +6161,23 @@ static void lay_down_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824CBC */ static void lay_down_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -6249,7 +6191,7 @@ static void lay_down_rc_track_left_half_banked_helix_down_small( /** rct2: 0x00824CCC */ static void lay_down_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -6263,7 +6205,7 @@ static void lay_down_rc_track_right_half_banked_helix_down_small( /** rct2: 0x00824CDC */ static void lay_down_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6295,19 +6237,19 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6333,12 +6275,11 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6364,12 +6305,12 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -6395,12 +6336,11 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6429,21 +6369,21 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6472,24 +6412,24 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -6515,12 +6455,11 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6546,12 +6485,12 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6577,12 +6516,11 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6611,23 +6549,23 @@ static void lay_down_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824CEC */ static void lay_down_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6659,19 +6597,19 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6697,12 +6635,11 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6728,12 +6665,12 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -6759,12 +6696,11 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6793,21 +6729,21 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6836,24 +6772,24 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -6879,12 +6815,11 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6910,12 +6845,12 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6941,12 +6876,11 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6975,23 +6909,23 @@ static void lay_down_rc_track_right_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824CFC */ static void lay_down_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -7005,7 +6939,7 @@ static void lay_down_rc_track_left_half_banked_helix_down_large( /** rct2: 0x00824D0C */ static void lay_down_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -7019,7 +6953,7 @@ static void lay_down_rc_track_right_half_banked_helix_down_large( /** rct2: 0x00824D3C */ static void lay_down_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7099,13 +7033,13 @@ static void lay_down_rc_track_left_quarter_turn_1_60_deg_up( } } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x00824D1C */ static void lay_down_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7186,13 +7120,13 @@ static void lay_down_rc_track_right_quarter_turn_1_60_deg_up( } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x00824D2C */ static void lay_down_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -7200,7 +7134,7 @@ static void lay_down_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x00824D4C */ static void lay_down_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -7208,7 +7142,7 @@ static void lay_down_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x00824D5C */ static void lay_down_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7230,13 +7164,13 @@ static void lay_down_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -7256,22 +7190,22 @@ static void lay_down_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00824D6C */ static void lay_down_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7281,9 +7215,9 @@ static void lay_down_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16224), { 0, 0, height }, { 32, 20, 0 }, @@ -7292,9 +7226,9 @@ static void lay_down_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16225), { 0, 0, height }, { 32, 20, 0 }, @@ -7303,9 +7237,9 @@ static void lay_down_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16224), { 0, 0, height }, { 32, 20, 0 }, @@ -7314,9 +7248,9 @@ static void lay_down_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16225), { 0, 0, height }, { 32, 20, 0 }, @@ -7324,9 +7258,9 @@ static void lay_down_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -7335,9 +7269,9 @@ static void lay_down_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26555), { 0, 0, height + 24 }, @@ -7346,9 +7280,9 @@ static void lay_down_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26556), { 0, 0, height + 24 }, @@ -7357,9 +7291,9 @@ static void lay_down_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26555), { 0, 0, height + 24 }, @@ -7368,9 +7302,9 @@ static void lay_down_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26556), { 0, 0, height + 24 }, @@ -7378,15 +7312,15 @@ static void lay_down_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x00824D8C */ static void lay_down_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7417,15 +7351,15 @@ static void lay_down_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7451,12 +7385,12 @@ static void lay_down_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7482,17 +7416,15 @@ static void lay_down_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7501,37 +7433,37 @@ static void lay_down_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16743), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16747), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16751), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16755), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -7564,16 +7496,16 @@ static void lay_down_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7599,12 +7531,12 @@ static void lay_down_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7630,17 +7562,15 @@ static void lay_down_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7667,32 +7597,32 @@ static void lay_down_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -7700,7 +7630,7 @@ static void lay_down_rc_track_left_eighth_to_diag( /** rct2: 0x00824D9C */ static void lay_down_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7731,15 +7661,15 @@ static void lay_down_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7765,12 +7695,12 @@ static void lay_down_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7796,17 +7726,15 @@ static void lay_down_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7815,37 +7743,37 @@ static void lay_down_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16727), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16731), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16735), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16739), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -7878,16 +7806,16 @@ static void lay_down_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7913,12 +7841,12 @@ static void lay_down_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7944,17 +7872,15 @@ static void lay_down_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7981,32 +7907,32 @@ static void lay_down_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8014,7 +7940,7 @@ static void lay_down_rc_track_right_eighth_to_diag( /** rct2: 0x00824DAC */ static void lay_down_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8023,7 +7949,7 @@ static void lay_down_rc_track_left_eighth_to_orthogonal( /** rct2: 0x00824DBC */ static void lay_down_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8032,7 +7958,7 @@ static void lay_down_rc_track_right_eighth_to_orthogonal( /** rct2: 0x00824DCC */ static void lay_down_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8063,15 +7989,15 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8097,12 +8023,12 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8128,17 +8054,15 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8147,37 +8071,37 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16775), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16779), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16783), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16787), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8210,17 +8134,16 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8246,12 +8169,12 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8277,17 +8200,15 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8314,32 +8235,32 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8347,7 +8268,7 @@ static void lay_down_rc_track_left_eighth_bank_to_diag( /** rct2: 0x00824DDC */ static void lay_down_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8378,15 +8299,15 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8412,12 +8333,12 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8443,17 +8364,15 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8462,37 +8381,37 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16759), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16763), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16767), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16771), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8525,17 +8444,16 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8561,12 +8479,12 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8592,17 +8510,15 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8629,32 +8545,32 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8662,7 +8578,7 @@ static void lay_down_rc_track_right_eighth_bank_to_diag( /** rct2: 0x00824DEC */ static void lay_down_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8671,7 +8587,7 @@ static void lay_down_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x00824DFC */ static void lay_down_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8680,7 +8596,7 @@ static void lay_down_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x00824D7C */ static void lay_down_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8710,10 +8626,9 @@ static void lay_down_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -8738,10 +8653,9 @@ static void lay_down_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -8766,10 +8680,9 @@ static void lay_down_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -8777,22 +8690,22 @@ static void lay_down_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16697), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -8802,30 +8715,29 @@ static void lay_down_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16635), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8856,10 +8768,9 @@ static void lay_down_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -8884,10 +8795,9 @@ static void lay_down_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -8912,10 +8822,9 @@ static void lay_down_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -8941,30 +8850,29 @@ static void lay_down_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8972,7 +8880,7 @@ static void lay_down_rc_track_diag_flat( /** rct2: 0x00824E2C */ static void lay_down_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9002,10 +8910,9 @@ static void lay_down_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9030,10 +8937,9 @@ static void lay_down_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9058,10 +8964,9 @@ static void lay_down_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9069,22 +8974,22 @@ static void lay_down_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16709), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9094,30 +8999,29 @@ static void lay_down_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16647), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -9148,10 +9052,9 @@ static void lay_down_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9176,10 +9079,9 @@ static void lay_down_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9204,10 +9106,9 @@ static void lay_down_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9233,30 +9134,29 @@ static void lay_down_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -9264,7 +9164,7 @@ static void lay_down_rc_track_diag_25_deg_up( /** rct2: 0x00824E8C */ static void lay_down_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9294,10 +9194,9 @@ static void lay_down_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9322,10 +9221,9 @@ static void lay_down_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9350,10 +9248,9 @@ static void lay_down_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9361,22 +9258,22 @@ static void lay_down_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16721), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9386,30 +9283,29 @@ static void lay_down_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16659), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -9426,10 +9322,9 @@ static void lay_down_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -9440,10 +9335,9 @@ static void lay_down_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -9454,10 +9348,9 @@ static void lay_down_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -9469,30 +9362,29 @@ static void lay_down_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -9500,7 +9392,7 @@ static void lay_down_rc_track_diag_60_deg_up( /** rct2: 0x00824E0C */ static void lay_down_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9530,10 +9422,9 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9558,10 +9449,9 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9586,10 +9476,9 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9597,22 +9486,22 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16701), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9622,30 +9511,29 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16639), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -9676,10 +9564,9 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9704,10 +9591,9 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9732,10 +9618,9 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9761,30 +9646,29 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -9792,7 +9676,7 @@ static void lay_down_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x00824E6C */ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9822,10 +9706,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9850,10 +9733,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9878,10 +9760,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9889,22 +9770,22 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16713), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9914,30 +9795,29 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16651), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9954,10 +9834,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9968,10 +9847,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9982,10 +9860,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9997,30 +9874,29 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10028,7 +9904,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x00824E7C */ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10058,10 +9934,9 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10086,10 +9961,9 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10114,10 +9988,9 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10125,22 +9998,22 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16717), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10150,30 +10023,29 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16655), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10190,10 +10062,9 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -10204,10 +10075,9 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -10218,10 +10088,9 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -10233,30 +10102,29 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10264,7 +10132,7 @@ static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x00824E1C */ static void lay_down_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10294,10 +10162,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10322,10 +10189,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10350,10 +10216,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10361,22 +10226,22 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16705), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10386,30 +10251,29 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16643), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10440,10 +10304,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10468,10 +10331,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10496,10 +10358,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10525,30 +10386,29 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10556,7 +10416,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x00824E5C */ static void lay_down_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10586,10 +10446,9 @@ static void lay_down_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10614,10 +10473,9 @@ static void lay_down_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10642,10 +10500,9 @@ static void lay_down_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10653,22 +10510,22 @@ static void lay_down_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16711), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10678,30 +10535,29 @@ static void lay_down_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16649), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10718,10 +10574,9 @@ static void lay_down_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10732,10 +10587,9 @@ static void lay_down_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -10746,10 +10600,9 @@ static void lay_down_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -10761,30 +10614,29 @@ static void lay_down_rc_track_diag_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 45, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10792,7 +10644,7 @@ static void lay_down_rc_track_diag_25_deg_down( /** rct2: 0x00824EBC */ static void lay_down_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10822,10 +10674,9 @@ static void lay_down_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10850,10 +10701,9 @@ static void lay_down_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10878,10 +10728,9 @@ static void lay_down_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10889,22 +10738,22 @@ static void lay_down_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16723), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -10914,30 +10763,29 @@ static void lay_down_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16661), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -10954,10 +10802,9 @@ static void lay_down_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -10968,10 +10815,9 @@ static void lay_down_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -10982,10 +10828,9 @@ static void lay_down_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -10997,30 +10842,29 @@ static void lay_down_rc_track_diag_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -11028,7 +10872,7 @@ static void lay_down_rc_track_diag_60_deg_down( /** rct2: 0x00824E3C */ static void lay_down_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11058,9 +10902,8 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -11085,9 +10928,8 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -11112,9 +10954,8 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -11122,22 +10963,22 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16707), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11147,29 +10988,28 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16645), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -11186,9 +11026,8 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11199,9 +11038,8 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11212,9 +11050,8 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11226,25 +11063,24 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11252,12 +11088,12 @@ static void lay_down_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00824E9C */ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11287,10 +11123,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -11315,10 +11150,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -11343,10 +11177,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -11354,22 +11187,22 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16719), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11379,30 +11212,29 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16657), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11419,10 +11251,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -11433,10 +11264,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11447,10 +11277,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -11462,30 +11291,29 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11493,7 +11321,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x00824EAC */ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11523,10 +11351,9 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -11551,10 +11378,9 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -11579,10 +11405,9 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -11590,22 +11415,22 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16715), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11615,30 +11440,29 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16653), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11655,10 +11479,9 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -11669,10 +11492,9 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11683,10 +11505,9 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -11698,30 +11519,29 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -11729,7 +11549,7 @@ static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x00824E4C */ static void lay_down_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11759,10 +11579,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -11787,10 +11606,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -11815,10 +11633,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -11826,22 +11643,22 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16703), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11851,30 +11668,29 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16641), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11891,10 +11707,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11905,10 +11720,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11919,10 +11733,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11934,30 +11747,29 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11965,7 +11777,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x00824EEC */ static void lay_down_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11981,10 +11793,9 @@ static void lay_down_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11998,10 +11809,9 @@ static void lay_down_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12012,38 +11822,36 @@ static void lay_down_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16667), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12060,10 +11868,9 @@ static void lay_down_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12074,10 +11881,9 @@ static void lay_down_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12088,10 +11894,9 @@ static void lay_down_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12103,31 +11908,30 @@ static void lay_down_rc_track_diag_flat_to_left_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12135,7 +11939,7 @@ static void lay_down_rc_track_diag_flat_to_left_bank( /** rct2: 0x00824EFC */ static void lay_down_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12151,10 +11955,9 @@ static void lay_down_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12165,10 +11968,9 @@ static void lay_down_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12182,38 +11984,36 @@ static void lay_down_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16672), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12230,10 +12030,9 @@ static void lay_down_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12244,10 +12043,9 @@ static void lay_down_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12258,10 +12056,9 @@ static void lay_down_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12273,31 +12070,30 @@ static void lay_down_rc_track_diag_flat_to_right_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12305,7 +12101,7 @@ static void lay_down_rc_track_diag_flat_to_right_bank( /** rct2: 0x00824F0C */ static void lay_down_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12321,10 +12117,9 @@ static void lay_down_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12338,10 +12133,9 @@ static void lay_down_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12352,38 +12146,36 @@ static void lay_down_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16674), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12400,10 +12192,9 @@ static void lay_down_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12414,10 +12205,9 @@ static void lay_down_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12428,10 +12218,9 @@ static void lay_down_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12443,31 +12232,30 @@ static void lay_down_rc_track_diag_left_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12475,7 +12263,7 @@ static void lay_down_rc_track_diag_left_bank_to_flat( /** rct2: 0x00824F1C */ static void lay_down_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12491,10 +12279,9 @@ static void lay_down_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12505,10 +12292,9 @@ static void lay_down_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12522,38 +12308,36 @@ static void lay_down_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16669), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12570,10 +12354,9 @@ static void lay_down_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12584,10 +12367,9 @@ static void lay_down_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12598,10 +12380,9 @@ static void lay_down_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12613,31 +12394,30 @@ static void lay_down_rc_track_diag_right_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12645,7 +12425,7 @@ static void lay_down_rc_track_diag_right_bank_to_flat( /** rct2: 0x00824F4C */ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12661,10 +12441,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12678,10 +12457,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12692,38 +12470,36 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16687), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12740,10 +12516,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12754,10 +12529,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12768,10 +12542,9 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12783,30 +12556,29 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12814,7 +12586,7 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x00824F5C */ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12830,10 +12602,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12844,10 +12615,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12861,38 +12631,36 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16692), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12909,10 +12677,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12923,10 +12690,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12937,10 +12703,9 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12952,30 +12717,29 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12983,7 +12747,7 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x00824F2C */ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12999,10 +12763,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13016,10 +12779,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13030,38 +12792,36 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16677), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13078,10 +12838,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13092,10 +12851,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13106,10 +12864,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -13121,30 +12878,29 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13152,7 +12908,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x00824F3C */ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13168,10 +12924,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13182,10 +12937,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13199,38 +12953,36 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16682), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13247,10 +12999,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13261,10 +13012,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -13275,10 +13025,9 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -13290,30 +13039,29 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -13321,7 +13069,7 @@ static void lay_down_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x00824F6C */ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13337,9 +13085,8 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13353,9 +13100,8 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13366,36 +13112,34 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16684), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -13412,9 +13156,8 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13425,9 +13168,8 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13438,9 +13180,8 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13452,25 +13193,24 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -13478,12 +13218,12 @@ static void lay_down_rc_track_diag_left_bank_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00824F7C */ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13499,9 +13239,8 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13512,9 +13251,8 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13528,36 +13266,34 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16679), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -13574,9 +13310,8 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13587,9 +13322,8 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13600,9 +13334,8 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13614,25 +13347,24 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -13640,12 +13372,12 @@ static void lay_down_rc_track_diag_right_bank_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00824F8C */ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13661,10 +13393,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13678,10 +13409,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13692,38 +13422,36 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16694), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13740,10 +13468,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13754,10 +13481,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13768,10 +13494,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13783,30 +13508,29 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13814,7 +13538,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x00824F9C */ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13830,10 +13554,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13844,10 +13567,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13861,38 +13583,36 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16689), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13909,10 +13629,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13923,10 +13642,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13937,10 +13655,9 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13952,30 +13669,29 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 37, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13983,7 +13699,7 @@ static void lay_down_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x00824ECC */ static void lay_down_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13999,10 +13715,9 @@ static void lay_down_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14013,10 +13728,9 @@ static void lay_down_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14027,38 +13741,36 @@ static void lay_down_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16663), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14075,10 +13787,9 @@ static void lay_down_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14089,10 +13800,9 @@ static void lay_down_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14103,10 +13813,9 @@ static void lay_down_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -14118,31 +13827,30 @@ static void lay_down_rc_track_diag_left_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14150,7 +13858,7 @@ static void lay_down_rc_track_diag_left_bank( /** rct2: 0x00824EDC */ static void lay_down_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -14166,10 +13874,9 @@ static void lay_down_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14180,10 +13887,9 @@ static void lay_down_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14194,38 +13900,36 @@ static void lay_down_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16665), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14242,10 +13946,9 @@ static void lay_down_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14256,10 +13959,9 @@ static void lay_down_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14270,10 +13972,9 @@ static void lay_down_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -14285,31 +13986,30 @@ static void lay_down_rc_track_diag_right_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -14317,7 +14017,7 @@ static void lay_down_rc_track_diag_right_bank( /** rct2: 0x00824FAC */ static void lay_down_rc_track_left_flyer_twist_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14346,18 +14046,17 @@ static void lay_down_rc_track_left_flyer_twist_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14383,12 +14082,11 @@ static void lay_down_rc_track_left_flyer_twist_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14415,31 +14113,30 @@ static void lay_down_rc_track_left_flyer_twist_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824FBC */ static void lay_down_rc_track_right_flyer_twist_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14468,18 +14165,17 @@ static void lay_down_rc_track_right_flyer_twist_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14505,12 +14201,11 @@ static void lay_down_rc_track_right_flyer_twist_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14537,31 +14232,30 @@ static void lay_down_rc_track_right_flyer_twist_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824FCC */ static void lay_down_rc_track_left_flyer_twist_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14591,19 +14285,18 @@ static void lay_down_rc_track_left_flyer_twist_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14629,12 +14322,11 @@ static void lay_down_rc_track_left_flyer_twist_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14660,30 +14352,29 @@ static void lay_down_rc_track_left_flyer_twist_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824FDC */ static void lay_down_rc_track_right_flyer_twist_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14713,19 +14404,18 @@ static void lay_down_rc_track_right_flyer_twist_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -14751,12 +14441,11 @@ static void lay_down_rc_track_right_flyer_twist_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -14782,30 +14471,29 @@ static void lay_down_rc_track_right_flyer_twist_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00824C3C */ static void lay_down_rc_track_flyer_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14834,15 +14522,15 @@ static void lay_down_rc_track_flyer_half_loop_up( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -14851,33 +14539,33 @@ static void lay_down_rc_track_flyer_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16595), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16603), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16600), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16608), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -14903,12 +14591,11 @@ static void lay_down_rc_track_flyer_half_loop_up( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -14936,18 +14623,18 @@ static void lay_down_rc_track_flyer_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00824C4C */ static void lay_down_rc_track_flyer_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14978,11 +14665,11 @@ static void lay_down_rc_track_flyer_half_loop_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -15008,12 +14695,11 @@ static void lay_down_rc_track_flyer_half_loop_down( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 2: switch (direction) @@ -15022,33 +14708,33 @@ static void lay_down_rc_track_flyer_half_loop_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16595), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16603), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16600), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16608), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -15074,22 +14760,22 @@ static void lay_down_rc_track_flyer_half_loop_down( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x00824C5C */ static void lay_down_rc_track_left_flyer_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15121,26 +14807,24 @@ static void lay_down_rc_track_left_flyer_corkscrew_up( if (direction == 2) { - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction != 2) { - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -15166,8 +14850,8 @@ static void lay_down_rc_track_left_flyer_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -15194,29 +14878,29 @@ static void lay_down_rc_track_left_flyer_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00824C6C */ static void lay_down_rc_track_right_flyer_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15245,16 +14929,16 @@ static void lay_down_rc_track_right_flyer_corkscrew_up( { 32, 20, 3 }, { 0, 6, height + 4 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -15280,8 +14964,8 @@ static void lay_down_rc_track_right_flyer_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -15308,29 +14992,29 @@ static void lay_down_rc_track_right_flyer_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00824C7C */ static void lay_down_rc_track_left_flyer_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15360,17 +15044,17 @@ static void lay_down_rc_track_left_flyer_corkscrew_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -15396,8 +15080,8 @@ static void lay_down_rc_track_left_flyer_corkscrew_down( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -15423,28 +15107,28 @@ static void lay_down_rc_track_left_flyer_corkscrew_down( { 20, 32, 3 }, { 6, 0, height + 4 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00824C8C */ static void lay_down_rc_track_right_flyer_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 2 - trackSequence, (direction + 3) % 4, height, trackElement); @@ -15452,7 +15136,7 @@ static void lay_down_rc_track_right_flyer_corkscrew_down( /** rct2: 0x00824FEC */ static void lay_down_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -15472,12 +15156,11 @@ static void lay_down_rc_track_block_brakes( { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -15497,21 +15180,21 @@ static void lay_down_rc_track_block_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } static void lay_down_rc_track_left_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15541,20 +15224,20 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -15580,12 +15263,11 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -15611,12 +15293,12 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -15642,12 +15324,11 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -15674,28 +15355,28 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lay_down_rc_track_right_quarter_banked_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15725,20 +15406,20 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -15764,12 +15445,11 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( { 32, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -15795,12 +15475,12 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( { 16, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -15826,12 +15506,11 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -15858,28 +15537,28 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lay_down_rc_track_left_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -15909,20 +15588,20 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -15948,12 +15627,11 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -15979,12 +15657,12 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -16010,12 +15688,11 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -16042,28 +15719,28 @@ static void lay_down_rc_track_left_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lay_down_rc_track_right_quarter_banked_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -16093,20 +15770,20 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -16132,12 +15809,11 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_down( { 32, 16, 3 }, { 0, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -16163,12 +15839,12 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_down( { 16, 16, 3 }, { 0, 16, height + 38 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -16194,12 +15870,11 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 38 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -16226,27 +15901,27 @@ static void lay_down_rc_track_right_quarter_banked_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 39, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lay_down_rc_track_half_loop_inverted_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -16276,33 +15951,33 @@ static void lay_down_rc_track_half_loop_inverted_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -16328,8 +16003,8 @@ static void lay_down_rc_track_half_loop_inverted_up( { 2, 2, 3 }, { 29, 20, height + 29 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -16355,12 +16030,11 @@ static void lay_down_rc_track_half_loop_inverted_up( { 2, 2, 119 }, { 29, 29, height + 2 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -16388,17 +16062,17 @@ static void lay_down_rc_track_half_loop_inverted_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lay_down_rc_track_half_loop_uninverted_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lay_down_rc_track_half_loop_inverted_up(session, ride, 3 - trackSequence, direction, height, trackElement); diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index 349c29c70e..1c5cac1729 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _LimLauncherBlockBrakeImages[NumOrthogonalDirect /** rct2: 0x008A6D50, 0x008A6D60, 0x008A6D70 */ static void lim_launched_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -60,14 +60,14 @@ static void lim_launched_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A65E0 */ static void lim_launched_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -79,41 +79,40 @@ static void lim_launched_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15388), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15396), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15395), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15403), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -139,12 +138,11 @@ static void lim_launched_rc_track_left_vertical_loop( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -170,9 +168,9 @@ static void lim_launched_rc_track_left_vertical_loop( { 2, 16, 119 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -198,18 +196,17 @@ static void lim_launched_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -235,12 +232,11 @@ static void lim_launched_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -266,9 +262,9 @@ static void lim_launched_rc_track_left_vertical_loop( { 3, 16, 119 }, { 12, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -294,12 +290,11 @@ static void lim_launched_rc_track_left_vertical_loop( { 32, 2, 63 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -308,53 +303,52 @@ static void lim_launched_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15395), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15403), { 0, 6, height }, { 32, 20, 7 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15388), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15396), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A65F0 */ static void lim_launched_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -383,12 +377,12 @@ static void lim_launched_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -414,7 +408,7 @@ static void lim_launched_rc_track_right_vertical_loop( { 32, 26, 3 }); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -440,7 +434,7 @@ static void lim_launched_rc_track_right_vertical_loop( { 2, 16, 119 }, { 16, 0, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -466,13 +460,13 @@ static void lim_launched_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -498,7 +492,7 @@ static void lim_launched_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -524,7 +518,7 @@ static void lim_launched_rc_track_right_vertical_loop( { 4, 16, 119 }, { 10, 16, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -550,7 +544,7 @@ static void lim_launched_rc_track_right_vertical_loop( { 32, 26, 3 }); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -576,17 +570,17 @@ static void lim_launched_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -595,7 +589,7 @@ static void lim_launched_rc_track_right_vertical_loop( /** rct2: 0x008A6D10 */ static void lim_launched_rc_track_left_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -636,15 +630,15 @@ static void lim_launched_rc_track_left_twist_down_to_up( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -682,12 +676,11 @@ static void lim_launched_rc_track_left_twist_down_to_up( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -728,23 +721,23 @@ static void lim_launched_rc_track_left_twist_down_to_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height - 32, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height - 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height - 32, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height, 0x20); + PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; } } /** rct2: 0x008A6D20 */ static void lim_launched_rc_track_right_twist_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -785,15 +778,15 @@ static void lim_launched_rc_track_right_twist_down_to_up( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -831,12 +824,11 @@ static void lim_launched_rc_track_right_twist_down_to_up( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -877,23 +869,23 @@ static void lim_launched_rc_track_right_twist_down_to_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 32, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height + 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 32, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height, 0x20); + PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; } } /** rct2: 0x008A6D30 */ static void lim_launched_rc_track_left_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -936,12 +928,12 @@ static void lim_launched_rc_track_left_twist_up_to_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 32, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height, 0x20); + PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; case 1: switch (direction) @@ -979,12 +971,11 @@ static void lim_launched_rc_track_left_twist_up_to_down( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1022,27 +1013,27 @@ static void lim_launched_rc_track_left_twist_up_to_down( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6D40 */ static void lim_launched_rc_track_right_twist_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1085,12 +1076,12 @@ static void lim_launched_rc_track_right_twist_up_to_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -1128,12 +1119,11 @@ static void lim_launched_rc_track_right_twist_up_to_down( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1171,27 +1161,27 @@ static void lim_launched_rc_track_right_twist_up_to_down( { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6CD0 */ static void lim_launched_rc_track_left_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1225,9 +1215,9 @@ static void lim_launched_rc_track_left_corkscrew_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1253,8 +1243,8 @@ static void lim_launched_rc_track_left_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1281,29 +1271,28 @@ static void lim_launched_rc_track_left_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A6CE0 */ static void lim_launched_rc_track_right_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1332,15 +1321,15 @@ static void lim_launched_rc_track_right_corkscrew_up( { 32, 20, 3 }, { 0, 6, height + 4 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1366,8 +1355,8 @@ static void lim_launched_rc_track_right_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1394,29 +1383,28 @@ static void lim_launched_rc_track_right_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A6CF0 */ static void lim_launched_rc_track_left_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); @@ -1424,7 +1412,7 @@ static void lim_launched_rc_track_left_corkscrew_down( /** rct2: 0x008A6D00 */ static void lim_launched_rc_track_right_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); @@ -1432,7 +1420,7 @@ static void lim_launched_rc_track_right_corkscrew_down( /** rct2: 0x008A6D80 */ static void lim_launched_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1452,17 +1440,17 @@ static void lim_launched_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6C10 */ static void lim_launched_rc_track_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1491,10 +1479,10 @@ static void lim_launched_rc_track_90_deg_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -1503,7 +1491,7 @@ static void lim_launched_rc_track_90_deg_up( /** rct2: 0x008A6C20 */ static void lim_launched_rc_track_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1511,7 +1499,7 @@ static void lim_launched_rc_track_90_deg_down( /** rct2: 0x008A6C30 */ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1542,12 +1530,12 @@ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: break; @@ -1556,7 +1544,7 @@ static void lim_launched_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x008A6C40 */ static void lim_launched_rc_track_90_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1564,7 +1552,7 @@ static void lim_launched_rc_track_90_deg_down_to_60_deg_down( /** rct2: 0x008A6C50 */ static void lim_launched_rc_track_90_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1593,20 +1581,20 @@ static void lim_launched_rc_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } /** rct2: 0x008A6C60 */ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1637,11 +1625,11 @@ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: break; @@ -1650,7 +1638,7 @@ static void lim_launched_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x008A6C70 */ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1679,9 +1667,9 @@ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -1707,9 +1695,9 @@ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -1737,18 +1725,18 @@ static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A6C80 */ static void lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1757,7 +1745,7 @@ static void lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down( /** rct2: 0x008A6D90 */ static void lim_launched_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -1767,16 +1755,16 @@ static void lim_launched_rc_track_block_brakes( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1811,10 +1799,10 @@ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( { 2, 20, 63 }, { 24, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -1823,7 +1811,7 @@ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up( /** rct2: 0x008A6CA0 */ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1858,10 +1846,10 @@ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( { 2, 20, 63 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -1870,7 +1858,7 @@ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up( /** rct2: 0x008A6CB0 */ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1879,7 +1867,7 @@ static void lim_launched_rc_track_left_quarter_turn_1_90_deg_down( /** rct2: 0x008A6CC0 */ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -1887,7 +1875,7 @@ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_down( } static void lim_launched_rc_track_left_barrel_roll_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1904,7 +1892,7 @@ static void lim_launched_rc_track_left_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 1), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1916,7 +1904,7 @@ static void lim_launched_rc_track_left_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 7), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1928,7 +1916,7 @@ static void lim_launched_rc_track_left_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 13), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -1940,18 +1928,18 @@ static void lim_launched_rc_track_left_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 19), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1997,12 +1985,11 @@ static void lim_launched_rc_track_left_barrel_roll_up_to_down( { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2051,22 +2038,22 @@ static void lim_launched_rc_track_left_barrel_roll_up_to_down( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_right_barrel_roll_up_to_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2083,7 +2070,7 @@ static void lim_launched_rc_track_right_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 25), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2095,7 +2082,7 @@ static void lim_launched_rc_track_right_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 31), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2107,7 +2094,7 @@ static void lim_launched_rc_track_right_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 37), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -2119,18 +2106,18 @@ static void lim_launched_rc_track_right_barrel_roll_up_to_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 43), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2176,12 +2163,11 @@ static void lim_launched_rc_track_right_barrel_roll_up_to_down( { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2230,22 +2216,22 @@ static void lim_launched_rc_track_right_barrel_roll_up_to_down( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_left_barrel_roll_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_barrel_roll_up_to_down( @@ -2253,7 +2239,7 @@ static void lim_launched_rc_track_left_barrel_roll_down_to_up( } static void lim_launched_rc_track_right_barrel_roll_down_to_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_barrel_roll_up_to_down( @@ -2261,7 +2247,7 @@ static void lim_launched_rc_track_right_barrel_roll_down_to_up( } static void lim_launched_rc_track_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2294,14 +2280,14 @@ static void lim_launched_rc_track_half_loop_up( { 0, 6, height }, { 32, 20, 7 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2311,7 +2297,7 @@ static void lim_launched_rc_track_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP + 1), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2319,7 +2305,7 @@ static void lim_launched_rc_track_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP + 5), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2327,7 +2313,7 @@ static void lim_launched_rc_track_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP + 9), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -2335,12 +2321,12 @@ static void lim_launched_rc_track_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP + 13), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2370,12 +2356,11 @@ static void lim_launched_rc_track_half_loop_up( { 16, 16, height }, { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2407,24 +2392,24 @@ static void lim_launched_rc_track_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); } static void lim_launched_rc_track_flat_to_60_deg_up_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2459,16 +2444,15 @@ static void lim_launched_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2500,12 +2484,11 @@ static void lim_launched_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2537,12 +2520,11 @@ static void lim_launched_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -2574,26 +2556,25 @@ static void lim_launched_rc_track_flat_to_60_deg_up_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 19, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 19, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } static void lim_launched_rc_track_60_deg_up_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2628,16 +2609,15 @@ static void lim_launched_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 24, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: switch (direction) @@ -2669,12 +2649,11 @@ static void lim_launched_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -2706,12 +2685,11 @@ static void lim_launched_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2743,27 +2721,26 @@ static void lim_launched_rc_track_60_deg_up_to_flat_long_base( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_flat_to_60_deg_down_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_60_deg_up_to_flat_long_base( @@ -2771,7 +2748,7 @@ static void lim_launched_rc_track_flat_to_60_deg_down_long_base( } static void lim_launched_rc_track_60_deg_down_to_flat_long_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_flat_to_60_deg_up_long_base( @@ -2779,7 +2756,7 @@ static void lim_launched_rc_track_60_deg_down_to_flat_long_base( } static void lim_launched_rc_track_left_large_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2813,16 +2790,16 @@ static void lim_launched_rc_track_left_large_corkscrew_up( break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -2832,7 +2809,7 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 1), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 34, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2840,7 +2817,7 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 6), { 0, 0, height }, { 26, 1, 32 }, { 0, 29, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2848,7 +2825,7 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 11), { 0, 0, height }, { 20, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -2856,16 +2833,15 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 16), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -2895,18 +2871,17 @@ static void lim_launched_rc_track_left_large_corkscrew_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { @@ -2915,7 +2890,7 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 3), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2923,7 +2898,7 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 8), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2931,7 +2906,7 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 13), { 0, 0, height }, { 24, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -2939,12 +2914,12 @@ static void lim_launched_rc_track_left_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 18), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: switch (direction) @@ -2975,27 +2950,26 @@ static void lim_launched_rc_track_left_large_corkscrew_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_right_large_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3029,16 +3003,16 @@ static void lim_launched_rc_track_right_large_corkscrew_up( break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -3048,7 +3022,7 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 21), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3056,7 +3030,7 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 26), { 0, 0, height }, { 20, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3064,7 +3038,7 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 31), { 0, 0, height }, { 26, 1, 32 }, { 0, 29, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3072,16 +3046,15 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 36), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 34, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -3111,18 +3084,17 @@ static void lim_launched_rc_track_right_large_corkscrew_up( { 0, 0, height }, { 48, 1, 64 }, { 0, 31, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { @@ -3131,7 +3103,7 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 23), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3139,7 +3111,7 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 28), { 0, 0, height }, { 24, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3147,7 +3119,7 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 33), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3155,11 +3127,11 @@ static void lim_launched_rc_track_right_large_corkscrew_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 38), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: switch (direction) @@ -3190,41 +3162,40 @@ static void lim_launched_rc_track_right_large_corkscrew_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_left_large_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_large_corkscrew_up(session, ride, 5 - trackSequence, (direction + 1) & 3, height, trackElement); } static void lim_launched_rc_track_right_large_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_large_corkscrew_up(session, ride, 5 - trackSequence, (direction - 1) & 3, height, trackElement); } static void lim_launched_rc_track_left_medium_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3258,15 +3229,15 @@ static void lim_launched_rc_track_left_medium_half_loop_up( break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3297,12 +3268,11 @@ static void lim_launched_rc_track_left_medium_half_loop_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3312,7 +3282,7 @@ static void lim_launched_rc_track_left_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 2), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 2 }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3320,7 +3290,7 @@ static void lim_launched_rc_track_left_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 7), { 0, 0, height }, { 1, 32, 96 }, { 29, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3328,7 +3298,7 @@ static void lim_launched_rc_track_left_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 12), { 0, 0, height }, { 1, 32, 96 }, { 31, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3336,13 +3306,13 @@ static void lim_launched_rc_track_left_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 17), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: switch (direction) @@ -3372,9 +3342,9 @@ static void lim_launched_rc_track_left_medium_half_loop_up( { 0, 0, height }, { 1, 32, 160 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: switch (direction) @@ -3405,23 +3375,22 @@ static void lim_launched_rc_track_left_medium_half_loop_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + PaintUtilRotateSegments(SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_right_medium_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3455,15 +3424,15 @@ static void lim_launched_rc_track_right_medium_half_loop_up( break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3494,12 +3463,11 @@ static void lim_launched_rc_track_right_medium_half_loop_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + PaintUtilRotateSegments(SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3509,7 +3477,7 @@ static void lim_launched_rc_track_right_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 22), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3517,7 +3485,7 @@ static void lim_launched_rc_track_right_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 27), { 0, 0, height }, { 0, 32, 96 }, { 30, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3525,7 +3493,7 @@ static void lim_launched_rc_track_right_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 32), { 0, 0, height }, { 0, 32, 96 }, { 29, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3533,13 +3501,13 @@ static void lim_launched_rc_track_right_medium_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 37), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 2 }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: switch (direction) @@ -3570,9 +3538,9 @@ static void lim_launched_rc_track_right_medium_half_loop_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: switch (direction) @@ -3603,36 +3571,35 @@ static void lim_launched_rc_track_right_medium_half_loop_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void lim_launched_rc_track_left_medium_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_medium_half_loop_up(session, ride, 4 - trackSequence, direction, height, trackElement); } static void lim_launched_rc_track_right_medium_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_medium_half_loop_up(session, ride, 4 - trackSequence, direction, height, trackElement); } static void lim_launched_rc_track_left_zero_g_roll_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3649,7 +3616,7 @@ static void lim_launched_rc_track_left_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 1), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3661,7 +3628,7 @@ static void lim_launched_rc_track_left_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 5), { 0, 0, height }, { 32, 1, 32 }, { 0, 31, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3669,7 +3636,7 @@ static void lim_launched_rc_track_left_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 8), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3677,18 +3644,18 @@ static void lim_launched_rc_track_left_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 12), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -3718,12 +3685,11 @@ static void lim_launched_rc_track_left_zero_g_roll_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3764,26 +3730,24 @@ static void lim_launched_rc_track_left_zero_g_roll_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_general_support_height(session, height + 40, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_right_zero_g_roll_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3796,7 +3760,7 @@ static void lim_launched_rc_track_right_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 16), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3804,7 +3768,7 @@ static void lim_launched_rc_track_right_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 20), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3816,7 +3780,7 @@ static void lim_launched_rc_track_right_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 25), { 0, 0, height }, { 32, 1, 32 }, { 0, 31, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3828,17 +3792,17 @@ static void lim_launched_rc_track_right_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 29), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -3868,12 +3832,11 @@ static void lim_launched_rc_track_right_zero_g_roll_up( { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -3914,40 +3877,38 @@ static void lim_launched_rc_track_right_zero_g_roll_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_general_support_height(session, height + 40, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_left_zero_g_roll_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_zero_g_roll_up(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void lim_launched_rc_track_right_zero_g_roll_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_zero_g_roll_up(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void lim_launched_rc_track_left_large_zero_g_roll_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3984,14 +3945,14 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -4025,9 +3986,9 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -4061,18 +4022,16 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); switch (direction) { @@ -4081,7 +4040,7 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 4), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4089,7 +4048,7 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 8), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4101,7 +4060,7 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 14), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4109,26 +4068,26 @@ static void lim_launched_rc_track_left_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 19), { 0, 0, height }, { 32, 10, 20 }, { 0, 18, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_right_large_zero_g_roll_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4165,14 +4124,14 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -4206,9 +4165,9 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( { 0, 0, height }, { 32, 0, 96 }, { 0, 30, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -4243,18 +4202,16 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { @@ -4263,7 +4220,7 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 24), { 0, 0, height }, { 32, 10, 20 }, { 0, 18, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4275,7 +4232,7 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 30), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4283,7 +4240,7 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 34), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4291,26 +4248,26 @@ static void lim_launched_rc_track_right_large_zero_g_roll_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 39), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_left_large_zero_g_roll_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_large_zero_g_roll_up( @@ -4318,7 +4275,7 @@ static void lim_launched_rc_track_left_large_zero_g_roll_down( } static void lim_launched_rc_track_right_large_zero_g_roll_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_large_zero_g_roll_up( @@ -4326,7 +4283,7 @@ static void lim_launched_rc_track_right_large_zero_g_roll_down( } static void lim_launched_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4363,20 +4320,20 @@ static void lim_launched_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4406,26 +4363,25 @@ static void lim_launched_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( { 6, 0, height }, { 20, 32, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lim_launched_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4462,20 +4418,20 @@ static void lim_launched_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4505,26 +4461,25 @@ static void lim_launched_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( { 6, 0, height }, { 20, 32, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lim_launched_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4557,21 +4512,20 @@ static void lim_launched_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( { 0, 6, height }, { 32, 20, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4605,25 +4559,25 @@ static void lim_launched_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lim_launched_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4656,21 +4610,20 @@ static void lim_launched_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank { 0, 6, height }, { 32, 20, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -4704,25 +4657,25 @@ static void lim_launched_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lim_launched_rc_track_left_large_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4755,14 +4708,14 @@ static void lim_launched_rc_track_left_large_half_loop_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4772,7 +4725,7 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 1), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4780,7 +4733,7 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 8), { 0, 0, height }, { 32, 20, 9 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4788,7 +4741,7 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 15), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4796,13 +4749,13 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 22), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -4832,12 +4785,11 @@ static void lim_launched_rc_track_left_large_half_loop_up( { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -4847,7 +4799,7 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 3), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4855,7 +4807,7 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 10), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -4863,7 +4815,7 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 17), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -4871,16 +4823,15 @@ static void lim_launched_rc_track_left_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 24), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -4910,9 +4861,9 @@ static void lim_launched_rc_track_left_large_half_loop_up( { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -4942,12 +4893,11 @@ static void lim_launched_rc_track_left_large_half_loop_up( { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -4979,20 +4929,19 @@ static void lim_launched_rc_track_left_large_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_right_large_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5025,14 +4974,14 @@ static void lim_launched_rc_track_right_large_half_loop_up( { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -5042,7 +4991,7 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 29), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5050,7 +4999,7 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 36), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -5058,7 +5007,7 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 43), { 0, 0, height }, { 32, 20, 9 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -5066,13 +5015,13 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 50), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5102,12 +5051,11 @@ static void lim_launched_rc_track_right_large_half_loop_up( { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -5117,7 +5065,7 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 31), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5125,7 +5073,7 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 38), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -5133,7 +5081,7 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 45), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -5141,16 +5089,15 @@ static void lim_launched_rc_track_right_large_half_loop_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 52), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -5180,9 +5127,9 @@ static void lim_launched_rc_track_right_large_half_loop_up( { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -5212,12 +5159,11 @@ static void lim_launched_rc_track_right_large_half_loop_up( { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -5249,34 +5195,33 @@ static void lim_launched_rc_track_right_large_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void lim_launched_rc_track_right_large_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_right_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, trackElement); } static void lim_launched_rc_track_left_large_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_left_large_half_loop_up(session, ride, 6 - trackSequence, direction, height, trackElement); } static void lim_launched_rc_track_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5286,7 +5231,7 @@ static void lim_launched_rc_track_flat_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 0), { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5297,8 +5242,7 @@ static void lim_launched_rc_track_flat_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 1), { 0, 0, height }, { 32, 2, 43 }, { 0, 4, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5309,32 +5253,31 @@ static void lim_launched_rc_track_flat_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 3), { 0, 0, height }, { 32, 2, 43 }, { 0, 4, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 5), { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } static void lim_launched_rc_track_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5372,36 +5315,36 @@ static void lim_launched_rc_track_60_deg_up_to_flat( { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void lim_launched_rc_track_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_60_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void lim_launched_rc_track_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { lim_launched_rc_track_flat_to_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void lim_launched_rc_track_diag_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5416,9 +5359,9 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_up( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -5430,9 +5373,9 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_up( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -5444,15 +5387,15 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_up( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5460,27 +5403,27 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 13), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lim_launched_rc_track_diag_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5495,9 +5438,9 @@ static void lim_launched_rc_track_diag_60_deg_up_to_flat( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -5509,9 +5452,9 @@ static void lim_launched_rc_track_diag_60_deg_up_to_flat( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5523,15 +5466,15 @@ static void lim_launched_rc_track_diag_60_deg_up_to_flat( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5539,27 +5482,27 @@ static void lim_launched_rc_track_diag_60_deg_up_to_flat( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 17), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void lim_launched_rc_track_diag_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5574,9 +5517,9 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_down( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -5588,9 +5531,9 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_down( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5602,15 +5545,15 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_down( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5618,27 +5561,27 @@ static void lim_launched_rc_track_diag_flat_to_60_deg_down( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 19), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void lim_launched_rc_track_diag_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5653,9 +5596,9 @@ static void lim_launched_rc_track_diag_60_deg_down_to_flat( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -5667,9 +5610,9 @@ static void lim_launched_rc_track_diag_60_deg_down_to_flat( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -5681,15 +5624,15 @@ static void lim_launched_rc_track_diag_60_deg_down_to_flat( { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5697,27 +5640,27 @@ static void lim_launched_rc_track_diag_60_deg_down_to_flat( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 15), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void lim_launched_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5743,12 +5686,12 @@ static void lim_launched_rc_track_booster( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } 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 7e00b335d5..e340496ae0 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -26,7 +26,7 @@ static constexpr auto SPR_LOOPING_RC_FLAT_CHAINED_NW_SE = 15017; /** rct2: 0x008A6370 */ static void looping_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -56,7 +56,7 @@ static void looping_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -78,17 +78,17 @@ static void looping_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void looping_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIdsFrictionWheels[4][2] = { @@ -113,14 +113,14 @@ static void looping_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6380 */ static void looping_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -150,7 +150,7 @@ static void looping_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -180,25 +180,25 @@ static void looping_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6390 */ static void looping_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -228,7 +228,7 @@ static void looping_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -258,25 +258,25 @@ static void looping_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A63A0 */ static void looping_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -306,7 +306,7 @@ static void looping_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -336,25 +336,25 @@ static void looping_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A63B0 */ static void looping_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -390,7 +390,7 @@ static void looping_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -426,25 +426,25 @@ static void looping_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A63C0 */ static void looping_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -480,7 +480,7 @@ static void looping_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -516,25 +516,25 @@ static void looping_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A63D0 */ static void looping_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -564,7 +564,7 @@ static void looping_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -594,25 +594,25 @@ static void looping_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A63E0 */ static void looping_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { looping_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -620,7 +620,7 @@ static void looping_rc_track_25_deg_down( /** rct2: 0x008A63F0 */ static void looping_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { looping_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -628,7 +628,7 @@ static void looping_rc_track_60_deg_down( /** rct2: 0x008A6400 */ static void looping_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -636,7 +636,7 @@ static void looping_rc_track_flat_to_25_deg_down( /** rct2: 0x008A6410 */ static void looping_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -644,7 +644,7 @@ static void looping_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A6420 */ static void looping_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -652,7 +652,7 @@ static void looping_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A6430 */ static void looping_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -660,7 +660,7 @@ static void looping_rc_track_25_deg_down_to_flat( /** rct2: 0x008A6440 */ static void looping_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -689,17 +689,17 @@ static void looping_rc_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -725,12 +725,11 @@ static void looping_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -756,12 +755,12 @@ static void looping_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -787,12 +786,11 @@ static void looping_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -818,26 +816,26 @@ static void looping_rc_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6450 */ static void looping_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -846,7 +844,7 @@ static void looping_rc_track_right_quarter_turn_5( /** rct2: 0x008A6460 */ static void looping_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -880,17 +878,17 @@ static void looping_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6470 */ static void looping_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -924,17 +922,17 @@ static void looping_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6480 */ static void looping_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -968,17 +966,17 @@ static void looping_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6490 */ static void looping_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1012,17 +1010,17 @@ static void looping_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A64A0 */ static void looping_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1054,17 +1052,17 @@ static void looping_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1090,12 +1088,11 @@ static void looping_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1121,12 +1118,12 @@ static void looping_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1152,12 +1149,11 @@ static void looping_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1186,26 +1182,26 @@ static void looping_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A64B0 */ static void looping_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1214,7 +1210,7 @@ static void looping_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008A64C0 */ static void looping_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1248,24 +1244,24 @@ static void looping_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A64D0 */ static void looping_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1299,24 +1295,24 @@ static void looping_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A64E0 */ static void looping_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1350,24 +1346,24 @@ static void looping_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A64F0 */ static void looping_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1401,24 +1397,24 @@ static void looping_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A6500 */ static void looping_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1426,7 +1422,7 @@ static void looping_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008A6510 */ static void looping_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1434,7 +1430,7 @@ static void looping_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008A6520 */ static void looping_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1442,7 +1438,7 @@ static void looping_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008A6530 */ static void looping_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1450,7 +1446,7 @@ static void looping_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008A6540 */ static void looping_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1478,17 +1474,17 @@ static void looping_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6550 */ static void looping_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { looping_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1496,7 +1492,7 @@ static void looping_rc_track_right_bank( /** rct2: 0x008A6560 */ static void looping_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1525,17 +1521,17 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1561,12 +1557,11 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1592,12 +1587,12 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1623,12 +1618,11 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1654,26 +1648,26 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6570 */ static void looping_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1702,17 +1696,17 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1738,12 +1732,11 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1769,12 +1762,12 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1800,12 +1793,11 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1831,26 +1823,26 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6580 */ static void looping_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1859,7 +1851,7 @@ static void looping_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008A6590 */ static void looping_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1868,7 +1860,7 @@ static void looping_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008A65A0 */ static void looping_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1897,14 +1889,14 @@ static void looping_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1913,14 +1905,14 @@ static void looping_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15261), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15265), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1934,12 +1926,11 @@ static void looping_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1958,23 +1949,22 @@ static void looping_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15261), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15265), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2000,26 +1990,26 @@ static void looping_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A65B0 */ static void looping_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2048,14 +2038,14 @@ static void looping_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2064,14 +2054,14 @@ static void looping_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15269), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15273), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2085,12 +2075,11 @@ static void looping_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2109,23 +2098,22 @@ static void looping_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15269), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15273), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2151,26 +2139,26 @@ static void looping_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A65C0 */ static void looping_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2201,14 +2189,13 @@ static void looping_rc_track_left_vertical_loop( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2234,12 +2221,11 @@ static void looping_rc_track_left_vertical_loop( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2248,7 +2234,7 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15350), { 16, 0, height }, { 3, 16, 119 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_CENTRED, 1, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15364), { 16, 0, height }, @@ -2258,7 +2244,7 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15358), { 12, 0, height }, { 3, 16, 119 }, { 12, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT_CENTRED, 0, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15366), { 12, 0, height }, @@ -2268,7 +2254,7 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15353), { 10, 16, height }, { 4, 16, 119 }, { 10, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK, 2, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15365), { 10, 16, height }, @@ -2278,16 +2264,16 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15361), { 16, 16, height }, { 2, 16, 119 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT, 3, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15367), { 16, 16, height }, { 2, 16, 119 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2313,18 +2299,17 @@ static void looping_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2350,12 +2335,11 @@ static void looping_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2364,7 +2348,7 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15353), { 10, 16, height }, { 4, 16, 119 }, { 10, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK, 2, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15365), { 10, 16, height }, @@ -2374,7 +2358,7 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15361), { 16, 16, height }, { 2, 16, 119 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT, 3, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15367), { 16, 16, height }, @@ -2384,7 +2368,7 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15350), { 16, 0, height }, { 3, 16, 119 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_CENTRED, 1, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15364), { 16, 0, height }, @@ -2394,16 +2378,16 @@ static void looping_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15358), { 12, 0, height }, { 3, 16, 119 }, { 12, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT_CENTRED, 0, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15366), { 12, 0, height }, { 3, 16, 119 }, { 12, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2429,12 +2413,11 @@ static void looping_rc_track_left_vertical_loop( { 32, 2, 63 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2463,25 +2446,24 @@ static void looping_rc_track_left_vertical_loop( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A65D0 */ static void looping_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2512,9 +2494,9 @@ static void looping_rc_track_right_vertical_loop( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2540,7 +2522,7 @@ static void looping_rc_track_right_vertical_loop( { 32, 26, 3 }); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2549,7 +2531,7 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15381), { 16, 16, height }, { 2, 16, 119 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK, 3, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15384), { 16, 16, height }, @@ -2559,7 +2541,7 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15373), { 10, 16, height }, { 4, 16, 119 }, { 10, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT, 1, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15386), { 10, 16, height }, @@ -2569,7 +2551,7 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15378), { 12, 0, height }, { 3, 16, 119 }, { 12, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_CENTRED, 0, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15385), { 12, 0, height }, @@ -2579,14 +2561,14 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15370), { 16, 0, height }, { 2, 16, 119 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT_CENTRED, 2, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15387), { 16, 0, height }, { 2, 16, 119 }, { 16, 0, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2612,13 +2594,13 @@ static void looping_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2644,7 +2626,7 @@ static void looping_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2653,7 +2635,7 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15378), { 12, 0, height }, { 3, 16, 119 }, { 12, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_CENTRED, 0, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15385), { 12, 0, height }, @@ -2663,7 +2645,7 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15370), { 16, 0, height }, { 2, 16, 119 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT_CENTRED, 2, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15387), { 16, 0, height }, @@ -2673,7 +2655,7 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15381), { 16, 16, height }, { 2, 16, 119 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK, 3, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15384), { 16, 16, height }, @@ -2683,14 +2665,14 @@ static void looping_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15373), { 10, 16, height }, { 4, 16, 119 }, { 10, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_THICK_ALT, 1, 0, height - 8, session.TrackColours[SCHEME_TRACK]); PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15386), { 10, 16, height }, { 4, 16, 119 }, { 10, 16, height }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2716,7 +2698,7 @@ static void looping_rc_track_right_vertical_loop( { 32, 26, 3 }); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2745,13 +2727,13 @@ static void looping_rc_track_right_vertical_loop( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2760,7 +2742,7 @@ static void looping_rc_track_right_vertical_loop( /** rct2: 0x008A6630 */ static void looping_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2789,17 +2771,17 @@ static void looping_rc_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2825,9 +2807,9 @@ static void looping_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2853,26 +2835,26 @@ static void looping_rc_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6640 */ static void looping_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2881,7 +2863,7 @@ static void looping_rc_track_right_quarter_turn_3( /** rct2: 0x008A6650 */ static void looping_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2913,17 +2895,17 @@ static void looping_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2949,9 +2931,9 @@ static void looping_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2980,26 +2962,26 @@ static void looping_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6660 */ static void looping_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3008,7 +2990,7 @@ static void looping_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008A6670 */ static void looping_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3037,20 +3019,20 @@ static void looping_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -3076,26 +3058,26 @@ static void looping_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6680 */ static void looping_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3124,20 +3106,20 @@ static void looping_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -3146,50 +3128,50 @@ static void looping_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15317), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15319), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15321), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15323), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6690 */ static void looping_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3198,7 +3180,7 @@ static void looping_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008A66A0 */ static void looping_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3207,7 +3189,7 @@ static void looping_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008A66B0 */ static void looping_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3239,18 +3221,18 @@ static void looping_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3276,9 +3258,9 @@ static void looping_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3307,20 +3289,20 @@ static void looping_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3349,23 +3331,23 @@ static void looping_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3391,9 +3373,9 @@ static void looping_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3422,22 +3404,22 @@ static void looping_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A66C0 */ static void looping_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3469,18 +3451,18 @@ static void looping_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3506,9 +3488,9 @@ static void looping_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3537,20 +3519,20 @@ static void looping_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3579,23 +3561,23 @@ static void looping_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3621,9 +3603,9 @@ static void looping_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3652,22 +3634,22 @@ static void looping_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A66D0 */ static void looping_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3681,7 +3663,7 @@ static void looping_rc_track_left_half_banked_helix_down_small( /** rct2: 0x008A66E0 */ static void looping_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3695,7 +3677,7 @@ static void looping_rc_track_right_half_banked_helix_down_small( /** rct2: 0x008A66F0 */ static void looping_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3727,18 +3709,18 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3764,12 +3746,11 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3795,12 +3776,12 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3826,12 +3807,11 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3860,20 +3840,20 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3902,23 +3882,23 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3944,12 +3924,11 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3975,12 +3954,12 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4006,12 +3985,11 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4040,22 +4018,22 @@ static void looping_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6700 */ static void looping_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4087,18 +4065,18 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4124,12 +4102,11 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4155,12 +4132,12 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4186,12 +4163,11 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4220,20 +4196,20 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4262,23 +4238,23 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4304,12 +4280,11 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4335,12 +4310,12 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4366,12 +4341,11 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4400,22 +4374,22 @@ static void looping_rc_track_right_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6710 */ static void looping_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4429,7 +4403,7 @@ static void looping_rc_track_left_half_banked_helix_down_large( /** rct2: 0x008A6720 */ static void looping_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4443,7 +4417,7 @@ static void looping_rc_track_right_half_banked_helix_down_large( /** rct2: 0x008A6750 */ static void looping_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4482,13 +4456,13 @@ static void looping_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A6730 */ static void looping_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4527,13 +4501,13 @@ static void looping_rc_track_right_quarter_turn_1_60_deg_up( break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A6740 */ static void looping_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -4541,7 +4515,7 @@ static void looping_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008A6760 */ static void looping_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -4549,7 +4523,7 @@ static void looping_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008A6770 */ static void looping_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4575,17 +4549,17 @@ static void looping_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6A40 */ static void looping_rc_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4613,24 +4587,24 @@ static void looping_rc_track_25_deg_up_left_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6A50 */ static void looping_rc_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4658,24 +4632,24 @@ static void looping_rc_track_25_deg_up_right_banked( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6780 */ static void looping_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4684,8 +4658,8 @@ static void looping_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_D), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15004), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4694,8 +4668,8 @@ static void looping_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_D), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15005), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4704,8 +4678,8 @@ static void looping_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_D), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15004), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4714,22 +4688,22 @@ static void looping_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_D), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15005), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A6A60 */ static void looping_rc_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4737,7 +4711,7 @@ static void looping_rc_track_25_deg_down_left_banked( /** rct2: 0x008A6A70 */ static void looping_rc_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4745,7 +4719,7 @@ static void looping_rc_track_25_deg_down_right_banked( /** rct2: 0x008A6860 */ static void looping_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4774,14 +4748,14 @@ static void looping_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4807,12 +4781,11 @@ static void looping_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4838,15 +4811,15 @@ static void looping_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4855,44 +4828,43 @@ static void looping_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15529), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15533), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15537), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15541), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6870 */ static void looping_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4921,14 +4893,14 @@ static void looping_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4954,12 +4926,11 @@ static void looping_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4985,15 +4956,15 @@ static void looping_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5002,44 +4973,43 @@ static void looping_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15513), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15517), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15521), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15525), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6880 */ static void looping_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5048,7 +5018,7 @@ static void looping_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008A6890 */ static void looping_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5057,7 +5027,7 @@ static void looping_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008A68A0 */ static void looping_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5086,14 +5056,14 @@ static void looping_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5119,12 +5089,11 @@ static void looping_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5150,15 +5119,15 @@ static void looping_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5167,44 +5136,43 @@ static void looping_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15561), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15565), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15569), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15573), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A68B0 */ static void looping_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5233,14 +5201,14 @@ static void looping_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5266,12 +5234,11 @@ static void looping_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5297,15 +5264,15 @@ static void looping_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5314,44 +5281,43 @@ static void looping_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15545), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15549), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15553), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15557), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A68C0 */ static void looping_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5360,7 +5326,7 @@ static void looping_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008A68D0 */ static void looping_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5369,7 +5335,7 @@ static void looping_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008A6790 */ static void looping_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5397,9 +5363,9 @@ static void looping_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5424,9 +5390,9 @@ static void looping_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5451,9 +5417,9 @@ static void looping_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5461,22 +5427,22 @@ static void looping_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15449), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5486,36 +5452,36 @@ static void looping_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15421), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A67C0 */ static void looping_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5543,9 +5509,9 @@ static void looping_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5570,9 +5536,9 @@ static void looping_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5597,9 +5563,9 @@ static void looping_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5607,22 +5573,22 @@ static void looping_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15461), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5632,36 +5598,36 @@ static void looping_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15433), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A67F0 */ static void looping_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5689,9 +5655,9 @@ static void looping_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5716,9 +5682,9 @@ static void looping_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5743,9 +5709,9 @@ static void looping_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5753,22 +5719,22 @@ static void looping_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15473), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5778,36 +5744,36 @@ static void looping_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15445), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A67A0 */ static void looping_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5835,9 +5801,9 @@ static void looping_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5862,9 +5828,9 @@ static void looping_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5889,9 +5855,9 @@ static void looping_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5899,22 +5865,22 @@ static void looping_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15453), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5924,36 +5890,36 @@ static void looping_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15425), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A67D0 */ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5981,9 +5947,9 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6008,9 +5974,9 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6035,9 +6001,9 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6045,22 +6011,22 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15465), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6070,36 +6036,36 @@ static void looping_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15437), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A67E0 */ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6127,9 +6093,9 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6154,9 +6120,9 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6181,9 +6147,9 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6191,22 +6157,22 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15469), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6216,36 +6182,36 @@ static void looping_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15441), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A67B0 */ static void looping_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6273,9 +6239,9 @@ static void looping_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6300,9 +6266,9 @@ static void looping_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6327,9 +6293,9 @@ static void looping_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6337,22 +6303,22 @@ static void looping_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15457), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6362,36 +6328,36 @@ static void looping_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15429), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A6820 */ static void looping_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6419,9 +6385,9 @@ static void looping_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6446,9 +6412,9 @@ static void looping_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6473,9 +6439,9 @@ static void looping_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6483,22 +6449,22 @@ static void looping_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15463), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6508,36 +6474,36 @@ static void looping_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15435), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A6850 */ static void looping_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6565,9 +6531,9 @@ static void looping_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6592,9 +6558,9 @@ static void looping_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6619,9 +6585,9 @@ static void looping_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6629,22 +6595,22 @@ static void looping_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15475), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6654,36 +6620,36 @@ static void looping_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15447), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A6800 */ static void looping_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6711,8 +6677,8 @@ static void looping_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6737,8 +6703,8 @@ static void looping_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6763,8 +6729,8 @@ static void looping_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6772,22 +6738,22 @@ static void looping_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15459), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6797,37 +6763,37 @@ static void looping_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15431), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6830 */ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6855,9 +6821,9 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6882,9 +6848,9 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6909,9 +6875,9 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6919,22 +6885,22 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15471), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6944,36 +6910,36 @@ static void looping_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15443), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6840 */ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7001,9 +6967,9 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7028,9 +6994,9 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7055,9 +7021,9 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7065,22 +7031,22 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15467), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7090,36 +7056,36 @@ static void looping_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15439), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6810 */ static void looping_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7147,9 +7113,9 @@ static void looping_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7174,9 +7140,9 @@ static void looping_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7201,9 +7167,9 @@ static void looping_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7211,22 +7177,22 @@ static void looping_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15455), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7236,36 +7202,36 @@ static void looping_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15427), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A6900 */ static void looping_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7279,9 +7245,9 @@ static void looping_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7295,9 +7261,9 @@ static void looping_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7308,43 +7274,43 @@ static void looping_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15501), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6910 */ static void looping_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7358,9 +7324,9 @@ static void looping_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7371,9 +7337,9 @@ static void looping_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7387,43 +7353,43 @@ static void looping_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15506), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6920 */ static void looping_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7437,9 +7403,9 @@ static void looping_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7453,9 +7419,9 @@ static void looping_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7466,43 +7432,43 @@ static void looping_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15508), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6930 */ static void looping_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7516,9 +7482,9 @@ static void looping_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7529,9 +7495,9 @@ static void looping_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7545,43 +7511,43 @@ static void looping_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15503), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6960 */ static void looping_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7595,9 +7561,9 @@ static void looping_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7611,9 +7577,9 @@ static void looping_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7624,43 +7590,43 @@ static void looping_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15491), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A6970 */ static void looping_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7674,9 +7640,9 @@ static void looping_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7687,9 +7653,9 @@ static void looping_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7703,43 +7669,43 @@ static void looping_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15496), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A6940 */ static void looping_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7753,9 +7719,9 @@ static void looping_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -7769,9 +7735,9 @@ static void looping_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -7782,43 +7748,43 @@ static void looping_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15481), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A6950 */ static void looping_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7832,9 +7798,9 @@ static void looping_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -7845,9 +7811,9 @@ static void looping_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -7861,43 +7827,43 @@ static void looping_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15486), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A6980 */ static void looping_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7911,8 +7877,8 @@ static void looping_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7926,8 +7892,8 @@ static void looping_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7938,43 +7904,43 @@ static void looping_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15488), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6990 */ static void looping_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7988,8 +7954,8 @@ static void looping_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8000,8 +7966,8 @@ static void looping_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8015,43 +7981,43 @@ static void looping_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15483), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A69A0 */ static void looping_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8065,9 +8031,9 @@ static void looping_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8081,9 +8047,9 @@ static void looping_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8094,43 +8060,43 @@ static void looping_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15498), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A69B0 */ static void looping_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8144,9 +8110,9 @@ static void looping_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8157,9 +8123,9 @@ static void looping_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8173,43 +8139,43 @@ static void looping_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15493), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A68E0 */ static void looping_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8223,9 +8189,9 @@ static void looping_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8236,9 +8202,9 @@ static void looping_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8249,43 +8215,43 @@ static void looping_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15477), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A68F0 */ static void looping_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8299,9 +8265,9 @@ static void looping_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8312,9 +8278,9 @@ static void looping_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8325,43 +8291,43 @@ static void looping_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15479), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A6C00 */ static void looping_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8387,17 +8353,17 @@ static void looping_rc_track_block_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A6BC0 */ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8426,20 +8392,20 @@ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -8465,26 +8431,26 @@ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6BD0 */ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8513,20 +8479,20 @@ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -8535,50 +8501,50 @@ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15679), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15681), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15683), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15685), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6BE0 */ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -8588,7 +8554,7 @@ static void looping_rc_track_left_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008A6BF0 */ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -8598,7 +8564,7 @@ static void looping_rc_track_right_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008A6B80 */ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8627,17 +8593,17 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8663,12 +8629,11 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8694,12 +8659,12 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8725,12 +8690,11 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8756,26 +8720,26 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6B90 */ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8804,17 +8768,17 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8840,12 +8804,11 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8871,12 +8834,12 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8902,12 +8865,11 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8933,26 +8895,26 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A6BA0 */ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8962,7 +8924,7 @@ static void looping_rc_track_left_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008A6BB0 */ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8972,7 +8934,7 @@ static void looping_rc_track_right_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008A6A80 */ static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9003,24 +8965,24 @@ static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6A90 */ static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9051,24 +9013,24 @@ static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6AA0 */ static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9099,24 +9061,24 @@ static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6AB0 */ static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9147,24 +9109,24 @@ static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A6AC0 */ static void looping_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9173,7 +9135,7 @@ static void looping_rc_track_25_deg_down_to_left_banked_25_deg_down( /** rct2: 0x008A6AD0 */ static void looping_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9182,7 +9144,7 @@ static void looping_rc_track_25_deg_down_to_right_banked_25_deg_down( /** rct2: 0x008A6AE0 */ static void looping_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9191,7 +9153,7 @@ static void looping_rc_track_left_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008A6AF0 */ static void looping_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9200,7 +9162,7 @@ static void looping_rc_track_right_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008A6B00 */ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9228,24 +9190,24 @@ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A6B10 */ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9273,24 +9235,24 @@ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A6B40 */ static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9318,24 +9280,24 @@ static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A6B50 */ static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9363,24 +9325,24 @@ static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A6B60 */ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9389,7 +9351,7 @@ static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_down( /** rct2: 0x008A6B70 */ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9398,7 +9360,7 @@ static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_down( /** rct2: 0x008A6B20 */ static void looping_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9407,7 +9369,7 @@ static void looping_rc_track_left_banked_25_deg_down_to_left_banked_flat( /** rct2: 0x008A6B30 */ static void looping_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9416,7 +9378,7 @@ static void looping_rc_track_right_banked_25_deg_down_to_right_banked_flat( /** rct2: 0x008A69C0 */ static void looping_rc_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9447,24 +9409,24 @@ static void looping_rc_track_flat_to_left_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A69D0 */ static void looping_rc_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9495,24 +9457,24 @@ static void looping_rc_track_flat_to_right_banked_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A69E0 */ static void looping_rc_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9543,24 +9505,24 @@ static void looping_rc_track_left_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A69F0 */ static void looping_rc_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9591,24 +9553,24 @@ static void looping_rc_track_right_banked_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A6A00 */ static void looping_rc_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9616,7 +9578,7 @@ static void looping_rc_track_flat_to_left_banked_25_deg_down( /** rct2: 0x008A6A10 */ static void looping_rc_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9624,7 +9586,7 @@ static void looping_rc_track_flat_to_right_banked_25_deg_down( /** rct2: 0x008A6A20 */ static void looping_rc_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9632,14 +9594,14 @@ static void looping_rc_track_left_banked_25_deg_down_to_flat( /** rct2: 0x008A6A30 */ static void looping_rc_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void looping_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9659,12 +9621,12 @@ static void looping_rc_track_booster( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_looping_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index 61f6207826..d5e9c32f44 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008B08D0 */ static void mine_ride_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -32,7 +32,7 @@ static void mine_ride_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -42,19 +42,18 @@ static void mine_ride_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void mine_ride_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -72,14 +71,14 @@ static void mine_ride_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_2(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B08E0 */ static void mine_ride_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -90,8 +89,7 @@ static void mine_ride_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -100,7 +98,7 @@ static void mine_ride_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -110,8 +108,7 @@ static void mine_ride_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -120,27 +117,27 @@ static void mine_ride_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008B08F0 */ static void mine_ride_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -151,7 +148,7 @@ static void mine_ride_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -160,8 +157,7 @@ static void mine_ride_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -170,7 +166,7 @@ static void mine_ride_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -179,27 +175,26 @@ static void mine_ride_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008B0900 */ static void mine_ride_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -210,8 +205,7 @@ static void mine_ride_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -220,7 +214,7 @@ static void mine_ride_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -230,8 +224,7 @@ static void mine_ride_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -240,27 +233,27 @@ static void mine_ride_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008B0910 */ static void mine_ride_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mine_ride_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -268,7 +261,7 @@ static void mine_ride_track_25_deg_down( /** rct2: 0x008B0920 */ static void mine_ride_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -276,7 +269,7 @@ static void mine_ride_track_flat_to_25_deg_down( /** rct2: 0x008B0930 */ static void mine_ride_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -284,7 +277,7 @@ static void mine_ride_track_25_deg_down_to_flat( /** rct2: 0x008B0940 */ static void mine_ride_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -296,41 +289,39 @@ static void mine_ride_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19427), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19432), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19437), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19422), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -356,12 +347,11 @@ static void mine_ride_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -387,12 +377,12 @@ static void mine_ride_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -418,12 +408,11 @@ static void mine_ride_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -432,50 +421,48 @@ static void mine_ride_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19423), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19428), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19433), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19418), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0950 */ static void mine_ride_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -484,7 +471,7 @@ static void mine_ride_track_right_quarter_turn_5( /** rct2: 0x008B0960 */ static void mine_ride_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -498,7 +485,7 @@ static void mine_ride_track_flat_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -510,8 +497,7 @@ static void mine_ride_track_flat_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -520,7 +506,7 @@ static void mine_ride_track_flat_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -529,20 +515,19 @@ static void mine_ride_track_flat_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B0970 */ static void mine_ride_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -553,7 +538,7 @@ static void mine_ride_track_flat_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -562,8 +547,7 @@ static void mine_ride_track_flat_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -575,7 +559,7 @@ static void mine_ride_track_flat_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -587,20 +571,19 @@ static void mine_ride_track_flat_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B0980 */ static void mine_ride_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -614,7 +597,7 @@ static void mine_ride_track_left_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -626,8 +609,7 @@ static void mine_ride_track_left_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -636,7 +618,7 @@ static void mine_ride_track_left_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -645,20 +627,19 @@ static void mine_ride_track_left_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B0990 */ static void mine_ride_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -669,7 +650,7 @@ static void mine_ride_track_right_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -678,8 +659,7 @@ static void mine_ride_track_right_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -691,7 +671,7 @@ static void mine_ride_track_right_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -703,20 +683,19 @@ static void mine_ride_track_right_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B09A0 */ static void mine_ride_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -731,41 +710,39 @@ static void mine_ride_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19458), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19452), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19457), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19442), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -791,12 +768,11 @@ static void mine_ride_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -822,12 +798,12 @@ static void mine_ride_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -853,12 +829,11 @@ static void mine_ride_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -867,15 +842,14 @@ static void mine_ride_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19443), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19448), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -884,36 +858,35 @@ static void mine_ride_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19459), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19438), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B09B0 */ static void mine_ride_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -922,7 +895,7 @@ static void mine_ride_track_banked_right_quarter_turn_5( /** rct2: 0x008B09C0 */ static void mine_ride_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -936,7 +909,7 @@ static void mine_ride_track_left_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -948,8 +921,7 @@ static void mine_ride_track_left_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -958,7 +930,7 @@ static void mine_ride_track_left_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -967,27 +939,26 @@ static void mine_ride_track_left_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008B09D0 */ static void mine_ride_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -998,7 +969,7 @@ static void mine_ride_track_right_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1007,8 +978,7 @@ static void mine_ride_track_right_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1020,7 +990,7 @@ static void mine_ride_track_right_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1032,27 +1002,26 @@ static void mine_ride_track_right_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008B09E0 */ static void mine_ride_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1066,8 +1035,7 @@ static void mine_ride_track_25_deg_up_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1079,7 +1047,7 @@ static void mine_ride_track_25_deg_up_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -1089,8 +1057,7 @@ static void mine_ride_track_25_deg_up_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1099,27 +1066,27 @@ static void mine_ride_track_25_deg_up_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008B09F0 */ static void mine_ride_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1130,8 +1097,7 @@ static void mine_ride_track_25_deg_up_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1140,7 +1106,7 @@ static void mine_ride_track_25_deg_up_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -1153,8 +1119,7 @@ static void mine_ride_track_25_deg_up_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1166,27 +1131,27 @@ static void mine_ride_track_25_deg_up_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008B0A00 */ static void mine_ride_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1194,7 +1159,7 @@ static void mine_ride_track_left_bank_to_25_deg_down( /** rct2: 0x008B0A10 */ static void mine_ride_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1202,7 +1167,7 @@ static void mine_ride_track_right_bank_to_25_deg_down( /** rct2: 0x008B0A20 */ static void mine_ride_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1210,7 +1175,7 @@ static void mine_ride_track_25_deg_down_to_left_bank( /** rct2: 0x008B0A30 */ static void mine_ride_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1218,7 +1183,7 @@ static void mine_ride_track_25_deg_down_to_right_bank( /** rct2: 0x008B0A40 */ static void mine_ride_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1229,7 +1194,7 @@ static void mine_ride_track_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1238,8 +1203,7 @@ static void mine_ride_track_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1248,7 +1212,7 @@ static void mine_ride_track_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1257,20 +1221,19 @@ static void mine_ride_track_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B0A50 */ static void mine_ride_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mine_ride_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1278,7 +1241,7 @@ static void mine_ride_track_right_bank( /** rct2: 0x008B0A60 */ static void mine_ride_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1290,38 +1253,36 @@ static void mine_ride_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19460), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19464), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19463), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19467), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1330,14 +1291,13 @@ static void mine_ride_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19461), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19465), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1351,12 +1311,11 @@ static void mine_ride_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1375,23 +1334,21 @@ static void mine_ride_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19461), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19465), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1400,50 +1357,48 @@ static void mine_ride_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19463), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19467), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19460), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19464), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0A70 */ static void mine_ride_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1455,38 +1410,36 @@ static void mine_ride_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19468), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19472), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19471), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19475), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1495,14 +1448,13 @@ static void mine_ride_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19469), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19473), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1516,12 +1468,11 @@ static void mine_ride_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1540,23 +1491,21 @@ static void mine_ride_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19469), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19473), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1565,50 +1514,48 @@ static void mine_ride_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19471), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19475), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19468), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19472), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0AB0 */ static void mine_ride_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1620,41 +1567,39 @@ static void mine_ride_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19397), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19400), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19403), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19394), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1680,9 +1625,9 @@ static void mine_ride_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1691,50 +1636,48 @@ static void mine_ride_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19395), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19398), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19401), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19392), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0AC0 */ static void mine_ride_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1743,7 +1686,7 @@ static void mine_ride_track_right_quarter_turn_3( /** rct2: 0x008B0AD0 */ static void mine_ride_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1758,41 +1701,39 @@ static void mine_ride_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19416), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19412), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19415), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19406), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1818,9 +1759,9 @@ static void mine_ride_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1829,15 +1770,14 @@ static void mine_ride_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19407), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19410), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1846,36 +1786,35 @@ static void mine_ride_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19417), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19404), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0AE0 */ static void mine_ride_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1884,7 +1823,7 @@ static void mine_ride_track_right_quarter_turn_3_bank( /** rct2: 0x008B0AF0 */ static void mine_ride_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1899,42 +1838,40 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19502), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19498), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19501), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19492), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1960,9 +1897,9 @@ static void mine_ride_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1971,14 +1908,14 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19493), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19496), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1988,30 +1925,30 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19503), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19490), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -2020,7 +1957,7 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19492), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2030,40 +1967,38 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19502), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19498), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19501), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2089,9 +2024,9 @@ static void mine_ride_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2100,21 +2035,21 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19490), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19493), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19496), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -2124,25 +2059,25 @@ static void mine_ride_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19503), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0B00 */ static void mine_ride_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2154,22 +2089,20 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19476), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19479), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19482), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2178,21 +2111,21 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19489), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2218,9 +2151,9 @@ static void mine_ride_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2229,7 +2162,7 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19478), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2239,37 +2172,37 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19488), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19484), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19487), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -2278,15 +2211,14 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19479), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19482), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2295,33 +2227,32 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19489), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19476), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2347,9 +2278,9 @@ static void mine_ride_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2361,46 +2292,46 @@ static void mine_ride_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19488), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19484), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19487), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19478), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0B10 */ static void mine_ride_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -2414,7 +2345,7 @@ static void mine_ride_track_left_half_banked_helix_down_small( /** rct2: 0x008B0B20 */ static void mine_ride_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -2428,7 +2359,7 @@ static void mine_ride_track_right_half_banked_helix_down_small( /** rct2: 0x008B0B30 */ static void mine_ride_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2443,42 +2374,40 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19546), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19540), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19545), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19530), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2504,12 +2433,11 @@ static void mine_ride_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2535,12 +2463,12 @@ static void mine_ride_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -2566,12 +2494,11 @@ static void mine_ride_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2580,14 +2507,14 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19531), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19536), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2597,30 +2524,30 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19547), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19526), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2629,7 +2556,7 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19530), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2639,40 +2566,38 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19546), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19540), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19545), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -2698,12 +2623,11 @@ static void mine_ride_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -2729,12 +2653,12 @@ static void mine_ride_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -2760,12 +2684,11 @@ static void mine_ride_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -2774,21 +2697,21 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19526), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19531), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19536), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -2798,25 +2721,25 @@ static void mine_ride_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19547), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0B40 */ static void mine_ride_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2828,22 +2751,20 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19504), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19509), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19514), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2852,21 +2773,21 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19525), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2892,12 +2813,11 @@ static void mine_ride_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2923,12 +2843,12 @@ static void mine_ride_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -2954,12 +2874,11 @@ static void mine_ride_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2968,7 +2887,7 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19508), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2978,37 +2897,37 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19524), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19518), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19523), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3017,15 +2936,14 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19509), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19514), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3034,33 +2952,32 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19525), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19504), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3086,12 +3003,11 @@ static void mine_ride_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3117,12 +3033,12 @@ static void mine_ride_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3148,12 +3064,11 @@ static void mine_ride_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3165,46 +3080,46 @@ static void mine_ride_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19524), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19518), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19523), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19508), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0B50 */ static void mine_ride_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -3218,7 +3133,7 @@ static void mine_ride_track_left_half_banked_helix_down_large( /** rct2: 0x008B0B60 */ static void mine_ride_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -3232,7 +3147,7 @@ static void mine_ride_track_right_half_banked_helix_down_large( /** rct2: 0x008B0B70 */ static void mine_ride_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3240,8 +3155,8 @@ static void mine_ride_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19338), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3249,8 +3164,8 @@ static void mine_ride_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19339), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3258,8 +3173,8 @@ static void mine_ride_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19338), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -3267,22 +3182,22 @@ static void mine_ride_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19339), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008B0B90 */ static void mine_ride_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3294,38 +3209,36 @@ static void mine_ride_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19564), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19568), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19572), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19576), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3351,12 +3264,11 @@ static void mine_ride_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3382,15 +3294,15 @@ static void mine_ride_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3399,44 +3311,41 @@ static void mine_ride_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19567), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19571), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19575), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19579), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0BA0 */ static void mine_ride_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3448,38 +3357,36 @@ static void mine_ride_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19548), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19552), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19556), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19560), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3505,12 +3412,11 @@ static void mine_ride_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3536,15 +3442,15 @@ static void mine_ride_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3553,44 +3459,41 @@ static void mine_ride_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19551), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19555), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19559), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19563), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0BB0 */ static void mine_ride_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -3599,7 +3502,7 @@ static void mine_ride_track_left_eighth_to_orthogonal( /** rct2: 0x008B0BC0 */ static void mine_ride_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -3608,7 +3511,7 @@ static void mine_ride_track_right_eighth_to_orthogonal( /** rct2: 0x008B0BD0 */ static void mine_ride_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3620,38 +3523,36 @@ static void mine_ride_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19596), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19600), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19604), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19608), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3677,12 +3578,11 @@ static void mine_ride_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3708,15 +3608,15 @@ static void mine_ride_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3725,44 +3625,41 @@ static void mine_ride_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19599), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19603), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19607), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19611), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0BE0 */ static void mine_ride_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3774,38 +3671,36 @@ static void mine_ride_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19580), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19584), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19588), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19592), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3831,12 +3726,11 @@ static void mine_ride_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3862,15 +3756,15 @@ static void mine_ride_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3879,44 +3773,41 @@ static void mine_ride_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19583), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19587), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19591), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19595), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0BF0 */ static void mine_ride_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -3925,7 +3816,7 @@ static void mine_ride_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008B0C00 */ static void mine_ride_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -3934,7 +3825,7 @@ static void mine_ride_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008B0B80 */ static void mine_ride_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3948,9 +3839,9 @@ static void mine_ride_track_diag_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3961,9 +3852,9 @@ static void mine_ride_track_diag_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3974,43 +3865,41 @@ static void mine_ride_track_diag_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19613), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0C30 */ static void mine_ride_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4024,9 +3913,9 @@ static void mine_ride_track_diag_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4037,9 +3926,9 @@ static void mine_ride_track_diag_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4050,43 +3939,43 @@ static void mine_ride_track_diag_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19625), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008B0C10 */ static void mine_ride_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4100,9 +3989,9 @@ static void mine_ride_track_diag_flat_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4113,9 +4002,9 @@ static void mine_ride_track_diag_flat_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4126,43 +4015,41 @@ static void mine_ride_track_diag_flat_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19617), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B0C20 */ static void mine_ride_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4176,9 +4063,9 @@ static void mine_ride_track_diag_25_deg_up_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4189,9 +4076,9 @@ static void mine_ride_track_diag_25_deg_up_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4202,43 +4089,43 @@ static void mine_ride_track_diag_25_deg_up_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19621), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008B0C60 */ static void mine_ride_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4252,9 +4139,9 @@ static void mine_ride_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4265,9 +4152,9 @@ static void mine_ride_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4278,43 +4165,43 @@ static void mine_ride_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19627), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008B0C40 */ static void mine_ride_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4328,8 +4215,8 @@ static void mine_ride_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4340,8 +4227,8 @@ static void mine_ride_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4352,43 +4239,43 @@ static void mine_ride_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19623), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008B0C50 */ static void mine_ride_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4402,9 +4289,9 @@ static void mine_ride_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4415,9 +4302,9 @@ static void mine_ride_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4428,43 +4315,41 @@ static void mine_ride_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19619), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B0C90 */ static void mine_ride_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4478,9 +4363,9 @@ static void mine_ride_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4494,9 +4379,9 @@ static void mine_ride_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4507,43 +4392,41 @@ static void mine_ride_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19633), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0CA0 */ static void mine_ride_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4557,9 +4440,9 @@ static void mine_ride_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4570,9 +4453,9 @@ static void mine_ride_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4586,43 +4469,41 @@ static void mine_ride_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19638), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0CB0 */ static void mine_ride_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4636,9 +4517,9 @@ static void mine_ride_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4652,9 +4533,9 @@ static void mine_ride_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4665,43 +4546,41 @@ static void mine_ride_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19640), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0CC0 */ static void mine_ride_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4715,9 +4594,9 @@ static void mine_ride_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4728,9 +4607,9 @@ static void mine_ride_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4744,43 +4623,41 @@ static void mine_ride_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19635), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0CF0 */ static void mine_ride_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4794,9 +4671,9 @@ static void mine_ride_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4810,9 +4687,9 @@ static void mine_ride_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4823,43 +4700,41 @@ static void mine_ride_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19653), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B0D00 */ static void mine_ride_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4873,9 +4748,9 @@ static void mine_ride_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4886,9 +4761,9 @@ static void mine_ride_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4902,43 +4777,41 @@ static void mine_ride_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19658), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B0CD0 */ static void mine_ride_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4952,9 +4825,9 @@ static void mine_ride_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4968,9 +4841,9 @@ static void mine_ride_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4981,43 +4854,43 @@ static void mine_ride_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19643), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008B0CE0 */ static void mine_ride_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5031,9 +4904,9 @@ static void mine_ride_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -5044,9 +4917,9 @@ static void mine_ride_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -5060,43 +4933,43 @@ static void mine_ride_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19648), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008B0D10 */ static void mine_ride_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5110,8 +4983,8 @@ static void mine_ride_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -5125,8 +4998,8 @@ static void mine_ride_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -5137,43 +5010,43 @@ static void mine_ride_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19650), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008B0D20 */ static void mine_ride_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5187,8 +5060,8 @@ static void mine_ride_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -5199,8 +5072,8 @@ static void mine_ride_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -5214,43 +5087,43 @@ static void mine_ride_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19645), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008B0D30 */ static void mine_ride_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5264,9 +5137,9 @@ static void mine_ride_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5280,9 +5153,9 @@ static void mine_ride_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5293,43 +5166,41 @@ static void mine_ride_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19660), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B0D40 */ static void mine_ride_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5343,9 +5214,9 @@ static void mine_ride_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5356,9 +5227,9 @@ static void mine_ride_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5372,43 +5243,41 @@ static void mine_ride_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19655), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B0C70 */ static void mine_ride_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5422,9 +5291,9 @@ static void mine_ride_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5435,9 +5304,9 @@ static void mine_ride_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5448,43 +5317,41 @@ static void mine_ride_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19629), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008B0C80 */ static void mine_ride_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5498,9 +5365,9 @@ static void mine_ride_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5511,9 +5378,9 @@ static void mine_ride_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5524,36 +5391,34 @@ static void mine_ride_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19631), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index 91d4d63f9b..5ffa691120 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _MineTrainBlockBrakeImages[NumOrthogonalDirectio /** rct2: 0x0071BFA4 */ static void mine_train_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -43,25 +43,25 @@ static void mine_train_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20054), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20055), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20056), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20057), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -74,25 +74,25 @@ static void mine_train_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20052), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20053), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C154, 0x0071C164, 0x0071C174 */ static void mine_train_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -120,14 +120,14 @@ static void mine_train_rc_track_station( } track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 3); track_paint_util_draw_station(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071BFB4 */ static void mine_train_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -138,25 +138,25 @@ static void mine_train_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20102), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20103), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20104), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20105), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -168,43 +168,43 @@ static void mine_train_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20074), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20075), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20076), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20077), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0071BFC4 */ static void mine_train_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -213,42 +213,42 @@ static void mine_train_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20090), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20091), { 0, 0, height }, { 1, 32, 98 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20092), { 0, 0, height }, { 1, 32, 98 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 6, 23, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20093), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x0071BFD4 */ static void mine_train_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -259,25 +259,25 @@ static void mine_train_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20094), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20095), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20096), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20097), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -289,43 +289,43 @@ static void mine_train_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20066), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20067), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20068), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20069), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0071BFE4 */ static void mine_train_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -334,7 +334,7 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20078), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -343,7 +343,7 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20082), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -352,30 +352,30 @@ static void mine_train_rc_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20083), { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 15, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20081), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x0071BFF4 */ static void mine_train_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -384,7 +384,7 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20084), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -393,7 +393,7 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20088), { 0, 0, height }, { 32, 2, 66 }, { 0, 4, height }); - wooden_a_supports_paint_setup(session, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: session.WoodenSupportsPrependTo = PaintAddImageAsParentRotated( @@ -402,30 +402,30 @@ static void mine_train_rc_track_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20089), { 0, 0, height }, { 32, 2, 66 }, { 0, 4, height }); - wooden_a_supports_paint_setup(session, 6, 19, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 19, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20087), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x0071C004 */ static void mine_train_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -436,25 +436,25 @@ static void mine_train_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20098), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20099), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20100), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20101), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -466,43 +466,43 @@ static void mine_train_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20070), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20071), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20072), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20073), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0071C014 */ static void mine_train_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mine_train_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -510,7 +510,7 @@ static void mine_train_rc_track_25_deg_down( /** rct2: 0x0071C024 */ static void mine_train_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mine_train_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -518,7 +518,7 @@ static void mine_train_rc_track_60_deg_down( /** rct2: 0x0071C034 */ static void mine_train_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -526,7 +526,7 @@ static void mine_train_rc_track_flat_to_25_deg_down( /** rct2: 0x0071C044 */ static void mine_train_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -534,7 +534,7 @@ static void mine_train_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x0071C054 */ static void mine_train_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -542,7 +542,7 @@ static void mine_train_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x0071C064 */ static void mine_train_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -550,7 +550,7 @@ static void mine_train_rc_track_25_deg_down_to_flat( /** rct2: 0x0071C0B4 */ static void mine_train_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -562,38 +562,38 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20155), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20160), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20165), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20150), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -602,33 +602,32 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20154), { 0, 0, height }, { 32, 16, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20159), { 0, 0, height }, { 32, 16, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20164), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20149), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -637,39 +636,39 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20153), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20158), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20163), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20148), { 0, 0, height }, { 16, 16, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -678,33 +677,32 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20152), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20157), { 0, 0, height }, { 16, 32, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20162), { 0, 0, height }, { 16, 32, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20147), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -713,45 +711,45 @@ static void mine_train_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20151), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20156), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20161), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20146), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C0C4 */ static void mine_train_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -760,7 +758,7 @@ static void mine_train_rc_track_right_quarter_turn_5( /** rct2: 0x0071C074 */ static void mine_train_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -772,7 +770,7 @@ static void mine_train_rc_track_flat_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20114), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -781,29 +779,29 @@ static void mine_train_rc_track_flat_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20115), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20108), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20109), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C084 */ static void mine_train_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -812,13 +810,13 @@ static void mine_train_rc_track_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20110), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20111), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -827,7 +825,7 @@ static void mine_train_rc_track_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20116), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -836,17 +834,17 @@ static void mine_train_rc_track_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20117), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C094 */ static void mine_train_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -858,7 +856,7 @@ static void mine_train_rc_track_left_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20116), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -867,29 +865,29 @@ static void mine_train_rc_track_left_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20117), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20110), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20111), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C0A4 */ static void mine_train_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -898,13 +896,13 @@ static void mine_train_rc_track_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20108), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20109), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -913,7 +911,7 @@ static void mine_train_rc_track_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20114), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -922,17 +920,17 @@ static void mine_train_rc_track_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20115), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C0D4 */ static void mine_train_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -947,38 +945,38 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20186), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20180), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20185), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20170), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -987,33 +985,32 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20174), { 0, 0, height }, { 32, 16, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20179), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20184), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20169), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1022,39 +1019,39 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20173), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20178), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20183), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20168), { 0, 0, height }, { 16, 16, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1063,33 +1060,32 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20172), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20177), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20182), { 0, 0, height }, { 16, 32, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20167), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1098,13 +1094,13 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20171), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20176), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1113,33 +1109,33 @@ static void mine_train_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20187), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20166), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C0E4 */ static void mine_train_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1148,7 +1144,7 @@ static void mine_train_rc_track_banked_right_quarter_turn_5( /** rct2: 0x0071C204 */ static void mine_train_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1160,7 +1156,7 @@ static void mine_train_rc_track_left_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20122), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1169,36 +1165,36 @@ static void mine_train_rc_track_left_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20123), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20120), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20121), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0071C214 */ static void mine_train_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1207,13 +1203,13 @@ static void mine_train_rc_track_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20124), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20125), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1222,7 +1218,7 @@ static void mine_train_rc_track_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20128), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1231,24 +1227,24 @@ static void mine_train_rc_track_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20129), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0071C224 */ static void mine_train_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1260,7 +1256,7 @@ static void mine_train_rc_track_25_deg_up_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20134), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1269,36 +1265,36 @@ static void mine_train_rc_track_25_deg_up_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20135), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20132), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20133), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0071C234 */ static void mine_train_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1307,13 +1303,13 @@ static void mine_train_rc_track_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20136), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20137), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1322,7 +1318,7 @@ static void mine_train_rc_track_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20140), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1331,24 +1327,24 @@ static void mine_train_rc_track_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20141), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0071C244 */ static void mine_train_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1356,7 +1352,7 @@ static void mine_train_rc_track_left_bank_to_25_deg_down( /** rct2: 0x0071C254 */ static void mine_train_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1364,7 +1360,7 @@ static void mine_train_rc_track_right_bank_to_25_deg_down( /** rct2: 0x0071C264 */ static void mine_train_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1372,7 +1368,7 @@ static void mine_train_rc_track_25_deg_down_to_left_bank( /** rct2: 0x0071C274 */ static void mine_train_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1380,7 +1376,7 @@ static void mine_train_rc_track_25_deg_down_to_right_bank( /** rct2: 0x0071C304 */ static void mine_train_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1389,35 +1385,35 @@ static void mine_train_rc_track_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20142), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20143), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20144), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20145), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C314 */ static void mine_train_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mine_train_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1425,7 +1421,7 @@ static void mine_train_rc_track_right_bank( /** rct2: 0x0071C0F4 */ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1437,38 +1433,38 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20250), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20255), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20260), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20265), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1477,33 +1473,32 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20251), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20256), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20261), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20266), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1512,39 +1507,39 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20252), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20257), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20262), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20267), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1553,33 +1548,32 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20253), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20258), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20263), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20268), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1588,45 +1582,45 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20254), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20259), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20264), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20269), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C104 */ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1638,38 +1632,38 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20230), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20235), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20240), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20245), { 0, 0, height }, { 32, 27, 1 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1678,33 +1672,32 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20231), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20236), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20241), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20246), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1713,39 +1706,39 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20232), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20237), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20242), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20247), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1754,33 +1747,32 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20233), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20238), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20243), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20248), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1789,45 +1781,45 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20234), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20239), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20244), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20249), { 0, 0, height }, { 27, 32, 1 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C114 */ static void mine_train_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1836,7 +1828,7 @@ static void mine_train_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x0071C124 */ static void mine_train_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1845,7 +1837,7 @@ static void mine_train_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x0071C134 */ static void mine_train_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1857,33 +1849,33 @@ static void mine_train_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20270), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20274), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20273), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20277), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1892,33 +1884,32 @@ static void mine_train_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20271), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20275), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20272), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20276), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1927,33 +1918,32 @@ static void mine_train_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20272), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20276), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20271), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20275), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1962,45 +1952,45 @@ static void mine_train_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20273), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20277), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20270), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20274), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C144 */ static void mine_train_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2012,33 +2002,33 @@ static void mine_train_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20278), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20282), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20281), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20285), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2047,33 +2037,32 @@ static void mine_train_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20279), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20283), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20280), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20284), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2082,33 +2071,32 @@ static void mine_train_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20280), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20284), { 0, 0, height }, { 32, 26, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20279), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20283), { 0, 0, height }, { 32, 26, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2117,45 +2105,45 @@ static void mine_train_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20281), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20285), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20278), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20282), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C184 */ static void mine_train_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2167,51 +2155,51 @@ static void mine_train_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20193), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20196), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20199), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20190), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2237,9 +2225,9 @@ static void mine_train_rc_track_left_quarter_turn_3( { 16, 16, 1 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2248,45 +2236,45 @@ static void mine_train_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20191), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20194), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20197), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20188), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C194 */ static void mine_train_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2295,7 +2283,7 @@ static void mine_train_rc_track_right_quarter_turn_3( /** rct2: 0x0071C1A4 */ static void mine_train_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2310,51 +2298,51 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20212), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20208), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20211), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20202), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2380,9 +2368,9 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( { 16, 16, 1 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2391,13 +2379,13 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20203), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20206), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2406,33 +2394,33 @@ static void mine_train_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20213), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20200), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C1B4 */ static void mine_train_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2441,7 +2429,7 @@ static void mine_train_rc_track_right_quarter_turn_3_bank( /** rct2: 0x0071C1C4 */ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2453,56 +2441,56 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20225), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20227), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20229), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20223), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2511,45 +2499,45 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20224), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20226), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20228), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20222), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C1D4 */ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2561,56 +2549,56 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20214), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20216), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20218), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20220), { 0, 6, height }, { 32, 20, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2619,45 +2607,45 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20215), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20217), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20219), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20221), { 6, 0, height }, { 20, 32, 1 }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C1E4 */ static void mine_train_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2666,7 +2654,7 @@ static void mine_train_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x0071C1F4 */ static void mine_train_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2675,7 +2663,7 @@ static void mine_train_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x0071C284 */ static void mine_train_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2690,55 +2678,55 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20312), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20308), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20311), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20302), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2764,9 +2752,9 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( { 16, 16, 1 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2775,13 +2763,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20303), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20306), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2790,30 +2778,30 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20313), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20300), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -2822,7 +2810,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20302), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2831,54 +2819,54 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20312), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20308), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20311), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2904,9 +2892,9 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( { 16, 16, 1 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -2915,19 +2903,19 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20300), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20303), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20306), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2936,26 +2924,26 @@ static void mine_train_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20313), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C294 */ static void mine_train_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2967,19 +2955,19 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20286), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20289), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20292), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2988,37 +2976,37 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20299), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3044,9 +3032,9 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( { 16, 16, 1 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3055,7 +3043,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20288), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3064,36 +3052,36 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20298), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20294), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20297), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3102,13 +3090,13 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20289), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20292), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3117,48 +3105,48 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20299), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20286), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3184,9 +3172,9 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( { 16, 16, 1 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3198,44 +3186,44 @@ static void mine_train_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20298), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20294), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20297), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20288), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C2A4 */ static void mine_train_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3250,7 +3238,7 @@ static void mine_train_rc_track_left_half_banked_helix_down_small( /** rct2: 0x0071C2B4 */ static void mine_train_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3265,7 +3253,7 @@ static void mine_train_rc_track_right_half_banked_helix_down_small( /** rct2: 0x0071C2C4 */ static void mine_train_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3280,42 +3268,42 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20356), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20350), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20355), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20340), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3324,33 +3312,32 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20344), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20349), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20354), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20339), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3359,7 +3346,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20343), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3368,31 +3355,31 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20178), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20353), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20338), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3401,7 +3388,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20342), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3410,27 +3397,26 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20177), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20352), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20337), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3439,13 +3425,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20341), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20346), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3454,30 +3440,30 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20357), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20336), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3486,7 +3472,7 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20340), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3495,41 +3481,41 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20356), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20350), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20355), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3538,33 +3524,32 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20339), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20344), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20349), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20354), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3573,13 +3558,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20338), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20343), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3588,25 +3573,25 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20178), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20353), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3615,13 +3600,13 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20337), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20342), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3630,21 +3615,20 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20177), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20352), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3653,19 +3637,19 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20336), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20341), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20346), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3674,26 +3658,26 @@ static void mine_train_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20357), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C2D4 */ static void mine_train_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3705,19 +3689,19 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20314), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20319), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20324), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3726,24 +3710,24 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20335), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3752,33 +3736,32 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20315), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20320), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20325), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20330), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3787,37 +3770,37 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20316), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20321), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20326), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20331), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3826,33 +3809,32 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20317), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20322), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20327), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20332), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3861,7 +3843,7 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20318), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height + 8 }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3870,36 +3852,36 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20334), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20328), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20333), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3908,13 +3890,13 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20319), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20324), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3923,35 +3905,35 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20335), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20314), { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3960,33 +3942,32 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20320), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20325), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20330), { 0, 0, height }, { 16, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20315), { 0, 0, height }, { 16, 32, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3995,37 +3976,37 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20321), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20326), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20331), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20316), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4034,33 +4015,32 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20322), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20327), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20332), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20317), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4072,44 +4052,44 @@ static void mine_train_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20334), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20328), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20333), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20318), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 8 }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C2E4 */ static void mine_train_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4124,7 +4104,7 @@ static void mine_train_rc_track_left_half_banked_helix_down_large( /** rct2: 0x0071C2F4 */ static void mine_train_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4139,7 +4119,7 @@ static void mine_train_rc_track_right_half_banked_helix_down_large( /** rct2: 0x0071C324 */ static void mine_train_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4149,24 +4129,24 @@ static void mine_train_rc_track_brakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20058), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20059), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0071C334 */ static void mine_train_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4175,36 +4155,36 @@ static void mine_train_rc_track_on_ride_photo( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20052), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20053), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20052), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20053), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0071C354 */ static void mine_train_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4216,33 +4196,33 @@ static void mine_train_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20452), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20456), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20460), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20464), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4251,29 +4231,29 @@ static void mine_train_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20453), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20457), { 0, 0, height }, { 34, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20461), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20465), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4282,48 +4262,48 @@ static void mine_train_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20454), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20458), { 0, 0, height }, { 16, 16, 1 }, { 16, 16, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20462), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20466), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4349,15 +4329,15 @@ static void mine_train_rc_track_left_eighth_to_diag( { 16, 16, 1 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C364 */ static void mine_train_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4369,33 +4349,33 @@ static void mine_train_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20436), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20440), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20444), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20448), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4404,29 +4384,29 @@ static void mine_train_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20437), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20441), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20445), { 0, 0, height }, { 34, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20449), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4435,48 +4415,48 @@ static void mine_train_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20438), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20442), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20446), { 0, 0, height }, { 28, 28, 1 }, { 4, 4, height }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20450), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4502,15 +4482,15 @@ static void mine_train_rc_track_right_eighth_to_diag( { 16, 16, 1 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C374 */ static void mine_train_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4519,7 +4499,7 @@ static void mine_train_rc_track_left_eighth_to_orthogonal( /** rct2: 0x0071C384 */ static void mine_train_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4528,7 +4508,7 @@ static void mine_train_rc_track_right_eighth_to_orthogonal( /** rct2: 0x0071C394 */ static void mine_train_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4540,33 +4520,33 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20484), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20488), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20492), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20496), { 0, 0, height }, { 32, 32, 1 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4575,29 +4555,29 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20485), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20489), { 0, 0, height }, { 34, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20493), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20497), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4606,48 +4586,48 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20486), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20490), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20494), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20498), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4673,15 +4653,15 @@ static void mine_train_rc_track_left_eighth_bank_to_diag( { 16, 16, 1 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C3A4 */ static void mine_train_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4693,33 +4673,33 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20468), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20472), { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20476), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20480), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4728,29 +4708,29 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20469), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20473), { 0, 0, height }, { 32, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20477), { 0, 0, height }, { 34, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20481), { 0, 0, height }, { 32, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4759,48 +4739,48 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20470), { 0, 0, height }, { 16, 16, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20474), { 0, 0, height }, { 16, 16, 1 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20478), { 0, 0, height }, { 28, 28, 0 }, { 4, 4, height + 27 }); - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20482), { 0, 0, height }, { 16, 16, 1 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4826,15 +4806,15 @@ static void mine_train_rc_track_right_eighth_bank_to_diag( { 16, 16, 1 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C3B4 */ static void mine_train_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4843,7 +4823,7 @@ static void mine_train_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x0071C3C4 */ static void mine_train_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4852,7 +4832,7 @@ static void mine_train_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x0071C344 */ static void mine_train_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4880,8 +4860,8 @@ static void mine_train_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -4892,16 +4872,16 @@ static void mine_train_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20386), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4913,21 +4893,21 @@ static void mine_train_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20358), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -4935,19 +4915,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]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20388), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -4956,24 +4936,24 @@ 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]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20360), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -4998,15 +4978,15 @@ static void mine_train_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C414 */ static void mine_train_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5034,8 +5014,8 @@ static void mine_train_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5046,16 +5026,16 @@ static void mine_train_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20398), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5067,21 +5047,21 @@ static void mine_train_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20370), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5089,19 +5069,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20400), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5110,24 +5090,24 @@ 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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20372), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5152,15 +5132,15 @@ static void mine_train_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0071C474 */ static void mine_train_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5174,8 +5154,8 @@ static void mine_train_rc_track_diag_60_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -5184,42 +5164,42 @@ static void mine_train_rc_track_diag_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20382), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20384), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -5230,15 +5210,15 @@ static void mine_train_rc_track_diag_60_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x0071C3F4 */ static void mine_train_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5266,8 +5246,8 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5278,16 +5258,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20390), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5299,21 +5279,21 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20362), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5321,19 +5301,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]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20392), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5342,24 +5322,24 @@ 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]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20364), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5384,15 +5364,15 @@ static void mine_train_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0071C454 */ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5406,8 +5386,8 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -5416,42 +5396,42 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20374), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20376), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -5462,15 +5442,15 @@ static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C464 */ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5484,8 +5464,8 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -5494,42 +5474,42 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20378), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20380), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -5540,15 +5520,15 @@ static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up( { 16, 16, 1 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C404 */ static void mine_train_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5576,8 +5556,8 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5588,16 +5568,16 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20394), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5609,21 +5589,21 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20366), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5631,19 +5611,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20396), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5652,24 +5632,24 @@ 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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20368), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5694,15 +5674,15 @@ static void mine_train_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0071C444 */ static void mine_train_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5730,8 +5710,8 @@ static void mine_train_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5742,16 +5722,16 @@ static void mine_train_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20400), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5763,21 +5743,21 @@ static void mine_train_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20372), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5785,19 +5765,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20398), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5806,24 +5786,24 @@ 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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20370), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5848,15 +5828,15 @@ static void mine_train_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0071C4A4 */ static void mine_train_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5870,8 +5850,8 @@ static void mine_train_rc_track_diag_60_deg_down( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -5880,42 +5860,42 @@ static void mine_train_rc_track_diag_60_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20384), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20382), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -5926,15 +5906,15 @@ static void mine_train_rc_track_diag_60_deg_down( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x0071C424 */ static void mine_train_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5962,7 +5942,7 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -5973,16 +5953,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20396), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -5994,20 +5974,20 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20368), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6015,19 +5995,19 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20394), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6036,23 +6016,23 @@ 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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20366), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6077,16 +6057,16 @@ static void mine_train_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0071C484 */ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6100,8 +6080,8 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 1 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6110,42 +6090,42 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20380), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20378), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -6156,15 +6136,15 @@ static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C494 */ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6178,8 +6158,8 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6188,42 +6168,42 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20376), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20374), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -6234,15 +6214,15 @@ static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x0071C434 */ static void mine_train_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6270,8 +6250,8 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6282,16 +6262,16 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20392), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6303,21 +6283,21 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20364), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6325,19 +6305,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]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20390), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -6346,24 +6326,24 @@ 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]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20362), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6388,15 +6368,15 @@ static void mine_train_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0071C4D4 */ static void mine_train_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6410,8 +6390,8 @@ static void mine_train_rc_track_diag_flat_to_left_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6423,42 +6403,42 @@ static void mine_train_rc_track_diag_flat_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20410), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20408), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6469,15 +6449,15 @@ static void mine_train_rc_track_diag_flat_to_left_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C4B4 */ static void mine_train_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6491,8 +6471,8 @@ static void mine_train_rc_track_diag_flat_to_right_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6501,29 +6481,29 @@ static void mine_train_rc_track_diag_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20411), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6532,14 +6512,14 @@ static void mine_train_rc_track_diag_flat_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20415), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6550,15 +6530,15 @@ static void mine_train_rc_track_diag_flat_to_right_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C4C4 */ static void mine_train_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6572,8 +6552,8 @@ static void mine_train_rc_track_diag_left_bank_to_flat( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6585,42 +6565,42 @@ static void mine_train_rc_track_diag_left_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20415), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20411), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6631,15 +6611,15 @@ static void mine_train_rc_track_diag_left_bank_to_flat( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C4E4 */ static void mine_train_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6653,8 +6633,8 @@ static void mine_train_rc_track_diag_right_bank_to_flat( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6663,29 +6643,29 @@ static void mine_train_rc_track_diag_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20408), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6694,14 +6674,14 @@ static void mine_train_rc_track_diag_right_bank_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20410), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6712,15 +6692,15 @@ static void mine_train_rc_track_diag_right_bank_to_flat( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C514 */ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6734,8 +6714,8 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -6747,42 +6727,42 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20430), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20428), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -6793,15 +6773,15 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0071C524 */ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6815,8 +6795,8 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -6825,29 +6805,29 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20431), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6856,14 +6836,14 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20435), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -6874,15 +6854,15 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0071C4F4 */ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6896,8 +6876,8 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -6909,42 +6889,42 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20420), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20418), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -6955,15 +6935,15 @@ static void mine_train_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0071C504 */ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6977,8 +6957,8 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -6987,29 +6967,29 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20421), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 10, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7018,14 +6998,14 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20425), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -7036,15 +7016,15 @@ static void mine_train_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0071C534 */ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7069,16 +7049,16 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20425), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -7086,19 +7066,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20421), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -7114,13 +7094,13 @@ static void mine_train_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0071C544 */ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7142,16 +7122,16 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20418), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -7159,10 +7139,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 11, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7171,10 +7151,10 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20420), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 8, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 9, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -7190,13 +7170,13 @@ static void mine_train_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0071C554 */ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7210,8 +7190,8 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7223,42 +7203,42 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20435), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20431), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7269,15 +7249,15 @@ static void mine_train_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0071C564 */ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7291,8 +7271,8 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7301,29 +7281,29 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20428), { -16, -16, height }, { 32, 32, 1 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7332,14 +7312,14 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20430), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7350,15 +7330,15 @@ static void mine_train_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 1 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0071C3D4 */ static void mine_train_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7372,9 +7352,9 @@ static void mine_train_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7383,44 +7363,44 @@ static void mine_train_rc_track_diag_left_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20402), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20404), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -7431,16 +7411,16 @@ static void mine_train_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C3E4 */ static void mine_train_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7454,9 +7434,9 @@ static void mine_train_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7465,44 +7445,44 @@ static void mine_train_rc_track_diag_right_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20404), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 10, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 11, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(20402), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 9, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -7513,26 +7493,26 @@ static void mine_train_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0071C574 */ static void mine_train_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(_MineTrainBlockBrakeImages[direction][isClosed]), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - 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); + WoodenASupportsPaintSetup(session, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_mine_train_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 16f6570366..5916f61868 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _MiniRCBlockBrakeImages[NumOrthogonalDirections] /** rct2: 0x008A4ABC */ static void mini_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -45,8 +45,7 @@ static void mini_rc_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -55,7 +54,7 @@ static void mini_rc_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -65,8 +64,7 @@ static void mini_rc_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -75,7 +73,7 @@ static void mini_rc_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -92,8 +90,7 @@ static void mini_rc_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -103,20 +100,20 @@ static void mini_rc_track_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void mini_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -144,14 +141,14 @@ static void mini_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_2(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A4ACC */ static void mini_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -164,7 +161,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -174,7 +171,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -184,7 +181,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -194,7 +191,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -210,7 +207,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -220,7 +217,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -230,7 +227,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -240,7 +237,7 @@ static void mini_rc_track_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -248,20 +245,20 @@ static void mini_rc_track_25_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A4ADC */ static void mini_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -272,8 +269,7 @@ static void mini_rc_track_60_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 38, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 38, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -282,7 +278,7 @@ static void mini_rc_track_60_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 38, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -292,8 +288,7 @@ static void mini_rc_track_60_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 38, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 38, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -302,27 +297,27 @@ static void mini_rc_track_60_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 38, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A4AEC */ static void mini_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -335,8 +330,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -345,7 +339,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -355,8 +349,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -365,7 +358,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -381,8 +374,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -391,7 +383,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -401,8 +393,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -411,7 +402,7 @@ static void mini_rc_track_flat_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -419,20 +410,20 @@ static void mini_rc_track_flat_to_25_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A4AFC */ static void mini_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -443,8 +434,7 @@ static void mini_rc_track_25_deg_up_to_60_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -456,7 +446,7 @@ static void mini_rc_track_25_deg_up_to_60_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -469,8 +459,7 @@ static void mini_rc_track_25_deg_up_to_60_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -479,27 +468,27 @@ static void mini_rc_track_25_deg_up_to_60_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A4B0C */ static void mini_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -510,8 +499,7 @@ static void mini_rc_track_60_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 26, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 26, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -523,7 +511,7 @@ static void mini_rc_track_60_deg_up_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 26, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -536,8 +524,7 @@ static void mini_rc_track_60_deg_up_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 26, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 26, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -546,27 +533,27 @@ static void mini_rc_track_60_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 26, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A4B1C */ static void mini_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -579,7 +566,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -589,7 +576,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -599,7 +586,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -609,7 +596,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -625,7 +612,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -635,7 +622,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -645,7 +632,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -655,7 +642,7 @@ static void mini_rc_track_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -663,20 +650,20 @@ static void mini_rc_track_25_deg_up_to_flat( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A4B2C */ static void mini_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mini_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -684,7 +671,7 @@ static void mini_rc_track_25_deg_down( /** rct2: 0x008A4B3C */ static void mini_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mini_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -692,7 +679,7 @@ static void mini_rc_track_60_deg_down( /** rct2: 0x008A4B4C */ static void mini_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -700,7 +687,7 @@ static void mini_rc_track_flat_to_25_deg_down( /** rct2: 0x008A4B5C */ static void mini_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -708,7 +695,7 @@ static void mini_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A4B6C */ static void mini_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -716,7 +703,7 @@ static void mini_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A4B7C */ static void mini_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -724,7 +711,7 @@ static void mini_rc_track_25_deg_down_to_flat( /** rct2: 0x008A4B8C */ static void mini_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -736,41 +723,39 @@ static void mini_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18851), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18856), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18861), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18846), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -796,12 +781,11 @@ static void mini_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -827,12 +811,12 @@ static void mini_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -858,12 +842,11 @@ static void mini_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -872,50 +855,48 @@ static void mini_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18847), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18852), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18857), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18842), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4B9C */ static void mini_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -924,7 +905,7 @@ static void mini_rc_track_right_quarter_turn_5( /** rct2: 0x008A4BAC */ static void mini_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -938,7 +919,7 @@ static void mini_rc_track_flat_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -950,8 +931,7 @@ static void mini_rc_track_flat_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -960,7 +940,7 @@ static void mini_rc_track_flat_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -969,20 +949,19 @@ static void mini_rc_track_flat_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A4BBC */ static void mini_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -993,7 +972,7 @@ static void mini_rc_track_flat_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1002,8 +981,7 @@ static void mini_rc_track_flat_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1015,7 +993,7 @@ static void mini_rc_track_flat_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1027,20 +1005,19 @@ static void mini_rc_track_flat_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A4BCC */ static void mini_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1054,7 +1031,7 @@ static void mini_rc_track_left_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1066,8 +1043,7 @@ static void mini_rc_track_left_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1076,7 +1052,7 @@ static void mini_rc_track_left_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1085,20 +1061,19 @@ static void mini_rc_track_left_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A4BDC */ static void mini_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1109,7 +1084,7 @@ static void mini_rc_track_right_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1118,8 +1093,7 @@ static void mini_rc_track_right_bank_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1131,7 +1105,7 @@ static void mini_rc_track_right_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1143,20 +1117,19 @@ static void mini_rc_track_right_bank_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A4BEC */ static void mini_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1171,41 +1144,39 @@ static void mini_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18882), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18876), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18881), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18866), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1231,12 +1202,11 @@ static void mini_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1262,12 +1232,12 @@ static void mini_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1293,12 +1263,11 @@ static void mini_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1307,15 +1276,14 @@ static void mini_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18867), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18872), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1324,36 +1292,35 @@ static void mini_rc_track_banked_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18883), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18862), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4BFC */ static void mini_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1362,7 +1329,7 @@ static void mini_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008A4C0C */ static void mini_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1376,7 +1343,7 @@ static void mini_rc_track_left_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1388,8 +1355,7 @@ static void mini_rc_track_left_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1398,7 +1364,7 @@ static void mini_rc_track_left_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1407,27 +1373,26 @@ static void mini_rc_track_left_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A4C1C */ static void mini_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1438,7 +1403,7 @@ static void mini_rc_track_right_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1447,8 +1412,7 @@ static void mini_rc_track_right_bank_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1460,7 +1424,7 @@ static void mini_rc_track_right_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1472,27 +1436,26 @@ static void mini_rc_track_right_bank_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A4C2C */ static void mini_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1506,8 +1469,7 @@ static void mini_rc_track_25_deg_up_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1519,7 +1481,7 @@ static void mini_rc_track_25_deg_up_to_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -1529,8 +1491,7 @@ static void mini_rc_track_25_deg_up_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1539,27 +1500,27 @@ static void mini_rc_track_25_deg_up_to_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A4C3C */ static void mini_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1570,8 +1531,7 @@ static void mini_rc_track_25_deg_up_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1580,7 +1540,7 @@ static void mini_rc_track_25_deg_up_to_right_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -1593,8 +1553,7 @@ static void mini_rc_track_25_deg_up_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1606,27 +1565,27 @@ static void mini_rc_track_25_deg_up_to_right_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A4C4C */ static void mini_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1634,7 +1593,7 @@ static void mini_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008A4C5C */ static void mini_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1642,7 +1601,7 @@ static void mini_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008A4C6C */ static void mini_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1650,7 +1609,7 @@ static void mini_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008A4C7C */ static void mini_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1658,7 +1617,7 @@ static void mini_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008A4C8C */ static void mini_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1669,7 +1628,7 @@ static void mini_rc_track_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -1678,8 +1637,7 @@ static void mini_rc_track_left_bank( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -1688,7 +1646,7 @@ static void mini_rc_track_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -1697,20 +1655,19 @@ static void mini_rc_track_left_bank( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A4C9C */ static void mini_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mini_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1718,7 +1675,7 @@ static void mini_rc_track_right_bank( /** rct2: 0x008A4CAC */ static void mini_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1730,41 +1687,41 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18936), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18941), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18946), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18951), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1790,12 +1747,11 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1821,12 +1777,12 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -1852,12 +1808,11 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -1866,50 +1821,50 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18940), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18945), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18950), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18955), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4CBC */ static void mini_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1921,41 +1876,41 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18916), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18921), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18926), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18931), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1981,12 +1936,11 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -2012,12 +1966,12 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -2043,12 +1997,11 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -2057,50 +2010,50 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18920), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18925), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18930), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18935), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4CCC */ static void mini_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2109,7 +2062,7 @@ static void mini_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008A4CDC */ static void mini_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2118,7 +2071,7 @@ static void mini_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008A4CEC */ static void mini_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2130,38 +2083,36 @@ static void mini_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18900), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18904), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18903), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18907), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2170,14 +2121,13 @@ static void mini_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18901), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18905), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2191,12 +2141,11 @@ static void mini_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2215,23 +2164,21 @@ static void mini_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18901), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18905), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2240,50 +2187,48 @@ static void mini_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18903), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18907), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18900), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18904), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4CFC */ static void mini_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2295,38 +2240,36 @@ static void mini_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18908), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18912), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18911), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18915), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2335,14 +2278,13 @@ static void mini_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18909), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18913), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2356,12 +2298,11 @@ static void mini_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2380,23 +2321,21 @@ static void mini_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18909), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18913), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2405,50 +2344,48 @@ static void mini_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18911), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18915), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18908), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18912), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4D3C */ static void mini_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2460,41 +2397,39 @@ static void mini_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18821), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18824), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18827), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18818), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2520,9 +2455,9 @@ static void mini_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2531,50 +2466,48 @@ static void mini_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18819), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18822), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18825), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18816), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4D4C */ static void mini_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2583,7 +2516,7 @@ static void mini_rc_track_right_quarter_turn_3( /** rct2: 0x008A4D5C */ static void mini_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2598,41 +2531,39 @@ static void mini_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18840), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18836), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18839), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18830), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2658,9 +2589,9 @@ static void mini_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2669,15 +2600,14 @@ static void mini_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18831), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18834), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2686,36 +2616,35 @@ static void mini_rc_track_left_quarter_turn_3_bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18841), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18828), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4D6C */ static void mini_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2724,7 +2653,7 @@ static void mini_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008A4D7C */ static void mini_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2736,44 +2665,44 @@ static void mini_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18967), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18969), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18971), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18965), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2782,50 +2711,50 @@ static void mini_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18966), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18968), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18970), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18964), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4D8C */ static void mini_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2837,44 +2766,44 @@ static void mini_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18956), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18958), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18960), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18962), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -2883,50 +2812,50 @@ static void mini_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18957), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18959), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18961), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18963), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4D9C */ static void mini_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2935,7 +2864,7 @@ static void mini_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008A4DAC */ static void mini_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -2944,7 +2873,7 @@ static void mini_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008A4DBC */ static void mini_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2959,42 +2888,40 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18998), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18994), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18997), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18988), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3020,9 +2947,9 @@ static void mini_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3031,14 +2958,14 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18989), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18992), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3048,30 +2975,30 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18999), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18986), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3080,7 +3007,7 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18988), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3090,40 +3017,38 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18998), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18994), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18997), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3149,9 +3074,9 @@ static void mini_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3160,21 +3085,21 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18986), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18989), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18992), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3184,25 +3109,25 @@ static void mini_rc_track_left_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18999), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4DCC */ static void mini_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3214,22 +3139,20 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18972), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18975), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18978), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3238,21 +3161,21 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18985), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3278,9 +3201,9 @@ static void mini_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3289,7 +3212,7 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18974), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3299,37 +3222,37 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18984), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18980), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18983), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3338,15 +3261,14 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18975), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18978), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3355,33 +3277,32 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18985), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18972), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3407,9 +3328,9 @@ static void mini_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3421,46 +3342,46 @@ static void mini_rc_track_right_half_banked_helix_up_small( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18984), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18980), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18983), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18974), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4DDC */ static void mini_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3474,7 +3395,7 @@ static void mini_rc_track_left_half_banked_helix_down_small( /** rct2: 0x008A4DEC */ static void mini_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -3488,7 +3409,7 @@ static void mini_rc_track_right_half_banked_helix_down_small( /** rct2: 0x008A4DFC */ static void mini_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3503,42 +3424,40 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19042), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19036), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19041), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19026), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3564,12 +3483,11 @@ static void mini_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3595,12 +3513,12 @@ static void mini_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -3626,12 +3544,11 @@ static void mini_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3640,14 +3557,14 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19027), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19032), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3657,30 +3574,30 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19043), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19022), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -3689,7 +3606,7 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19026), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3699,40 +3616,38 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19042), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19036), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19041), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -3758,12 +3673,11 @@ static void mini_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -3789,12 +3703,12 @@ static void mini_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -3820,12 +3734,11 @@ static void mini_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -3834,21 +3747,21 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19022), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19027), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19032), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -3858,25 +3771,25 @@ static void mini_rc_track_left_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19043), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4E0C */ static void mini_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3888,22 +3801,20 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19000), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19005), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19010), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3912,21 +3823,21 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19021), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3952,12 +3863,11 @@ static void mini_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3983,12 +3893,12 @@ static void mini_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4014,12 +3924,11 @@ static void mini_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4028,7 +3937,7 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19004), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4038,37 +3947,37 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19020), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19014), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19019), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4077,15 +3986,14 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19005), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19010), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4094,33 +4002,32 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19021), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19000), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4146,12 +4053,11 @@ static void mini_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4177,12 +4083,12 @@ static void mini_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4208,12 +4114,11 @@ static void mini_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4225,46 +4130,46 @@ static void mini_rc_track_right_half_banked_helix_up_large( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19020), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19014), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19019), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19004), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4E1C */ static void mini_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4278,7 +4183,7 @@ static void mini_rc_track_left_half_banked_helix_down_large( /** rct2: 0x008A4E2C */ static void mini_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -4292,7 +4197,7 @@ static void mini_rc_track_right_half_banked_helix_down_large( /** rct2: 0x008A4E5C */ static void mini_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4331,13 +4236,13 @@ static void mini_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A4E3C */ static void mini_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4376,13 +4281,13 @@ static void mini_rc_track_right_quarter_turn_1_60_deg_up( break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A4E4C */ static void mini_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 1) & 3, height, trackElement); @@ -4390,7 +4295,7 @@ static void mini_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008A4E6C */ static void mini_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -4398,7 +4303,7 @@ static void mini_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008A4E7C */ static void mini_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4410,7 +4315,7 @@ static void mini_rc_track_brakes( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -4420,20 +4325,19 @@ static void mini_rc_track_brakes( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A50CC */ static void mini_rc_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4444,8 +4348,7 @@ static void mini_rc_track_25_deg_up_left_banked( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -4454,7 +4357,7 @@ static void mini_rc_track_25_deg_up_left_banked( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -4464,8 +4367,7 @@ static void mini_rc_track_25_deg_up_left_banked( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -4474,27 +4376,27 @@ static void mini_rc_track_25_deg_up_left_banked( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A50DC */ static void mini_rc_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4505,8 +4407,7 @@ static void mini_rc_track_25_deg_up_right_banked( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -4515,7 +4416,7 @@ static void mini_rc_track_25_deg_up_right_banked( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -4525,8 +4426,7 @@ static void mini_rc_track_25_deg_up_right_banked( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -4535,27 +4435,27 @@ static void mini_rc_track_25_deg_up_right_banked( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A4E8C */ static void mini_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4563,8 +4463,8 @@ static void mini_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18738), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4572,8 +4472,8 @@ static void mini_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18739), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4581,8 +4481,8 @@ static void mini_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18738), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -4590,22 +4490,22 @@ static void mini_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(18739), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A50EC */ static void mini_rc_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4613,7 +4513,7 @@ static void mini_rc_track_25_deg_down_left_banked( /** rct2: 0x008A50FC */ static void mini_rc_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -4621,7 +4521,7 @@ static void mini_rc_track_25_deg_down_right_banked( /** rct2: 0x008A4EAC */ static void mini_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4633,38 +4533,36 @@ static void mini_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19076), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19080), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19084), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19088), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4690,12 +4588,11 @@ static void mini_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4721,15 +4618,15 @@ static void mini_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4738,44 +4635,41 @@ static void mini_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19079), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19083), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19087), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19091), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4EBC */ static void mini_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4787,38 +4681,36 @@ static void mini_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19060), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19064), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19068), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19072), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4844,12 +4736,11 @@ static void mini_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4875,15 +4766,15 @@ static void mini_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4892,44 +4783,41 @@ static void mini_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19063), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19067), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19071), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19075), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4ECC */ static void mini_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4938,7 +4826,7 @@ static void mini_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008A4EDC */ static void mini_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -4947,7 +4835,7 @@ static void mini_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008A4EEC */ static void mini_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4959,38 +4847,36 @@ static void mini_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19108), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19112), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19116), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19120), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5016,12 +4902,11 @@ static void mini_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5047,15 +4932,15 @@ static void mini_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5064,44 +4949,41 @@ static void mini_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19111), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19115), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19119), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19123), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4EFC */ static void mini_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5113,38 +4995,36 @@ static void mini_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19092), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19096), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19100), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19104), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5170,12 +5050,11 @@ static void mini_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5201,15 +5080,15 @@ static void mini_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5218,44 +5097,41 @@ static void mini_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19095), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19099), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19103), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19107), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4F0C */ static void mini_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5264,7 +5140,7 @@ static void mini_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008A4F1C */ static void mini_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5273,7 +5149,7 @@ static void mini_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008A4E9C */ static void mini_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5301,9 +5177,9 @@ static void mini_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5328,9 +5204,9 @@ static void mini_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5355,9 +5231,9 @@ static void mini_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5365,22 +5241,22 @@ static void mini_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19187), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5390,36 +5266,36 @@ static void mini_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19125), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4F4C */ static void mini_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5447,9 +5323,9 @@ static void mini_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5474,9 +5350,9 @@ static void mini_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5501,9 +5377,9 @@ static void mini_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5511,22 +5387,22 @@ static void mini_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19199), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5536,36 +5412,36 @@ static void mini_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19137), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A4FAC */ static void mini_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5579,9 +5455,9 @@ static void mini_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -5592,9 +5468,9 @@ static void mini_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -5605,43 +5481,43 @@ static void mini_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 38, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19149), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 42, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 38, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 42, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A4F2C */ static void mini_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5669,9 +5545,9 @@ static void mini_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5696,9 +5572,9 @@ static void mini_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5723,9 +5599,9 @@ static void mini_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5733,22 +5609,22 @@ static void mini_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19191), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5758,36 +5634,36 @@ static void mini_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19129), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A4F8C */ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5801,9 +5677,9 @@ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -5814,9 +5690,9 @@ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5827,43 +5703,43 @@ static void mini_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19141), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4F9C */ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5877,9 +5753,9 @@ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -5890,9 +5766,9 @@ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -5903,43 +5779,43 @@ static void mini_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19145), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 27, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4F3C */ static void mini_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5967,9 +5843,9 @@ static void mini_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5994,9 +5870,9 @@ static void mini_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6021,9 +5897,9 @@ static void mini_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6031,22 +5907,22 @@ static void mini_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19195), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6056,36 +5932,36 @@ static void mini_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19133), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A4F7C */ static void mini_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6113,9 +5989,9 @@ static void mini_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6140,9 +6016,9 @@ static void mini_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6167,9 +6043,9 @@ static void mini_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6177,22 +6053,22 @@ static void mini_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19201), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6202,36 +6078,36 @@ static void mini_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19139), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A4FDC */ static void mini_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6245,9 +6121,9 @@ static void mini_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -6258,9 +6134,9 @@ static void mini_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -6271,43 +6147,43 @@ static void mini_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 30, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19151), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 34, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 30, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 34, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A4F5C */ static void mini_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6335,8 +6211,8 @@ static void mini_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6361,8 +6237,8 @@ static void mini_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6387,8 +6263,8 @@ static void mini_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6396,22 +6272,22 @@ static void mini_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19197), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6421,37 +6297,37 @@ static void mini_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19135), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A4FBC */ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6465,9 +6341,9 @@ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6478,9 +6354,9 @@ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6491,43 +6367,43 @@ static void mini_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19147), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4FCC */ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6541,9 +6417,9 @@ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -6554,9 +6430,9 @@ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6567,43 +6443,43 @@ static void mini_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19143), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A4F6C */ static void mini_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6631,9 +6507,9 @@ static void mini_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6658,9 +6534,9 @@ static void mini_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6685,9 +6561,9 @@ static void mini_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6695,22 +6571,22 @@ static void mini_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19193), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6720,36 +6596,36 @@ static void mini_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19131), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A500C */ static void mini_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6763,9 +6639,9 @@ static void mini_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6779,9 +6655,9 @@ static void mini_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6792,43 +6668,41 @@ static void mini_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19157), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A501C */ static void mini_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6842,9 +6716,9 @@ static void mini_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6855,9 +6729,9 @@ static void mini_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6871,43 +6745,41 @@ static void mini_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19162), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A502C */ static void mini_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6921,9 +6793,9 @@ static void mini_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6937,9 +6809,9 @@ static void mini_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6950,43 +6822,41 @@ static void mini_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19164), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A503C */ static void mini_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7000,9 +6870,9 @@ static void mini_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7013,9 +6883,9 @@ static void mini_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7029,43 +6899,41 @@ static void mini_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19159), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A506C */ static void mini_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7079,9 +6947,9 @@ static void mini_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7095,9 +6963,9 @@ static void mini_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7108,43 +6976,41 @@ static void mini_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19177), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A507C */ static void mini_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7158,9 +7024,9 @@ static void mini_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7171,9 +7037,9 @@ static void mini_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7187,43 +7053,41 @@ static void mini_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19182), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A504C */ static void mini_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7237,9 +7101,9 @@ static void mini_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -7253,9 +7117,9 @@ static void mini_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -7266,43 +7130,43 @@ static void mini_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19167), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A505C */ static void mini_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7316,9 +7180,9 @@ static void mini_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -7329,9 +7193,9 @@ static void mini_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -7345,43 +7209,43 @@ static void mini_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19172), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A508C */ static void mini_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7395,8 +7259,8 @@ static void mini_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7410,8 +7274,8 @@ static void mini_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7422,43 +7286,43 @@ static void mini_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19174), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A509C */ static void mini_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7472,8 +7336,8 @@ static void mini_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7484,8 +7348,8 @@ static void mini_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7499,43 +7363,43 @@ static void mini_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19169), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A50AC */ static void mini_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7549,9 +7413,9 @@ static void mini_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7565,9 +7429,9 @@ static void mini_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7578,43 +7442,41 @@ static void mini_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19184), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A50BC */ static void mini_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7628,9 +7490,9 @@ static void mini_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7641,9 +7503,9 @@ static void mini_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7657,43 +7519,41 @@ static void mini_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19179), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalBSupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A4FEC */ static void mini_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7707,9 +7567,9 @@ static void mini_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7720,9 +7580,9 @@ static void mini_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7733,43 +7593,41 @@ static void mini_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19153), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A4FFC */ static void mini_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7783,9 +7641,9 @@ static void mini_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7796,9 +7654,9 @@ static void mini_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7809,43 +7667,41 @@ static void mini_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19155), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A530C */ static void mini_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -7858,27 +7714,26 @@ static void mini_rc_track_block_brakes( case 2: if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: case 3: if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A510C */ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7890,44 +7745,44 @@ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19317), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19319), { 0, 6, height }, { 32, 1, 34 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19321), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19315), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -7936,50 +7791,50 @@ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19316), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19318), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19320), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19314), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A511C */ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7991,44 +7846,44 @@ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19306), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19308), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19310), { 0, 6, height }, { 32, 1, 34 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19312), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -8037,50 +7892,50 @@ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19307), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19309), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19311), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19313), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A512C */ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -8090,7 +7945,7 @@ static void mini_rc_track_left_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008A513C */ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -8099,7 +7954,7 @@ static void mini_rc_track_right_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008A514C */ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8111,41 +7966,41 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19286), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19291), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19296), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19301), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8171,12 +8026,11 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8202,12 +8056,12 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8233,12 +8087,11 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8247,50 +8100,50 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19290), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19295), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19300), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19305), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A515C */ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8302,41 +8155,41 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19266), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19271), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19276), { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19281), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8362,12 +8215,11 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8393,12 +8245,12 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8424,12 +8276,11 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8438,50 +8289,50 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19270), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19275), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19280), { 0, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19285), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A516C */ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8491,7 +8342,7 @@ static void mini_rc_track_left_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008A517C */ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8500,7 +8351,7 @@ static void mini_rc_track_right_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008A518C */ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8511,8 +8362,7 @@ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8524,7 +8374,7 @@ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -8534,8 +8384,7 @@ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8544,27 +8393,27 @@ static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A519C */ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8575,8 +8424,7 @@ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8585,7 +8433,7 @@ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -8598,8 +8446,7 @@ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8608,27 +8455,27 @@ static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A51AC */ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8639,8 +8486,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8652,7 +8498,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -8662,8 +8508,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8672,27 +8517,27 @@ static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A51BC */ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8703,8 +8548,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8713,7 +8557,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -8726,8 +8570,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8736,27 +8579,27 @@ static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A51CC */ static void mini_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8764,7 +8607,7 @@ static void mini_rc_track_25_deg_down_to_left_banked_25_deg_down( /** rct2: 0x008A51DC */ static void mini_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8772,7 +8615,7 @@ static void mini_rc_track_25_deg_down_to_right_banked_25_deg_down( /** rct2: 0x008A51EC */ static void mini_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8780,7 +8623,7 @@ static void mini_rc_track_left_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008A51FC */ static void mini_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -8788,7 +8631,7 @@ static void mini_rc_track_right_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008A520C */ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8799,7 +8642,7 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8808,8 +8651,7 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -8818,7 +8660,7 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8827,27 +8669,26 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A521C */ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8858,7 +8699,7 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8867,8 +8708,7 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -8877,7 +8717,7 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8886,27 +8726,26 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A524C */ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8917,8 +8756,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8927,7 +8765,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -8937,8 +8775,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -8947,27 +8784,27 @@ static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A525C */ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -8978,8 +8815,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -8988,7 +8824,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -8998,8 +8834,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -9008,27 +8843,27 @@ static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A526C */ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9037,7 +8872,7 @@ static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_down( /** rct2: 0x008A527C */ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9046,7 +8881,7 @@ static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_down( /** rct2: 0x008A522C */ static void mini_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9055,7 +8890,7 @@ static void mini_rc_track_left_banked_25_deg_down_to_left_banked_flat( /** rct2: 0x008A523C */ static void mini_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -9064,7 +8899,7 @@ static void mini_rc_track_right_banked_25_deg_down_to_right_banked_flat( /** rct2: 0x008A528C */ static void mini_rc_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9075,7 +8910,7 @@ static void mini_rc_track_flat_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -9087,8 +8922,7 @@ static void mini_rc_track_flat_to_left_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -9097,7 +8931,7 @@ static void mini_rc_track_flat_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -9106,27 +8940,26 @@ static void mini_rc_track_flat_to_left_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A529C */ static void mini_rc_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9137,7 +8970,7 @@ static void mini_rc_track_flat_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -9146,8 +8979,7 @@ static void mini_rc_track_flat_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 2: @@ -9159,7 +8991,7 @@ static void mini_rc_track_flat_to_right_banked_25_deg_up( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -9168,27 +9000,26 @@ static void mini_rc_track_flat_to_right_banked_25_deg_up( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A52AC */ static void mini_rc_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9199,8 +9030,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -9212,7 +9042,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -9222,8 +9052,7 @@ static void mini_rc_track_left_banked_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -9232,27 +9061,27 @@ static void mini_rc_track_left_banked_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A52BC */ static void mini_rc_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -9263,8 +9092,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -9273,7 +9101,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; @@ -9286,8 +9114,7 @@ static void mini_rc_track_right_banked_25_deg_up_to_flat( { 0, 27, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 3: @@ -9296,27 +9123,27 @@ static void mini_rc_track_right_banked_25_deg_up_to_flat( { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A52CC */ static void mini_rc_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9324,7 +9151,7 @@ static void mini_rc_track_flat_to_left_banked_25_deg_down( /** rct2: 0x008A52DC */ static void mini_rc_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9332,7 +9159,7 @@ static void mini_rc_track_flat_to_right_banked_25_deg_down( /** rct2: 0x008A52EC */ static void mini_rc_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -9340,14 +9167,14 @@ static void mini_rc_track_left_banked_25_deg_down_to_flat( /** rct2: 0x008A52FC */ static void mini_rc_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void mini_rc_track_left_curved_lift_hill( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9359,44 +9186,44 @@ static void mini_rc_track_left_curved_lift_hill( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19333), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19335), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19337), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19331), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -9405,49 +9232,49 @@ static void mini_rc_track_left_curved_lift_hill( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19332), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19334), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19336), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19330), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void mini_rc_track_right_curved_lift_hill( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9459,44 +9286,44 @@ static void mini_rc_track_right_curved_lift_hill( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19322), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19324), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19326), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19328), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -9505,49 +9332,49 @@ static void mini_rc_track_right_curved_lift_hill( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19323), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19325), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19327), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(19329), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void mini_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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. @@ -9565,7 +9392,7 @@ static void mini_rc_track_booster( { ne_sw_offsetX, ne_sw_offsetY, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; case 1: @@ -9575,15 +9402,14 @@ static void mini_rc_track_booster( { nw_se_offsetX, nw_se_offsetY, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp index 9d6c33f131..f1a92fdee7 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008AFE9C */ static void mini_suspended_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -60,32 +60,32 @@ static void mini_suspended_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AFF4C, 0x008AFF5C, 0x008AFF6C */ static void mini_suspended_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -106,14 +106,14 @@ static void mini_suspended_rc_track_station( { 32, 20, 1 }, { 0, 2, height }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 3); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AFEAC */ static void mini_suspended_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -169,26 +169,26 @@ static void mini_suspended_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -196,18 +196,18 @@ static void mini_suspended_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AFEBC */ static void mini_suspended_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -263,26 +263,26 @@ static void mini_suspended_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 6, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 8, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 7, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 5, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -290,18 +290,18 @@ static void mini_suspended_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008AFECC */ static void mini_suspended_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -357,26 +357,26 @@ static void mini_suspended_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 6, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 8, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 7, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 5, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -384,18 +384,18 @@ static void mini_suspended_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AFEDC */ static void mini_suspended_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { mini_suspended_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -403,7 +403,7 @@ static void mini_suspended_rc_track_25_deg_down( /** rct2: 0x008AFEEC */ static void mini_suspended_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -411,7 +411,7 @@ static void mini_suspended_rc_track_flat_to_25_deg_down( /** rct2: 0x008AFEFC */ static void mini_suspended_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -419,7 +419,7 @@ static void mini_suspended_rc_track_25_deg_down_to_flat( /** rct2: 0x008AFF0C */ static void mini_suspended_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -449,31 +449,31 @@ static void mini_suspended_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -499,12 +499,11 @@ static void mini_suspended_rc_track_left_quarter_turn_5( { 32, 16, 1 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -530,12 +529,12 @@ static void mini_suspended_rc_track_left_quarter_turn_5( { 16, 16, 1 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -561,12 +560,11 @@ static void mini_suspended_rc_track_left_quarter_turn_5( { 16, 32, 1 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -593,19 +591,19 @@ static void mini_suspended_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -613,20 +611,20 @@ static void mini_suspended_rc_track_left_quarter_turn_5( switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AFF1C */ static void mini_suspended_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -635,7 +633,7 @@ static void mini_suspended_rc_track_right_quarter_turn_5( /** rct2: 0x008AFF2C */ static void mini_suspended_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -665,27 +663,27 @@ static void mini_suspended_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -712,24 +710,23 @@ static void mini_suspended_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 5, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -756,24 +753,23 @@ static void mini_suspended_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 5, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 6, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -800,18 +796,18 @@ static void mini_suspended_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -819,20 +815,20 @@ static void mini_suspended_rc_track_s_bend_left( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AFF3C */ static void mini_suspended_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -862,27 +858,27 @@ static void mini_suspended_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -909,24 +905,23 @@ static void mini_suspended_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 8, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -953,24 +948,23 @@ static void mini_suspended_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 8, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 7, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -997,18 +991,18 @@ static void mini_suspended_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1016,20 +1010,20 @@ static void mini_suspended_rc_track_s_bend_right( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AFF7C */ static void mini_suspended_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1059,31 +1053,31 @@ static void mini_suspended_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1109,9 +1103,9 @@ static void mini_suspended_rc_track_left_quarter_turn_3( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1138,19 +1132,19 @@ static void mini_suspended_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1158,20 +1152,20 @@ static void mini_suspended_rc_track_left_quarter_turn_3( switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008AFF8C */ static void mini_suspended_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1180,7 +1174,7 @@ static void mini_suspended_rc_track_right_quarter_turn_3( /** rct2: 0x008AFFAC */ static void mini_suspended_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1210,27 +1204,27 @@ static void mini_suspended_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1256,12 +1250,11 @@ static void mini_suspended_rc_track_left_eighth_to_diag( { 32, 16, 1 }, { 0, 16, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1287,15 +1280,15 @@ static void mini_suspended_rc_track_left_eighth_to_diag( { 16, 16, 1 }, { 0, 0, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -1322,39 +1315,39 @@ static void mini_suspended_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 3, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 1, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 0, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 2, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AFFBC */ static void mini_suspended_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1384,27 +1377,27 @@ static void mini_suspended_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1430,12 +1423,11 @@ static void mini_suspended_rc_track_right_eighth_to_diag( { 32, 16, 1 }, { 0, 0, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1461,15 +1453,15 @@ static void mini_suspended_rc_track_right_eighth_to_diag( { 16, 16, 1 }, { 0, 16, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -1496,39 +1488,39 @@ static void mini_suspended_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008AFFCC */ static void mini_suspended_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1537,7 +1529,7 @@ static void mini_suspended_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008AFFDC */ static void mini_suspended_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1546,7 +1538,7 @@ static void mini_suspended_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008AFF9C */ static void mini_suspended_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1574,9 +1566,9 @@ static void mini_suspended_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1601,9 +1593,9 @@ static void mini_suspended_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1628,9 +1620,9 @@ static void mini_suspended_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1656,36 +1648,36 @@ static void mini_suspended_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 30, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008B000C */ static void mini_suspended_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1713,9 +1705,9 @@ static void mini_suspended_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1740,9 +1732,9 @@ static void mini_suspended_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1767,9 +1759,9 @@ static void mini_suspended_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1795,36 +1787,36 @@ static void mini_suspended_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008AFFEC */ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1852,9 +1844,9 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1879,9 +1871,9 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1906,9 +1898,9 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1934,36 +1926,36 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008AFFFC */ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1991,9 +1983,9 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2018,9 +2010,9 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2045,9 +2037,9 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2073,36 +2065,36 @@ static void mini_suspended_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008B003C */ static void mini_suspended_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2130,9 +2122,9 @@ static void mini_suspended_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2157,9 +2149,9 @@ static void mini_suspended_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2184,9 +2176,9 @@ static void mini_suspended_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2212,36 +2204,36 @@ static void mini_suspended_rc_track_diag_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008B001C */ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2269,8 +2261,8 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2295,8 +2287,8 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2321,8 +2313,8 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2348,36 +2340,36 @@ static void mini_suspended_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008B002C */ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2405,9 +2397,9 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2432,9 +2424,9 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2459,9 +2451,9 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2487,29 +2479,29 @@ static void mini_suspended_rc_track_diag_25_deg_down_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 1, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK, 2, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 34, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index ee1fde0589..65d0835a0a 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -35,7 +35,7 @@ static constexpr const uint32_t MULTI_DIM_INVERTED_BLOCK_BRAKE_NW_SE_CLOSED = 26 /** rct2: 0x00792D88 */ static void multi_dimension_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -59,7 +59,7 @@ static void multi_dimension_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -82,13 +82,13 @@ static void multi_dimension_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -108,22 +108,22 @@ static void multi_dimension_rc_track_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00792F98, 0x00792FA8, 0x00792FB8 */ static void multi_dimension_rc_track_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[NumOrthogonalDirections][3] = { @@ -173,14 +173,14 @@ static void multi_dimension_rc_track_station( track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, height); } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00792D98 */ static void multi_dimension_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -212,7 +212,7 @@ static void multi_dimension_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -243,20 +243,20 @@ static void multi_dimension_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else { @@ -284,26 +284,26 @@ static void multi_dimension_rc_track_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -311,19 +311,19 @@ static void multi_dimension_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } } /** rct2: 0x00792DA8 */ static void multi_dimension_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -353,19 +353,19 @@ static void multi_dimension_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 24, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } else { @@ -394,21 +394,21 @@ static void multi_dimension_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } /** rct2: 0x00792DB8 */ static void multi_dimension_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -440,7 +440,7 @@ static void multi_dimension_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -471,20 +471,20 @@ static void multi_dimension_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -512,26 +512,26 @@ static void multi_dimension_rc_track_flat_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -539,19 +539,19 @@ static void multi_dimension_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x00792DC8 */ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -587,19 +587,19 @@ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else { @@ -634,21 +634,21 @@ static void multi_dimension_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x00792DD8 */ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -684,19 +684,19 @@ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else { @@ -730,26 +730,26 @@ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 68, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 68, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 68, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 68, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -757,19 +757,19 @@ static void multi_dimension_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } /** rct2: 0x00792DE8 */ static void multi_dimension_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -801,7 +801,7 @@ static void multi_dimension_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } @@ -832,20 +832,20 @@ static void multi_dimension_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -873,26 +873,26 @@ static void multi_dimension_rc_track_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -900,19 +900,19 @@ static void multi_dimension_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x00792DF8 */ static void multi_dimension_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { multi_dimension_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -920,7 +920,7 @@ static void multi_dimension_rc_track_25_deg_down( /** rct2: 0x00792E08 */ static void multi_dimension_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { multi_dimension_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -928,7 +928,7 @@ static void multi_dimension_rc_track_60_deg_down( /** rct2: 0x00792E18 */ static void multi_dimension_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -936,7 +936,7 @@ static void multi_dimension_rc_track_flat_to_25_deg_down( /** rct2: 0x00792E28 */ static void multi_dimension_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -944,7 +944,7 @@ static void multi_dimension_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x00792E38 */ static void multi_dimension_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -952,7 +952,7 @@ static void multi_dimension_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x00792E48 */ static void multi_dimension_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -960,7 +960,7 @@ static void multi_dimension_rc_track_25_deg_down_to_flat( /** rct2: 0x00792E58 */ static void multi_dimension_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -991,17 +991,17 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1027,12 +1027,12 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1058,13 +1058,12 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1090,12 +1089,12 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1121,21 +1120,20 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1168,21 +1166,20 @@ static void multi_dimension_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1208,12 +1205,12 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1239,13 +1236,12 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1271,12 +1267,12 @@ static void multi_dimension_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1303,23 +1299,22 @@ static void multi_dimension_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1327,7 +1322,7 @@ static void multi_dimension_rc_track_left_quarter_turn_5( /** rct2: 0x00792E68 */ static void multi_dimension_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1336,7 +1331,7 @@ static void multi_dimension_rc_track_right_quarter_turn_5( /** rct2: 0x00792E78 */ static void multi_dimension_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1372,12 +1367,12 @@ static void multi_dimension_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1405,24 +1400,24 @@ static void multi_dimension_rc_track_flat_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00792E88 */ static void multi_dimension_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1458,12 +1453,12 @@ static void multi_dimension_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1491,24 +1486,24 @@ static void multi_dimension_rc_track_flat_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00792E98 */ static void multi_dimension_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1544,12 +1539,12 @@ static void multi_dimension_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1577,24 +1572,24 @@ static void multi_dimension_rc_track_left_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00792EA8 */ static void multi_dimension_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1630,12 +1625,12 @@ static void multi_dimension_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -1663,24 +1658,24 @@ static void multi_dimension_rc_track_right_bank_to_flat( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00792EB8 */ static void multi_dimension_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -1714,17 +1709,17 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1750,12 +1745,12 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1781,13 +1776,12 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1813,12 +1807,12 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1847,21 +1841,20 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -1894,21 +1887,20 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1934,12 +1926,12 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1965,13 +1957,12 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1997,12 +1988,12 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 24 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -2029,23 +2020,22 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -2053,7 +2043,7 @@ static void multi_dimension_rc_track_banked_left_quarter_turn_5( /** rct2: 0x00792EC8 */ static void multi_dimension_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2063,7 +2053,7 @@ static void multi_dimension_rc_track_banked_right_quarter_turn_5( /** rct2: 0x00792ED8 */ static void multi_dimension_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2099,19 +2089,19 @@ static void multi_dimension_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -2139,28 +2129,28 @@ static void multi_dimension_rc_track_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2168,19 +2158,19 @@ static void multi_dimension_rc_track_left_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x00792EE8 */ static void multi_dimension_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2216,19 +2206,19 @@ static void multi_dimension_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -2256,28 +2246,28 @@ static void multi_dimension_rc_track_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2285,19 +2275,19 @@ static void multi_dimension_rc_track_right_bank_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } } /** rct2: 0x00792EF8 */ static void multi_dimension_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2333,19 +2323,19 @@ static void multi_dimension_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -2373,28 +2363,28 @@ static void multi_dimension_rc_track_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2402,19 +2392,19 @@ static void multi_dimension_rc_track_25_deg_up_to_left_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x00792F08 */ static void multi_dimension_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2450,19 +2440,19 @@ static void multi_dimension_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else { @@ -2490,28 +2480,28 @@ static void multi_dimension_rc_track_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2519,19 +2509,19 @@ static void multi_dimension_rc_track_25_deg_up_to_right_bank( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } } /** rct2: 0x00792F18 */ static void multi_dimension_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2539,7 +2529,7 @@ static void multi_dimension_rc_track_left_bank_to_25_deg_down( /** rct2: 0x00792F28 */ static void multi_dimension_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2547,7 +2537,7 @@ static void multi_dimension_rc_track_right_bank_to_25_deg_down( /** rct2: 0x00792F38 */ static void multi_dimension_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2555,7 +2545,7 @@ static void multi_dimension_rc_track_25_deg_down_to_left_bank( /** rct2: 0x00792F48 */ static void multi_dimension_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2563,7 +2553,7 @@ static void multi_dimension_rc_track_25_deg_down_to_right_bank( /** rct2: 0x00792F58 */ static void multi_dimension_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2593,12 +2583,12 @@ static void multi_dimension_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -2626,24 +2616,24 @@ static void multi_dimension_rc_track_left_bank( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00792F68 */ static void multi_dimension_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { multi_dimension_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2651,7 +2641,7 @@ static void multi_dimension_rc_track_right_bank( /** rct2: 0x00792F78 */ static void multi_dimension_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -2682,14 +2672,14 @@ static void multi_dimension_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2698,14 +2688,14 @@ static void multi_dimension_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15817), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15821), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2719,8 +2709,8 @@ static void multi_dimension_rc_track_s_bend_left( { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2739,19 +2729,19 @@ static void multi_dimension_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15817), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15821), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2777,19 +2767,19 @@ static void multi_dimension_rc_track_s_bend_left( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -2822,17 +2812,16 @@ static void multi_dimension_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2859,24 +2848,24 @@ static void multi_dimension_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2903,24 +2892,24 @@ static void multi_dimension_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2947,22 +2936,21 @@ static void multi_dimension_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -2970,7 +2958,7 @@ static void multi_dimension_rc_track_s_bend_left( /** rct2: 0x00792F88 */ static void multi_dimension_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3001,14 +2989,14 @@ static void multi_dimension_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3017,14 +3005,14 @@ static void multi_dimension_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15825), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15829), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -3038,8 +3026,8 @@ static void multi_dimension_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3058,19 +3046,19 @@ static void multi_dimension_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15825), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15829), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3096,19 +3084,19 @@ static void multi_dimension_rc_track_s_bend_right( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3141,17 +3129,16 @@ static void multi_dimension_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3178,24 +3165,24 @@ static void multi_dimension_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3222,24 +3209,24 @@ static void multi_dimension_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3266,22 +3253,21 @@ static void multi_dimension_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3289,7 +3275,7 @@ static void multi_dimension_rc_track_s_bend_right( /** rct2: 0x00792FC8 */ static void multi_dimension_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3320,17 +3306,17 @@ static void multi_dimension_rc_track_left_quarter_turn_3( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3356,10 +3342,9 @@ static void multi_dimension_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3385,21 +3370,20 @@ static void multi_dimension_rc_track_left_quarter_turn_3( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3432,21 +3416,20 @@ static void multi_dimension_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3472,10 +3455,9 @@ static void multi_dimension_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3502,23 +3484,22 @@ static void multi_dimension_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3526,7 +3507,7 @@ static void multi_dimension_rc_track_left_quarter_turn_3( /** rct2: 0x00792FD8 */ static void multi_dimension_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3535,7 +3516,7 @@ static void multi_dimension_rc_track_right_quarter_turn_3( /** rct2: 0x00792FE8 */ static void multi_dimension_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -3569,17 +3550,17 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3605,10 +3586,9 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3637,21 +3617,20 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3684,21 +3663,20 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3724,10 +3702,9 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3754,23 +3731,22 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3778,7 +3754,7 @@ static void multi_dimension_rc_track_left_quarter_turn_3_bank( /** rct2: 0x00792FF8 */ static void multi_dimension_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3787,7 +3763,7 @@ static void multi_dimension_rc_track_right_quarter_turn_3_bank( /** rct2: 0x00793008 */ static void multi_dimension_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3819,17 +3795,17 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3855,9 +3831,9 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3886,21 +3862,21 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -3929,22 +3905,22 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -3970,9 +3946,9 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4001,21 +3977,21 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00793018 */ static void multi_dimension_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4047,17 +4023,17 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4083,9 +4059,9 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4114,19 +4090,19 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4155,24 +4131,24 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4198,9 +4174,9 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4229,21 +4205,21 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00793028 */ static void multi_dimension_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -4258,7 +4234,7 @@ static void multi_dimension_rc_track_left_half_banked_helix_down_small( /** rct2: 0x00793038 */ static void multi_dimension_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -4273,7 +4249,7 @@ static void multi_dimension_rc_track_right_half_banked_helix_down_small( /** rct2: 0x00793048 */ static void multi_dimension_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4305,17 +4281,17 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4341,12 +4317,11 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4372,12 +4347,12 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4403,12 +4378,11 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4437,21 +4411,21 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4480,22 +4454,22 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4521,12 +4495,11 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4552,12 +4525,12 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4583,12 +4556,11 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4617,21 +4589,21 @@ static void multi_dimension_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00793058 */ static void multi_dimension_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4663,17 +4635,17 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4699,12 +4671,11 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4730,12 +4701,12 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4761,12 +4732,11 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4795,19 +4765,19 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4836,24 +4806,24 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4879,12 +4849,11 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4910,12 +4879,12 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4941,12 +4910,11 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4975,21 +4943,21 @@ static void multi_dimension_rc_track_right_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00793068 */ static void multi_dimension_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -5004,7 +4972,7 @@ static void multi_dimension_rc_track_left_half_banked_helix_down_large( /** rct2: 0x00793078 */ static void multi_dimension_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -5019,7 +4987,7 @@ static void multi_dimension_rc_track_right_half_banked_helix_down_large( /** rct2: 0x00793088 */ static void multi_dimension_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5041,12 +5009,12 @@ static void multi_dimension_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -5066,22 +5034,22 @@ static void multi_dimension_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00793098 */ static void multi_dimension_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5091,9 +5059,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15806), { 0, 0, height }, { 32, 20, 0 }, @@ -5102,9 +5070,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15807), { 0, 0, height }, { 32, 20, 0 }, @@ -5113,9 +5081,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15806), { 0, 0, height }, { 32, 20, 0 }, @@ -5124,9 +5092,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15807), { 0, 0, height }, { 32, 20, 0 }, @@ -5134,9 +5102,9 @@ static void multi_dimension_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else { @@ -5145,9 +5113,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26227), { 0, 0, height + 24 }, @@ -5156,9 +5124,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26228), { 0, 0, height + 24 }, @@ -5167,9 +5135,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26227), { 0, 0, height + 24 }, @@ -5178,9 +5146,9 @@ static void multi_dimension_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(26228), { 0, 0, height + 24 }, @@ -5188,15 +5156,15 @@ static void multi_dimension_rc_track_on_ride_photo( break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } /** rct2: 0x00793328 */ static void multi_dimension_rc_track_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5227,10 +5195,10 @@ static void multi_dimension_rc_track_90_deg_up( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -5264,10 +5232,10 @@ static void multi_dimension_rc_track_90_deg_up( { 32, 20, 3 }, { 0, 6, height + 56 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -5277,7 +5245,7 @@ static void multi_dimension_rc_track_90_deg_up( /** rct2: 0x00793338 */ static void multi_dimension_rc_track_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { multi_dimension_rc_track_90_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5285,7 +5253,7 @@ static void multi_dimension_rc_track_90_deg_down( /** rct2: 0x00793348 */ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5318,12 +5286,12 @@ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: break; @@ -5359,12 +5327,12 @@ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: break; @@ -5374,7 +5342,7 @@ static void multi_dimension_rc_track_60_deg_up_to_90_deg_up( /** rct2: 0x00793358 */ static void multi_dimension_rc_track_90_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -5382,7 +5350,7 @@ static void multi_dimension_rc_track_90_deg_down_to_60_deg_down( /** rct2: 0x00793368 */ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5413,15 +5381,15 @@ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } else { @@ -5451,21 +5419,21 @@ static void multi_dimension_rc_track_90_deg_up_to_60_deg_up( switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_INVERTED_5); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_INVERTED_5); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } } /** rct2: 0x00793378 */ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5498,11 +5466,11 @@ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: break; @@ -5538,11 +5506,11 @@ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -5552,7 +5520,7 @@ static void multi_dimension_rc_track_60_deg_down_to_90_deg_down( /** rct2: 0x007930B8 */ static void multi_dimension_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5583,14 +5551,14 @@ static void multi_dimension_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5616,8 +5584,8 @@ static void multi_dimension_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5643,17 +5611,15 @@ static void multi_dimension_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5662,33 +5628,33 @@ static void multi_dimension_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15999), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16003), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16007), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16011), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5721,16 +5687,16 @@ static void multi_dimension_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5756,12 +5722,12 @@ static void multi_dimension_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5787,17 +5753,15 @@ static void multi_dimension_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5824,32 +5788,32 @@ static void multi_dimension_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5857,7 +5821,7 @@ static void multi_dimension_rc_track_left_eighth_to_diag( /** rct2: 0x007930C8 */ static void multi_dimension_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -5888,14 +5852,14 @@ static void multi_dimension_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5921,8 +5885,8 @@ static void multi_dimension_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5948,17 +5912,15 @@ static void multi_dimension_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5967,33 +5929,33 @@ static void multi_dimension_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15983), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15987), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15991), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(15995), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6026,16 +5988,16 @@ static void multi_dimension_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6061,12 +6023,12 @@ static void multi_dimension_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6092,17 +6054,15 @@ static void multi_dimension_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6129,32 +6089,32 @@ static void multi_dimension_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6162,7 +6122,7 @@ static void multi_dimension_rc_track_right_eighth_to_diag( /** rct2: 0x007930D8 */ static void multi_dimension_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6171,7 +6131,7 @@ static void multi_dimension_rc_track_left_eighth_to_orthogonal( /** rct2: 0x007930E8 */ static void multi_dimension_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6180,7 +6140,7 @@ static void multi_dimension_rc_track_right_eighth_to_orthogonal( /** rct2: 0x007930F8 */ static void multi_dimension_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6211,14 +6171,14 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6244,8 +6204,8 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6271,17 +6231,15 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6290,33 +6248,33 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16031), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16035), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16039), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16043), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6349,17 +6307,16 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6385,12 +6342,12 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6416,17 +6373,15 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6453,32 +6408,32 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6486,7 +6441,7 @@ static void multi_dimension_rc_track_left_eighth_bank_to_diag( /** rct2: 0x00793108 */ static void multi_dimension_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6517,14 +6472,14 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6550,8 +6505,8 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6577,17 +6532,15 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6596,33 +6549,33 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16015), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16019), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16023), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16027), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6655,17 +6608,16 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - metal_a_supports_paint_setup( + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -6691,12 +6643,12 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height + 22 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6722,17 +6674,15 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6759,32 +6709,32 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6792,7 +6742,7 @@ static void multi_dimension_rc_track_right_eighth_bank_to_diag( /** rct2: 0x00793118 */ static void multi_dimension_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6801,7 +6751,7 @@ static void multi_dimension_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x00793128 */ static void multi_dimension_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6810,7 +6760,7 @@ static void multi_dimension_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x007930A8 */ static void multi_dimension_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -6840,10 +6790,9 @@ static void multi_dimension_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6868,10 +6817,9 @@ static void multi_dimension_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6896,10 +6844,9 @@ static void multi_dimension_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6907,22 +6854,22 @@ static void multi_dimension_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16107), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6932,30 +6879,29 @@ static void multi_dimension_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16045), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6986,10 +6932,9 @@ static void multi_dimension_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7014,10 +6959,9 @@ static void multi_dimension_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7042,10 +6986,9 @@ static void multi_dimension_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7071,30 +7014,29 @@ static void multi_dimension_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -7102,7 +7044,7 @@ static void multi_dimension_rc_track_diag_flat( /** rct2: 0x00793158 */ static void multi_dimension_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7132,10 +7074,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7160,10 +7101,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7188,10 +7128,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7199,22 +7138,22 @@ static void multi_dimension_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16119), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7224,30 +7163,29 @@ static void multi_dimension_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16057), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -7278,10 +7216,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7306,10 +7243,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7334,10 +7270,9 @@ static void multi_dimension_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7363,30 +7298,29 @@ static void multi_dimension_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -7394,7 +7328,7 @@ static void multi_dimension_rc_track_diag_25_deg_up( /** rct2: 0x007931B8 */ static void multi_dimension_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7410,10 +7344,9 @@ static void multi_dimension_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -7424,10 +7357,9 @@ static void multi_dimension_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -7438,38 +7370,36 @@ static void multi_dimension_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16069), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -7486,10 +7416,9 @@ static void multi_dimension_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -7500,10 +7429,9 @@ static void multi_dimension_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -7514,10 +7442,9 @@ static void multi_dimension_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -7529,30 +7456,29 @@ static void multi_dimension_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 32, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 36, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 32, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 36, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -7560,7 +7486,7 @@ static void multi_dimension_rc_track_diag_60_deg_up( /** rct2: 0x00793138 */ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7590,10 +7516,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7618,10 +7543,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7646,10 +7570,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7657,22 +7580,22 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16111), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7682,30 +7605,29 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16049), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -7736,10 +7658,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7764,10 +7685,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7792,10 +7712,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7821,30 +7740,29 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -7852,7 +7770,7 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x00793198 */ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -7868,10 +7786,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -7882,10 +7799,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -7896,38 +7812,36 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16061), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -7944,10 +7858,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -7958,10 +7871,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -7972,10 +7884,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -7987,30 +7898,29 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 16, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 16, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 16, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 16, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -8018,7 +7928,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x007931A8 */ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8034,10 +7944,9 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -8048,10 +7957,9 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8062,38 +7970,36 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16065), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -8110,10 +8016,9 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -8124,10 +8029,9 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8138,10 +8042,9 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8153,30 +8056,29 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 21, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 21, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 21, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 21, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -8184,7 +8086,7 @@ static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x00793148 */ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8214,10 +8116,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -8242,10 +8143,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -8270,10 +8170,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -8281,22 +8180,22 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16115), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -8306,30 +8205,29 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16053), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -8360,10 +8258,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -8388,10 +8285,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -8416,10 +8312,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -8445,30 +8340,29 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -8476,7 +8370,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x00793188 */ static void multi_dimension_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8506,10 +8400,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -8534,10 +8427,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -8562,10 +8454,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -8573,22 +8464,22 @@ static void multi_dimension_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16121), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -8598,30 +8489,29 @@ static void multi_dimension_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16059), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -8638,10 +8528,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8652,10 +8541,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8666,10 +8554,9 @@ static void multi_dimension_rc_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -8681,30 +8568,29 @@ static void multi_dimension_rc_track_diag_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -8712,7 +8598,7 @@ static void multi_dimension_rc_track_diag_25_deg_down( /** rct2: 0x007931E8 */ static void multi_dimension_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8728,10 +8614,9 @@ static void multi_dimension_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -8742,10 +8627,9 @@ static void multi_dimension_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -8756,38 +8640,36 @@ static void multi_dimension_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16071), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -8804,10 +8686,9 @@ static void multi_dimension_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -8818,10 +8699,9 @@ static void multi_dimension_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) @@ -8832,10 +8712,9 @@ static void multi_dimension_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 88 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -8847,30 +8726,29 @@ static void multi_dimension_rc_track_diag_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 24, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 28, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 24, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 28, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -8878,7 +8756,7 @@ static void multi_dimension_rc_track_diag_60_deg_down( /** rct2: 0x00793168 */ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -8908,9 +8786,8 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -8935,9 +8812,8 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -8962,9 +8838,8 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -8972,22 +8847,22 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16117), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -8997,29 +8872,28 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16055), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -9036,10 +8910,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -9050,10 +8923,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -9064,10 +8936,9 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -9079,25 +8950,24 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9105,12 +8975,12 @@ static void multi_dimension_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007931C8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9126,10 +8996,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9140,10 +9009,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9154,38 +9022,36 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16067), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9202,10 +9068,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9216,10 +9081,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9230,10 +9094,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9245,30 +9108,29 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 17, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 17, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 17, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 17, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9276,7 +9138,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x007931D8 */ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9292,10 +9154,9 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9306,10 +9167,9 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9320,38 +9180,36 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16063), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9368,10 +9226,9 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9382,10 +9239,9 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -9396,10 +9252,9 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 56 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9411,30 +9266,29 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 8, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 8, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 8, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 8, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9442,7 +9296,7 @@ static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x00793178 */ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9472,10 +9326,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9500,10 +9353,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9528,10 +9380,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9539,22 +9390,22 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16113), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -9564,30 +9415,29 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16051), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -9604,10 +9454,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -9618,10 +9467,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -9632,10 +9480,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -9647,30 +9494,29 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -9678,7 +9524,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x00793218 */ static void multi_dimension_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9694,10 +9540,9 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9711,10 +9556,9 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9725,38 +9569,36 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16077), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -9773,10 +9615,9 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9787,10 +9628,9 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9801,10 +9641,9 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -9816,31 +9655,30 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -9848,7 +9686,7 @@ static void multi_dimension_rc_track_diag_flat_to_left_bank( /** rct2: 0x00793228 */ static void multi_dimension_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -9864,10 +9702,9 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9878,10 +9715,9 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9895,38 +9731,36 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16082), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -9943,10 +9777,9 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -9957,10 +9790,9 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9971,10 +9803,9 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -9986,31 +9817,30 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -10018,7 +9848,7 @@ static void multi_dimension_rc_track_diag_flat_to_right_bank( /** rct2: 0x00793238 */ static void multi_dimension_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10034,10 +9864,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10051,10 +9880,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -10065,38 +9893,36 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16084), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -10113,10 +9939,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10127,10 +9952,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -10141,10 +9965,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -10156,31 +9979,30 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -10188,7 +10010,7 @@ static void multi_dimension_rc_track_diag_left_bank_to_flat( /** rct2: 0x00793248 */ static void multi_dimension_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10204,10 +10026,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10218,10 +10039,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -10235,38 +10055,36 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16079), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -10283,10 +10101,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10297,10 +10114,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -10311,10 +10127,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -10326,31 +10141,30 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -10358,7 +10172,7 @@ static void multi_dimension_rc_track_diag_right_bank_to_flat( /** rct2: 0x00793278 */ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10374,10 +10188,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -10391,10 +10204,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10405,38 +10217,36 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16097), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -10453,10 +10263,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -10467,10 +10276,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10481,10 +10289,9 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -10496,30 +10303,29 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -10527,7 +10333,7 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x00793288 */ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10543,10 +10349,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -10557,10 +10362,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10574,38 +10378,36 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16102), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -10622,10 +10424,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -10636,10 +10437,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10650,10 +10450,9 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -10665,30 +10464,29 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -10696,7 +10494,7 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x00793258 */ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10712,10 +10510,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10729,10 +10526,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -10743,38 +10539,36 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16087), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10791,10 +10585,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10805,10 +10598,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -10819,10 +10611,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -10834,30 +10625,29 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10865,7 +10655,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x00793268 */ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -10881,10 +10671,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10895,10 +10684,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -10912,38 +10700,36 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16092), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10960,10 +10746,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10974,10 +10759,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -10988,10 +10772,9 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11003,30 +10786,29 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -11034,7 +10816,7 @@ static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x00793298 */ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11050,9 +10832,8 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11066,9 +10847,8 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11079,36 +10859,34 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16094), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -11125,9 +10903,8 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11138,9 +10915,8 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11151,9 +10927,8 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11165,25 +10940,24 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11191,12 +10965,12 @@ static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007932A8 */ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11212,9 +10986,8 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11225,9 +10998,8 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11241,36 +11013,34 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16089), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } } @@ -11287,9 +11057,8 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11300,9 +11069,8 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11313,9 +11081,8 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11327,25 +11094,24 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -11353,12 +11119,12 @@ static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down( } } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007932B8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11374,10 +11140,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11391,10 +11156,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11405,38 +11169,36 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16104), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11453,10 +11215,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11467,10 +11228,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11481,10 +11241,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11496,30 +11255,29 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11527,7 +11285,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x007932C8 */ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11543,10 +11301,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11557,10 +11314,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11574,38 +11330,36 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16099), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11622,10 +11376,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11636,10 +11389,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -11650,10 +11402,9 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11665,30 +11416,29 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 40, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11696,7 +11446,7 @@ static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x007931F8 */ static void multi_dimension_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11712,10 +11462,9 @@ static void multi_dimension_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11726,10 +11475,9 @@ static void multi_dimension_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -11740,38 +11488,36 @@ static void multi_dimension_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16073), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -11788,10 +11534,9 @@ static void multi_dimension_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11802,10 +11547,9 @@ static void multi_dimension_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -11816,10 +11560,9 @@ static void multi_dimension_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -11831,31 +11574,30 @@ static void multi_dimension_rc_track_diag_left_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -11863,7 +11605,7 @@ static void multi_dimension_rc_track_diag_left_bank( /** rct2: 0x00793208 */ static void multi_dimension_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -11879,10 +11621,9 @@ static void multi_dimension_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11893,10 +11634,9 @@ static void multi_dimension_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -11907,38 +11647,36 @@ static void multi_dimension_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16075), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -11955,10 +11693,9 @@ static void multi_dimension_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11969,10 +11706,9 @@ static void multi_dimension_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -11983,10 +11719,9 @@ static void multi_dimension_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height + 22 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -11998,31 +11733,30 @@ static void multi_dimension_rc_track_diag_right_bank( break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 1, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 0, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 2, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 3, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12030,7 +11764,7 @@ static void multi_dimension_rc_track_diag_right_bank( /** rct2: 0x007932D8 */ static void multi_dimension_rc_track_left_flyer_twist_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12059,18 +11793,17 @@ static void multi_dimension_rc_track_left_flyer_twist_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12096,12 +11829,11 @@ static void multi_dimension_rc_track_left_flyer_twist_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12128,31 +11860,30 @@ static void multi_dimension_rc_track_left_flyer_twist_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007932E8 */ static void multi_dimension_rc_track_right_flyer_twist_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12181,18 +11912,17 @@ static void multi_dimension_rc_track_right_flyer_twist_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12218,12 +11948,11 @@ static void multi_dimension_rc_track_right_flyer_twist_up( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12250,31 +11979,30 @@ static void multi_dimension_rc_track_right_flyer_twist_up( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007932F8 */ static void multi_dimension_rc_track_left_flyer_twist_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12304,19 +12032,18 @@ static void multi_dimension_rc_track_left_flyer_twist_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12342,12 +12069,11 @@ static void multi_dimension_rc_track_left_flyer_twist_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12373,30 +12099,29 @@ static void multi_dimension_rc_track_left_flyer_twist_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00793308 */ static void multi_dimension_rc_track_right_flyer_twist_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12426,19 +12151,18 @@ static void multi_dimension_rc_track_right_flyer_twist_down( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12464,12 +12188,11 @@ static void multi_dimension_rc_track_right_flyer_twist_down( { 32, 20, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -12495,30 +12218,29 @@ static void multi_dimension_rc_track_right_flyer_twist_down( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x00793398 */ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12551,11 +12273,11 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -12581,9 +12303,9 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo { 2, 20, 31 }, { 24, 6, height + 16 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -12609,9 +12331,9 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo { 2, 20, 31 }, { 29, 6, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: break; @@ -12647,11 +12369,11 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12677,9 +12399,9 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -12705,9 +12427,9 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: break; @@ -12717,7 +12439,7 @@ static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_lo /** rct2: 0x00793318 */ static void multi_dimension_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -12734,11 +12456,10 @@ static void multi_dimension_rc_track_block_brakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][isClosed]), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES_INVERTED, 4, 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); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else { @@ -12753,22 +12474,22 @@ static void multi_dimension_rc_track_block_brakes( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][isClosed]), { 0, 0, height + 24 }, { 32, 20, 3 }, { 0, 6, height + 24 }); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES_INVERTED, 4, 0, height + 36, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } } /** rct2: 0x00793388 */ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12799,9 +12520,9 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -12827,9 +12548,9 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -12857,11 +12578,11 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12893,9 +12614,9 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter { 2, 20, 31 }, { 28, 6, height - 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -12921,9 +12642,9 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter { 2, 20, 31 }, { 24, 6, height - 16 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12951,11 +12672,11 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12963,7 +12684,7 @@ static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter /** rct2: 0x00793398 */ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -12996,11 +12717,11 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -13026,9 +12747,9 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( { 2, 20, 31 }, { 24, 6, height + 16 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -13054,9 +12775,9 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( { 2, 20, 31 }, { 29, 6, height + 24 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: break; @@ -13092,11 +12813,11 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -13122,9 +12843,9 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -13150,9 +12871,9 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: break; @@ -13162,7 +12883,7 @@ static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop( /** rct2: 0x00793388 */ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (!trackElement.IsInverted()) @@ -13193,9 +12914,9 @@ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -13221,9 +12942,9 @@ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -13251,11 +12972,11 @@ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -13287,9 +13008,9 @@ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter { 2, 20, 31 }, { 28, 6, height - 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -13315,9 +13036,9 @@ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter { 2, 20, 31 }, { 24, 6, height - 16 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -13345,11 +13066,11 @@ static void multi_dimension_rc_track_multidim_inverted_90_deg_up_to_flat_quarter } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index 5adcbe15a2..4a697eabcd 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -196,29 +196,29 @@ static constexpr const uint32_t reverse_freefall_rc_track_pieces_vertical_suppor }; static void paint_reverse_freefall_rc_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction & 1) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_REVERSE_FREEFALL_RC_FLAT_NW_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_REVERSE_FREEFALL_RC_FLAT_SW_NE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - 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); + WoodenASupportsPaintSetup(session, (direction & 1) ? 1 : 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_reverse_freefall_rc_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -231,10 +231,10 @@ static void paint_reverse_freefall_rc_station( // height += 2 (height) imageId = session.TrackColours[SCHEME_TRACK].WithIndex(reverse_freefall_rc_track_pieces_station[direction]); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); - 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); + WoodenASupportsPaintSetup(session, (direction & 1) ? 1 : 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else if (direction == 1 || direction == 3) { @@ -244,20 +244,20 @@ static void paint_reverse_freefall_rc_station( // height += 2 (height) imageId = session.TrackColours[SCHEME_TRACK].WithIndex(reverse_freefall_rc_track_pieces_station[direction]); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); - 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); + WoodenASupportsPaintSetup(session, (direction & 1) ? 1 : 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_reverse_freefall_rc_slope( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const int8_t bbHeights03[] = { 1, 6, 14, 37, 64 }; @@ -289,11 +289,11 @@ static void paint_reverse_freefall_rc_slope( int32_t tunnelOffset = tunnelOffsets03[trackSequence]; if (direction & 1) { - paint_util_push_tunnel_right(session, height + tunnelOffset, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + tunnelOffset, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_left(session, height + tunnelOffset, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + tunnelOffset, TUNNEL_SQUARE_FLAT); } } else @@ -305,12 +305,12 @@ static void paint_reverse_freefall_rc_slope( session, direction, supportsImageId, { 0, 0, height }, { 32, 20, bbHeight }, { 0, 6, height }); } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 5: - if (wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS])) + if (WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS])) { ImageId floorImageId; if (direction & 1) @@ -332,8 +332,8 @@ static void paint_reverse_freefall_rc_slope( session, direction, supportsImageId, { 0, 0, height }, { isDirection03 ? 26 : 18, 26, 126 }, { isDirection03 ? 3 : 11, 3, height }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + supportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 6: if (isDirection03) @@ -350,15 +350,15 @@ static void paint_reverse_freefall_rc_slope( PaintAddImageAsChildRotated( session, direction, supportsImageId, { 0, 0, height }, { 1, 20, 126 }, { 27, 6, height }); } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; } } static void paint_reverse_freefall_rc_vertical( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId supportsImageId, trackImageId; @@ -368,8 +368,8 @@ static void paint_reverse_freefall_rc_vertical( supportsImageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex( reverse_freefall_rc_track_pieces_vertical_supports[direction]); 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: trackImageId = session.TrackColours[SCHEME_TRACK].WithIndex(reverse_freefall_rc_track_pieces_vertical[direction]); @@ -383,15 +383,15 @@ static void paint_reverse_freefall_rc_vertical( PaintAddImageAsParentRotated( session, direction, trackImageId, { 0, 0, height }, { 2, 20, 79 }, { 30, 6, height }); } - paint_util_set_vertical_tunnel(session, height + 80); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetVerticalTunnel(session, height + 80); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } static void paint_reverse_freefall_rc_onride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -412,13 +412,13 @@ static void paint_reverse_freefall_rc_onride_photo( PaintAddImageAsParentRotated( session, direction, colour.WithIndex(imageIds[direction]), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); track_paint_util_onride_photo_paint(session, direction, height + 3, trackElement); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_reverse_freefall_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index 9c77f4d1a7..86ae7fe1b6 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -27,7 +27,7 @@ * rct2: 0x006D4453 */ void vehicle_visual_reverser( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { Vehicle* v1 = GetEntity(vehicle->prev_vehicle_on_ride); @@ -47,7 +47,7 @@ void vehicle_visual_reverser( /** rct2: 0x0086E65C */ static void reverser_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -59,14 +59,14 @@ static void reverser_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21520), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21521), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -79,24 +79,24 @@ static void reverser_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21504), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21505), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void reverser_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -112,16 +112,16 @@ static void reverser_rc_track_station( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][0]), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0086E66C */ static void reverser_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -132,25 +132,25 @@ static void reverser_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21530), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21531), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21532), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21533), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -162,43 +162,43 @@ static void reverser_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21516), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21517), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21518), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21519), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0086E67C */ static void reverser_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -209,25 +209,25 @@ static void reverser_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21522), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21523), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21524), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21525), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -239,43 +239,43 @@ static void reverser_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21508), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21509), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21510), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21511), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0086E68C */ static void reverser_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -286,25 +286,25 @@ static void reverser_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21526), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21527), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21528), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21529), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -316,43 +316,43 @@ static void reverser_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21512), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21513), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21514), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21515), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0086E69C */ static void reverser_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { reverser_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -360,7 +360,7 @@ static void reverser_rc_track_25_deg_down( /** rct2: 0x0086E6AC */ static void reverser_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -368,7 +368,7 @@ static void reverser_rc_track_flat_to_25_deg_down( /** rct2: 0x0086E6BC */ static void reverser_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -376,7 +376,7 @@ static void reverser_rc_track_25_deg_down_to_flat( /** rct2: 0x0086E6CC */ static void reverser_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -388,38 +388,38 @@ static void reverser_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21543), { 0, 2, height }, { 32, 27, 2 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21548), { 0, 2, height }, { 32, 27, 2 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21553), { 0, 2, height }, { 32, 32, 2 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21538), { 0, 2, height }, { 32, 32, 2 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -428,33 +428,32 @@ static void reverser_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21542), { 0, 0, height }, { 32, 16, 2 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21547), { 0, 0, height }, { 32, 16, 2 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21552), { 0, 16, height }, { 32, 16, 2 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21537), { 0, 16, height }, { 32, 16, 2 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -463,39 +462,39 @@ static void reverser_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21541), { 0, 16, height }, { 16, 16, 2 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21546), { 16, 16, height }, { 16, 16, 2 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21551), { 16, 0, height }, { 16, 16, 2 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21536), { 0, 0, height }, { 16, 16, 2 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -504,33 +503,32 @@ static void reverser_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21540), { 16, 0, height }, { 16, 34, 2 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21545), { 0, 0, height }, { 16, 32, 2 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21550), { 0, 0, height }, { 16, 32, 2 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21535), { 16, 0, height }, { 16, 32, 2 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -539,45 +537,45 @@ static void reverser_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21539), { 2, 0, height }, { 32, 32, 2 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21544), { 2, 0, height }, { 27, 32, 2 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21549), { 2, 0, height }, { 27, 32, 2 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21534), { 2, 0, height }, { 32, 32, 2 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0086E6DC */ static void reverser_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -586,7 +584,7 @@ static void reverser_rc_track_right_quarter_turn_5( /** rct2: 0x0086E6EC */ static void reverser_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -598,33 +596,33 @@ static void reverser_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21566), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21570), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21569), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21573), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -633,33 +631,32 @@ static void reverser_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21567), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21571), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21568), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21572), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -668,33 +665,32 @@ static void reverser_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21568), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21572), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21567), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21571), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -703,45 +699,45 @@ static void reverser_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21569), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21573), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21566), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21570), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0086E6FC */ static void reverser_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -753,33 +749,33 @@ static void reverser_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21574), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21578), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21577), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21581), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -788,33 +784,32 @@ static void reverser_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21575), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21579), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21576), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21580), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -823,33 +818,32 @@ static void reverser_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21576), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21580), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21575), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21579), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -858,45 +852,45 @@ static void reverser_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21577), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21581), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21574), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21578), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0086E73C */ static void reverser_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -908,36 +902,36 @@ static void reverser_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21559), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21562), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21565), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21556), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -963,9 +957,9 @@ static void reverser_rc_track_left_quarter_turn_3( { 16, 16, 2 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -974,45 +968,45 @@ static void reverser_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21557), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21560), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21563), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21554), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0086E74C */ static void reverser_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1021,7 +1015,7 @@ static void reverser_rc_track_right_quarter_turn_3( /** rct2: 0x0086E75C */ static void reverser_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1031,24 +1025,24 @@ static void reverser_rc_track_brakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21506), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21507), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0086E76C */ static void reverser_rc_track_left_reverser( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1060,33 +1054,33 @@ static void reverser_rc_track_left_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21582), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21588), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21594), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21600), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1095,29 +1089,29 @@ static void reverser_rc_track_left_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21585), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21591), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21597), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21603), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1126,29 +1120,29 @@ static void reverser_rc_track_left_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21586), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21592), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21598), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21604), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1157,29 +1151,29 @@ static void reverser_rc_track_left_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21587), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21593), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21599), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21605), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1188,29 +1182,29 @@ static void reverser_rc_track_left_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21583), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21589), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21595), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21601), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1219,45 +1213,45 @@ static void reverser_rc_track_left_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21584), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21590), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21596), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21602), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0086E77C */ static void reverser_rc_track_right_reverser( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1269,33 +1263,33 @@ static void reverser_rc_track_right_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21596), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21602), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21584), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21590), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1304,29 +1298,29 @@ static void reverser_rc_track_right_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21599), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21605), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21587), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21593), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1335,29 +1329,29 @@ static void reverser_rc_track_right_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21598), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21604), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21586), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21592), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1366,29 +1360,29 @@ static void reverser_rc_track_right_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21597), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21603), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21585), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21591), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1397,29 +1391,29 @@ static void reverser_rc_track_right_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21595), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21601), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21583), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21589), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1428,38 +1422,38 @@ static void reverser_rc_track_right_reverser( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21594), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21600), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21582), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21588), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index 54af4d6c10..696ebc3a05 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -67,7 +67,7 @@ constexpr int32_t SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_3_A = 21879; /** rct2: 0x0077839C */ static void side_friction_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -81,7 +81,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21664), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -90,7 +90,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21665), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -99,7 +99,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21668), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -108,7 +108,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21669), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -124,7 +124,7 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21608), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: @@ -134,18 +134,18 @@ static void side_friction_rc_track_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21609), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x007784AC, 0x007784BC, 0x007784CC */ static void side_friction_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -158,16 +158,16 @@ static void side_friction_rc_track_station( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction]), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x007783AC */ static void side_friction_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -181,7 +181,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21690), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -190,7 +190,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21691), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -199,7 +199,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21692), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -208,7 +208,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21693), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -223,7 +223,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21634), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -232,7 +232,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21635), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -241,7 +241,7 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21636), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -250,25 +250,25 @@ static void side_friction_rc_track_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21637), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x007783CC */ static void side_friction_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -282,7 +282,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21682), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -291,7 +291,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21683), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -300,7 +300,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21684), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -309,7 +309,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21685), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -324,7 +324,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21626), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -333,7 +333,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21627), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -342,7 +342,7 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21628), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -351,25 +351,25 @@ static void side_friction_rc_track_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21629), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x007783FC */ static void side_friction_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -383,7 +383,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21686), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -392,7 +392,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21687), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -401,7 +401,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21688), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -410,7 +410,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21689), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -425,7 +425,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21630), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -434,7 +434,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21631), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -443,7 +443,7 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21632), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -452,25 +452,25 @@ static void side_friction_rc_track_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21633), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0077840C */ static void side_friction_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { side_friction_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -478,7 +478,7 @@ static void side_friction_rc_track_25_deg_down( /** rct2: 0x0077842C */ static void side_friction_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -486,7 +486,7 @@ static void side_friction_rc_track_flat_to_25_deg_down( /** rct2: 0x0077845C */ static void side_friction_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -494,7 +494,7 @@ static void side_friction_rc_track_25_deg_down_to_flat( /** rct2: 0x0077846C */ static void side_friction_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -509,7 +509,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21747), { 0, 2, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -518,7 +518,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21752), { 0, 2, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -527,7 +527,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21757), { 0, 2, height }, { 32, 32, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -536,20 +536,20 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21742), { 0, 2, height }, { 32, 32, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -561,7 +561,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21746), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -570,7 +570,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21751), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -579,7 +579,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21756), { 0, 16, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -588,15 +588,14 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21741), { 0, 16, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -608,7 +607,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21745), { 0, 16, height }, { 16, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -617,7 +616,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21750), { 16, 16, height }, { 16, 16, 0 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -626,7 +625,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21755), { 16, 0, height }, { 16, 16, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -635,21 +634,21 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21740), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -661,7 +660,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21744), { 16, 0, height }, { 16, 34, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -670,7 +669,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21749), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -679,7 +678,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21754), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -688,15 +687,14 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21739), { 16, 0, height }, { 16, 32, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -708,7 +706,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21743), { 2, 0, height }, { 32, 32, 0 }, { 2, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -717,7 +715,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21748), { 2, 0, height }, { 27, 32, 0 }, { 2, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -726,7 +724,7 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21753), { 2, 0, height }, { 27, 32, 0 }, { 2, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -735,27 +733,27 @@ static void side_friction_rc_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21738), { 2, 0, height }, { 32, 32, 0 }, { 2, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0077847C */ static void side_friction_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -764,7 +762,7 @@ static void side_friction_rc_track_right_quarter_turn_5( /** rct2: 0x0077848C */ static void side_friction_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -779,7 +777,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21904), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -788,7 +786,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21908), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -797,7 +795,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21907), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -806,15 +804,15 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21911), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -826,7 +824,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21905), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -835,7 +833,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21909), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -844,7 +842,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21906), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -853,15 +851,14 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21910), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -873,7 +870,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21906), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -882,7 +879,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21910), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -891,7 +888,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21905), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -900,15 +897,14 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21909), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -920,7 +916,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21907), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -929,7 +925,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21911), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -938,7 +934,7 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21904), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -947,27 +943,27 @@ static void side_friction_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21908), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0077849C */ static void side_friction_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -982,7 +978,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21912), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -991,7 +987,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21916), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1000,7 +996,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21915), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1009,15 +1005,15 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21919), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1029,7 +1025,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21913), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1038,7 +1034,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21917), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1047,7 +1043,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21914), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1056,15 +1052,14 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21918), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1076,7 +1071,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21914), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1085,7 +1080,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21918), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1094,7 +1089,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21913), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1103,15 +1098,14 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21917), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1123,7 +1117,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21915), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1132,7 +1126,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21919), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1141,7 +1135,7 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21912), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1150,27 +1144,27 @@ static void side_friction_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21916), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007784DC */ static void side_friction_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1185,7 +1179,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21711), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1194,7 +1188,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21714), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1203,7 +1197,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21717), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1212,18 +1206,18 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21708), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1261,9 +1255,9 @@ static void side_friction_rc_track_left_quarter_turn_3( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1275,7 +1269,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21709), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1284,7 +1278,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21712), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1293,7 +1287,7 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21715), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1302,27 +1296,27 @@ static void side_friction_rc_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21706), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007784EC */ static void side_friction_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1331,7 +1325,7 @@ static void side_friction_rc_track_right_quarter_turn_3( /** rct2: 0x007784FC */ static void side_friction_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1344,7 +1338,7 @@ static void side_friction_rc_track_brakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21612), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: @@ -1354,17 +1348,17 @@ static void side_friction_rc_track_brakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21613), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x007785DC */ static void side_friction_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1379,7 +1373,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21806), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1388,7 +1382,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21810), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1397,7 +1391,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21814), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1406,15 +1400,15 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21818), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1426,7 +1420,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21807), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1435,7 +1429,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21811), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1444,7 +1438,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21815), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1453,11 +1447,11 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21819), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1469,7 +1463,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21808), { 0, 0, height }, { 16, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1478,7 +1472,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21812), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1487,7 +1481,7 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21816), { 0, 0, height }, { 16, 16, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1496,30 +1490,30 @@ static void side_friction_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21820), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1557,15 +1551,15 @@ static void side_friction_rc_track_left_eighth_to_diag( { 16, 16, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007785EC */ static void side_friction_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1580,7 +1574,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21774), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1589,7 +1583,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21778), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1598,7 +1592,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21782), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1607,15 +1601,15 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21786), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1627,7 +1621,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21775), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1636,7 +1630,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21779), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1645,7 +1639,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21783), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1654,11 +1648,11 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21787), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1670,7 +1664,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21776), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -1679,7 +1673,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21780), { 0, 0, height }, { 16, 16, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1688,7 +1682,7 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21784), { 0, 0, height }, { 28, 28, 0 }, { 4, 4, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -1697,30 +1691,30 @@ static void side_friction_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21788), { 0, 0, height }, { 16, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1758,15 +1752,15 @@ static void side_friction_rc_track_right_eighth_to_diag( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x007785FC */ static void side_friction_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1775,7 +1769,7 @@ static void side_friction_rc_track_left_eighth_to_orthogonal( /** rct2: 0x0077860C */ static void side_friction_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1784,7 +1778,7 @@ static void side_friction_rc_track_right_eighth_to_orthogonal( /** rct2: 0x0077850C */ static void side_friction_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1812,8 +1806,8 @@ static void side_friction_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1827,16 +1821,16 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21850), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1851,21 +1845,21 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21826), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1873,10 +1867,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1885,10 +1879,10 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21851), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -1897,10 +1891,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -1909,15 +1903,15 @@ static void side_friction_rc_track_diag_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21827), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1942,15 +1936,15 @@ static void side_friction_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x0077853C */ static void side_friction_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1978,8 +1972,8 @@ static void side_friction_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1993,16 +1987,16 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21868), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2017,21 +2011,21 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21844), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2039,10 +2033,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2051,10 +2045,10 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21869), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2063,10 +2057,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2075,15 +2069,15 @@ static void side_friction_rc_track_diag_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21845), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2108,15 +2102,15 @@ static void side_friction_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0077851C */ static void side_friction_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2144,8 +2138,8 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2159,16 +2153,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21856), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2183,21 +2177,21 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21832), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2205,10 +2199,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2217,10 +2211,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21857), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2229,10 +2223,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2241,15 +2235,15 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21833), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2274,15 +2268,15 @@ static void side_friction_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x0077852C */ static void side_friction_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2310,8 +2304,8 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2325,16 +2319,16 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21862), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2349,21 +2343,21 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21838), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2371,10 +2365,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2383,10 +2377,10 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21863), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2395,10 +2389,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2407,15 +2401,15 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21839), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2440,15 +2434,15 @@ static void side_friction_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0077859C */ static void side_friction_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2476,8 +2470,8 @@ static void side_friction_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2491,16 +2485,16 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21869), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2515,21 +2509,21 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21845), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2537,10 +2531,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2549,10 +2543,10 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21868), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2561,10 +2555,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2573,15 +2567,15 @@ static void side_friction_rc_track_diag_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21844), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2606,15 +2600,15 @@ static void side_friction_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x0077857C */ static void side_friction_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2655,16 +2649,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21863), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2679,16 +2673,16 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21839), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2699,10 +2693,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2711,10 +2705,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21862), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2723,10 +2717,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2735,10 +2729,10 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21838), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2769,13 +2763,13 @@ static void side_friction_rc_track_diag_flat_to_25_deg_down( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0077858C */ static void side_friction_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2803,8 +2797,8 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2818,16 +2812,16 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21857), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2842,21 +2836,21 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21833), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2864,10 +2858,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2876,10 +2870,10 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21856), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -2888,10 +2882,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2900,15 +2894,15 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(21832), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2933,14 +2927,14 @@ static void side_friction_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void side_friction_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2952,7 +2946,7 @@ static void side_friction_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_DIR_0_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2963,7 +2957,7 @@ static void side_friction_rc_track_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_DIR_1_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 22, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2973,7 +2967,7 @@ static void side_friction_rc_track_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_DIR_2_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 23, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 23, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2982,31 +2976,31 @@ static void side_friction_rc_track_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_DIR_3_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void side_friction_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { side_friction_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3020,7 +3014,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_0_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 13, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 13, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3031,7 +3025,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_1_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3042,7 +3036,7 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_2_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 15, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3053,31 +3047,31 @@ static void side_friction_rc_track_25_deg_up_to_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_25_DEG_UP_TO_60_DEG_UP_DIR_3_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void side_friction_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3091,7 +3085,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_0_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3102,7 +3096,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_1_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 18, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3113,7 +3107,7 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_2_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 19, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 19, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3124,31 +3118,31 @@ static void side_friction_rc_track_60_deg_up_to_25_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_60_DEG_UP_TO_25_DEG_UP_DIR_3_B), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void side_friction_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3163,8 +3157,8 @@ static void side_friction_rc_track_diag_60_deg_up( { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -3178,30 +3172,30 @@ static void side_friction_rc_track_diag_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_DIAG_60_DEG_UP_DIR_0_B), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3212,14 +3206,14 @@ static void side_friction_rc_track_diag_60_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_DIAG_60_DEG_UP_DIR_2_B), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -3232,21 +3226,21 @@ static void side_friction_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } static void side_friction_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, 3 - trackSequence, (direction + 2) % 4, height, trackElement); } static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3261,8 +3255,8 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3276,29 +3270,29 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_0_B), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3309,14 +3303,14 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(SPR_SIDE_FRICTION_DIAG_60_DEG_UP_TO_25_DEG_UP_DIR_2_B), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3328,14 +3322,14 @@ static void side_friction_rc_track_diag_60_deg_up_to_25_deg_up( { -16, -16, height }, { 16, 16, 2 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void side_friction_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -3343,7 +3337,7 @@ static void side_friction_rc_track_diag_25_deg_down_to_60_deg_down( }; static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3358,8 +3352,8 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( { -16 + 4, -16 + 2, height }, { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3372,29 +3366,29 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(24033), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3404,14 +3398,14 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(24034), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3423,14 +3417,14 @@ static void side_friction_rc_track_diag_25_deg_up_to_60_deg_up( { -16, -16, height }, { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void side_friction_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( diff --git a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp index 646feef5f7..db9ff8ace2 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -27,7 +27,7 @@ namespace SingleRailRC { static void TrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -61,8 +61,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -84,18 +83,17 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackStation( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -122,13 +120,13 @@ namespace SingleRailRC { 32, 28, 2 }, { 0, 2, height }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_2(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void Track25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -162,8 +160,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -195,25 +192,24 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -247,8 +243,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -278,25 +273,24 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void TrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -330,8 +324,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -361,25 +354,24 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void Track25DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -421,8 +413,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -458,25 +449,24 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void Track60DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -518,8 +508,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -555,25 +544,24 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void Track25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -607,8 +595,7 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -638,67 +625,66 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void Track25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -731,10 +717,10 @@ namespace SingleRailRC { 0, 0, height }, { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: break; @@ -742,14 +728,14 @@ namespace SingleRailRC } static void Track90DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegUpTo90DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -784,17 +770,17 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 36, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_vertical_tunnel(session, height + 56); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetVerticalTunnel(session, height + 56); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: break; @@ -802,14 +788,14 @@ namespace SingleRailRC } static void Track90DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpTo90DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -838,19 +824,19 @@ namespace SingleRailRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 48, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 48, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 48, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } static void Track60DegDownTo90DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -885,11 +871,11 @@ namespace SingleRailRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 48, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: break; @@ -897,7 +883,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -930,19 +916,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -972,10 +956,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1005,27 +988,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1033,7 +1014,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1066,19 +1047,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1108,12 +1087,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1143,13 +1122,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1179,12 +1157,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1214,27 +1192,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1242,7 +1218,7 @@ namespace SingleRailRC } static void TrackLeftEighthToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1275,15 +1251,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1313,12 +1288,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1348,17 +1323,15 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1368,7 +1341,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 3)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1376,7 +1349,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 7)), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1384,7 +1357,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 11)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -1392,22 +1365,22 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 15)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightEighthToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1440,15 +1413,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1478,12 +1450,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1513,17 +1485,15 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1533,7 +1503,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 19)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1541,7 +1511,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 23)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -1549,7 +1519,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 27)), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -1557,22 +1527,22 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE + 31)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftEighthToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1580,7 +1550,7 @@ namespace SingleRailRC } static void TrackRightEighthToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1588,7 +1558,7 @@ namespace SingleRailRC } static void TrackDiagFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1618,10 +1588,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1648,10 +1617,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1678,10 +1646,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1689,7 +1656,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1697,15 +1664,15 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_LIFT_TRACK_FLAT_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1715,7 +1682,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1723,29 +1690,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_FLAT_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiag25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1776,10 +1742,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1807,10 +1772,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1838,10 +1802,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1849,7 +1812,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1858,15 +1821,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1876,7 +1839,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -1884,29 +1847,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiag25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1937,10 +1899,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1968,10 +1929,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1999,10 +1959,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2010,7 +1969,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2019,15 +1978,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_GENTLE_DIAGONAL + 5)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2037,7 +1996,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2045,29 +2004,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_DIAGONAL + 5)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2098,10 +2056,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2129,10 +2086,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2160,10 +2116,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2171,7 +2126,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2180,15 +2135,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2198,7 +2153,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2206,29 +2161,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2259,10 +2213,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2290,10 +2243,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2321,10 +2273,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2332,7 +2283,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2341,15 +2292,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_GENTLE_DIAGONAL + 11)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2359,7 +2310,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2367,29 +2318,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_DIAGONAL + 11)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2420,9 +2370,8 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2450,9 +2399,8 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2480,9 +2428,8 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2490,7 +2437,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2499,15 +2446,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_GENTLE_DIAGONAL + 7)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2517,7 +2464,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2525,30 +2472,29 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_DIAGONAL + 7)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiag25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2579,10 +2525,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2610,10 +2555,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2641,10 +2585,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2652,7 +2595,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2661,15 +2604,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_GENTLE_DIAGONAL + 3)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2679,7 +2622,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2687,29 +2630,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_DIAGONAL + 3)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2740,10 +2682,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2771,10 +2712,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2802,10 +2742,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2813,7 +2752,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 38, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2822,15 +2761,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_STEEP_DIAGONAL + 9)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 38, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2840,7 +2779,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 38, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2848,29 +2787,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_STEEP_DIAGONAL + 9)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 38, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } static void TrackDiag25DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2901,10 +2839,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2932,10 +2869,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2963,10 +2899,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2974,7 +2909,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -2983,15 +2918,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_STEEP_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3001,7 +2936,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3009,29 +2944,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_STEEP_DIAGONAL + 1)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3062,10 +2996,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3093,10 +3026,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3124,10 +3056,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3135,7 +3066,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3144,15 +3075,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_STEEP_DIAGONAL + 5)), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3162,7 +3093,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3170,29 +3101,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_STEEP_DIAGONAL + 5)), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3223,10 +3153,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3254,10 +3183,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3285,10 +3213,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3296,7 +3223,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3305,15 +3232,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_STEEP_DIAGONAL + 11)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3323,7 +3250,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3331,29 +3258,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_STEEP_DIAGONAL + 11)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } static void TrackDiag25DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3384,10 +3310,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3415,10 +3340,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3446,10 +3370,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3457,7 +3380,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3466,15 +3389,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_STEEP_DIAGONAL + 7)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3484,7 +3407,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3492,29 +3415,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_STEEP_DIAGONAL + 7)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3545,10 +3467,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3576,10 +3497,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3607,10 +3527,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3618,7 +3537,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3627,15 +3546,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_STEEP_DIAGONAL + 3)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3645,7 +3564,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -3653,29 +3572,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_STEEP_DIAGONAL + 3)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackFlatToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3715,16 +3633,16 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackFlatToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3764,30 +3682,30 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackLeftBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3827,23 +3745,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackRightBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3883,23 +3801,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void Track25DegUpToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3939,23 +3857,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void Track25DegUpToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -3995,51 +3913,51 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackLeftBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToRightBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4071,23 +3989,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4103,10 +4021,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4124,10 +4041,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4140,16 +4056,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4158,28 +4073,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 2)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagFlatToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4195,10 +4109,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4211,10 +4124,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4232,16 +4144,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4250,28 +4161,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 6)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagLeftBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4287,10 +4197,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4308,10 +4217,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4324,16 +4232,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4342,28 +4249,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 9)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagRightBankToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4379,10 +4285,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -4395,10 +4300,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4416,16 +4320,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4434,28 +4337,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 4)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagLeftBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4471,10 +4373,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4492,10 +4393,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4508,16 +4408,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4526,28 +4425,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 12)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiagRightBankTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4563,10 +4461,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -4579,10 +4476,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -4600,16 +4496,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4618,28 +4513,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 16)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegUpToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4655,10 +4549,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4676,10 +4569,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4692,16 +4584,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4710,28 +4601,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 22)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiag25DegUpToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4747,10 +4637,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -4763,10 +4652,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -4784,16 +4672,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4802,28 +4689,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 26)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } static void TrackDiagLeftBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4839,9 +4725,8 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4859,9 +4744,8 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4874,15 +4758,14 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4891,29 +4774,28 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 29)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiagRightBankTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4929,9 +4811,8 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4944,9 +4825,8 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4964,15 +4844,14 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -4981,29 +4860,28 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 24)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackDiag25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5019,10 +4897,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5040,10 +4917,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5056,16 +4932,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5074,28 +4949,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 19)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiag25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5111,10 +4985,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -5127,10 +5000,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -5148,16 +5020,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5166,28 +5037,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 14)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackDiagLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5203,10 +5073,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5219,10 +5088,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5235,16 +5103,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5253,28 +5120,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 31)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackDiagRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5290,10 +5156,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5306,10 +5171,9 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5322,16 +5186,15 @@ namespace SingleRailRC { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5340,28 +5203,27 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_BANK_TRANSITION_DIAGONAL + 33)), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftQuarterTurn3Bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5398,19 +5260,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5440,10 +5300,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5477,27 +5336,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightQuarterTurn3Bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -5505,7 +5362,7 @@ namespace SingleRailRC } static void TrackBankedLeftQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5542,19 +5399,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5584,12 +5439,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5619,13 +5474,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -5655,12 +5509,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5694,27 +5548,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackBankedRightQuarterTurn5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -5722,7 +5574,7 @@ namespace SingleRailRC } static void TrackLeftEighthBankToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5755,15 +5607,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5793,12 +5644,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5828,17 +5679,15 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5848,7 +5697,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 3)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -5856,7 +5705,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 7)), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -5864,7 +5713,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 11)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -5872,22 +5721,22 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 15)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightEighthBankToDiag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5920,15 +5769,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5958,12 +5806,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5993,17 +5841,15 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -6013,7 +5859,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 19)), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -6021,7 +5867,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 23)), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -6029,7 +5875,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 27)), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -6037,22 +5883,22 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CURVE_BANKED + 31)), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftEighthBankToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6060,7 +5906,7 @@ namespace SingleRailRC } static void TrackRightEighthBankToOrthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -6068,7 +5914,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6101,22 +5947,20 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -6146,27 +5990,25 @@ namespace SingleRailRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6199,22 +6041,20 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -6224,7 +6064,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE + 9)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -6232,7 +6072,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE + 11)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -6240,7 +6080,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE + 13)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -6248,29 +6088,28 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE + 15)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -6278,7 +6117,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -6286,7 +6125,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn525DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6319,19 +6158,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6361,12 +6198,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -6396,13 +6233,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -6432,12 +6268,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -6467,27 +6303,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightQuarterTurn525DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6520,19 +6354,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -6562,12 +6394,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -6597,13 +6429,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -6633,12 +6464,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -6668,27 +6499,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftQuarterTurn525DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -6696,7 +6525,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn525DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -6704,7 +6533,7 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn160DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6751,12 +6580,12 @@ namespace SingleRailRC break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void TrackRightQuarterTurn160DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6803,26 +6632,26 @@ namespace SingleRailRC break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void TrackLeftQuarterTurn160DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightQuarterTurn160DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn160DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftQuarterTurn160DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftQuarterTurn190DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6863,10 +6692,10 @@ namespace SingleRailRC { 0, 0, height }, { 2, 20, 63 }, { 24, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -6874,7 +6703,7 @@ namespace SingleRailRC } static void TrackRightQuarterTurn190DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6915,10 +6744,10 @@ namespace SingleRailRC { 0, 0, height }, { 2, 20, 63 }, { 4, 6, height + 8 }); break; } - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: break; @@ -6926,21 +6755,21 @@ namespace SingleRailRC } static void TrackLeftQuarterTurn190DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightQuarterTurn190DegUp(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightQuarterTurn190DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftQuarterTurn190DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } static void Track25DegUpToLeftBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6976,23 +6805,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track25DegUpToRightBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7028,23 +6857,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackLeftBanked25DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7080,23 +6909,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackRightBanked25DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7132,51 +6961,51 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void TrackLeftBanked25DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToLeftBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownToRightBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBanked25DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedFlatToLeftBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7208,23 +7037,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackRightBankedFlatToRightBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7256,23 +7085,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackLeftBanked25DegUpToLeftBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7304,23 +7133,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackRightBanked25DegUpToRightBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7352,51 +7181,51 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackLeftBankedFlatToLeftBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBanked25DegUpToRightBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBankedFlatToRightBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBanked25DegUpToLeftBankedFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToLeftBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBankedFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToRightBankedFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBankedFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegUpLeftBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7428,23 +7257,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track25DegUpRightBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7476,37 +7305,37 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void Track25DegDownLeftBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpRightBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track25DegDownRightBanked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track25DegUpLeftBanked(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToLeftBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7542,23 +7371,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackFlatToRightBanked25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7594,23 +7423,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackLeftBanked25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7646,23 +7475,23 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackRightBanked25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7698,51 +7527,51 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void TrackFlatToLeftBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackFlatToRightBanked25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBanked25DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBanked25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToRightBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBanked25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatToLeftBanked25DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftBankedQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7779,22 +7608,20 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -7828,27 +7655,25 @@ namespace SingleRailRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightBankedQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7885,22 +7710,20 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -7911,7 +7734,7 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE_BANKED + 9)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -7920,7 +7743,7 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE_BANKED + 11)), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -7929,7 +7752,7 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE_BANKED + 13)), { 6, 0, height }, { 1, 32, 34 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -7938,29 +7761,28 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_GENTLE_SMALL_CURVE_BANKED + 15)), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftBankedQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -7968,7 +7790,7 @@ namespace SingleRailRC } static void TrackRightBankedQuarterTurn3Tile25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -7976,7 +7798,7 @@ namespace SingleRailRC } static void TrackLeftBankedQuarterTurn525DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8013,19 +7835,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8059,12 +7879,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8098,13 +7918,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8138,12 +7957,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8177,27 +7996,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackRightBankedQuarterTurn525DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8234,19 +8051,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -8280,12 +8095,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -8319,13 +8134,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -8359,12 +8173,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -8398,27 +8212,25 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackLeftBankedQuarterTurn525DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8426,7 +8238,7 @@ namespace SingleRailRC } static void TrackRightBankedQuarterTurn525DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -8434,7 +8246,7 @@ namespace SingleRailRC } static void TrackSBendLeft( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8467,16 +8279,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8486,7 +8296,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 1)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -8494,7 +8304,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 5)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height - 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -8510,12 +8320,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8537,7 +8347,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 1)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -8545,16 +8355,16 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 5)), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height - 1, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8584,27 +8394,25 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackSBendRight( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8637,16 +8445,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8656,7 +8462,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 9)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -8664,7 +8470,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 13)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -8680,12 +8486,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8707,7 +8513,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 9)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -8715,16 +8521,16 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_S_BEND + 13)), { 0, 0, height }, { 32, 26, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8754,27 +8560,25 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixUpSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8811,20 +8615,18 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8854,10 +8656,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -8891,22 +8692,20 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8940,25 +8739,23 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -8988,10 +8785,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -9025,23 +8821,21 @@ namespace SingleRailRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightHalfBankedHelixUpSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9078,20 +8872,18 @@ namespace SingleRailRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9121,10 +8913,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -9158,22 +8949,20 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -9207,25 +8996,23 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -9255,10 +9042,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -9292,23 +9078,21 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixDownSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -9321,7 +9105,7 @@ namespace SingleRailRC } static void TrackRightHalfBankedHelixDownSmall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -9334,7 +9118,7 @@ namespace SingleRailRC } static void TrackLeftHalfBankedHelixUpLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9371,20 +9155,18 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9414,12 +9196,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -9449,13 +9231,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -9485,12 +9266,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -9524,22 +9305,20 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -9573,25 +9352,23 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -9621,12 +9398,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -9656,13 +9433,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -9692,12 +9468,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -9731,22 +9507,20 @@ namespace SingleRailRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackRightHalfBankedHelixUpLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9783,20 +9557,18 @@ namespace SingleRailRC { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -9826,12 +9598,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -9861,13 +9633,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -9897,12 +9668,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -9912,7 +9683,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 26)), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -9924,7 +9695,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 32)), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -9932,7 +9703,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 37)), { 0, 0, height }, { 1, 32, 26 }, { 27, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -9940,24 +9711,23 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 43)), { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -9991,25 +9761,23 @@ namespace SingleRailRC { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -10039,12 +9807,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -10074,13 +9842,12 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -10110,12 +9877,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -10129,7 +9896,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 32)), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -10137,7 +9904,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 37)), { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -10145,7 +9912,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 43)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -10153,25 +9920,24 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HELIX + 26)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 8 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } static void TrackLeftHalfBankedHelixDownLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -10184,7 +9950,7 @@ namespace SingleRailRC } static void TrackRightHalfBankedHelixDownLarge( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -10197,7 +9963,7 @@ namespace SingleRailRC } static void TrackLeftBarrelRollUpToDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10214,7 +9980,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 1)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -10226,7 +9992,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 7)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -10238,7 +10004,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 13)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -10250,19 +10016,18 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 19)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10308,12 +10073,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10362,23 +10127,22 @@ namespace SingleRailRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackRightBarrelRollUpToDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10395,7 +10159,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 25)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -10407,7 +10171,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 31)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -10419,7 +10183,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 37)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -10431,19 +10195,18 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_BARREL_ROLL + 43)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height + 1, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10489,12 +10252,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10543,37 +10306,36 @@ namespace SingleRailRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackLeftBarrelRollDownToUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightBarrelRollDownToUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightBarrelRollUpToDown(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackHalfLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10606,15 +10368,14 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 7 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -10624,7 +10385,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_HALF_LOOP + 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -10632,7 +10393,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_HALF_LOOP + 5)), { 0, 14, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -10640,7 +10401,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_HALF_LOOP + 9)), { 0, 6, height }, { 3, 20, 63 }, { 28, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -10648,12 +10409,12 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_HALF_LOOP + 13)), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -10683,12 +10444,12 @@ namespace SingleRailRC { 16, 16, height }, { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -10720,24 +10481,24 @@ namespace SingleRailRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackHalfLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackHalfLoopUp(session, ride, 3 - trackSequence, direction, height, trackElement); } static void TrackBrakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10757,16 +10518,16 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackOnRidePhoto( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -10774,10 +10535,8 @@ namespace SingleRailRC case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_FLAT + 0)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -10785,10 +10544,8 @@ namespace SingleRailRC case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_FLAT + 1)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -10796,10 +10553,8 @@ namespace SingleRailRC case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_FLAT + 0)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); @@ -10807,23 +10562,21 @@ namespace SingleRailRC case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_FLAT + 1)), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void TrackFlatTo60DegUpLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10858,16 +10611,16 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -10899,12 +10652,12 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -10936,12 +10689,12 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -10973,26 +10726,26 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 19, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } } static void Track60DegUpToFlatLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11027,16 +10780,16 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 24, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: switch (direction) @@ -11068,12 +10821,12 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 18, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: switch (direction) @@ -11105,12 +10858,12 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 13, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11142,41 +10895,41 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackFlatTo60DegDownLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpToFlatLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlatLongBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatTo60DegUpLongBase(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackBlockBrakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -11198,16 +10951,16 @@ namespace SingleRailRC } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void TrackLeftCorkscrewUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11241,18 +10994,16 @@ namespace SingleRailRC break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11282,8 +11033,8 @@ namespace SingleRailRC { 0, 0, height }, { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11314,29 +11065,28 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackRightCorkscrewUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11369,17 +11119,15 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 4 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11409,8 +11157,8 @@ namespace SingleRailRC { 0, 0, height }, { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -11441,43 +11189,42 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 33, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackLeftCorkscrewDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightCorkscrewUp(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightCorkscrewDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftCorkscrewUp(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); } static void TrackLeftLargeCorkscrewUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11511,18 +11258,16 @@ namespace SingleRailRC break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -11532,7 +11277,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 34, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -11540,7 +11285,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 6)), { 0, 0, height }, { 26, 1, 32 }, { 0, 29, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -11548,7 +11293,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 11)), { 0, 0, height }, { 20, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -11556,16 +11301,16 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 16)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -11595,18 +11340,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) @@ -11616,7 +11360,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 3)), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -11624,7 +11368,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 8)), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -11632,7 +11376,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 13)), { 0, 0, height }, { 24, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -11640,12 +11384,12 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 18)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: switch (direction) @@ -11676,27 +11420,27 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackRightLargeCorkscrewUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11730,18 +11474,16 @@ namespace SingleRailRC break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, - paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -11751,7 +11493,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 21)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -11759,7 +11501,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 26)), { 0, 0, height }, { 20, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -11767,7 +11509,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 31)), { 0, 0, height }, { 26, 1, 32 }, { 0, 29, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 22, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -11775,16 +11517,16 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 36)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 34, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -11814,18 +11556,17 @@ namespace SingleRailRC { 0, 0, height }, { 48, 1, 64 }, { 0, 31, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) @@ -11835,7 +11576,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 23)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -11843,7 +11584,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 28)), { 0, 0, height }, { 24, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -11851,7 +11592,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 33)), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -11859,11 +11600,11 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_CORKSCREW + 38)), { 0, 0, height }, { 28, 28, 0 }, { 2, 2, height + 50 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 5: switch (direction) @@ -11894,34 +11635,34 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackLeftLargeCorkscrewDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightLargeCorkscrewUp(session, ride, 5 - trackSequence, (direction + 1) & 3, height, trackElement); } static void TrackRightLargeCorkscrewDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftLargeCorkscrewUp(session, ride, 5 - trackSequence, (direction - 1) & 3, height, trackElement); @@ -11944,7 +11685,7 @@ namespace SingleRailRC // 8756 static void TrackLeftMediumHalfLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11978,16 +11719,15 @@ namespace SingleRailRC break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12018,12 +11758,12 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -12033,7 +11773,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 2)), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 2 }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -12041,7 +11781,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 7)), { 0, 0, height }, { 1, 32, 96 }, { 29, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -12049,7 +11789,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 12)), { 0, 0, height }, { 1, 32, 96 }, { 31, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -12057,14 +11797,13 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 17)), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: switch (direction) @@ -12094,10 +11833,9 @@ namespace SingleRailRC { 0, 0, height }, { 1, 32, 160 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: switch (direction) @@ -12128,23 +11866,23 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackRightMediumHalfLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12178,16 +11916,15 @@ namespace SingleRailRC break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -12218,12 +11955,12 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -12233,7 +11970,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 22)), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -12241,7 +11978,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 27)), { 0, 0, height }, { 0, 32, 96 }, { 30, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 18, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -12249,7 +11986,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 32)), { 0, 0, height }, { 0, 32, 96 }, { 29, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -12257,14 +11994,13 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_MEDIUM_HALF_LOOP + 37)), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 2 }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: switch (direction) @@ -12295,10 +12031,9 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 144, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: switch (direction) @@ -12329,36 +12064,36 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackLeftMediumHalfLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightMediumHalfLoopUp(session, ride, 4 - trackSequence, direction, height, trackElement); } static void TrackRightMediumHalfLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftMediumHalfLoopUp(session, ride, 4 - trackSequence, direction, height, trackElement); } static void TrackLeftZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12375,7 +12110,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 1)), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -12387,7 +12122,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 5)), { 0, 0, height }, { 32, 1, 32 }, { 0, 31, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -12395,7 +12130,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 8)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -12403,18 +12138,18 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 12)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -12444,12 +12179,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12490,26 +12225,26 @@ namespace SingleRailRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackRightZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12522,7 +12257,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 16)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 14, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -12530,7 +12265,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 20)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -12542,7 +12277,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 25)), { 0, 0, height }, { 32, 1, 32 }, { 0, 31, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -12554,17 +12289,17 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_ZERO_G_ROLL + 29)), { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 28 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: switch (direction) @@ -12594,12 +12329,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height + 28 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -12640,40 +12375,40 @@ namespace SingleRailRC switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 38, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackLeftZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftZeroGRollUp(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightZeroGRollUp(session, ride, 2 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackLeftLargeZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12710,15 +12445,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -12752,9 +12486,9 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -12788,17 +12522,17 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); switch (direction) @@ -12808,7 +12542,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 4)), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -12816,7 +12550,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 8)), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -12828,7 +12562,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 14)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -12836,26 +12570,26 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 19)), { 0, 0, height }, { 32, 10, 20 }, { 0, 18, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackRightLargeZeroGRollUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12892,15 +12626,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 25, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -12934,9 +12667,9 @@ namespace SingleRailRC { 0, 0, height }, { 32, 0, 96 }, { 0, 30, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -12971,17 +12704,17 @@ namespace SingleRailRC break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) @@ -12991,7 +12724,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 24)), { 0, 0, height }, { 32, 10, 20 }, { 0, 18, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -13003,7 +12736,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 30)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height + 40 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -13011,7 +12744,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 34)), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -13019,40 +12752,40 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_ZERO_G_ROLL + 39)), { 0, 0, height }, { 26, 0, 20 }, { 0, 26, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackLeftLargeZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftLargeZeroGRollUp(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackRightLargeZeroGRollDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightLargeZeroGRollUp(session, ride, 3 - trackSequence, (direction + 2) & 3, height, trackElement); } static void Track90DegToInvertedFlatQuarterLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13085,9 +12818,9 @@ namespace SingleRailRC { 0, 0, height }, { 2, 20, 31 }, { 4, 6, height + 8 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -13117,9 +12850,9 @@ namespace SingleRailRC { 0, 0, height }, { 2, 20, 31 }, { -8, 6, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -13151,24 +12884,24 @@ namespace SingleRailRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } static void TrackInvertedFlatTo90DegQuarterLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track90DegToInvertedFlatQuarterLoopUp(session, ride, 2 - trackSequence, direction, height, trackElement); } static void TrackLeftBankToLeftQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13205,22 +12938,20 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13250,27 +12981,26 @@ namespace SingleRailRC { 6, 0, height }, { 20, 32, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackRightBankToRightQuarterTurn3Tile25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13307,22 +13037,20 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13352,27 +13080,26 @@ namespace SingleRailRC { 6, 0, height }, { 20, 32, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackLeftQuarterTurn3Tile25DegDownToLeftBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13405,22 +13132,21 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13454,27 +13180,25 @@ namespace SingleRailRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackRightQuarterTurn3Tile25DegDownToRightBank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13507,22 +13231,21 @@ namespace SingleRailRC { 0, 6, height }, { 32, 20, 3 }, { 0, 6, height - 6 }); break; } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height - 6, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -13556,27 +13279,25 @@ namespace SingleRailRC { 6, 0, height }, { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackLeftLargeHalfLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13609,15 +13330,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13627,7 +13347,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 1)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -13635,7 +13355,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 8)), { 0, 0, height }, { 32, 20, 9 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -13643,7 +13363,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 15)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -13651,13 +13371,13 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 22)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -13687,12 +13407,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -13702,7 +13422,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 3)), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -13710,7 +13430,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 10)), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -13718,7 +13438,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 17)), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -13726,16 +13446,16 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 24)), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -13765,10 +13485,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -13798,12 +13517,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -13835,20 +13554,20 @@ namespace SingleRailRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackRightLargeHalfLoopUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13881,15 +13600,14 @@ namespace SingleRailRC { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -13899,7 +13617,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 29)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -13907,7 +13625,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 36)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -13915,7 +13633,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 43)), { 0, 0, height }, { 32, 20, 9 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -13923,13 +13641,13 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 50)), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -13959,12 +13677,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -13974,7 +13692,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 31)), { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -13982,7 +13700,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 38)), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 28, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -13990,7 +13708,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 45)), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 200 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -13998,16 +13716,16 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_LARGE_HALF_LOOP + 52)), { 0, 0, height }, { 32, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 4: switch (direction) @@ -14037,10 +13755,9 @@ namespace SingleRailRC { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: switch (direction) @@ -14070,12 +13787,12 @@ namespace SingleRailRC { 0, 0, height }, { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 224, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; case 6: switch (direction) @@ -14107,34 +13824,34 @@ namespace SingleRailRC } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } } static void TrackRightLargeHalfLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackRightLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, trackElement); } static void TrackLeftLargeHalfLoopDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackLeftLargeHalfLoopUp(session, ride, 6 - trackSequence, direction, height, trackElement); } static void TrackFlatTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -14146,7 +13863,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 0)), { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14158,7 +13875,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 1)), { 0, 0, height }, { 32, 2, 43 }, { 0, 4, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -14170,7 +13887,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 3)), { 0, 0, height }, { 32, 2, 43 }, { 0, 4, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -14178,7 +13895,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 5)), { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -14192,7 +13909,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 0)), { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14204,7 +13921,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 1)), { 0, 0, height }, { 32, 2, 43 }, { 0, 4, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -14216,7 +13933,7 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 3)), { 0, 0, height }, { 32, 2, 43 }, { 0, 4, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 0, height + 4, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: @@ -14224,26 +13941,26 @@ namespace SingleRailRC session, direction, session.TrackColours[SCHEME_TRACK].WithIndex((SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 5)), { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } static void Track60DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -14283,7 +14000,7 @@ namespace SingleRailRC { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -14322,37 +14039,37 @@ namespace SingleRailRC { 0, 0, height }, { 32, 27, 4 }, { 0, 2, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void TrackFlatTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { Track60DegUpToFlat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void Track60DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { TrackFlatTo60DegUp(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void TrackDiagFlatTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14384,10 +14101,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -14416,10 +14132,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -14448,10 +14163,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -14459,7 +14173,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14468,15 +14182,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 13)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -14486,7 +14200,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14495,29 +14209,28 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 13)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } static void TrackDiag60DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14549,10 +14262,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -14581,10 +14293,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -14613,10 +14324,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -14624,7 +14334,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14633,15 +14343,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 17)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -14651,7 +14361,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14660,29 +14370,28 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 17)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiagFlatTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14714,10 +14423,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -14746,10 +14454,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -14778,10 +14485,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -14789,7 +14495,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14798,15 +14504,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 19)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -14816,7 +14522,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14825,29 +14531,28 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 19)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } static void TrackDiag60DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -14879,10 +14584,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -14911,10 +14615,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -14943,10 +14646,9 @@ namespace SingleRailRC break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -14954,7 +14656,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14963,15 +14665,15 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_LIFT_TRACK_SMALL_FLAT_TO_STEEP + 15)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -14981,7 +14683,7 @@ namespace SingleRailRC switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: @@ -14990,23 +14692,22 @@ namespace SingleRailRC session.TrackColours[SCHEME_TRACK].WithIndex( (SPR_G2_SINGLE_RAIL_TRACK_SMALL_FLAT_TO_STEEP + 15)), { -16, -16, height }, { 32, 32, 4 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, - 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } diff --git a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp index 22c49c3638..0803f363bf 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -32,7 +32,7 @@ static constexpr const uint32_t _StandUpBlockBrakeImages[NumOrthogonalDirections /** rct2: 0x008A7114 */ static void stand_up_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -58,7 +58,7 @@ static void stand_up_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -78,18 +78,18 @@ static void stand_up_rc_track_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7384, 0x008A7394, 0x008A73A4 */ static void stand_up_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -117,14 +117,14 @@ static void stand_up_rc_track_station( { 32, 32, 1 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_2(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7124 */ static void stand_up_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -150,7 +150,7 @@ static void stand_up_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -176,25 +176,25 @@ static void stand_up_rc_track_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A7134 */ static void stand_up_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -222,7 +222,7 @@ static void stand_up_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -250,25 +250,25 @@ static void stand_up_rc_track_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A7144 */ static void stand_up_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -294,7 +294,7 @@ static void stand_up_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -320,25 +320,25 @@ static void stand_up_rc_track_flat_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A7154 */ static void stand_up_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -372,7 +372,7 @@ static void stand_up_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -406,25 +406,25 @@ static void stand_up_rc_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A7164 */ static void stand_up_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -458,7 +458,7 @@ static void stand_up_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -492,25 +492,25 @@ static void stand_up_rc_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A7174 */ static void stand_up_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -536,7 +536,7 @@ static void stand_up_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } else @@ -562,25 +562,25 @@ static void stand_up_rc_track_25_deg_up_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A7184 */ static void stand_up_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { stand_up_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -588,7 +588,7 @@ static void stand_up_rc_track_25_deg_down( /** rct2: 0x008A7194 */ static void stand_up_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { stand_up_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -596,7 +596,7 @@ static void stand_up_rc_track_60_deg_down( /** rct2: 0x008A71A4 */ static void stand_up_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -604,7 +604,7 @@ static void stand_up_rc_track_flat_to_25_deg_down( /** rct2: 0x008A71B4 */ static void stand_up_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -612,7 +612,7 @@ static void stand_up_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A71C4 */ static void stand_up_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -620,7 +620,7 @@ static void stand_up_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A71D4 */ static void stand_up_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -628,7 +628,7 @@ static void stand_up_rc_track_25_deg_down_to_flat( /** rct2: 0x008A71E4 */ static void stand_up_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -657,17 +657,17 @@ static void stand_up_rc_track_left_quarter_turn_5( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -693,12 +693,11 @@ static void stand_up_rc_track_left_quarter_turn_5( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -724,12 +723,12 @@ static void stand_up_rc_track_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -755,12 +754,11 @@ static void stand_up_rc_track_left_quarter_turn_5( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -786,26 +784,26 @@ static void stand_up_rc_track_left_quarter_turn_5( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A71F4 */ static void stand_up_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -814,7 +812,7 @@ static void stand_up_rc_track_right_quarter_turn_5( /** rct2: 0x008A7204 */ static void stand_up_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -838,17 +836,17 @@ static void stand_up_rc_track_flat_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7214 */ static void stand_up_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -872,17 +870,17 @@ static void stand_up_rc_track_flat_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7224 */ static void stand_up_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -906,17 +904,17 @@ static void stand_up_rc_track_left_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7234 */ static void stand_up_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -940,17 +938,17 @@ static void stand_up_rc_track_right_bank_to_flat( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A7244 */ static void stand_up_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -982,17 +980,17 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1018,12 +1016,11 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -1049,12 +1046,12 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -1080,12 +1077,11 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -1114,26 +1110,26 @@ static void stand_up_rc_track_banked_left_quarter_turn_5( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7254 */ static void stand_up_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1142,7 +1138,7 @@ static void stand_up_rc_track_banked_right_quarter_turn_5( /** rct2: 0x008A7264 */ static void stand_up_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1166,24 +1162,24 @@ static void stand_up_rc_track_left_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A7274 */ static void stand_up_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1207,24 +1203,24 @@ static void stand_up_rc_track_right_bank_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A7284 */ static void stand_up_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1248,24 +1244,24 @@ static void stand_up_rc_track_25_deg_up_to_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A7294 */ static void stand_up_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1289,24 +1285,24 @@ static void stand_up_rc_track_25_deg_up_to_right_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A72A4 */ static void stand_up_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1314,7 +1310,7 @@ static void stand_up_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008A72B4 */ static void stand_up_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1322,7 +1318,7 @@ static void stand_up_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008A72C4 */ static void stand_up_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1330,7 +1326,7 @@ static void stand_up_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008A72D4 */ static void stand_up_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1338,7 +1334,7 @@ static void stand_up_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008A72E4 */ static void stand_up_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1362,17 +1358,17 @@ static void stand_up_rc_track_left_bank( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A72F4 */ static void stand_up_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { stand_up_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1380,7 +1376,7 @@ static void stand_up_rc_track_right_bank( /** rct2: 0x008A7304 */ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1411,8 +1407,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -1439,19 +1434,18 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1506,12 +1500,11 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( break; } } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1566,12 +1559,12 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: if (trackElement.HasChain()) @@ -1626,12 +1619,11 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( break; } } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: if (trackElement.HasChain()) @@ -1659,8 +1651,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -1687,28 +1678,27 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7314 */ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1739,8 +1729,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -1767,19 +1756,18 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1834,12 +1822,11 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( break; } } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1894,12 +1881,12 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: if (trackElement.HasChain()) @@ -1954,12 +1941,11 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( break; } } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: if (trackElement.HasChain()) @@ -1987,8 +1973,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -2015,28 +2000,27 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7324 */ static void stand_up_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2045,7 +2029,7 @@ static void stand_up_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008A7334 */ static void stand_up_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2054,7 +2038,7 @@ static void stand_up_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008A7344 */ static void stand_up_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2083,14 +2067,14 @@ static void stand_up_rc_track_s_bend_left( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2099,14 +2083,14 @@ static void stand_up_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25372), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25377), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2120,12 +2104,11 @@ static void stand_up_rc_track_s_bend_left( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2144,23 +2127,22 @@ static void stand_up_rc_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25372), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25377), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2186,26 +2168,26 @@ static void stand_up_rc_track_s_bend_left( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7354 */ static void stand_up_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2234,14 +2216,14 @@ static void stand_up_rc_track_s_bend_right( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2250,14 +2232,14 @@ static void stand_up_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25368), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25381), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -2271,12 +2253,11 @@ static void stand_up_rc_track_s_bend_right( { 32, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2295,23 +2276,22 @@ static void stand_up_rc_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25368), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25381), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2337,26 +2317,26 @@ static void stand_up_rc_track_s_bend_right( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7364 */ static void stand_up_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2385,17 +2365,16 @@ static void stand_up_rc_track_left_vertical_loop( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2404,37 +2383,36 @@ static void stand_up_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25478), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25486), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25483), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25491), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2460,9 +2438,9 @@ static void stand_up_rc_track_left_vertical_loop( { 4, 16, 119 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2488,18 +2466,17 @@ static void stand_up_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2525,12 +2502,11 @@ static void stand_up_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2556,9 +2532,9 @@ static void stand_up_rc_track_left_vertical_loop( { 3, 16, 119 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2567,37 +2543,36 @@ static void stand_up_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25483), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25491), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25478), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25486), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2623,29 +2598,28 @@ static void stand_up_rc_track_left_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A7374 */ static void stand_up_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2674,12 +2648,12 @@ static void stand_up_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -2688,32 +2662,32 @@ static void stand_up_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25507), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25499), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25502), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25494), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2739,7 +2713,7 @@ static void stand_up_rc_track_right_vertical_loop( { 5, 16, 119 }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -2765,13 +2739,13 @@ static void stand_up_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2797,7 +2771,7 @@ static void stand_up_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -2823,7 +2797,7 @@ static void stand_up_rc_track_right_vertical_loop( { 4, 16, 119 }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -2832,32 +2806,32 @@ static void stand_up_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25502), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25494), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25507), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25499), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -2883,17 +2857,17 @@ static void stand_up_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2902,7 +2876,7 @@ static void stand_up_rc_track_right_vertical_loop( /** rct2: 0x008A73B4 */ static void stand_up_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2931,17 +2905,17 @@ static void stand_up_rc_track_left_quarter_turn_3( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2967,9 +2941,9 @@ static void stand_up_rc_track_left_quarter_turn_3( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -2995,26 +2969,26 @@ static void stand_up_rc_track_left_quarter_turn_3( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A73C4 */ static void stand_up_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3023,7 +2997,7 @@ static void stand_up_rc_track_right_quarter_turn_3( /** rct2: 0x008A73D4 */ static void stand_up_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3055,17 +3029,17 @@ static void stand_up_rc_track_left_quarter_turn_3_bank( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3091,9 +3065,9 @@ static void stand_up_rc_track_left_quarter_turn_3_bank( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3122,26 +3096,26 @@ static void stand_up_rc_track_left_quarter_turn_3_bank( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A73E4 */ static void stand_up_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3150,7 +3124,7 @@ static void stand_up_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008A73F4 */ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3181,8 +3155,7 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -3209,22 +3182,21 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3252,8 +3224,7 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -3280,28 +3251,27 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_up( { 20, 32, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7404 */ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3332,8 +3302,7 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } else { @@ -3360,22 +3329,21 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3386,28 +3354,28 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25552), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25554), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25556), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25558), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3420,28 +3388,28 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25536), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25538), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25540), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25542), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -3449,22 +3417,22 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_up( switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7414 */ static void stand_up_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3473,7 +3441,7 @@ static void stand_up_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008A7424 */ static void stand_up_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -3482,7 +3450,7 @@ static void stand_up_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008A7434 */ static void stand_up_rc_track_half_loop_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3511,14 +3479,14 @@ static void stand_up_rc_track_half_loop_up( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -3527,33 +3495,33 @@ static void stand_up_rc_track_half_loop_up( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25576), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25584), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25581), { 0, 6, height }, { 32, 2, 3 }, { 0, 20, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25589), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3579,12 +3547,11 @@ static void stand_up_rc_track_half_loop_up( { 2, 16, 119 }, { 15, 6, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -3612,18 +3579,18 @@ static void stand_up_rc_track_half_loop_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7444 */ static void stand_up_rc_track_half_loop_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { stand_up_rc_track_half_loop_up(session, ride, 3 - trackSequence, direction, height, trackElement); @@ -3631,7 +3598,7 @@ static void stand_up_rc_track_half_loop_down( /** rct2: 0x008A7454 */ static void stand_up_rc_track_left_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3665,9 +3632,9 @@ static void stand_up_rc_track_left_corkscrew_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3693,8 +3660,8 @@ static void stand_up_rc_track_left_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3721,29 +3688,28 @@ static void stand_up_rc_track_left_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7464 */ static void stand_up_rc_track_right_corkscrew_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3772,15 +3738,15 @@ static void stand_up_rc_track_right_corkscrew_up( { 32, 20, 3 }, { 0, 6, height + 4 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -3806,8 +3772,8 @@ static void stand_up_rc_track_right_corkscrew_up( { 20, 20, 3 }, { 6, 6, height + 10 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3834,29 +3800,28 @@ static void stand_up_rc_track_right_corkscrew_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 35, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7474 */ static void stand_up_rc_track_left_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { stand_up_rc_track_right_corkscrew_up(session, ride, 2 - trackSequence, (direction + 1) & 3, height, trackElement); @@ -3864,7 +3829,7 @@ static void stand_up_rc_track_left_corkscrew_down( /** rct2: 0x008A7484 */ static void stand_up_rc_track_right_corkscrew_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { stand_up_rc_track_left_corkscrew_up(session, ride, 2 - trackSequence, (direction - 1) & 3, height, trackElement); @@ -3872,7 +3837,7 @@ static void stand_up_rc_track_right_corkscrew_down( /** rct2: 0x008A7734 */ static void stand_up_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3904,18 +3869,18 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3941,9 +3906,9 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3972,20 +3937,20 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4014,23 +3979,23 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4056,9 +4021,9 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4087,22 +4052,22 @@ static void stand_up_rc_track_left_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7744 */ static void stand_up_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4134,18 +4099,18 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4171,9 +4136,9 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4202,20 +4167,20 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4244,23 +4209,23 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4286,9 +4251,9 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( { 16, 16, 3 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4317,22 +4282,22 @@ static void stand_up_rc_track_right_half_banked_helix_up_small( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7754 */ static void stand_up_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -4346,7 +4311,7 @@ static void stand_up_rc_track_left_half_banked_helix_down_small( /** rct2: 0x008A7764 */ static void stand_up_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -4360,7 +4325,7 @@ static void stand_up_rc_track_right_half_banked_helix_down_small( /** rct2: 0x008A76F4 */ static void stand_up_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4392,18 +4357,18 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4429,12 +4394,11 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4460,12 +4424,12 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4491,12 +4455,11 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4525,20 +4488,20 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4567,23 +4530,23 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4609,12 +4572,11 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -4640,12 +4602,12 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -4671,12 +4633,11 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -4705,22 +4666,22 @@ static void stand_up_rc_track_left_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7704 */ static void stand_up_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4752,18 +4713,18 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4789,12 +4750,11 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4820,12 +4780,12 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -4851,12 +4811,11 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4885,20 +4844,20 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -4927,23 +4886,23 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 20, 32, 3 }, { 6, 0, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -4969,12 +4928,11 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 16, 32, 3 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -5000,12 +4958,12 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -5031,12 +4989,11 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -5065,22 +5022,22 @@ static void stand_up_rc_track_right_half_banked_helix_up_large( { 32, 20, 3 }, { 0, 6, height + 8 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7714 */ static void stand_up_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -5094,7 +5051,7 @@ static void stand_up_rc_track_left_half_banked_helix_down_large( /** rct2: 0x008A7724 */ static void stand_up_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -5108,7 +5065,7 @@ static void stand_up_rc_track_right_half_banked_helix_down_large( /** rct2: 0x008A7494 */ static void stand_up_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5126,17 +5083,17 @@ static void stand_up_rc_track_brakes( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A74A4 */ static void stand_up_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -5144,8 +5101,8 @@ static void stand_up_rc_track_on_ride_photo( case 0: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25229), { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); @@ -5153,8 +5110,8 @@ static void stand_up_rc_track_on_ride_photo( case 1: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25230), { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); @@ -5162,8 +5119,8 @@ static void stand_up_rc_track_on_ride_photo( case 2: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25229), { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); @@ -5171,22 +5128,22 @@ static void stand_up_rc_track_on_ride_photo( case 3: PaintAddImageAsParentRotated( session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25230), { 0, 6, height }, { 32, 20, 1 }, { 0, 6, height + 3 }); break; } 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A74B4 */ static void stand_up_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5215,14 +5172,14 @@ static void stand_up_rc_track_left_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5248,12 +5205,11 @@ static void stand_up_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5279,15 +5235,15 @@ static void stand_up_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5296,44 +5252,43 @@ static void stand_up_rc_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25646), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25650), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25654), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25658), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A74C4 */ static void stand_up_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5362,14 +5317,14 @@ static void stand_up_rc_track_right_eighth_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5395,12 +5350,11 @@ static void stand_up_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5426,15 +5380,15 @@ static void stand_up_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5443,44 +5397,43 @@ static void stand_up_rc_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25630), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25634), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25638), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25642), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A74D4 */ static void stand_up_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5489,7 +5442,7 @@ static void stand_up_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008A74E4 */ static void stand_up_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5498,7 +5451,7 @@ static void stand_up_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008A76A4 */ static void stand_up_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5527,14 +5480,14 @@ static void stand_up_rc_track_left_eighth_bank_to_diag( { 32, 20, 3 }, { 0, 6, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5560,12 +5513,11 @@ static void stand_up_rc_track_left_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5591,15 +5543,15 @@ static void stand_up_rc_track_left_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5608,44 +5560,43 @@ static void stand_up_rc_track_left_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25678), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25682), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25686), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25690), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A76B4 */ static void stand_up_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5674,14 +5625,14 @@ static void stand_up_rc_track_right_eighth_bank_to_diag( { 32, 1, 26 }, { 0, 27, height }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -5707,12 +5658,11 @@ static void stand_up_rc_track_right_eighth_bank_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5738,15 +5688,15 @@ static void stand_up_rc_track_right_eighth_bank_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5755,44 +5705,43 @@ static void stand_up_rc_track_right_eighth_bank_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25662), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25666), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25670), { 0, 0, height }, { 16, 18, 0 }, { 0, 16, height + 27 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25674), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A76C4 */ static void stand_up_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5801,7 +5750,7 @@ static void stand_up_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008A76D4 */ static void stand_up_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -5810,7 +5759,7 @@ static void stand_up_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008A74F4 */ static void stand_up_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5838,9 +5787,9 @@ static void stand_up_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -5865,9 +5814,9 @@ static void stand_up_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -5892,9 +5841,9 @@ static void stand_up_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -5902,22 +5851,22 @@ static void stand_up_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25754), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -5927,36 +5876,36 @@ static void stand_up_rc_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25692), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7524 */ static void stand_up_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5984,9 +5933,9 @@ static void stand_up_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6011,9 +5960,9 @@ static void stand_up_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6038,9 +5987,9 @@ static void stand_up_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6048,22 +5997,22 @@ static void stand_up_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25766), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6073,36 +6022,36 @@ static void stand_up_rc_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25704), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A7584 */ static void stand_up_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6130,9 +6079,9 @@ static void stand_up_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6157,9 +6106,9 @@ static void stand_up_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6184,9 +6133,9 @@ static void stand_up_rc_track_diag_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6194,22 +6143,22 @@ static void stand_up_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25778), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6219,36 +6168,36 @@ static void stand_up_rc_track_diag_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25716), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A7504 */ static void stand_up_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6276,9 +6225,9 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6303,9 +6252,9 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6330,9 +6279,9 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6340,22 +6289,22 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25758), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6365,36 +6314,36 @@ static void stand_up_rc_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25696), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7564 */ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6422,9 +6371,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6449,9 +6398,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6476,9 +6425,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6486,22 +6435,22 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25770), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6511,36 +6460,36 @@ static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25708), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7574 */ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6568,9 +6517,9 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6595,9 +6544,9 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6622,9 +6571,9 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6632,22 +6581,22 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25774), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6657,36 +6606,36 @@ static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25712), { -16, -16, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7514 */ static void stand_up_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6714,9 +6663,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6741,9 +6690,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6768,9 +6717,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6778,22 +6727,22 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25762), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6803,36 +6752,36 @@ static void stand_up_rc_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25700), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A7554 */ static void stand_up_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6860,9 +6809,9 @@ static void stand_up_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -6887,9 +6836,9 @@ static void stand_up_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -6914,9 +6863,9 @@ static void stand_up_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -6924,22 +6873,22 @@ static void stand_up_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25768), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -6949,36 +6898,36 @@ static void stand_up_rc_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25706), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A75B4 */ static void stand_up_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7006,9 +6955,9 @@ static void stand_up_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7033,9 +6982,9 @@ static void stand_up_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7060,9 +7009,9 @@ static void stand_up_rc_track_diag_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7070,22 +7019,22 @@ static void stand_up_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25780), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7095,36 +7044,36 @@ static void stand_up_rc_track_diag_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25718), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } /** rct2: 0x008A7534 */ static void stand_up_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7152,8 +7101,8 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7178,8 +7127,8 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7204,8 +7153,8 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7213,22 +7162,22 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25764), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7238,37 +7187,37 @@ static void stand_up_rc_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25702), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A7594 */ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7296,9 +7245,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7323,9 +7272,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7350,9 +7299,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7360,22 +7309,22 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25776), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7385,36 +7334,36 @@ static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25714), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A75A4 */ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7442,9 +7391,9 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7469,9 +7418,9 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7496,9 +7445,9 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7506,22 +7455,22 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25772), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7531,36 +7480,36 @@ static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25710), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A7544 */ static void stand_up_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7588,9 +7537,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -7615,9 +7564,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -7642,9 +7591,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -7652,22 +7601,22 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25760), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -7677,36 +7626,36 @@ static void stand_up_rc_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25698), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A75E4 */ static void stand_up_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7720,9 +7669,9 @@ static void stand_up_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7736,9 +7685,9 @@ static void stand_up_rc_track_diag_flat_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7749,43 +7698,43 @@ static void stand_up_rc_track_diag_flat_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25724), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A75F4 */ static void stand_up_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7799,9 +7748,9 @@ static void stand_up_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7812,9 +7761,9 @@ static void stand_up_rc_track_diag_flat_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7828,43 +7777,43 @@ static void stand_up_rc_track_diag_flat_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25729), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7604 */ static void stand_up_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7878,9 +7827,9 @@ static void stand_up_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7894,9 +7843,9 @@ static void stand_up_rc_track_diag_left_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7907,43 +7856,43 @@ static void stand_up_rc_track_diag_left_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25731), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7614 */ static void stand_up_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7957,9 +7906,9 @@ static void stand_up_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7970,9 +7919,9 @@ static void stand_up_rc_track_diag_right_bank_to_flat( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7986,43 +7935,43 @@ static void stand_up_rc_track_diag_right_bank_to_flat( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25726), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A7644 */ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8036,9 +7985,9 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8052,9 +8001,9 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8065,43 +8014,43 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25744), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7654 */ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8115,9 +8064,9 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8128,9 +8077,9 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8144,43 +8093,43 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25749), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7624 */ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8194,9 +8143,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8210,9 +8159,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8223,43 +8172,43 @@ static void stand_up_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25734), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A7634 */ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8273,9 +8222,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -8286,9 +8235,9 @@ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -8302,43 +8251,43 @@ static void stand_up_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25739), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A7664 */ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8352,8 +8301,8 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8367,8 +8316,8 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8379,43 +8328,43 @@ static void stand_up_rc_track_diag_left_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25741), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A7674 */ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8429,8 +8378,8 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8441,8 +8390,8 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8456,43 +8405,43 @@ static void stand_up_rc_track_diag_right_bank_to_25_deg_down( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25736), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A7684 */ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8506,9 +8455,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8522,9 +8471,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8535,43 +8484,43 @@ static void stand_up_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25751), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A7694 */ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8585,9 +8534,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -8598,9 +8547,9 @@ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -8614,43 +8563,43 @@ static void stand_up_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 0 }, { -16, -16, height + 35 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25746), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A75C4 */ static void stand_up_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8664,9 +8613,9 @@ static void stand_up_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8677,9 +8626,9 @@ static void stand_up_rc_track_diag_left_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8690,43 +8639,43 @@ static void stand_up_rc_track_diag_left_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25720), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A75D4 */ static void stand_up_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8740,9 +8689,9 @@ static void stand_up_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8753,9 +8702,9 @@ static void stand_up_rc_track_diag_right_bank( { 32, 32, 3 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8766,43 +8715,43 @@ static void stand_up_rc_track_diag_right_bank( { 32, 32, 0 }, { -16, -16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(25722), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A76E4 */ static void stand_up_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -8812,12 +8761,12 @@ static void stand_up_rc_track_block_brakes( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/Steeplechase.cpp b/src/openrct2/ride/coaster/Steeplechase.cpp index 4657e0ccc7..9b30f74fac 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008A59A8 */ static void steeplechase_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -31,14 +31,13 @@ static void steeplechase_track_flat( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28635), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28636), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -51,26 +50,25 @@ static void steeplechase_track_flat( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28633), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28634), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void steeplechase_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -88,14 +86,14 @@ static void steeplechase_track_station( { 32, 20, 3 }, { 0, 0, height }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 3); track_paint_util_draw_station(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A59B8 */ static void steeplechase_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -105,25 +103,23 @@ static void steeplechase_track_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28649), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28655), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28651), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28656), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -135,45 +131,43 @@ static void steeplechase_track_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28637), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28643), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28639), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28644), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A59C8 */ static void steeplechase_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -183,25 +177,23 @@ static void steeplechase_track_flat_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28650), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28657), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28652), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28658), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -213,45 +205,43 @@ static void steeplechase_track_flat_to_25_deg_up( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28638), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28645), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28640), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28646), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A59D8 */ static void steeplechase_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -261,25 +251,23 @@ static void steeplechase_track_25_deg_up_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28654), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28660), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28653), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28659), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -291,45 +279,43 @@ static void steeplechase_track_25_deg_up_to_flat( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28642), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28648), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28641), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28647), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A59E8 */ static void steeplechase_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { steeplechase_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -337,7 +323,7 @@ static void steeplechase_track_25_deg_down( /** rct2: 0x008A59F8 */ static void steeplechase_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { steeplechase_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -345,7 +331,7 @@ static void steeplechase_track_flat_to_25_deg_down( /** rct2: 0x008A5A08 */ static void steeplechase_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { steeplechase_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -353,7 +339,7 @@ static void steeplechase_track_25_deg_down_to_flat( /** rct2: 0x008A5A18 */ static void steeplechase_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -365,41 +351,41 @@ static void steeplechase_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28698), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28703), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28708), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height - 3, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28693), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height - 1, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -425,12 +411,11 @@ static void steeplechase_track_left_quarter_turn_5( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -456,12 +441,12 @@ static void steeplechase_track_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -487,12 +472,11 @@ static void steeplechase_track_left_quarter_turn_5( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -501,50 +485,50 @@ static void steeplechase_track_left_quarter_turn_5( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28694), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height - 3, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28699), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28704), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28689), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5A28 */ static void steeplechase_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -553,7 +537,7 @@ static void steeplechase_track_right_quarter_turn_5( /** rct2: 0x008A5A38 */ static void steeplechase_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -565,38 +549,38 @@ static void steeplechase_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28665), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28672), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28668), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28669), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -605,14 +589,14 @@ static void steeplechase_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28666), { 0, 0, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28671), { 0, 0, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -626,12 +610,11 @@ static void steeplechase_track_s_bend_left( { 33, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -650,23 +633,22 @@ static void steeplechase_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28666), { 0, 0, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28671), { 0, 0, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -675,50 +657,50 @@ static void steeplechase_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28668), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28669), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28665), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28672), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5A48 */ static void steeplechase_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -730,38 +712,38 @@ static void steeplechase_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28661), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28676), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28664), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28673), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -770,14 +752,14 @@ static void steeplechase_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28662), { 0, 6, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 8, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28675), { 0, 6, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: @@ -791,12 +773,11 @@ static void steeplechase_track_s_bend_right( { 33, 26, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -815,23 +796,22 @@ static void steeplechase_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28662), { 0, 6, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 8, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28675), { 0, 6, height }, { 33, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -840,50 +820,50 @@ static void steeplechase_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28664), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28673), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28661), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28676), { 0, 6, height }, { 33, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5A88 */ static void steeplechase_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -895,41 +875,41 @@ static void steeplechase_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28682), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28685), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28688), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28679), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height - 3, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -955,9 +935,9 @@ static void steeplechase_track_left_quarter_turn_3( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -966,50 +946,50 @@ static void steeplechase_track_left_quarter_turn_3( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28680), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28683), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28686), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28677), { 6, 0, height }, { 20, 32, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height - 3, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5A98 */ static void steeplechase_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1018,7 +998,7 @@ static void steeplechase_track_right_quarter_turn_3( /** rct2: 0x008A5AA8 */ static void steeplechase_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1027,25 +1007,24 @@ static void steeplechase_track_brakes( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28635), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28636), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A5AD8 */ static void steeplechase_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1057,38 +1036,38 @@ static void steeplechase_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28725), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28729), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28733), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28737), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1114,12 +1093,11 @@ static void steeplechase_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1145,15 +1123,15 @@ static void steeplechase_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1162,44 +1140,43 @@ static void steeplechase_track_left_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28728), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28732), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28736), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28740), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5AE8 */ static void steeplechase_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1211,38 +1188,38 @@ static void steeplechase_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28709), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28713), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28717), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28721), { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1268,12 +1245,11 @@ static void steeplechase_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1299,15 +1275,15 @@ static void steeplechase_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -1316,44 +1292,43 @@ static void steeplechase_track_right_eighth_to_diag( PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28712), { 0, 0, height }, { 16, 16, 3 }, { 16, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28716), { 0, 0, height }, { 16, 16, 3 }, { 0, 0, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28720), { 0, 0, height }, { 16, 18, 3 }, { 0, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28724), { 0, 0, height }, { 16, 16, 3 }, { 16, 16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5AF8 */ static void steeplechase_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1362,7 +1337,7 @@ static void steeplechase_track_left_eighth_to_orthogonal( /** rct2: 0x008A5B08 */ static void steeplechase_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1371,7 +1346,7 @@ static void steeplechase_track_right_eighth_to_orthogonal( /** rct2: 0x008A5AC8 */ static void steeplechase_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1399,9 +1374,9 @@ static void steeplechase_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1426,9 +1401,9 @@ static void steeplechase_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1453,9 +1428,9 @@ static void steeplechase_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1463,22 +1438,22 @@ static void steeplechase_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28758), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1488,36 +1463,36 @@ static void steeplechase_track_diag_flat( switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28742), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } /** rct2: 0x008A5B38 */ static void steeplechase_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1545,9 +1520,9 @@ static void steeplechase_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1572,9 +1547,9 @@ static void steeplechase_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1599,9 +1574,9 @@ static void steeplechase_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1609,22 +1584,22 @@ static void steeplechase_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28770), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1634,36 +1609,36 @@ static void steeplechase_track_diag_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28754), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A5B18 */ static void steeplechase_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1691,9 +1666,9 @@ static void steeplechase_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1718,9 +1693,9 @@ static void steeplechase_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1745,9 +1720,9 @@ static void steeplechase_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1755,22 +1730,22 @@ static void steeplechase_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28762), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1780,36 +1755,36 @@ static void steeplechase_track_diag_flat_to_25_deg_up( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28746), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A5B28 */ static void steeplechase_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1837,9 +1812,9 @@ static void steeplechase_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -1864,9 +1839,9 @@ static void steeplechase_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -1891,9 +1866,9 @@ static void steeplechase_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -1901,22 +1876,22 @@ static void steeplechase_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28766), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1926,36 +1901,36 @@ static void steeplechase_track_diag_25_deg_up_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28750), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A5B68 */ static void steeplechase_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1983,9 +1958,9 @@ static void steeplechase_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2010,9 +1985,9 @@ static void steeplechase_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2037,9 +2012,9 @@ static void steeplechase_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2047,22 +2022,22 @@ static void steeplechase_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28772), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2072,36 +2047,36 @@ static void steeplechase_track_diag_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28756), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } /** rct2: 0x008A5B48 */ static void steeplechase_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2129,8 +2104,8 @@ static void steeplechase_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2155,8 +2130,8 @@ static void steeplechase_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2181,8 +2156,8 @@ static void steeplechase_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2190,22 +2165,22 @@ static void steeplechase_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28768), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2215,37 +2190,37 @@ static void steeplechase_track_diag_flat_to_25_deg_down( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28752), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A5B58 */ static void steeplechase_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2273,9 +2248,9 @@ static void steeplechase_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -2300,9 +2275,9 @@ static void steeplechase_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -2327,9 +2302,9 @@ static void steeplechase_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -2337,22 +2312,22 @@ static void steeplechase_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28764), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -2362,36 +2337,36 @@ static void steeplechase_track_diag_25_deg_down_to_flat( switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28748), { -16, -16, height }, { 32, 32, 3 }, { -16, -16, height }); - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A5AB8 */ static void steeplechase_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -2400,20 +2375,19 @@ static void steeplechase_track_block_brakes( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28635), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(28636), { 0, 6, height }, { 32, 20, 3 }); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_steeplechase(int32_t trackType) diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index d9f8aa5c45..5e2cfc08be 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -20,7 +20,7 @@ /** rct2: 0x008A8958 */ static void suspended_swinging_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -60,20 +60,20 @@ static void suspended_swinging_rc_track_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A8AA8, 0x008A8AB8, 0x008A8AC8 */ static void suspended_swinging_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -94,14 +94,14 @@ static void suspended_swinging_rc_track_station( { 32, 20, 3 }, { 0, 6, height + 29 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 0); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A8968 */ static void suspended_swinging_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -157,26 +157,26 @@ static void suspended_swinging_rc_track_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 62, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -184,18 +184,18 @@ static void suspended_swinging_rc_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A8978 */ static void suspended_swinging_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -223,20 +223,20 @@ static void suspended_swinging_rc_track_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } /** rct2: 0x008A8988 */ static void suspended_swinging_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -292,26 +292,26 @@ static void suspended_swinging_rc_track_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -319,18 +319,18 @@ static void suspended_swinging_rc_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A8998 */ static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -364,20 +364,20 @@ static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up( } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008A89A8 */ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -445,26 +445,26 @@ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 76, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -472,18 +472,18 @@ static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } /** rct2: 0x008A89B8 */ static void suspended_swinging_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackElement.HasChain()) @@ -539,26 +539,26 @@ static void suspended_swinging_rc_track_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -566,18 +566,18 @@ static void suspended_swinging_rc_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_3); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_13); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_13); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A89C8 */ static void suspended_swinging_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { suspended_swinging_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -585,7 +585,7 @@ static void suspended_swinging_rc_track_25_deg_down( /** rct2: 0x008A89D8 */ static void suspended_swinging_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { suspended_swinging_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -593,7 +593,7 @@ static void suspended_swinging_rc_track_60_deg_down( /** rct2: 0x008A89E8 */ static void suspended_swinging_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -601,7 +601,7 @@ static void suspended_swinging_rc_track_flat_to_25_deg_down( /** rct2: 0x008A89F8 */ static void suspended_swinging_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -609,7 +609,7 @@ static void suspended_swinging_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A8A08 */ static void suspended_swinging_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -617,7 +617,7 @@ static void suspended_swinging_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A8A18 */ static void suspended_swinging_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -625,7 +625,7 @@ static void suspended_swinging_rc_track_25_deg_down_to_flat( /** rct2: 0x008A8A28 */ static void suspended_swinging_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -655,20 +655,19 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -694,12 +693,11 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -725,12 +723,12 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -756,12 +754,11 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -788,29 +785,28 @@ static void suspended_swinging_rc_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8A38 */ static void suspended_swinging_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -819,7 +815,7 @@ static void suspended_swinging_rc_track_right_quarter_turn_5( /** rct2: 0x008A8A48 */ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -849,20 +845,19 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -888,12 +883,11 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -919,12 +913,12 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -950,12 +944,11 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( { 16, 32, 3 }, { 16, 0, height + 37 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -982,29 +975,28 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8A58 */ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1034,20 +1026,19 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -1073,12 +1064,11 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -1104,12 +1094,12 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 80, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 5: switch (direction) @@ -1135,12 +1125,11 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( { 16, 32, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 6: switch (direction) @@ -1167,29 +1156,28 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8A68 */ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1199,7 +1187,7 @@ static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008A8A78 */ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1209,7 +1197,7 @@ static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008A8A88 */ static void suspended_swinging_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1239,16 +1227,15 @@ static void suspended_swinging_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1275,24 +1262,23 @@ static void suspended_swinging_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1319,24 +1305,23 @@ static void suspended_swinging_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 6, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -1363,28 +1348,27 @@ static void suspended_swinging_rc_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8A98 */ static void suspended_swinging_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1414,16 +1398,15 @@ static void suspended_swinging_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1450,24 +1433,23 @@ static void suspended_swinging_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1494,24 +1476,23 @@ static void suspended_swinging_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 7, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -1538,28 +1519,27 @@ static void suspended_swinging_rc_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8AD8 */ static void suspended_swinging_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1589,20 +1569,19 @@ static void suspended_swinging_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1628,9 +1607,9 @@ static void suspended_swinging_rc_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -1657,29 +1636,28 @@ static void suspended_swinging_rc_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8AE8 */ static void suspended_swinging_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1688,7 +1666,7 @@ static void suspended_swinging_rc_track_right_quarter_turn_3( /** rct2: 0x008A8AF8 */ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1718,23 +1696,22 @@ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1761,29 +1738,28 @@ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8B08 */ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1813,23 +1789,22 @@ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_INVERTED_4); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1856,29 +1831,28 @@ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_INVERTED_5); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_INVERTED_5); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_INVERTED_5); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8B18 */ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1888,7 +1862,7 @@ static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008A8B28 */ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1898,7 +1872,7 @@ static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008A8B38 */ static void suspended_swinging_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1917,20 +1891,20 @@ static void suspended_swinging_rc_track_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A8B48 */ static void suspended_swinging_rc_track_left_quarter_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1960,20 +1934,19 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1999,12 +1972,11 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( { 32, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2030,12 +2002,12 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( { 16, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -2061,12 +2033,11 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2093,29 +2064,28 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8B58 */ static void suspended_swinging_rc_track_right_quarter_helix_large_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2145,20 +2115,19 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2184,12 +2153,11 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( { 32, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2215,12 +2183,12 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( { 16, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -2246,12 +2214,11 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2278,29 +2245,28 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height + 16, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height + 16, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8B68 */ static void suspended_swinging_rc_track_left_quarter_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2330,20 +2296,19 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2369,12 +2334,11 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( { 32, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2400,12 +2364,12 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( { 16, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -2431,12 +2395,11 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2463,29 +2426,28 @@ static void suspended_swinging_rc_track_left_quarter_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8B78 */ static void suspended_swinging_rc_track_right_quarter_helix_large_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2515,20 +2477,19 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 16, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2554,12 +2515,11 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( { 32, 16, 3 }, { 0, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -2585,12 +2545,12 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( { 16, 16, 3 }, { 0, 16, height + 43 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -2616,12 +2576,11 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( { 16, 32, 3 }, { 16, 0, height + 43 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -2648,29 +2607,28 @@ static void suspended_swinging_rc_track_right_quarter_helix_large_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRight(session, height, TUNNEL_INVERTED_3); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelLeft(session, height, TUNNEL_INVERTED_3); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8B88 */ static void suspended_swinging_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2700,16 +2658,15 @@ static void suspended_swinging_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2735,12 +2692,11 @@ static void suspended_swinging_rc_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2766,15 +2722,15 @@ static void suspended_swinging_rc_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -2801,39 +2757,39 @@ static void suspended_swinging_rc_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8B98 */ static void suspended_swinging_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2863,16 +2819,15 @@ static void suspended_swinging_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -2898,12 +2853,11 @@ static void suspended_swinging_rc_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 29 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -2929,15 +2883,15 @@ static void suspended_swinging_rc_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -2964,39 +2918,39 @@ static void suspended_swinging_rc_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8BA8 */ static void suspended_swinging_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -3005,7 +2959,7 @@ static void suspended_swinging_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008A8BB8 */ static void suspended_swinging_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -3014,7 +2968,7 @@ static void suspended_swinging_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008A8BC8 */ static void suspended_swinging_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3042,9 +2996,9 @@ static void suspended_swinging_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3069,9 +3023,9 @@ static void suspended_swinging_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3096,9 +3050,9 @@ static void suspended_swinging_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3124,36 +3078,36 @@ static void suspended_swinging_rc_track_diag_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008A8BF8 */ static void suspended_swinging_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3181,9 +3135,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3208,9 +3162,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3235,9 +3189,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3263,36 +3217,36 @@ static void suspended_swinging_rc_track_diag_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A8C58 */ static void suspended_swinging_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3306,9 +3260,9 @@ static void suspended_swinging_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: switch (direction) @@ -3319,9 +3273,9 @@ static void suspended_swinging_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: switch (direction) @@ -3332,9 +3286,9 @@ static void suspended_swinging_rc_track_diag_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: switch (direction) @@ -3346,36 +3300,36 @@ static void suspended_swinging_rc_track_diag_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 32, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 36, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 32, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 36, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } } /** rct2: 0x008A8BD8 */ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3403,9 +3357,9 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3430,9 +3384,9 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3457,9 +3411,9 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3485,36 +3439,36 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_up( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A8C38 */ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3528,9 +3482,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -3541,9 +3495,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -3554,9 +3508,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -3568,36 +3522,36 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 16, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8C48 */ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3611,9 +3565,9 @@ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -3624,9 +3578,9 @@ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -3637,9 +3591,9 @@ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -3651,36 +3605,36 @@ static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 21, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8BE8 */ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3708,9 +3662,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3735,9 +3689,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3762,9 +3716,9 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3790,36 +3744,36 @@ static void suspended_swinging_rc_track_diag_25_deg_up_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A8C28 */ static void suspended_swinging_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3847,9 +3801,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: if (trackElement.HasChain()) @@ -3874,9 +3828,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: if (trackElement.HasChain()) @@ -3901,9 +3855,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: if (trackElement.HasChain()) @@ -3929,36 +3883,36 @@ static void suspended_swinging_rc_track_diag_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 56, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x008A8C88 */ static void suspended_swinging_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3972,9 +3926,9 @@ static void suspended_swinging_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 29 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: switch (direction) @@ -3985,9 +3939,9 @@ static void suspended_swinging_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: switch (direction) @@ -3998,9 +3952,9 @@ static void suspended_swinging_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: switch (direction) @@ -4011,16 +3965,16 @@ static void suspended_swinging_rc_track_diag_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 93 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 120, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } } /** rct2: 0x008A8C08 */ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4048,8 +4002,8 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -4074,8 +4028,8 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -4100,8 +4054,8 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -4127,36 +4081,36 @@ static void suspended_swinging_rc_track_diag_flat_to_25_deg_down( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A8C68 */ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4170,9 +4124,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 3 }, { 0, 0, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -4183,9 +4137,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4196,9 +4150,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -4210,36 +4164,36 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 17, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8C78 */ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4253,9 +4207,9 @@ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: switch (direction) @@ -4266,9 +4220,9 @@ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: switch (direction) @@ -4279,9 +4233,9 @@ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 61 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: switch (direction) @@ -4293,36 +4247,36 @@ static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 8, height + 44, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 88, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; } } /** rct2: 0x008A8C18 */ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4350,9 +4304,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: if (trackElement.HasChain()) @@ -4377,9 +4331,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: if (trackElement.HasChain()) @@ -4404,9 +4358,9 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: if (trackElement.HasChain()) @@ -4432,36 +4386,36 @@ static void suspended_swinging_rc_track_diag_25_deg_down_to_flat( } } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x008A8B38 */ static void suspended_swinging_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -4480,15 +4434,15 @@ static void suspended_swinging_rc_track_block_brakes( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height + 44, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_INVERTED_3); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_suspended_swinging_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index f125d56313..911767fd18 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -164,7 +164,7 @@ static constexpr const uint32_t virginia_reel_track_pieces_flat_quarter_turn_1_t * rct2: 0x006D5B48 */ void vehicle_visual_virginia_reel( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { imageDirection = OpenRCT2::Entity::Yaw::YawTo32(imageDirection); @@ -186,7 +186,9 @@ void vehicle_visual_virginia_reel( } }(); baseImage_id += ecx & 7; - const vehicle_boundbox* bb = &_virginiaReelBoundbox[baseImage_id >> 3]; + const auto& vehicleBb = _virginiaReelBoundbox[baseImage_id >> 3]; + auto bb = BoundBoxXYZ{ { vehicleBb.offset_x, vehicleBb.offset_y, vehicleBb.offset_z + z }, + { vehicleBb.length_x, vehicleBb.length_y, vehicleBb.length_z } }; baseImage_id += carEntry->base_image_id; auto image_id = ImageId(baseImage_id, vehicle->colours.Body, vehicle->colours.Trim); @@ -194,9 +196,7 @@ void vehicle_visual_virginia_reel( { image_id = ConstructionMarker.WithIndex(image_id.GetIndex()); } - PaintAddImageAsParent( - 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 }); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, bb); if (session.DPI.zoom_level < ZoomLevel{ 2 } && vehicle->num_peeps > 0 && !vehicle->IsGhost()) { @@ -211,9 +211,7 @@ void vehicle_visual_virginia_reel( if (riding_peep_sprites[i] != 0xFF) { image_id = ImageId(baseImage_id + ((i + 1) * 72), riding_peep_sprites[i]); - PaintAddImageAsChild( - 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 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, bb); } } } @@ -223,7 +221,7 @@ void vehicle_visual_virginia_reel( /** rct2: 0x00811264 */ static void paint_virginia_reel_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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; @@ -236,23 +234,23 @@ static void paint_virginia_reel_track_flat( if (direction & 1) { PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00811274 */ static void paint_virginia_reel_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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; @@ -262,7 +260,7 @@ static void paint_virginia_reel_track_25_deg_up( } auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction]); - paint_struct* ps; + PaintStruct* ps; if (direction & 1) { @@ -281,30 +279,30 @@ 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]); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; case 1: - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 2: - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00811294 */ static void paint_virginia_reel_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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; @@ -314,44 +312,44 @@ static void paint_virginia_reel_track_flat_to_25_deg_up( } auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction]); - paint_struct* ps; + PaintStruct* ps; switch (direction) { case 0: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); session.WoodenSupportsPrependTo = ps; - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 2: ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); session.WoodenSupportsPrependTo = ps; - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; case 3: PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x00811294 */ static void paint_virginia_reel_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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; @@ -361,7 +359,7 @@ static void paint_virginia_reel_track_25_deg_up_to_flat( } auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction]); - paint_struct* ps; + PaintStruct* ps; if (direction & 1) { @@ -380,30 +378,30 @@ 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]); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14); break; case 2: - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14); break; case 3: - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008112A4 */ static void paint_virginia_reel_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { paint_virginia_reel_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -411,7 +409,7 @@ static void paint_virginia_reel_track_25_deg_down( /** rct2: 0x008112B4 */ static void paint_virginia_reel_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -419,7 +417,7 @@ static void paint_virginia_reel_track_flat_to_25_deg_down( /** rct2: 0x008112C4 */ static void paint_virginia_reel_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -427,7 +425,7 @@ static void paint_virginia_reel_track_25_deg_down_to_flat( /** rct2: 0x008112D4, 0x008112E4, 0x008112F4 */ static void paint_virginia_reel_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -438,9 +436,9 @@ static void paint_virginia_reel_station( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 2 }, { 0, 2, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_VIRGINIA_REEL_FLAT_SW_NE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 20, 2 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else if (direction == 1 || direction == 3) { @@ -448,16 +446,16 @@ static void paint_virginia_reel_station( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 2 }, { 2, 0, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_VIRGINIA_REEL_FLAT_NW_SE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 20, 32, 2 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 20, 32, 2 } }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint8_t virginia_reel_left_quarter_turn_supports[] = { @@ -469,7 +467,7 @@ static constexpr const uint8_t virginia_reel_left_quarter_turn_supports[] = { /** rct2: 0x00811304 */ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -480,18 +478,18 @@ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( switch (trackSequence) { case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 0: case 3: - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( 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); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint8_t virginia_reel_right_quarter_turn_3_tiles_to_left_turn_map[] = { @@ -503,7 +501,7 @@ static constexpr const uint8_t virginia_reel_right_quarter_turn_3_tiles_to_left_ /** rct2: 0x00811314 */ static void paint_virginia_reel_track_right_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -513,7 +511,7 @@ static void paint_virginia_reel_track_right_quarter_turn_3_tiles( /** rct2: 0x00811324 */ static void paint_virginia_reel_track_left_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -523,30 +521,30 @@ 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]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - 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); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00811334 */ static void paint_virginia_reel_track_right_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 3) % 4, height, trackElement); diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 47f07f57ab..063d2ebd97 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -165,7 +165,7 @@ static constexpr const uint32_t _wild_mouse_block_brakes_image_ids[NumOrthogonal /** rct2: 0x0078B1E4 */ static void wild_mouse_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -180,16 +180,16 @@ static void wild_mouse_track_flat( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void wild_mouse_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -219,14 +219,14 @@ static void wild_mouse_track_station( } track_paint_util_draw_station_metal_supports(session, direction, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0078B1F4 */ static void wild_mouse_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -241,24 +241,24 @@ static void wild_mouse_track_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0078B204 */ static void wild_mouse_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -282,29 +282,29 @@ static void wild_mouse_track_60_deg_up( { if (direction == 0 || direction == 3) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -33, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -33, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x0078B214 */ static void wild_mouse_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -319,24 +319,24 @@ static void wild_mouse_track_flat_to_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -4, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0078B224 */ static void wild_mouse_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -366,24 +366,24 @@ static void wild_mouse_track_25_deg_up_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -13, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -13, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x0078B234 */ static void wild_mouse_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -413,24 +413,24 @@ static void wild_mouse_track_60_deg_up_to_25_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -21, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -21, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x0078B244 */ static void wild_mouse_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -445,24 +445,24 @@ static void wild_mouse_track_25_deg_up_to_flat( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -7, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0078B254 */ static void wild_mouse_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -470,7 +470,7 @@ static void wild_mouse_track_25_deg_down( /** rct2: 0x0078B264 */ static void wild_mouse_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -478,7 +478,7 @@ static void wild_mouse_track_60_deg_down( /** rct2: 0x0078B274 */ static void wild_mouse_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -486,7 +486,7 @@ static void wild_mouse_track_flat_to_25_deg_down( /** rct2: 0x0078B284 */ static void wild_mouse_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -494,7 +494,7 @@ static void wild_mouse_track_25_deg_down_to_60_deg_down( /** rct2: 0x0078B294 */ static void wild_mouse_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -502,17 +502,17 @@ static void wild_mouse_track_60_deg_down_to_25_deg_down( /** rct2: 0x0078B2A4 */ static void wild_mouse_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wild_mouse_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][3] = { + static constexpr const SpriteBb imageIds[4][3] = { { { SPR_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_1, { 0, 0, 0 }, { 16, 16, 0 }, { 16, 16, 3 } }, @@ -543,7 +543,7 @@ static void wild_mouse_track_right_quarter_turn_3( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -560,15 +560,15 @@ static void wild_mouse_track_right_quarter_turn_3( blockedSegments = SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void wild_mouse_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][2] = { + static constexpr const SpriteBb imageIds[4][2] = { { { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_DOWN_SW_SE_PART_0, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_DOWN_SW_SE_PART_1, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 3 } }, @@ -591,7 +591,7 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( if (trackSequence == 0 || trackSequence == 3) { int32_t part = trackSequence == 0 ? 0 : 1; - const sprite_bb* sbb = &imageIds[direction][part]; + const SpriteBb* sbb = &imageIds[direction][part]; const auto& offset = sbb->offset; PaintAddImageAsParent( session, session.TrackColours[SCHEME_TRACK].WithIndex(sbb->sprite_id), { offset.x, offset.y, height + offset.z }, @@ -605,7 +605,7 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -619,12 +619,12 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_down( blockedSegments = SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + generalSupportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + generalSupportHeights[trackSequence], 0x20); } static void wild_mouse_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -633,10 +633,10 @@ static void wild_mouse_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x0078B314 */ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][2] = { + static constexpr const SpriteBb imageIds[4][2] = { { { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_UP_SW_SE_PART_0, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 3 } }, { SPR_WILD_MOUSE_QUARTER_TURN_3_25_DEG_UP_SW_SE_PART_1, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 3 } }, @@ -659,7 +659,7 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( if (trackSequence == 0 || trackSequence == 3) { int32_t part = trackSequence == 0 ? 0 : 1; - const sprite_bb* sbb = &imageIds[direction][part]; + const SpriteBb* sbb = &imageIds[direction][part]; PaintAddImageAsParent( session, session.TrackColours[SCHEME_TRACK].WithIndex(sbb->sprite_id), { sbb->offset.x, sbb->offset.y, height + sbb->offset.z }, sbb->bb_size); @@ -670,18 +670,16 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: if (direction == 2) { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, -11, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -11, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); } break; } @@ -696,13 +694,13 @@ static void wild_mouse_track_right_quarter_turn_3_25_deg_up( blockedSegments = SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + generalSupportHeights[trackSequence], 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + generalSupportHeights[trackSequence], 0x20); } /** rct2: 0x0078B324 */ static void wild_mouse_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -710,7 +708,7 @@ static void wild_mouse_track_left_quarter_turn_3_25_deg_down( } static void wild_mouse_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -719,7 +717,7 @@ static void wild_mouse_track_left_quarter_turn_3( /** rct2: 0x0078B394 */ static void wild_mouse_track_left_quarter_turn_1( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -745,16 +743,16 @@ static void wild_mouse_track_left_quarter_turn_1( 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -1, 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, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0078B3A4 */ static void wild_mouse_track_right_quarter_turn_1( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wild_mouse_track_left_quarter_turn_1(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -762,7 +760,7 @@ static void wild_mouse_track_right_quarter_turn_1( /** rct2: 0x0078B354 */ static void wild_mouse_track_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -792,24 +790,24 @@ static void wild_mouse_track_flat_to_60_deg_up( } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -5, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -5, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x0078B364 */ static void wild_mouse_track_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -841,29 +839,29 @@ static void wild_mouse_track_60_deg_up_to_flat( { if (direction == 0 || direction == 3) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, -17, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, -17, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); } } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x0078B374 */ static void wild_mouse_track_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -871,7 +869,7 @@ static void wild_mouse_track_flat_to_60_deg_down( /** rct2: 0x0078B384 */ static void wild_mouse_track_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -879,24 +877,24 @@ static void wild_mouse_track_60_deg_down_to_flat( /** rct2: 0x0078B344 */ static void wild_mouse_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(_wild_mouse_brakes_image_ids[direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0078B3C4 */ static void wild_mouse_track_rotation_control_toggle( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -910,17 +908,17 @@ static void wild_mouse_track_rotation_control_toggle( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0078B3B4 */ static void wild_mouse_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isClosed = trackElement.BlockBrakeClosed(); @@ -928,12 +926,12 @@ static void wild_mouse_track_block_brakes( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_wild_mouse(int32_t trackType) diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index e9a4d8df0c..d3bc1a553d 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -448,7 +448,7 @@ static constexpr const uint32_t _wooden_rc_station_block_brakes_image_ids[4][2] { SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_OPEN_NW_SE, SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_CLOSED_NW_SE }, }; -ImageId wooden_rc_get_rails_colour(paint_session& session) +ImageId wooden_rc_get_rails_colour(PaintSession& session) { return session.TrackColours[SCHEME_TRACK]; } @@ -456,7 +456,7 @@ ImageId wooden_rc_get_rails_colour(paint_session& session) /** rct2: 0x008AC568 */ template static void wooden_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -476,15 +476,15 @@ static void wooden_rc_track_flat( wooden_rc_track_paint( session, imageIds[direction][isChained], railsImageIds[direction][isChained], direction, 0, 2, 32, 25, 2, height, 0, 3, height); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void wooden_rc_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -507,17 +507,17 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AC578 */ template static void wooden_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -585,25 +585,25 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AC588 */ template static void wooden_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -623,25 +623,25 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008AC598 */ template static void wooden_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -709,25 +709,25 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AC5A8 */ template static void wooden_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -769,25 +769,25 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AC5B8 */ template static void wooden_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -829,25 +829,25 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008AC5C8 */ template static void wooden_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -915,25 +915,25 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AC5D8 */ template static void wooden_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -942,7 +942,7 @@ static void wooden_rc_track_25_deg_down( /** rct2: 0x008AC5E8 */ template static void wooden_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -951,7 +951,7 @@ static void wooden_rc_track_60_deg_down( /** rct2: 0x008AC5F8 */ template static void wooden_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -960,7 +960,7 @@ static void wooden_rc_track_flat_to_25_deg_down( /** rct2: 0x008AC608 */ template static void wooden_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -969,7 +969,7 @@ static void wooden_rc_track_25_deg_down_to_60_deg_down( /** rct2: 0x008AC618 */ template static void wooden_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -978,7 +978,7 @@ static void wooden_rc_track_60_deg_down_to_25_deg_down( /** rct2: 0x008AC628 */ template static void wooden_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -986,7 +986,7 @@ static void wooden_rc_track_25_deg_down_to_flat( template static void wooden_rc_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -1332,7 +1332,7 @@ static void wooden_rc_track_right_quarter_turn_5( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -1363,13 +1363,13 @@ static void wooden_rc_track_right_quarter_turn_5( | SEGMENT_D0 | SEGMENT_D4; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void wooden_rc_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1379,7 +1379,7 @@ static void wooden_rc_track_left_quarter_turn_5( /** rct2: 0x008AC658 */ template static void wooden_rc_track_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1416,16 +1416,16 @@ 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]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AC668 */ template static void wooden_rc_track_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1462,16 +1462,16 @@ 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]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AC678 */ template static void wooden_rc_track_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_rc_track_flat_to_right_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1480,7 +1480,7 @@ static void wooden_rc_track_left_bank_to_flat( /** rct2: 0x008AC688 */ template static void wooden_rc_track_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_rc_track_flat_to_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -1488,7 +1488,7 @@ static void wooden_rc_track_right_bank_to_flat( template static void wooden_rc_track_banked_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -1834,7 +1834,7 @@ static void wooden_rc_track_banked_right_quarter_turn_5( if (supportType[direction][trackSequence] != -1) { - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -1865,13 +1865,13 @@ static void wooden_rc_track_banked_right_quarter_turn_5( | SEGMENT_D0 | SEGMENT_D4; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template static void wooden_rc_track_banked_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1882,7 +1882,7 @@ static void wooden_rc_track_banked_left_quarter_turn_5( /** rct2: 0x008AC6B8 */ template static void wooden_rc_track_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1919,23 +1919,23 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AC6C8 */ template static void wooden_rc_track_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -1972,23 +1972,23 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AC6D8 */ template static void wooden_rc_track_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -2025,23 +2025,23 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AC6E8 */ template static void wooden_rc_track_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][4] = { @@ -2078,23 +2078,23 @@ 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]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AC6F8 */ template static void wooden_rc_track_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2103,7 +2103,7 @@ static void wooden_rc_track_left_bank_to_25_deg_down( /** rct2: 0x008AC708 */ template static void wooden_rc_track_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2112,7 +2112,7 @@ static void wooden_rc_track_right_bank_to_25_deg_down( /** rct2: 0x008AC718 */ template static void wooden_rc_track_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2121,7 +2121,7 @@ static void wooden_rc_track_25_deg_down_to_left_bank( /** rct2: 0x008AC728 */ template static void wooden_rc_track_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2130,7 +2130,7 @@ static void wooden_rc_track_25_deg_down_to_right_bank( /** rct2: 0x008AC738 */ template static void wooden_rc_track_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -2142,16 +2142,16 @@ 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]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AC748 */ template static void wooden_rc_track_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_rc_track_left_bank(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -2160,7 +2160,7 @@ static void wooden_rc_track_right_bank( /** rct2: 0x008AC758 */ template static void wooden_rc_track_left_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2175,7 +2175,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24647), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2190,7 +2190,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24678), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2199,7 +2199,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24657), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2208,20 +2208,20 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24662), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2233,7 +2233,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24648), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2248,7 +2248,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24679), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2257,7 +2257,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24658), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2272,15 +2272,14 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24685), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -2292,7 +2291,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24649), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2307,7 +2306,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24680), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 59 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2316,7 +2315,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24659), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2331,21 +2330,21 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24686), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 59 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -2357,7 +2356,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24650), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2372,7 +2371,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24681), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2387,7 +2386,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24683), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2402,15 +2401,14 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24687), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -2422,7 +2420,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24651), { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2437,7 +2435,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24682), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2452,7 +2450,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24684), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2467,20 +2465,20 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24688), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -2488,7 +2486,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_up( /** rct2: 0x008AC768 */ template static void wooden_rc_track_right_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2503,7 +2501,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24627), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2512,7 +2510,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24632), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2527,7 +2525,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24673), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2536,20 +2534,20 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24642), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -2567,7 +2565,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24667), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2576,7 +2574,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24633), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2591,7 +2589,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24674), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2600,15 +2598,14 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24643), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -2626,7 +2623,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24668), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 59 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2635,7 +2632,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24634), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2650,7 +2647,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24675), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 59 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2659,21 +2656,21 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24644), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -2691,7 +2688,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24669), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2706,7 +2703,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24671), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2721,7 +2718,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24676), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2730,15 +2727,14 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24645), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -2756,7 +2752,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24670), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2771,7 +2767,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24672), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2786,7 +2782,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24677), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2795,20 +2791,20 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24646), { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -2816,7 +2812,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_up( /** rct2: 0x008AC778 */ template static void wooden_rc_track_left_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2827,7 +2823,7 @@ static void wooden_rc_track_left_quarter_turn_5_25_deg_down( /** rct2: 0x008AC788 */ template static void wooden_rc_track_right_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -2838,7 +2834,7 @@ static void wooden_rc_track_right_quarter_turn_5_25_deg_down( /** rct2: 0x008AC798 */ template static void wooden_rc_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -2853,7 +2849,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24591), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2868,7 +2864,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24607), { 0, 0, height }, { 32, 25, 0 }, { 0, 3, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2877,7 +2873,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24594), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2892,15 +2888,15 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24610), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -2912,7 +2908,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24592), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2927,7 +2923,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24608), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2936,7 +2932,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24593), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -2951,15 +2947,14 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24609), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -2971,7 +2966,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24593), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -2986,7 +2981,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24609), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -2995,7 +2990,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24592), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3010,15 +3005,14 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24608), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3030,7 +3024,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24594), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3045,7 +3039,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24610), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3054,7 +3048,7 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24591), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3069,20 +3063,20 @@ static void wooden_rc_track_s_bend_left( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24607), { 0, 0, height }, { 32, 25, 0 }, { 0, 3, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3090,7 +3084,7 @@ static void wooden_rc_track_s_bend_left( /** rct2: 0x008AC7A8 */ template static void wooden_rc_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3111,7 +3105,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24611), { 0, 0, height }, { 32, 25, 0 }, { 0, 3, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3120,7 +3114,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24603), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3135,7 +3129,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24614), { 0, 0, height }, { 32, 25, 0 }, { 0, 3, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3144,15 +3138,15 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24606), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -3170,7 +3164,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24612), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3179,7 +3173,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24604), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3194,7 +3188,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24613), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3203,15 +3197,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24605), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -3229,7 +3222,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24613), { 0, 0, height }, { 32, 26, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3238,7 +3231,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24605), { 0, 0, height }, { 32, 26, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3253,7 +3246,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24612), { 0, 0, height }, { 32, 26, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3262,15 +3255,14 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24604), { 0, 0, height }, { 32, 26, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -3288,7 +3280,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24614), { 0, 0, height }, { 32, 25, 0 }, { 0, 3, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3297,7 +3289,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24606), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3312,7 +3304,7 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24611), { 0, 0, height }, { 32, 25, 0 }, { 0, 3, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3321,20 +3313,20 @@ static void wooden_rc_track_s_bend_right( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24603), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -3342,7 +3334,7 @@ static void wooden_rc_track_s_bend_right( /** rct2: 0x008ACE18 */ template static void wooden_rc_track_left_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3371,17 +3363,16 @@ static void wooden_rc_track_left_vertical_loop( { 32, 20, 7 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -3390,37 +3381,36 @@ static void wooden_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23454), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23462), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23459), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23467), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3446,9 +3436,9 @@ static void wooden_rc_track_left_vertical_loop( { 4, 16, 119 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -3474,18 +3464,17 @@ static void wooden_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -3511,12 +3500,11 @@ static void wooden_rc_track_left_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -3542,9 +3530,9 @@ static void wooden_rc_track_left_vertical_loop( { 3, 16, 119 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -3553,37 +3541,36 @@ static void wooden_rc_track_left_vertical_loop( PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23459), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23467), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23454), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23462), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -3609,22 +3596,21 @@ static void wooden_rc_track_left_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -3632,7 +3618,7 @@ static void wooden_rc_track_left_vertical_loop( /** rct2: 0x008ACE28 */ template static void wooden_rc_track_right_vertical_loop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3661,12 +3647,12 @@ static void wooden_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -3675,32 +3661,32 @@ static void wooden_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23483), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23475), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23478), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23470), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -3726,7 +3712,7 @@ static void wooden_rc_track_right_vertical_loop( { 5, 16, 119 }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: switch (direction) @@ -3752,13 +3738,13 @@ static void wooden_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -3784,7 +3770,7 @@ static void wooden_rc_track_right_vertical_loop( { 32, 16, 3 }); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 7: switch (direction) @@ -3810,7 +3796,7 @@ static void wooden_rc_track_right_vertical_loop( { 4, 16, 119 }); break; } - paint_util_set_general_support_height(session, height + 168, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: switch (direction) @@ -3819,32 +3805,32 @@ static void wooden_rc_track_right_vertical_loop( PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23478), { 0, 14, height }, { 32, 2, 63 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23470), { 0, 0, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23483), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(23475), { 0, 6, height }, { 32, 26, 3 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 9: switch (direction) @@ -3870,17 +3856,17 @@ static void wooden_rc_track_right_vertical_loop( { 32, 20, 3 }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; case 2: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -3890,7 +3876,7 @@ static void wooden_rc_track_right_vertical_loop( /** rct2: 0x008AC7E8 */ template static void wooden_rc_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -3905,7 +3891,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24694), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -3920,7 +3906,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24706), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -3929,7 +3915,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24700), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -3944,18 +3930,18 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24703), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4005,9 +3991,9 @@ static void wooden_rc_track_left_quarter_turn_3( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4019,7 +4005,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24692), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4034,7 +4020,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24704), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4043,7 +4029,7 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24698), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4058,20 +4044,20 @@ static void wooden_rc_track_left_quarter_turn_3( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24701), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4079,7 +4065,7 @@ static void wooden_rc_track_left_quarter_turn_3( /** rct2: 0x008AC7F8 */ template static void wooden_rc_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4089,7 +4075,7 @@ static void wooden_rc_track_right_quarter_turn_3( /** rct2: 0x008AC808 */ template static void wooden_rc_track_left_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4105,7 +4091,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24712), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4122,7 +4108,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24724), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4132,7 +4118,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24718), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4149,18 +4135,18 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24721), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4216,9 +4202,9 @@ static void wooden_rc_track_left_quarter_turn_3_bank( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4231,7 +4217,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24710), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4248,7 +4234,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24722), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4258,7 +4244,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24716), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4275,20 +4261,20 @@ static void wooden_rc_track_left_quarter_turn_3_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24719), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -4296,7 +4282,7 @@ static void wooden_rc_track_left_quarter_turn_3_bank( /** rct2: 0x008AC818 */ template static void wooden_rc_track_right_quarter_turn_3_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4307,7 +4293,7 @@ static void wooden_rc_track_right_quarter_turn_3_bank( /** rct2: 0x008AC828 */ template static void wooden_rc_track_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4322,7 +4308,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24772), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4337,7 +4323,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24785), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4346,7 +4332,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24776), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4361,23 +4347,23 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24783), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4389,7 +4375,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24771), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4404,7 +4390,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24784), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4419,7 +4405,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24786), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4434,20 +4420,20 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24782), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -4455,7 +4441,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_up( /** rct2: 0x008AC838 */ template static void wooden_rc_track_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4476,7 +4462,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24777), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4485,7 +4471,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24763), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4500,7 +4486,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24780), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4509,23 +4495,23 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24767), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -4543,7 +4529,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24778), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4558,7 +4544,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24779), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4573,7 +4559,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24781), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4582,20 +4568,20 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24768), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -4603,7 +4589,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_up( /** rct2: 0x008AC848 */ template static void wooden_rc_track_left_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4614,7 +4600,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down( /** rct2: 0x008AC858 */ template static void wooden_rc_track_right_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -4625,7 +4611,7 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down( /** rct2: 0x008ACAB8 */ template static void wooden_rc_track_left_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -4641,7 +4627,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24748), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4658,7 +4644,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24760), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4668,7 +4654,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24754), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4685,37 +4671,37 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24757), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -4771,9 +4757,9 @@ static void wooden_rc_track_left_half_banked_helix_up_small( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -4786,7 +4772,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24746), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4803,7 +4789,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24758), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4813,7 +4799,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24752), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4830,24 +4816,24 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24755), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -4867,7 +4853,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24757), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -4877,7 +4863,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24748), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -4894,7 +4880,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24760), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -4904,42 +4890,42 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24754), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -4995,9 +4981,9 @@ static void wooden_rc_track_left_half_banked_helix_up_small( { 16, 16, 2 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5017,7 +5003,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24755), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5027,7 +5013,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24746), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5044,7 +5030,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24758), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5054,19 +5040,19 @@ static void wooden_rc_track_left_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24752), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5074,7 +5060,7 @@ static void wooden_rc_track_left_half_banked_helix_up_small( /** rct2: 0x008ACAC8 */ template static void wooden_rc_track_right_half_banked_helix_up_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5097,7 +5083,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24737), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5107,7 +5093,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24728), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5124,7 +5110,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24740), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5134,37 +5120,37 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24734), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5220,9 +5206,9 @@ static void wooden_rc_track_right_half_banked_helix_up_small( { 16, 16, 2 }, { 16, 0, height }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5242,7 +5228,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24739), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5252,7 +5238,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24730), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5269,7 +5255,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24742), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5279,24 +5265,24 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24736), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -5309,7 +5295,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24728), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5326,7 +5312,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24740), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5336,7 +5322,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24734), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5353,42 +5339,42 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24737), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5443,9 +5429,9 @@ static void wooden_rc_track_right_half_banked_helix_up_small( { 16, 16, 0 }, { 16, 16, height + 27 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5458,7 +5444,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24730), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5475,7 +5461,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24742), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5485,7 +5471,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24736), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5502,19 +5488,19 @@ static void wooden_rc_track_right_half_banked_helix_up_small( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24739), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -5522,7 +5508,7 @@ static void wooden_rc_track_right_half_banked_helix_up_small( /** rct2: 0x008ACAD8 */ template static void wooden_rc_track_left_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -5538,7 +5524,7 @@ static void wooden_rc_track_left_half_banked_helix_down_small( /** rct2: 0x008ACAE8 */ template static void wooden_rc_track_right_half_banked_helix_down_small( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 4) @@ -5554,7 +5540,7 @@ static void wooden_rc_track_right_half_banked_helix_down_small( /** rct2: 0x008ACAF8 */ template static void wooden_rc_track_left_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -5569,7 +5555,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24570), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5584,7 +5570,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24590), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5593,7 +5579,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24580), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5608,24 +5594,24 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24585), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -5637,7 +5623,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24569), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5652,7 +5638,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24589), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5661,7 +5647,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24579), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5676,15 +5662,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24584), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -5696,7 +5681,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24568), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5711,7 +5696,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24588), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 29 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5720,7 +5705,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24578), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5735,19 +5720,19 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24583), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -5759,7 +5744,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24567), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5774,7 +5759,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24587), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 33 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5783,7 +5768,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24577), { 0, 0, height }, { 16, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5798,15 +5783,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24582), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -5818,7 +5802,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24566), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5833,7 +5817,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24586), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 33 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5842,7 +5826,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24576), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5857,24 +5841,24 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24581), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -5892,7 +5876,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24585), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5901,7 +5885,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24570), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5916,7 +5900,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24590), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5925,29 +5909,29 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24580), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -5965,7 +5949,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24584), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -5974,7 +5958,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24569), { 0, 0, height }, { 16, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -5989,7 +5973,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24589), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -5998,15 +5982,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24579), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6024,7 +6007,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24583), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6033,7 +6016,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24568), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6048,7 +6031,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24588), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 29 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6057,19 +6040,19 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24578), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6087,7 +6070,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24582), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6096,7 +6079,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24567), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6111,7 +6094,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24587), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 33 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6120,15 +6103,14 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24577), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6146,7 +6128,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24581), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6155,7 +6137,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24566), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6170,7 +6152,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24586), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 33 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6179,19 +6161,19 @@ static void wooden_rc_track_left_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24576), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6199,7 +6181,7 @@ static void wooden_rc_track_left_half_banked_helix_up_large( /** rct2: 0x008ACB08 */ template static void wooden_rc_track_right_half_banked_helix_up_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -6220,7 +6202,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24551), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6229,7 +6211,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24536), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6244,7 +6226,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24556), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6253,24 +6235,24 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24546), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -6288,7 +6270,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24552), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6297,7 +6279,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24537), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6312,7 +6294,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24557), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6321,15 +6303,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24547), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -6347,7 +6328,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24553), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6356,7 +6337,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24538), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6371,7 +6352,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24558), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 29 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6380,19 +6361,19 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24548), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: switch (direction) @@ -6410,7 +6391,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24554), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6419,7 +6400,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24539), { 0, 0, height }, { 16, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6434,7 +6415,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24559), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 33 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6443,15 +6424,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24549), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: switch (direction) @@ -6469,7 +6449,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24555), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6478,7 +6458,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24540), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6493,7 +6473,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24560), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 33 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6502,24 +6482,24 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24550), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: switch (direction) @@ -6531,7 +6511,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24536), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6546,7 +6526,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24556), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6555,7 +6535,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24546), { 0, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6570,29 +6550,29 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24551), { 0, 0, height }, { 20, 32, 0 }, { 6, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: switch (direction) @@ -6604,7 +6584,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24537), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6619,7 +6599,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24557), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6628,7 +6608,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24547), { 0, 0, height }, { 16, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6643,15 +6623,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24552), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 10: switch (direction) @@ -6663,7 +6642,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24538), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6678,7 +6657,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24558), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 29 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6687,7 +6666,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24548), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6702,19 +6681,19 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24553), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: switch (direction) @@ -6726,7 +6705,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24539), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6741,7 +6720,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24559), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 33 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6750,7 +6729,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24549), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6765,15 +6744,14 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24554), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 13: switch (direction) @@ -6785,7 +6763,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24540), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -6800,7 +6778,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24560), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 33 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -6809,7 +6787,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24550), { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -6824,19 +6802,19 @@ static void wooden_rc_track_right_half_banked_helix_up_large( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24555), { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -6844,7 +6822,7 @@ static void wooden_rc_track_right_half_banked_helix_up_large( /** rct2: 0x008ACB18 */ template static void wooden_rc_track_left_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -6860,7 +6838,7 @@ static void wooden_rc_track_left_half_banked_helix_down_large( /** rct2: 0x008ACB28 */ template static void wooden_rc_track_right_half_banked_helix_down_large( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence >= 7) @@ -6876,7 +6854,7 @@ static void wooden_rc_track_right_half_banked_helix_down_large( /** rct2: 0x008ACB98 */ template static void wooden_rc_track_left_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -6939,14 +6917,14 @@ static void wooden_rc_track_left_quarter_turn_1_60_deg_up( break; } track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008ACB78 */ template static void wooden_rc_track_right_quarter_turn_1_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7009,14 +6987,14 @@ static void wooden_rc_track_right_quarter_turn_1_60_deg_up( break; } track_paint_util_right_quarter_turn_1_tile_tunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008ACB88 */ template static void wooden_rc_track_left_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -7026,7 +7004,7 @@ static void wooden_rc_track_left_quarter_turn_1_60_deg_down( /** rct2: 0x008ACBA8 */ template static void wooden_rc_track_right_quarter_turn_1_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -7036,7 +7014,7 @@ static void wooden_rc_track_right_quarter_turn_1_60_deg_down( /** rct2: 0x008AC868 */ template static void wooden_rc_track_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -7048,16 +7026,16 @@ 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]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008ACC78 */ template static void wooden_rc_track_25_deg_up_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7069,7 +7047,7 @@ static void wooden_rc_track_25_deg_up_left_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25115), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7084,7 +7062,7 @@ static void wooden_rc_track_25_deg_up_left_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25123), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7099,7 +7077,7 @@ static void wooden_rc_track_25_deg_up_left_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25124), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7108,25 +7086,25 @@ static void wooden_rc_track_25_deg_up_left_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25118), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACC88 */ template static void wooden_rc_track_25_deg_up_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7138,7 +7116,7 @@ static void wooden_rc_track_25_deg_up_right_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25119), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7153,7 +7131,7 @@ static void wooden_rc_track_25_deg_up_right_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25125), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7168,7 +7146,7 @@ static void wooden_rc_track_25_deg_up_right_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25126), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7177,25 +7155,25 @@ static void wooden_rc_track_25_deg_up_right_banked( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25122), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AC878 */ template static void wooden_rc_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -7233,17 +7211,17 @@ static void wooden_rc_track_on_ride_photo( { 0, 3, height }); break; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ACC98 */ template static void wooden_rc_track_25_deg_down_left_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -7252,7 +7230,7 @@ static void wooden_rc_track_25_deg_down_left_banked( /** rct2: 0x008ACCA8 */ template static void wooden_rc_track_25_deg_down_right_banked( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -7261,10 +7239,10 @@ static void wooden_rc_track_25_deg_down_right_banked( /** rct2: 0x008ACE08 */ template static void wooden_rc_track_water_splash( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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 bool transparent = gConfigGeneral.TransparentWater || (session.ViewFlags & VIEWPORT_FLAG_UNDERGROUND_INSIDE); const auto waterMask = ImageId(SPR_WATER_MASK).WithRemap(FilterPaletteID::PaletteWater).WithBlended(true); const auto waterOverlay = ImageId(transparent ? SPR_WATER_OVERLAY : SPR_RCT1_WATER_OVERLAY); @@ -7370,10 +7348,10 @@ static void wooden_rc_track_water_splash( { 32, 25, 2 }, { 0, 3, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -7475,9 +7453,9 @@ static void wooden_rc_track_water_splash( { 32, 25, 2 }, { 0, 3, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -7533,9 +7511,9 @@ static void wooden_rc_track_water_splash( { 32, 25, 2 }, { 0, 3, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -7637,9 +7615,9 @@ static void wooden_rc_track_water_splash( { 32, 25, 2 }, { 0, 3, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -7741,10 +7719,10 @@ static void wooden_rc_track_water_splash( { 32, 25, 2 }, { 0, 3, height }); break; } - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -7752,7 +7730,7 @@ static void wooden_rc_track_water_splash( /** rct2: 0x008AC958 */ template static void wooden_rc_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -7767,7 +7745,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25003), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7782,7 +7760,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25019), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7791,7 +7769,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25011), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7806,15 +7784,15 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25023), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -7826,7 +7804,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25004), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7841,7 +7819,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25020), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7850,7 +7828,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25012), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7865,11 +7843,11 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25024), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -7881,7 +7859,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25005), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -7896,7 +7874,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25021), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -7905,7 +7883,7 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25013), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -7920,30 +7898,30 @@ static void wooden_rc_track_left_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25025), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -7993,8 +7971,8 @@ static void wooden_rc_track_left_eighth_to_diag( { 16, 16, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8002,7 +7980,7 @@ static void wooden_rc_track_left_eighth_to_diag( /** rct2: 0x008AC968 */ template static void wooden_rc_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8023,7 +8001,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24995), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8032,7 +8010,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24983), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8047,7 +8025,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24999), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8056,15 +8034,15 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24991), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8082,7 +8060,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24996), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8091,7 +8069,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24984), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8106,7 +8084,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25000), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8115,11 +8093,11 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24992), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8137,7 +8115,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24997), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8146,7 +8124,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24985), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8161,7 +8139,7 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25001), { 0, 0, height }, { 28, 28, 0 }, { 4, 4, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8170,30 +8148,30 @@ static void wooden_rc_track_right_eighth_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24993), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8243,8 +8221,8 @@ static void wooden_rc_track_right_eighth_to_diag( { 16, 16, 2 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8252,7 +8230,7 @@ static void wooden_rc_track_right_eighth_to_diag( /** rct2: 0x008AC978 */ template static void wooden_rc_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8262,7 +8240,7 @@ static void wooden_rc_track_left_eighth_to_orthogonal( /** rct2: 0x008AC988 */ template static void wooden_rc_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8272,7 +8250,7 @@ static void wooden_rc_track_right_eighth_to_orthogonal( /** rct2: 0x008AC998 */ template static void wooden_rc_track_left_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8287,7 +8265,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25051), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8302,7 +8280,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25067), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8311,7 +8289,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25059), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8326,15 +8304,15 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25071), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8346,7 +8324,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25052), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8361,7 +8339,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25068), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8370,7 +8348,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25060), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8385,11 +8363,11 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25072), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8401,7 +8379,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25053), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8416,7 +8394,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25069), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8425,7 +8403,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25061), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8440,30 +8418,30 @@ static void wooden_rc_track_left_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25073), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8513,8 +8491,8 @@ static void wooden_rc_track_left_eighth_bank_to_diag( { 16, 16, 0 }, { 16, 0, height + 27 }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8522,7 +8500,7 @@ static void wooden_rc_track_left_eighth_bank_to_diag( /** rct2: 0x008AC9A8 */ template static void wooden_rc_track_right_eighth_bank_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8543,7 +8521,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25043), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8552,7 +8530,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25031), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8567,7 +8545,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25047), { 0, 0, height }, { 32, 32, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8576,15 +8554,15 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25039), { 0, 0, height }, { 32, 32, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -8602,7 +8580,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25044), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8611,7 +8589,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25032), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8626,7 +8604,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25048), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8635,11 +8613,11 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25040), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -8657,7 +8635,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25045), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -8666,7 +8644,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25033), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8681,7 +8659,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25049), { 0, 0, height }, { 28, 28, 0 }, { 4, 4, height + 27 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -8690,30 +8668,30 @@ static void wooden_rc_track_right_eighth_bank_to_diag( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25041), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: switch (direction) @@ -8763,8 +8741,8 @@ static void wooden_rc_track_right_eighth_bank_to_diag( { 16, 16, 2 }, { 16, 16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8772,7 +8750,7 @@ static void wooden_rc_track_right_eighth_bank_to_diag( /** rct2: 0x008AC9B8 */ template static void wooden_rc_track_left_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8783,7 +8761,7 @@ static void wooden_rc_track_left_eighth_bank_to_orthogonal( /** rct2: 0x008AC9C8 */ template static void wooden_rc_track_right_eighth_bank_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -8794,7 +8772,7 @@ static void wooden_rc_track_right_eighth_bank_to_orthogonal( /** rct2: 0x008AC888 */ template static void wooden_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -8828,8 +8806,8 @@ static void wooden_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: if (trackElement.HasChain()) @@ -8849,16 +8827,16 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24917), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8879,21 +8857,21 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24875), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: if (trackElement.HasChain()) @@ -8901,10 +8879,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8919,10 +8897,10 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24918), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -8931,10 +8909,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -8949,15 +8927,15 @@ static void wooden_rc_track_diag_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24876), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: if (trackElement.HasChain()) @@ -8988,8 +8966,8 @@ static void wooden_rc_track_diag_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -8997,7 +8975,7 @@ static void wooden_rc_track_diag_flat( /** rct2: 0x008AC8B8 */ template static void wooden_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9031,8 +9009,8 @@ static void wooden_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9052,16 +9030,16 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24935), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9082,21 +9060,21 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24893), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9104,10 +9082,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9122,10 +9100,10 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24936), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9134,10 +9112,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9152,15 +9130,15 @@ static void wooden_rc_track_diag_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24894), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9191,8 +9169,8 @@ static void wooden_rc_track_diag_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -9200,7 +9178,7 @@ static void wooden_rc_track_diag_25_deg_up( /** rct2: 0x008AC8E8 */ template static void wooden_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9217,8 +9195,8 @@ static void wooden_rc_track_diag_60_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -9236,29 +9214,29 @@ static void wooden_rc_track_diag_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24911), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 91 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9273,14 +9251,14 @@ static void wooden_rc_track_diag_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24912), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 91 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -9294,8 +9272,8 @@ static void wooden_rc_track_diag_60_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -9303,7 +9281,7 @@ static void wooden_rc_track_diag_60_deg_up( /** rct2: 0x008AC898 */ template static void wooden_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9337,8 +9315,8 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9358,16 +9336,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24923), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9388,21 +9366,21 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24881), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9410,10 +9388,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9428,10 +9406,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24924), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9440,10 +9418,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9458,15 +9436,15 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24882), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9497,8 +9475,8 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -9506,7 +9484,7 @@ static void wooden_rc_track_diag_flat_to_25_deg_up( /** rct2: 0x008AC8C8 */ template static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9523,8 +9501,8 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9542,29 +9520,29 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24899), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9579,14 +9557,14 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24900), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9600,8 +9578,8 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9609,7 +9587,7 @@ static void wooden_rc_track_diag_25_deg_up_to_60_deg_up( /** rct2: 0x008AC8D8 */ template static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9626,8 +9604,8 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -9645,29 +9623,29 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24905), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9682,14 +9660,14 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24906), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -9703,8 +9681,8 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( { 16, 16, 2 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -9712,7 +9690,7 @@ static void wooden_rc_track_diag_60_deg_up_to_25_deg_up( /** rct2: 0x008AC8A8 */ template static void wooden_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9746,8 +9724,8 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9767,16 +9745,16 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24929), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9797,21 +9775,21 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24887), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -9819,10 +9797,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9837,10 +9815,10 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24930), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -9849,10 +9827,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -9867,15 +9845,15 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24888), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -9906,8 +9884,8 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -9915,7 +9893,7 @@ static void wooden_rc_track_diag_25_deg_up_to_flat( /** rct2: 0x008AC918 */ template static void wooden_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -9949,8 +9927,8 @@ static void wooden_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: if (trackElement.HasChain()) @@ -9970,16 +9948,16 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24936), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10000,21 +9978,21 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24894), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10022,10 +10000,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10040,10 +10018,10 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24935), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10052,10 +10030,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10070,15 +10048,15 @@ static void wooden_rc_track_diag_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24893), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 43 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10109,8 +10087,8 @@ static void wooden_rc_track_diag_25_deg_down( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -10118,7 +10096,7 @@ static void wooden_rc_track_diag_25_deg_down( /** rct2: 0x008AC948 */ template static void wooden_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10135,8 +10113,8 @@ static void wooden_rc_track_diag_60_deg_down( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: switch (direction) @@ -10154,29 +10132,29 @@ static void wooden_rc_track_diag_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24912), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 91 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10191,14 +10169,14 @@ static void wooden_rc_track_diag_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24911), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 91 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: switch (direction) @@ -10212,8 +10190,8 @@ static void wooden_rc_track_diag_60_deg_down( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } } @@ -10221,7 +10199,7 @@ static void wooden_rc_track_diag_60_deg_down( /** rct2: 0x008AC8F8 */ template static void wooden_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10274,16 +10252,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24930), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10304,16 +10282,16 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24888), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10324,10 +10302,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10342,10 +10320,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24929), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10354,10 +10332,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10372,10 +10350,10 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24887), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10412,14 +10390,14 @@ static void wooden_rc_track_diag_flat_to_25_deg_down( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AC928 */ template static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10436,8 +10414,8 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( { 16, 16, 2 }, { 0, 0, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -10455,29 +10433,29 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24906), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10492,14 +10470,14 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24905), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -10513,8 +10491,8 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10522,7 +10500,7 @@ static void wooden_rc_track_diag_25_deg_down_to_60_deg_down( /** rct2: 0x008AC938 */ template static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10539,8 +10517,8 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -10558,29 +10536,29 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24900), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10595,14 +10573,14 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24899), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 59 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -10616,8 +10594,8 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -10625,7 +10603,7 @@ static void wooden_rc_track_diag_60_deg_down_to_25_deg_down( /** rct2: 0x008AC908 */ template static void wooden_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10659,8 +10637,8 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: if (trackElement.HasChain()) @@ -10680,16 +10658,16 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24924), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10710,21 +10688,21 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24882), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: if (trackElement.HasChain()) @@ -10732,10 +10710,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10750,10 +10728,10 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24923), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -10762,10 +10740,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]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10780,15 +10758,15 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24881), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: if (trackElement.HasChain()) @@ -10819,8 +10797,8 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( break; } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -10828,7 +10806,7 @@ static void wooden_rc_track_diag_25_deg_down_to_flat( /** rct2: 0x008ACA18 */ template static void wooden_rc_track_diag_flat_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10845,8 +10823,8 @@ static void wooden_rc_track_diag_flat_to_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10864,29 +10842,29 @@ static void wooden_rc_track_diag_flat_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24947), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -10901,14 +10879,14 @@ static void wooden_rc_track_diag_flat_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24948), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -10922,8 +10900,8 @@ static void wooden_rc_track_diag_flat_to_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -10931,7 +10909,7 @@ static void wooden_rc_track_diag_flat_to_left_bank( /** rct2: 0x008AC9F8 */ template static void wooden_rc_track_diag_flat_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -10948,8 +10926,8 @@ static void wooden_rc_track_diag_flat_to_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -10967,29 +10945,29 @@ static void wooden_rc_track_diag_flat_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24953), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11004,14 +10982,14 @@ static void wooden_rc_track_diag_flat_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24954), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -11025,8 +11003,8 @@ static void wooden_rc_track_diag_flat_to_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -11034,7 +11012,7 @@ static void wooden_rc_track_diag_flat_to_right_bank( /** rct2: 0x008ACA08 */ template static void wooden_rc_track_diag_left_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11051,8 +11029,8 @@ static void wooden_rc_track_diag_left_bank_to_flat( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11070,29 +11048,29 @@ static void wooden_rc_track_diag_left_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24954), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11107,14 +11085,14 @@ static void wooden_rc_track_diag_left_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24953), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -11128,8 +11106,8 @@ static void wooden_rc_track_diag_left_bank_to_flat( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -11137,7 +11115,7 @@ static void wooden_rc_track_diag_left_bank_to_flat( /** rct2: 0x008ACA28 */ template static void wooden_rc_track_diag_right_bank_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11154,8 +11132,8 @@ static void wooden_rc_track_diag_right_bank_to_flat( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -11173,29 +11151,29 @@ static void wooden_rc_track_diag_right_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24948), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11210,14 +11188,14 @@ static void wooden_rc_track_diag_right_bank_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24947), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -11231,8 +11209,8 @@ static void wooden_rc_track_diag_right_bank_to_flat( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -11240,7 +11218,7 @@ static void wooden_rc_track_diag_right_bank_to_flat( /** rct2: 0x008ACA58 */ template static void wooden_rc_track_diag_left_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11257,8 +11235,8 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11276,29 +11254,29 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24971), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11313,14 +11291,14 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24972), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11334,8 +11312,8 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11343,7 +11321,7 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_up( /** rct2: 0x008ACA68 */ template static void wooden_rc_track_diag_right_bank_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11360,8 +11338,8 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11379,29 +11357,29 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24977), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11416,14 +11394,14 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24978), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11437,8 +11415,8 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11446,7 +11424,7 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_up( /** rct2: 0x008ACA38 */ template static void wooden_rc_track_diag_25_deg_up_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11463,8 +11441,8 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -11482,29 +11460,29 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24959), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11519,14 +11497,14 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24960), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11540,8 +11518,8 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -11549,7 +11527,7 @@ static void wooden_rc_track_diag_25_deg_up_to_left_bank( /** rct2: 0x008ACA48 */ template static void wooden_rc_track_diag_25_deg_up_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11566,8 +11544,8 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -11585,29 +11563,29 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24965), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) { case 0: - wooden_b_supports_paint_setup(session, 4, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11622,14 +11600,14 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24966), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -11643,8 +11621,8 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } } @@ -11652,7 +11630,7 @@ static void wooden_rc_track_diag_25_deg_up_to_right_bank( /** rct2: 0x008ACA78 */ template static void wooden_rc_track_diag_left_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11686,16 +11664,16 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24966), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -11703,10 +11681,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11721,10 +11699,10 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24965), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -11743,14 +11721,14 @@ static void wooden_rc_track_diag_left_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACA88 */ template static void wooden_rc_track_diag_right_bank_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11784,16 +11762,16 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24960), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -11801,10 +11779,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]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 5, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11819,10 +11797,10 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24959), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_b_supports_paint_setup(session, 2, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); + WoodenBSupportsPaintSetup(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]); + WoodenBSupportsPaintSetup(session, 3, 0, height + 16, session.TrackColours[SCHEME_SUPPORTS]); break; } break; @@ -11841,14 +11819,14 @@ static void wooden_rc_track_diag_right_bank_to_25_deg_down( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACA98 */ template static void wooden_rc_track_diag_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11865,8 +11843,8 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11884,29 +11862,29 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24978), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -11921,14 +11899,14 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24977), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -11942,8 +11920,8 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -11951,7 +11929,7 @@ static void wooden_rc_track_diag_25_deg_down_to_left_bank( /** rct2: 0x008ACAA8 */ template static void wooden_rc_track_diag_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -11968,8 +11946,8 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -11987,29 +11965,29 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24972), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12024,14 +12002,14 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24971), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 35 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12045,8 +12023,8 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } @@ -12054,7 +12032,7 @@ static void wooden_rc_track_diag_25_deg_down_to_right_bank( /** rct2: 0x008AC9D8 */ template static void wooden_rc_track_diag_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12071,8 +12049,8 @@ static void wooden_rc_track_diag_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12090,29 +12068,29 @@ static void wooden_rc_track_diag_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24941), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12127,14 +12105,14 @@ static void wooden_rc_track_diag_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24942), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12148,8 +12126,8 @@ static void wooden_rc_track_diag_left_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12157,7 +12135,7 @@ static void wooden_rc_track_diag_left_bank( /** rct2: 0x008AC9E8 */ template static void wooden_rc_track_diag_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12174,8 +12152,8 @@ static void wooden_rc_track_diag_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -12193,29 +12171,29 @@ static void wooden_rc_track_diag_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24942), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) { case 0: - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12230,14 +12208,14 @@ static void wooden_rc_track_diag_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24941), { -16, -16, height }, { 32, 32, 0 }, { -16, -16, height + 27 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) @@ -12251,8 +12229,8 @@ static void wooden_rc_track_diag_right_bank( { 32, 32, 2 }, { -16, -16, height }); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } @@ -12260,7 +12238,7 @@ static void wooden_rc_track_diag_right_bank( /** rct2: 0x008ACB38 */ template static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12275,7 +12253,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).WithIndex(24824), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12290,7 +12268,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).WithIndex(24837), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12299,7 +12277,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).WithIndex(24828), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12314,23 +12292,23 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24835), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12342,7 +12320,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).WithIndex(24823), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12357,7 +12335,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).WithIndex(24836), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12372,7 +12350,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).WithIndex(24838), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12387,20 +12365,20 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24834), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } @@ -12408,7 +12386,7 @@ static void wooden_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up( /** rct2: 0x008ACB48 */ template static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12429,7 +12407,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).WithIndex(24829), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12438,7 +12416,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).WithIndex(24815), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12453,7 +12431,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).WithIndex(24832), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12462,23 +12440,23 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24819), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12496,7 +12474,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).WithIndex(24830), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12511,7 +12489,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).WithIndex(24831), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12526,7 +12504,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).WithIndex(24833), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12535,20 +12513,20 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24820), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } @@ -12556,7 +12534,7 @@ static void wooden_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up( /** rct2: 0x008ACB58 */ template static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12577,7 +12555,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).WithIndex(24831), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12592,7 +12570,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).WithIndex(24833), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12601,7 +12579,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).WithIndex(24820), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12616,23 +12594,23 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24830), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12644,7 +12622,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).WithIndex(24815), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12659,7 +12637,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).WithIndex(24832), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12668,7 +12646,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).WithIndex(24819), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12683,20 +12661,20 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24829), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } @@ -12704,7 +12682,7 @@ static void wooden_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank( /** rct2: 0x008ACB68 */ template static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12725,7 +12703,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).WithIndex(24834), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12734,7 +12712,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).WithIndex(24823), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12749,7 +12727,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).WithIndex(24836), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12764,23 +12742,23 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24838), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -12798,7 +12776,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).WithIndex(24835), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12807,7 +12785,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).WithIndex(24824), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12822,7 +12800,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).WithIndex(24837), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12831,20 +12809,20 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24828), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } @@ -12852,23 +12830,23 @@ static void wooden_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank( /** rct2: 0x008ACDF8 */ template static void wooden_rc_track_block_brakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { 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]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008ACCB8 */ template static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -12883,7 +12861,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24798), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12898,7 +12876,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24811), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12907,7 +12885,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24802), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12922,23 +12900,23 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24809), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -12950,7 +12928,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24797), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -12965,7 +12943,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24810), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -12980,7 +12958,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24812), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -12995,20 +12973,20 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24808), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -13016,7 +12994,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ACCC8 */ template static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13037,7 +13015,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24803), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13046,7 +13024,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24789), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13061,7 +13039,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24806), { 0, 6, height }, { 32, 20, 0 }, { 0, 6, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13070,23 +13048,23 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24793), { 0, 6, height }, { 32, 20, 2 }, { 0, 6, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) @@ -13104,7 +13082,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24804), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13119,7 +13097,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24805), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13134,7 +13112,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24807), { 6, 0, height }, { 20, 32, 0 }, { 6, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13143,20 +13121,20 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(24794), { 6, 0, height }, { 20, 32, 2 }, { 6, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -13164,7 +13142,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_up( /** rct2: 0x008ACCD8 */ template static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -13175,7 +13153,7 @@ static void wooden_rc_track_left_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008ACCE8 */ template static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -13186,7 +13164,7 @@ static void wooden_rc_track_right_banked_quarter_turn_3_25_deg_down( /** rct2: 0x008ACC38 */ template static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13201,7 +13179,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25187), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13216,7 +13194,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25218), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13225,7 +13203,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25197), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13234,20 +13212,20 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25202), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -13259,7 +13237,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25188), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13274,7 +13252,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25219), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13283,7 +13261,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25198), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13298,15 +13276,14 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25225), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -13318,7 +13295,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25189), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13333,7 +13310,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25220), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 59 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13342,7 +13319,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25199), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13357,21 +13334,21 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25226), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 59 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -13383,7 +13360,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25190), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13398,7 +13375,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25221), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13413,7 +13390,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25223), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13428,15 +13405,14 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25227), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -13448,7 +13424,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25191), { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13463,7 +13439,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25222), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13478,7 +13454,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25224), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13493,20 +13469,20 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25228), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 2: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -13514,7 +13490,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ACC48 */ template static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -13529,7 +13505,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25167), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13538,7 +13514,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25172), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13553,7 +13529,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25213), { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13562,20 +13538,20 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25182), { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -13593,7 +13569,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25207), { 0, 0, height }, { 32, 16, 0 }, { 0, 16, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13602,7 +13578,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25173), { 0, 0, height }, { 32, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13617,7 +13593,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25214), { 0, 0, height }, { 32, 16, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13626,15 +13602,14 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25183), { 0, 0, height }, { 32, 16, 2 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -13652,7 +13627,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25208), { 0, 0, height }, { 16, 16, 0 }, { 0, 0, height + 59 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13661,7 +13636,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25174), { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13676,7 +13651,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25215), { 0, 0, height }, { 16, 16, 0 }, { 16, 16, height + 59 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13685,21 +13660,21 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25184), { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: switch (direction) @@ -13717,7 +13692,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25209), { 0, 0, height }, { 16, 32, 0 }, { 16, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13732,7 +13707,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25211), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13747,7 +13722,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25216), { 0, 0, height }, { 16, 32, 0 }, { 0, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13756,15 +13731,14 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25185), { 0, 0, height }, { 16, 32, 2 }, { 16, 0, height }); - wooden_a_supports_paint_setup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 6: switch (direction) @@ -13782,7 +13756,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25210), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13797,7 +13771,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25212), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13812,7 +13786,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25217), { 0, 0, height }, { 27, 32, 0 }, { 2, 0, height + 67 }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13821,20 +13795,20 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25186), { 0, 0, height }, { 27, 32, 2 }, { 2, 0, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; } switch (direction) { case 0: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 1: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } @@ -13842,7 +13816,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_up( /** rct2: 0x008ACC58 */ template static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -13853,7 +13827,7 @@ static void wooden_rc_track_left_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008ACC68 */ template static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -13864,7 +13838,7 @@ static void wooden_rc_track_right_banked_quarter_turn_5_25_deg_down( /** rct2: 0x008ACCF8 */ template static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -13876,7 +13850,7 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25127), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13885,7 +13859,7 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25128), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13894,7 +13868,7 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25129), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13903,25 +13877,25 @@ static void wooden_rc_track_25_deg_up_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25130), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACD08 */ template static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -13933,7 +13907,7 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25131), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13942,7 +13916,7 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25132), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -13951,7 +13925,7 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25133), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -13960,25 +13934,25 @@ static void wooden_rc_track_25_deg_up_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25134), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACD18 */ template static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -13990,7 +13964,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25135), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -13999,7 +13973,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25136), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14008,7 +13982,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25137), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14017,25 +13991,25 @@ static void wooden_rc_track_left_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25138), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACD28 */ template static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14047,7 +14021,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25139), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14056,7 +14030,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25140), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14065,7 +14039,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25141), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14074,25 +14048,25 @@ static void wooden_rc_track_right_banked_25_deg_up_to_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25142), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008ACD38 */ template static void wooden_rc_track_25_deg_down_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14102,7 +14076,7 @@ static void wooden_rc_track_25_deg_down_to_left_banked_25_deg_down( /** rct2: 0x008ACD48 */ template static void wooden_rc_track_25_deg_down_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14112,7 +14086,7 @@ static void wooden_rc_track_25_deg_down_to_right_banked_25_deg_down( /** rct2: 0x008ACD58 */ template static void wooden_rc_track_left_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14122,7 +14096,7 @@ static void wooden_rc_track_left_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008ACD68 */ template static void wooden_rc_track_right_banked_25_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14132,7 +14106,7 @@ static void wooden_rc_track_right_banked_25_deg_down_to_25_deg_down( /** rct2: 0x008ACD78 */ template static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14144,7 +14118,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25143), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14159,7 +14133,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25159), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14174,7 +14148,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25160), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14183,25 +14157,25 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25146), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ACD88 */ template static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14213,7 +14187,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25147), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14228,7 +14202,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25161), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14243,7 +14217,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25162), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14252,25 +14226,25 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25150), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ACD98 */ template static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14282,7 +14256,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25151), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14297,7 +14271,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25163), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14312,7 +14286,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25164), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14321,25 +14295,25 @@ static void wooden_rc_track_left_banked_25_deg_up_to_left_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25154), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ACDA8 */ template static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14351,7 +14325,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25155), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14366,7 +14340,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25165), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14381,7 +14355,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25166), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14390,25 +14364,25 @@ static void wooden_rc_track_right_banked_25_deg_up_to_right_banked_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25158), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ACDB8 */ template static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14418,7 +14392,7 @@ static void wooden_rc_track_left_banked_flat_to_left_banked_25_deg_down( /** rct2: 0x008ACDC8 */ template static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14428,7 +14402,7 @@ static void wooden_rc_track_right_banked_flat_to_right_banked_25_deg_down( /** rct2: 0x008ACDD8 */ template static void wooden_rc_track_left_banked_25_deg_down_to_left_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14438,7 +14412,7 @@ static void wooden_rc_track_left_banked_25_deg_down_to_left_banked_flat( /** rct2: 0x008ACDE8 */ template static void wooden_rc_track_right_banked_25_deg_down_to_right_banked_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14448,7 +14422,7 @@ static void wooden_rc_track_right_banked_25_deg_down_to_right_banked_flat( /** rct2: 0x008ACBB8 */ template static void wooden_rc_track_flat_to_left_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14460,7 +14434,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25091), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14475,7 +14449,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25107), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14490,7 +14464,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25108), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14499,25 +14473,25 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25094), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ACBC8 */ template static void wooden_rc_track_flat_to_right_banked_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14529,7 +14503,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25095), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14544,7 +14518,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25109), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14559,7 +14533,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25110), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14568,25 +14542,25 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_up( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25098), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008ACBD8 */ template static void wooden_rc_track_left_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14598,7 +14572,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25099), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14613,7 +14587,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25111), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14628,7 +14602,7 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25112), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14637,25 +14611,25 @@ static void wooden_rc_track_left_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25102), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ACBE8 */ template static void wooden_rc_track_right_banked_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -14667,7 +14641,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25103), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: PaintAddImageAsParentRotated( @@ -14682,7 +14656,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25113), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: PaintAddImageAsParentRotated( @@ -14697,7 +14671,7 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25114), { 0, 0, height }, { 32, 1, 9 }, { 0, 26, height + 5 }); - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: PaintAddImageAsParentRotated( @@ -14706,25 +14680,25 @@ static void wooden_rc_track_right_banked_25_deg_up_to_flat( PaintAddImageAsChildRotated( session, direction, wooden_rc_get_rails_colour(session).WithIndex(25106), { 0, 0, height }, { 32, 25, 2 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008ACBF8 */ template static void wooden_rc_track_flat_to_left_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14734,7 +14708,7 @@ static void wooden_rc_track_flat_to_left_banked_25_deg_down( /** rct2: 0x008ACC08 */ template static void wooden_rc_track_flat_to_right_banked_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14744,7 +14718,7 @@ static void wooden_rc_track_flat_to_right_banked_25_deg_down( /** rct2: 0x008ACC18 */ template static void wooden_rc_track_left_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14754,7 +14728,7 @@ static void wooden_rc_track_left_banked_25_deg_down_to_flat( /** rct2: 0x008ACC28 */ template static void wooden_rc_track_right_banked_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -14763,7 +14737,7 @@ static void wooden_rc_track_right_banked_25_deg_down_to_flat( template static void wooden_rc_track_booster( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -14781,10 +14755,10 @@ 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]); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } template TRACK_PAINT_FUNCTION get_track_paint_function_wooden_and_classic_wooden_rc(int32_t trackType) diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.h b/src/openrct2/ride/coaster/WoodenRollerCoaster.h index 185b4ca564..e9f5eca76e 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.h +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.h @@ -24,7 +24,7 @@ struct sprite_bb_2 CoordsXYZ bb_size; }; -template ImageId wooden_rc_get_track_colour(const paint_session& session) +template ImageId wooden_rc_get_track_colour(const PaintSession& session) { if (isClassic) return session.TrackColours[SCHEME_TRACK]; @@ -34,11 +34,11 @@ template ImageId wooden_rc_get_track_colour(const paint_session& : session.TrackColours[SCHEME_TRACK].WithPrimary(session.TrackColours[SCHEME_SUPPORTS].GetPrimary()); } -ImageId wooden_rc_get_rails_colour(paint_session& session); +ImageId wooden_rc_get_rails_colour(PaintSession& session); template -paint_struct* wooden_rc_track_paint( - paint_session& session, uint32_t imageIdTrack, uint32_t imageIdRails, uint8_t direction, int8_t x_offset, int8_t y_offset, +PaintStruct* wooden_rc_track_paint( + PaintSession& session, uint32_t imageIdTrack, uint32_t imageIdRails, uint8_t direction, 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) { @@ -55,7 +55,7 @@ paint_struct* wooden_rc_track_paint( { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }); } -template void wooden_rc_track_paint_bb(paint_session& session, const sprite_bb_2* bb, int16_t height) +template void wooden_rc_track_paint_bb(PaintSession& session, const sprite_bb_2* bb, int16_t height) { if (bb->sprite_id_a == 0) return; @@ -68,8 +68,8 @@ template void wooden_rc_track_paint_bb(paint_session& session, c { ImageId railsImageId = wooden_rc_get_rails_colour(session).WithIndex(bb->sprite_id_b); PaintAddImageAsChild( - session, railsImageId, { bb->offset.x, bb->offset.y, height + bb->offset.z }, bb->bb_size, - { bb->bb_offset.x, bb->bb_offset.y, height + bb->bb_offset.z }); + session, railsImageId, { bb->offset.x, bb->offset.y, height + bb->offset.z }, + { { bb->bb_offset, height + bb->bb_offset.z }, bb->bb_size }); } } diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index a85aec0a75..5ebffd4e21 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -122,7 +122,7 @@ enum /** rct2: 0x008A5464 */ static void wooden_wild_mouse_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -134,19 +134,19 @@ static void wooden_wild_mouse_track_flat( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 1 }); - 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( + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D4, direction), - height, 0x20); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D4, direction), height, + 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void wooden_wild_mouse_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -162,16 +162,16 @@ static void wooden_wild_mouse_track_station( PaintAddImageAsChildRotated( session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][0]), { 0, 6, height }, { 32, 20, 1 }, { 0, 0, height }); - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A5474 */ static void wooden_wild_mouse_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -193,24 +193,24 @@ static void wooden_wild_mouse_track_25_deg_up( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[isChained][direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 2, height }, { 32, 25, 1 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, direction & 1, 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008A5484 */ static void wooden_wild_mouse_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -240,24 +240,24 @@ static void wooden_wild_mouse_track_60_deg_up( session, direction, imageId, { 0, 6, height }, { 2, 24, 93 }, { 28, 4, height - 16 }); } - wooden_a_supports_paint_setup(session, direction & 1, 21 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x008A5494 */ static void wooden_wild_mouse_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -279,24 +279,24 @@ static void wooden_wild_mouse_track_flat_to_25_deg_up( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[isChained][direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 2, height }, { 32, 25, 1 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008A54A4 */ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -330,23 +330,23 @@ static void wooden_wild_mouse_track_25_deg_up_to_60_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 2, 43 }, { 0, 4, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 13 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void wooden_wild_mouse_track_60_deg_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -380,24 +380,24 @@ static void wooden_wild_mouse_track_60_deg_to_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 2, 43 }, { 0, 4, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 17 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A54C4 */ static void wooden_wild_mouse_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[2][4] = { @@ -419,24 +419,24 @@ static void wooden_wild_mouse_track_25_deg_up_to_flat( auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[isChained][direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 2, height }, { 32, 25, 1 }, { 0, 3, height }); - wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008A54D4 */ static void wooden_wild_mouse_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_wild_mouse_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -444,7 +444,7 @@ static void wooden_wild_mouse_track_25_deg_down( /** rct2: 0x008A54E4 */ static void wooden_wild_mouse_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { wooden_wild_mouse_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -452,7 +452,7 @@ static void wooden_wild_mouse_track_60_deg_down( /** rct2: 0x008A54F4 */ static void wooden_wild_mouse_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -460,7 +460,7 @@ static void wooden_wild_mouse_track_flat_to_25_deg_down( /** rct2: 0x008A5504 */ static void wooden_wild_mouse_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -468,7 +468,7 @@ static void wooden_wild_mouse_track_25_deg_down_to_60_deg_down( /** rct2: 0x008A5514 */ static void wooden_wild_mouse_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -476,17 +476,17 @@ static void wooden_wild_mouse_track_60_deg_down_to_25_deg_down( /** rct2: 0x008A5524 */ static void wooden_wild_mouse_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void wooden_wild_mouse_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][3] = { + static constexpr const SpriteBb imageIds[4][3] = { { { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_0, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_1, { 16, 16, 0 }, { 0, 0, 0 }, { 16, 16, 1 } }, @@ -518,7 +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]); + WoodenASupportsPaintSetup(session, supportType[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -535,12 +535,12 @@ static void wooden_wild_mouse_track_right_quarter_turn_3( blockedSegments = SEGMENTS_ALL; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void wooden_wild_mouse_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -548,7 +548,7 @@ static void wooden_wild_mouse_track_left_quarter_turn_3( } static void wooden_wild_mouse_track_left_quarter_turn_1( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4] = { @@ -575,15 +575,15 @@ static void wooden_wild_mouse_track_left_quarter_turn_1( PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); break; } - wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008A55D4 */ static void wooden_wild_mouse_track_right_quarter_turn_1( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction - 1) & 3, height, trackElement); @@ -591,7 +591,7 @@ static void wooden_wild_mouse_track_right_quarter_turn_1( /** rct2: 0x008A55E4 */ static void wooden_wild_mouse_track_flat_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -624,24 +624,24 @@ static void wooden_wild_mouse_track_flat_to_60_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 2, 43 }, { 0, 4, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 29 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 29 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x008A55F4 */ static void wooden_wild_mouse_track_60_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -674,24 +674,24 @@ static void wooden_wild_mouse_track_60_deg_up_to_flat( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 6, height }, { 32, 2, 43 }, { 0, 4, height }); } - wooden_a_supports_paint_setup(session, direction & 1, 33 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 33 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x008A5604 */ static void wooden_wild_mouse_track_flat_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -699,7 +699,7 @@ static void wooden_wild_mouse_track_flat_to_60_deg_down( /** rct2: 0x008A5614 */ static void wooden_wild_mouse_track_60_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); diff --git a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h index 67e728e76a..72ad1e497b 100644 --- a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h @@ -19,8 +19,8 @@ constexpr const RideTypeDescriptor CorkscrewRollerCoasterRTD = { SET_FIELD(AlternateType, RIDE_TYPE_NULL), SET_FIELD(Category, RIDE_CATEGORY_ROLLERCOASTER), - SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_SMALL, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES,TRACK_BOOSTER}), - SET_FIELD(ExtraTrackPieces, {TRACK_SLOPE_STEEP_LONG, TRACK_TWIST}), + SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_SMALL, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES,TRACK_BOOSTER, TRACK_SLOPE_STEEP_LONG}), + SET_FIELD(ExtraTrackPieces, {TRACK_TWIST}), SET_FIELD(CoveredTrackPieces, {}), SET_FIELD(StartTrackPiece, TrackElemType::EndStation), SET_FIELD(TrackPaintFunction, get_track_paint_function_corkscrew_rc), diff --git a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h index 8428c6c96c..cc935770a6 100644 --- a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h @@ -20,8 +20,8 @@ constexpr const RideTypeDescriptor FlyingRollerCoasterRTD = { SET_FIELD(AlternateType, RIDE_TYPE_FLYING_ROLLER_COASTER_ALT), SET_FIELD(Category, RIDE_CATEGORY_ROLLERCOASTER), - SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_HELIX_SMALL, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_INLINE_TWIST_UNINVERTED, TRACK_FLYING_HALF_LOOP_UNINVERTED_UP, TRACK_QUARTER_LOOP_UNINVERTED_UP, TRACK_FLYING_LARGE_HALF_LOOP_UNINVERTED_UP, TRACK_SLOPE_VERTICAL}), - SET_FIELD(ExtraTrackPieces, {TRACK_BOOSTER, TRACK_SLOPE_STEEP_LONG, TRACK_FLYING_HALF_LOOP_UNINVERTED_DOWN}), + SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_HELIX_SMALL, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_INLINE_TWIST_UNINVERTED, TRACK_FLYING_HALF_LOOP_UNINVERTED_UP, TRACK_QUARTER_LOOP_UNINVERTED_UP, TRACK_FLYING_LARGE_HALF_LOOP_UNINVERTED_UP, TRACK_SLOPE_VERTICAL, TRACK_SLOPE_CURVE_BANKED}), + SET_FIELD(ExtraTrackPieces, {TRACK_BOOSTER, TRACK_SLOPE_STEEP_LONG, TRACK_FLYING_LARGE_HALF_LOOP_UNINVERTED_DOWN, TRACK_FLYING_HALF_LOOP_UNINVERTED_DOWN, TRACK_STATION_END, TRACK_VERTICAL_LOOP, TRACK_POWERED_LIFT}), SET_FIELD(CoveredTrackPieces, {}), SET_FIELD(StartTrackPiece, TrackElemType::EndStation), SET_FIELD(TrackPaintFunction, get_track_paint_function_flying_rc), @@ -65,8 +65,8 @@ constexpr const RideTypeDescriptor FlyingRollerCoasterAltRTD = { SET_FIELD(AlternateType, RIDE_TYPE_NULL), SET_FIELD(Category, RIDE_CATEGORY_NONE), - SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_HELIX_LARGE, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_INLINE_TWIST_INVERTED, TRACK_FLYING_HALF_LOOP_INVERTED_DOWN, TRACK_QUARTER_LOOP_INVERTED_DOWN, TRACK_FLYING_LARGE_HALF_LOOP_INVERTED_DOWN}), - SET_FIELD(ExtraTrackPieces, {TRACK_FLYING_HALF_LOOP_INVERTED_UP}), + SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_HELIX_LARGE, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_INLINE_TWIST_INVERTED, TRACK_FLYING_HALF_LOOP_INVERTED_DOWN, TRACK_QUARTER_LOOP_INVERTED_DOWN, TRACK_FLYING_LARGE_HALF_LOOP_INVERTED_DOWN, TRACK_BOOSTER}), + SET_FIELD(ExtraTrackPieces, {TRACK_FLYING_LARGE_HALF_LOOP_INVERTED_UP, TRACK_FLYING_HALF_LOOP_INVERTED_UP}), SET_FIELD(CoveredTrackPieces, {}), SET_FIELD(StartTrackPiece, TrackElemType::EndStation), SET_FIELD(TrackPaintFunction, nullptr), diff --git a/src/openrct2/ride/coaster/meta/HybridCoaster.h b/src/openrct2/ride/coaster/meta/HybridCoaster.h index 8890d2cecc..122a2a4f32 100644 --- a/src/openrct2/ride/coaster/meta/HybridCoaster.h +++ b/src/openrct2/ride/coaster/meta/HybridCoaster.h @@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor HybridCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 43, 24, 13, 13}), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 5, 8 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftRMC, 5, 8 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_hybrid_coaster), SET_FIELD(RatingsMultipliers, { 52, 36, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h index 5cdcf06ab1..fe18e40e7f 100644 --- a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h @@ -20,7 +20,7 @@ constexpr const RideTypeDescriptor InvertedRollerCoasterRTD = SET_FIELD(AlternateType, RIDE_TYPE_NULL), SET_FIELD(Category, RIDE_CATEGORY_ROLLERCOASTER), SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_TWIST, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_LARGE, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_HALF_LOOP_LARGE, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING}), - SET_FIELD(ExtraTrackPieces, {}), + SET_FIELD(ExtraTrackPieces, {TRACK_BOOSTER}), SET_FIELD(CoveredTrackPieces, {}), SET_FIELD(StartTrackPiece, TrackElemType::EndStation), SET_FIELD(TrackPaintFunction, get_track_paint_function_inverted_rc), @@ -29,7 +29,7 @@ constexpr const RideTypeDescriptor InvertedRollerCoasterRTD = RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES | RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS | RIDE_TYPE_FLAG_IS_SUSPENDED), SET_FIELD(RideModes, EnumsToFlags(RideMode::ContinuousCircuit, RideMode::ContinuousCircuitBlockSectioned, RideMode::PoweredLaunchPasstrough, RideMode::PoweredLaunch)), SET_FIELD(DefaultMode, RideMode::ContinuousCircuit), - SET_FIELD(OperatingSettings, { 7, 27, 0, 0, 0, 0 }), + SET_FIELD(OperatingSettings, { 7, 27, 0, 0, 38, 0 }), SET_FIELD(Naming, { STR_RIDE_NAME_INVERTED_ROLLER_COASTER, STR_RIDE_DESCRIPTION_INVERTED_ROLLER_COASTER }), SET_FIELD(NameConvention, { RideComponentType::Train, RideComponentType::Track, RideComponentType::Station }), SET_FIELD(EnumName, nameof(RIDE_TYPE_INVERTED_ROLLER_COASTER)), diff --git a/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h b/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h index a6c7a2f858..118647ab0f 100644 --- a/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h @@ -34,7 +34,7 @@ constexpr const RideTypeDescriptor SingleRailRollerCoasterRTD = SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE)), SET_FIELD(Heights, { 28, 24, 5, 7}), SET_FIELD(MaxMass, 18), - SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftClassic, 5, 8 }), + SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::LiftRMC, 5, 8 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_single_rail_roller_coaster), SET_FIELD(RatingsMultipliers, { 52, 36, 10 }), SET_FIELD(UpkeepCosts, { 40, 20, 80, 10, 3, 10 }), diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index bfe70d0d56..950c393c07 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -157,7 +157,7 @@ static constexpr const uint32_t CarRideTrackPiecesQuarterTurn3Tiles[4][3] = { /** rct2: 0x006F72C8 */ static void PaintCarRideTrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPiecesFlat[direction]); @@ -173,136 +173,136 @@ static void PaintCarRideTrackFlat( if (direction == 0 || direction == 2) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } else { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006F72D8 */ static void PaintCarRideTrack25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPieces25DegUp[direction]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 2, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 2, height }, { { 0, 6, height }, { 32, 20, 1 } }); } else { - PaintAddImageAsParent(session, imageId, { 2, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, imageId, { 2, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x006F72E8 */ static void PaintCarRideTrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPiecesFlatTo25DegUp[direction]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 2, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 2, height }, { { 0, 6, height }, { 32, 20, 1 } }); } else { - PaintAddImageAsParent(session, imageId, { 2, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, imageId, { 2, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x006F72F8 */ static void PaintCarRideTrack25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPieces25DegUpToFlat[direction]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 2, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 2, height }, { { 0, 6, height }, { 32, 20, 1 } }); } else { - PaintAddImageAsParent(session, imageId, { 2, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, imageId, { 2, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_12); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_12); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_12); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_12); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_0); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x006F7308 */ static void PaintCarRideTrack25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrack25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -310,7 +310,7 @@ static void PaintCarRideTrack25DegDown( /** rct2: 0x006F7318 */ static void PaintCarRideTrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrack25DegUpToFlat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -318,7 +318,7 @@ static void PaintCarRideTrackFlatTo25DegDown( /** rct2: 0x006F7328 */ static void PaintCarRideTrack25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -326,7 +326,7 @@ static void PaintCarRideTrack25DegDownToFlat( /** rct2: 0x006F7338, 0x006F7348, 0x006F7358 */ static void PaintCarRideStation( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -334,53 +334,53 @@ static void PaintCarRideStation( if (direction == 0 || direction == 2) { imageId = session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_B_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { { 0, 2, height }, { 32, 28, 1 } }); } else if (direction == 1 || direction == 3) { imageId = session.TrackColours[SCHEME_MISC].WithIndex(SPR_STATION_BASE_B_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { { 2, 0, height }, { 28, 32, 1 } }); } imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPiecesFlat[direction]); if (direction == 0 || direction == 2) { - PaintAddImageAsChild(session, imageId, { 0, 6, height }, { 32, 20, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 6, height }, { { 0, 0, height }, { 32, 20, 1 } }); } else { - PaintAddImageAsChild(session, imageId, { 6, 0, height }, { 20, 32, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 6, 0, height }, { { 0, 0, height }, { 20, 32, 1 } }); } if (direction == 0 || direction == 2) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 0 || direction == 2) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006F7378 */ static void PaintCarRideTrackRightQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -392,7 +392,7 @@ static void PaintCarRideTrackRightQuarterTurn3Tiles( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -409,14 +409,14 @@ static void PaintCarRideTrackRightQuarterTurn3Tiles( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006F7368 */ static void PaintCarRideTrackLeftQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -425,38 +425,41 @@ static void PaintCarRideTrackLeftQuarterTurn3Tiles( /** rct2: 0x006F7388 */ static void PaintCarRideTrackLeftQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPiecesLeftQuarterTurn1Tile[direction]); + CoordsXYZ offset; switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, { 6, 0, height }, { 26, 24, 1 }, { 6, 2, height }); + PaintAddImageAsParent(session, imageId, { 6, 0, height }, { { 6, 2, height }, { 26, 24, 1 } }); break; case 1: - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 26, 1 }); + offset = { 0, 0, height }; + PaintAddImageAsParent(session, imageId, offset, { offset, { 26, 26, 1 } }); break; case 2: - PaintAddImageAsParent(session, imageId, { 0, 6, height }, { 24, 26, 1 }, { 2, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 6, height }, { { 2, 6, height }, { 24, 26, 1 } }); break; case 3: - PaintAddImageAsParent(session, imageId, { 6, 6, height }, { 24, 24, 1 }); + offset = { 6, 6, height }; + PaintAddImageAsParent(session, imageId, offset, { offset, { 24, 24, 1 } }); break; } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006F7398 */ static void PaintCarRideTrackRightQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrackLeftQuarterTurn1Tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); @@ -464,7 +467,7 @@ static void PaintCarRideTrackRightQuarterTurn1Tile( /** rct2: 0x006F73A8 */ static void PaintCarRideTrackSpinningTunnel( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPiecesFlat[direction]); @@ -482,22 +485,22 @@ static void PaintCarRideTrackSpinningTunnel( if (direction == 0 || direction == 2) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } else { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006F73B8 */ static void PaintCarRideTrack60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPieces60DegUp[direction]); @@ -505,59 +508,59 @@ static void PaintCarRideTrack60DegUp( switch (direction) { case 0: - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); break; case 1: - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 98 }, { 27, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 98 } }); break; case 2: - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 98 } }); break; case 3: - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); break; } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 56, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 56, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 56, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 56, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x006F73C8 */ static void PaintCarRideTrack25DegUpTo60DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPieces25DegUpTo60DegUp[direction][0]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } if (CarRideTrackPieces25DegUpTo60DegUp[direction][1] != 0) @@ -566,54 +569,54 @@ static void PaintCarRideTrack25DegUpTo60DegUp( if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 66 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 66 }, { 27, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 66 } }); } } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x006F73D8 */ static void PaintCarRideTrack60DegUpTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPieces60DegUpTo25DegUp[direction][0]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); } if (CarRideTrackPieces60DegUpTo25DegUp[direction][1] != 0) @@ -622,43 +625,43 @@ static void PaintCarRideTrack60DegUpTo25DegUp( if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 27, height }, { 32, 1, 66 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 66 }, { 27, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 27, 0, height }, { 1, 32, 66 } }); } } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 24, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 24, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x006F73E8 */ static void PaintCarRideTrack60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrack60DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -666,7 +669,7 @@ static void PaintCarRideTrack60DegDown( /** rct2: 0x006F73F8 */ static void PaintCarRideTrack25DegDownTo60DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrack60DegUpTo25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -674,7 +677,7 @@ static void PaintCarRideTrack25DegDownTo60DegDown( /** rct2: 0x006F7408 */ static void PaintCarRideTrack60DegDownTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintCarRideTrack25DegUpTo60DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -682,7 +685,7 @@ static void PaintCarRideTrack60DegDownTo25DegDown( /** rct2: 0x006F7418 */ static void PaintCarRideTrackLogBumps( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(CarRideTrackPiecesLogBumps[direction]); @@ -698,17 +701,17 @@ static void PaintCarRideTrackLogBumps( if (direction == 0 || direction == 2) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } else { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index 91d31affcc..cd8ce3d40d 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -17,7 +17,7 @@ #include "../Track.h" #include "../TrackPaint.h" -static void PaintCircusTent(paint_session& session, const Ride& ride, uint8_t direction, int8_t al, int8_t cl, uint16_t height) +static void PaintCircusTent(PaintSession& session, const Ride& ride, uint8_t direction, int8_t al, int8_t cl, uint16_t height) { auto rideEntry = ride.GetRideEntry(); if (rideEntry == nullptr) @@ -32,28 +32,29 @@ static void PaintCircusTent(paint_session& session, const Ride& ride, uint8_t di auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); auto imageFlags = session.TrackColours[SCHEME_MISC]; - if (!imageFlags.HasPrimary()) + if (imageFlags.ToUInt32() != IMAGE_TYPE_REMAP) { imageTemplate = imageFlags; } auto imageIndex = rideEntry->Cars[0].base_image_id + direction; PaintAddImageAsParent( - session, imageTemplate.WithIndex(imageIndex), { al, cl, height + 3 }, { 24, 24, 47 }, { al + 16, cl + 16, height + 3 }); + session, imageTemplate.WithIndex(imageIndex), { al, cl, height + 3 }, + { { al + 16, cl + 16, height + 3 }, { 24, 24, 47 } }); session.CurrentlyDrawnEntity = nullptr; session.InteractionType = ViewportInteractionItem::Ride; } static void PaintCircus( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -106,9 +107,9 @@ static void PaintCircus( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } TRACK_PAINT_FUNCTION GetTrackPaintFunctionCircus(int32_t trackType) diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index f79febd5fa..73ce715fc4 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -46,7 +46,7 @@ static constexpr const BoundBoxXY CrookedHouseData[] = { * rct2: 0x0088ABA4 */ static void PaintCrookedHouseStructure( - paint_session& session, uint8_t direction, int32_t x_offset, int32_t y_offset, uint32_t segment, int32_t height) + PaintSession& session, uint8_t direction, int32_t x_offset, int32_t y_offset, uint32_t segment, int32_t height) { const auto* tileElement = session.CurrentlyDrawnTileElement; if (tileElement == nullptr) @@ -74,21 +74,21 @@ static void PaintCrookedHouseStructure( auto imageTemplate = session.TrackColours[SCHEME_MISC]; auto imageIndex = rideEntry->Cars[0].base_image_id + direction; PaintAddImageAsParent( - session, imageTemplate.WithIndex(imageIndex), { x_offset, y_offset, height + 3 }, { boundBox.length, 127 }, - { boundBox.offset, height + 3 }); + session, imageTemplate.WithIndex(imageIndex), { x_offset, y_offset, height + 3 }, + { { boundBox.offset, height + 3 }, { boundBox.length, 127 } }); session.CurrentlyDrawnEntity = nullptr; } static void PaintCrookedHouse( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -132,9 +132,9 @@ static void PaintCrookedHouse( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } TRACK_PAINT_FUNCTION GetTrackPaintFunctionCrookedHouse(int32_t trackType) diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index c83535de56..1e76f715b3 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -34,7 +34,7 @@ static constexpr const uint32_t DodgemsFenceSprites[] = { SprDodgemsFenceTopLeft, }; -static void PaintDodgemsRoof(paint_session& session, int32_t height, int32_t offset) +static void PaintDodgemsRoof(PaintSession& session, int32_t height, int32_t offset) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SprDodgemsRoofFrame + offset)); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 2 }); @@ -44,21 +44,21 @@ static void PaintDodgemsRoof(paint_session& session, int32_t height, int32_t off } static void PaintDodgems( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { auto imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SprDodgemsFloor); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 1, height }, { 30, 30, 1 } }); track_paint_util_paint_fences( session, edges, session.MapPosition, trackElement, ride, session.TrackColours[SCHEME_SUPPORTS], height, @@ -96,8 +96,8 @@ static void PaintDodgems( } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, height + 36, 0x20); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, height + 36, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 7ccd4d90df..5e10cc326f 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -42,7 +42,7 @@ static constexpr BoundBoxXY FerrisWheelData[] = { }; static void PaintFerrisWheelRiders( - paint_session& session, const rct_ride_entry& rideEntry, const Vehicle& vehicle, uint8_t direction, const CoordsXYZ offset, + PaintSession& session, const rct_ride_entry& rideEntry, const Vehicle& vehicle, uint8_t direction, const CoordsXYZ offset, const BoundBoxXYZ& bb) { for (int32_t i = 0; i < 32; i += 2) @@ -59,7 +59,7 @@ static void PaintFerrisWheelRiders( } static void PaintFerrisWheelStructure( - paint_session& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) { auto rideEntry = ride.GetRideEntry(); if (rideEntry == nullptr) @@ -79,7 +79,7 @@ static void PaintFerrisWheelStructure( auto supportsImageTemplate = session.TrackColours[SCHEME_TRACK]; auto wheelImageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); auto wheelImageFlags = session.TrackColours[SCHEME_MISC]; - if (!wheelImageFlags.HasPrimary()) + if (wheelImageFlags.ToUInt32() != IMAGE_TYPE_REMAP) { wheelImageTemplate = wheelImageFlags; } @@ -102,7 +102,7 @@ static void PaintFerrisWheelStructure( } static void PaintFerrisWheel( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -117,7 +117,7 @@ static void PaintFerrisWheel( edges = Edges1X4NeSw[relativeTrackSequence]; } - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -130,23 +130,23 @@ static void PaintFerrisWheel( if (edges & EDGE_NW && track_paint_util_has_fence(EDGE_NW, session.MapPosition, trackElement, ride, rotation)) { imageId = colourFlags.WithIndex(SPR_FENCE_ROPE_NW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 1, 7 }, { 0, 2, height + 2 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 2, height + 2 }, { 32, 1, 7 } }); } if (edges & EDGE_NE && track_paint_util_has_fence(EDGE_NE, session.MapPosition, trackElement, ride, rotation)) { imageId = colourFlags.WithIndex(SPR_FENCE_ROPE_NE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 2, 0, height + 2 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 0, height + 2 }, { 1, 32, 7 } }); } 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 = colourFlags.WithIndex(SPR_FENCE_ROPE_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 0, 29, height + 3 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 29, height + 3 }, { 28, 1, 7 } }); } if (edges & EDGE_SW && track_paint_util_has_fence(EDGE_SW, session.MapPosition, trackElement, ride, rotation)) { imageId = colourFlags.WithIndex(SPR_FENCE_ROPE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 30, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 30, 0, height + 2 }, { 1, 32, 7 } }); } switch (relativeTrackSequence) @@ -165,8 +165,8 @@ static void PaintFerrisWheel( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 176, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 176, 0x20); } TRACK_PAINT_FUNCTION GetTrackPaintFunctionFerrisWheel(int32_t trackType) diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index a5866d8c03..1220872d6f 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -35,29 +35,29 @@ static constexpr const uint32_t FlyingSaucersFenceSprites[] = { * rct2: 0x008873D8 */ static void paint_flying_saucers( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprFlyingSaucersFloor); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 1, 1, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 1, height }, { 30, 30, 1 } }); } track_paint_util_paint_fences( session, edges, session.MapPosition, trackElement, ride, session.TrackColours[SCHEME_TRACK], height, FlyingSaucersFenceSprites, session.CurrentRotation); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index 3bc6265056..cdb65c0e0c 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -177,7 +177,7 @@ static uint8_t GetTunnelDoorsImageStraightFlat(const TrackElement& trackElement, /** rct2: 0x00770BEC */ static void PaintGhostTrainTrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(GhostTrainTrackPiecesFlat[direction]); @@ -185,21 +185,21 @@ static void PaintGhostTrainTrackFlat( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); auto tunnelImage = GetTunnelDoorsImageStraightFlat(trackElement, direction); - paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); + PaintUtilPushTunnelRotated(session, direction, height, tunnelImage); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00770BFC */ static void PaintGhostTrainTrack25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(GhostTrainTrackPieces25DegUp[direction][0]); @@ -210,33 +210,33 @@ static void PaintGhostTrainTrack25DegUp( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00770C0C */ static void PaintGhostTrainTrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isBackwards = trackElement.GetTrackType() == TrackElemType::Down25ToFlat; @@ -258,32 +258,32 @@ static void PaintGhostTrainTrackFlatTo25DegUp( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, doorImage); + PaintUtilPushTunnelLeft(session, height, doorImage); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, doorImage); + PaintUtilPushTunnelRight(session, height, doorImage); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void PaintGhostTrainTrack25DegUpToFlatShared( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(GhostTrainTrackPieces25DegUpToFlat[direction][0]); @@ -294,17 +294,17 @@ static void PaintGhostTrainTrack25DegUpToFlatShared( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x00770C1C */ static void PaintGhostTrainTrack25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintGhostTrainTrack25DegUpToFlatShared(session, ride, trackSequence, direction, height, trackElement); @@ -312,23 +312,23 @@ static void PaintGhostTrainTrack25DegUpToFlat( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height + 8, DoorOpeningOutwardsToImage[trackElement.GetDoorBState()]); + PaintUtilPushTunnelRight(session, height + 8, DoorOpeningOutwardsToImage[trackElement.GetDoorBState()]); break; case 2: - paint_util_push_tunnel_left(session, height + 8, DoorOpeningOutwardsToImage[trackElement.GetDoorBState()]); + PaintUtilPushTunnelLeft(session, height + 8, DoorOpeningOutwardsToImage[trackElement.GetDoorBState()]); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_0); break; } } /** rct2: 0x00770C2C */ static void PaintGhostTrainTrack25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintGhostTrainTrack25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -336,7 +336,7 @@ static void PaintGhostTrainTrack25DegDown( /** rct2: 0x00770C3C */ static void PaintGhostTrainTrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintGhostTrainTrack25DegUpToFlatShared(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -344,23 +344,23 @@ static void PaintGhostTrainTrackFlatTo25DegDown( switch ((direction + 2) % 4) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height + 8, DoorOpeningInwardsToImage[trackElement.GetDoorAState()]); + PaintUtilPushTunnelRight(session, height + 8, DoorOpeningInwardsToImage[trackElement.GetDoorAState()]); break; case 2: - paint_util_push_tunnel_left(session, height + 8, DoorOpeningInwardsToImage[trackElement.GetDoorAState()]); + PaintUtilPushTunnelLeft(session, height + 8, DoorOpeningInwardsToImage[trackElement.GetDoorAState()]); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_0); break; } } /** rct2: 0x00770C4C */ static void PaintGhostTrainTrack25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintGhostTrainTrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -368,7 +368,7 @@ static void PaintGhostTrainTrack25DegDownToFlat( /** rct2: 0x00770C5C, 0x00770C6C, 0x00770C7C */ static void PaintGhostTrainStation( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -386,28 +386,28 @@ static void PaintGhostTrainStation( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(GhostTrainTrackPiecesFlat[direction]); PaintAddImageAsChildRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 0, height }); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); if (direction == 0 || direction == 2) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00770C9C */ static void PaintGhostTrainTrackRightQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -424,7 +424,7 @@ static void PaintGhostTrainTrackRightQuarterTurn3Tiles( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -441,14 +441,14 @@ static void PaintGhostTrainTrackRightQuarterTurn3Tiles( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00770CAC */ static void PaintGhostTrainTrackLeftQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -457,7 +457,7 @@ static void PaintGhostTrainTrackLeftQuarterTurn3Tiles( /** rct2: 0x00770CAC */ static void PaintGhostTrainTrackLeftQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isBackwards = trackElement.GetTrackType() == TrackElemType::RightQuarterTurn1Tile; @@ -477,14 +477,14 @@ static void PaintGhostTrainTrackLeftQuarterTurn1Tile( session, 3, height, 0, direction, session.TrackColours[SCHEME_TRACK], GhostTrainTrackPiecesQuarterTurn1Tile); track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, 0, tunnelStartImage, 0, tunnelEndImage); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 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); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00770CBC */ static void PaintGhostTrainTrackRightQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintGhostTrainTrackLeftQuarterTurn1Tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); @@ -492,7 +492,7 @@ static void PaintGhostTrainTrackRightQuarterTurn1Tile( /** rct2: 0x00770CCC */ static void PaintGhostTrainTrackSpinningTunnel( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(ghost_train_track_pieces_spinning_tunnel_track[direction]); @@ -502,17 +502,17 @@ static void PaintGhostTrainTrackSpinningTunnel( track_paint_util_spinning_tunnel_paint(session, 3, height, direction); auto tunnelImage = GetTunnelDoorsImageStraightFlat(trackElement, direction); - paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); + PaintUtilPushTunnelRotated(session, direction, height, tunnelImage); - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00770CDC */ static void PaintGhostTrainTrackBrakes( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(GhostTrainTrackPiecesBrakes[direction]); @@ -520,16 +520,16 @@ static void PaintGhostTrainTrackBrakes( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); auto tunnelImage = GetTunnelDoorsImageStraightFlat(trackElement, direction); - paint_util_push_tunnel_rotated(session, direction, height, tunnelImage); + PaintUtilPushTunnelRotated(session, direction, height, tunnelImage); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 95abee0d0b..6fd45427ed 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -24,7 +24,7 @@ static constexpr BoundBoxXY HauntedHouseData[] = { }; static void PaintHauntedHouseStructure( - paint_session& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint8_t part, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint8_t part, uint16_t height) { uint8_t frameNum = 0; @@ -44,9 +44,9 @@ static void PaintHauntedHouseStructure( auto imageTemplate = session.TrackColours[SCHEME_MISC]; auto baseImageIndex = rideEntry->Cars[0].base_image_id; auto imageIndex = baseImageIndex + direction; - PaintAddImageAsParent( - session, imageTemplate.WithIndex(imageIndex), { xOffset, yOffset, height }, { boundBox.length, 127 }, - { boundBox.offset, height }); + + auto bb = BoundBoxXYZ{ { boundBox.offset, height }, { boundBox.length, 127 } }; + PaintAddImageAsParent(session, imageTemplate.WithIndex(imageIndex), { xOffset, yOffset, height }, bb); if (session.DPI.zoom_level <= ZoomLevel{ 0 } && frameNum != 0) { @@ -61,14 +61,14 @@ static void PaintHauntedHouseStructure( } static void PaintHauntedHouse( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -112,9 +112,9 @@ static void PaintHauntedHouse( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } TRACK_PAINT_FUNCTION GetTrackPaintFunctionHauntedHouse(int32_t trackType) diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index e1eb44d6a3..96b64fa726 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -53,7 +53,7 @@ enum * rct: 0x004ACF4A */ static void MazePaintSetup( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint16_t mazeEntry = trackElement.GetMazeEntry(); @@ -64,9 +64,9 @@ static void MazePaintSetup( auto imageId = session.TrackColours[SCHEME_MISC].WithIndex(SPR_TERRAIN_DIRT); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 0 }); - wooden_a_supports_paint_setup(session, (rotation & 1) ? 0 : 1, 0, height, session.TrackColours[SCHEME_3]); + WoodenASupportsPaintSetup(session, (rotation & 1) ? 0 : 1, 0, height, session.TrackColours[SCHEME_3]); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); int32_t baseImageId = 0; switch (ride.track_colour[0].supports) @@ -89,99 +89,102 @@ static void MazePaintSetup( imageId = baseImage.WithIndexOffset(SprMazeOffsetWallCentre); if (mazeEntry & MAZE_ENTRY_FLAG_3) - PaintAddImageAsParent(session, imageId, { 2, 2, height }, { 10, 10, 9 }, { 3, 3, height + 2 }); + PaintAddImageAsParent(session, imageId, { 2, 2, height }, { { 3, 3, height + 2 }, { 10, 10, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_7) - PaintAddImageAsParent(session, imageId, { 2, 18, height }, { 10, 10, 9 }, { 3, 19, height + 2 }); + PaintAddImageAsParent(session, imageId, { 2, 18, height }, { { 3, 19, height + 2 }, { 10, 10, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_11) - PaintAddImageAsParent(session, imageId, { 18, 18, height }, { 10, 10, 9 }, { 19, 19, height + 2 }); + PaintAddImageAsParent(session, imageId, { 18, 18, height }, { { 19, 19, height + 2 }, { 10, 10, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_15) - PaintAddImageAsParent(session, imageId, { 18, 2, height }, { 10, 10, 9 }, { 19, 3, height + 2 }); + PaintAddImageAsParent(session, imageId, { 18, 2, height }, { { 19, 3, height + 2 }, { 10, 10, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetWallTopLeft); if (mazeEntry & MAZE_ENTRY_FLAG_0) - PaintAddImageAsParent(session, imageId, { 2, 0, height }, { 10, 1, 9 }, { 3, 1, height + 2 }); + PaintAddImageAsParent(session, imageId, { 2, 0, height }, { { 3, 1, height + 2 }, { 10, 1, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_13) - PaintAddImageAsParent(session, imageId, { 18, 0, height }, { 10, 1, 9 }, { 19, 1, height + 2 }); + PaintAddImageAsParent(session, imageId, { 18, 0, height }, { { 19, 1, height + 2 }, { 10, 1, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetWallBottomRight); if (mazeEntry & MAZE_ENTRY_FLAG_5) - PaintAddImageAsParent(session, imageId, { 2, 30, height }, { 10, 1, 9 }, { 3, 30, height + 2 }); + PaintAddImageAsParent(session, imageId, { 2, 30, height }, { { 3, 30, height + 2 }, { 10, 1, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_8) - PaintAddImageAsParent(session, imageId, { 18, 30, height }, { 10, 1, 9 }, { 19, 30, height + 2 }); + PaintAddImageAsParent(session, imageId, { 18, 30, height }, { { 19, 30, height + 2 }, { 10, 1, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetWallTopRight); if (mazeEntry & MAZE_ENTRY_FLAG_1) - PaintAddImageAsParent(session, imageId, { 0, 2, height }, { 1, 10, 9 }, { 1, 3, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 2, height }, { { 1, 3, height + 2 }, { 1, 10, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_4) - PaintAddImageAsParent(session, imageId, { 0, 18, height }, { 1, 10, 9 }, { 1, 19, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 18, height }, { { 1, 19, height + 2 }, { 1, 10, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetWallBottomLeft); if (mazeEntry & MAZE_ENTRY_FLAG_12) - PaintAddImageAsParent(session, imageId, { 30, 2, height }, { 1, 10, 9 }, { 30, 3, height + 2 }); + PaintAddImageAsParent(session, imageId, { 30, 2, height }, { { 30, 3, height + 2 }, { 1, 10, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_9) - PaintAddImageAsParent(session, imageId, { 30, 18, height }, { 1, 10, 9 }, { 30, 19, height + 2 }); + PaintAddImageAsParent(session, imageId, { 30, 18, height }, { { 30, 19, height + 2 }, { 1, 10, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetWallInnerNeSw); if (mazeEntry & MAZE_ENTRY_FLAG_2) - PaintAddImageAsParent(session, imageId, { 2, 14, height }, { 10, 4, 9 }, { 3, 14, height + 2 }); + PaintAddImageAsParent(session, imageId, { 2, 14, height }, { { 3, 14, height + 2 }, { 10, 4, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_10) - PaintAddImageAsParent(session, imageId, { 18, 14, height }, { 10, 4, 9 }, { 19, 14, height + 2 }); + PaintAddImageAsParent(session, imageId, { 18, 14, height }, { { 19, 14, height + 2 }, { 10, 4, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetWallInnerNwSe); if (mazeEntry & MAZE_ENTRY_FLAG_14) - PaintAddImageAsParent(session, imageId, { 14, 2, height }, { 4, 10, 9 }, { 14, 3, height + 2 }); + PaintAddImageAsParent(session, imageId, { 14, 2, height }, { { 14, 3, height + 2 }, { 4, 10, 9 } }); if (mazeEntry & MAZE_ENTRY_FLAG_6) - PaintAddImageAsParent(session, imageId, { 14, 18, height }, { 4, 10, 9 }, { 14, 19, height + 2 }); + PaintAddImageAsParent(session, imageId, { 14, 18, height }, { { 14, 19, height + 2 }, { 4, 10, 9 } }); imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnCorner); if (mazeEntry & (MAZE_ENTRY_FLAG_0 | MAZE_ENTRY_FLAG_1)) - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 9 }, { 1, 1, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 1, height + 2 }, { 1, 1, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_4 | MAZE_ENTRY_FLAG_5)) - PaintAddImageAsParent(session, imageId, { 0, 30, height }, { 1, 1, 9 }, { 1, 30, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 30, height }, { { 1, 30, height + 2 }, { 1, 1, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_8 | MAZE_ENTRY_FLAG_9)) - PaintAddImageAsParent(session, imageId, { 30, 30, height }, { 1, 1, 9 }, { 30, 30, height + 2 }); + PaintAddImageAsParent(session, imageId, { 30, 30, height }, { { 30, 30, height + 2 }, { 1, 1, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_12 | MAZE_ENTRY_FLAG_13)) - PaintAddImageAsParent(session, imageId, { 30, 0, height }, { 1, 1, 9 }, { 30, 1, height + 2 }); + PaintAddImageAsParent(session, imageId, { 30, 0, height }, { { 30, 1, height + 2 }, { 1, 1, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_0 | MAZE_ENTRY_FLAG_13 | MAZE_ENTRY_FLAG_14)) PaintAddImageAsParent( - session, ImageId(baseImageId + SprMazeOffsetColumnTopLeft), { 14, 0, height }, { 2, 1, 9 }, { 15, 1, height + 2 }); + session, ImageId(baseImageId + SprMazeOffsetColumnTopLeft), { 14, 0, height }, + { { 15, 1, height + 2 }, { 2, 1, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_5 | MAZE_ENTRY_FLAG_6 | MAZE_ENTRY_FLAG_8)) PaintAddImageAsParent( - session, ImageId(baseImageId + SprMazeOffsetColumnBottomRight), { 14, 30, height }, { 2, 1, 9 }, - { 15, 30, height + 2 }); + session, ImageId(baseImageId + SprMazeOffsetColumnBottomRight), { 14, 30, height }, + { { 15, 30, height + 2 }, { 2, 1, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_1 | MAZE_ENTRY_FLAG_2 | MAZE_ENTRY_FLAG_4)) PaintAddImageAsParent( - session, ImageId(baseImageId + SprMazeOffsetColumnTopRight), { 0, 14, height }, { 1, 2, 9 }, { 1, 15, height + 2 }); + session, ImageId(baseImageId + SprMazeOffsetColumnTopRight), { 0, 14, height }, + { { 1, 15, height + 2 }, { 1, 2, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_9 | MAZE_ENTRY_FLAG_10 | MAZE_ENTRY_FLAG_12)) PaintAddImageAsParent( - session, ImageId(baseImageId + SprMazeOffsetColumnBottomLeft), { 30, 14, height }, { 1, 2, 9 }, - { 30, 15, height + 2 }); + session, ImageId(baseImageId + SprMazeOffsetColumnBottomLeft), { 30, 14, height }, + { { 30, 15, height + 2 }, { 1, 2, 9 } }); if (mazeEntry & (MAZE_ENTRY_FLAG_2 | MAZE_ENTRY_FLAG_6 | MAZE_ENTRY_FLAG_10 | MAZE_ENTRY_FLAG_14)) { PaintAddImageAsParent( - session, ImageId(baseImageId + SprMazeOffsetColumnCentre), { 14, 14, height }, { 2, 2, 8 }, { 15, 15, height + 2 }); + session, ImageId(baseImageId + SprMazeOffsetColumnCentre), { 14, 14, height }, + { { 15, 15, height + 2 }, { 2, 2, 8 } }); - paint_util_set_segment_support_height(session, SEGMENT_C4, height + 12, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, height + 12, 0x20); } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** @@ -202,7 +205,7 @@ money64 MazeCalculateCost(money32 constructionCost, const Ride& ride, const Coor const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze); money64 price = (ride.GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.PriceModifier) >> 16; - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); auto heightDifference = (loc.z - surfaceElement->GetBaseZ()) / COORDS_Z_PER_TINY_Z; money64 supportCost = heightDifference * ride.GetRideTypeDescriptor().BuildCosts.SupportPrice; diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 9d77b37cf7..ce70de6aff 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -26,7 +26,7 @@ static constexpr const uint16_t MerryGoRoundBreakdownVibration[] = { }; static void PaintRiders( - paint_session& session, const Ride& ride, const rct_ride_entry& rideEntry, const Vehicle& vehicle, int32_t rotationOffset, + PaintSession& session, const Ride& ride, const rct_ride_entry& rideEntry, const Vehicle& vehicle, int32_t rotationOffset, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { if (session.DPI.zoom_level > ZoomLevel{ 0 }) @@ -51,7 +51,7 @@ static void PaintRiders( } static void PaintCarousel( - paint_session& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) { height += 7; @@ -99,14 +99,14 @@ static void PaintCarousel( } static void PaintMerryGoRound( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -159,9 +159,9 @@ static void PaintMerryGoRound( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } TRACK_PAINT_FUNCTION GetTrackPaintFunctionMerryGoRound(int32_t trackType) diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 708243519d..a986463923 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -11,6 +11,7 @@ #include "../../entity/EntityRegistry.h" #include "../../entity/Guest.h" #include "../../interface/Viewport.h" +#include "../../paint/Paint.SessionFlags.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../world/Map.h" @@ -443,24 +444,24 @@ const size_t MiniGolfPeepAnimationLengths[] = { }; // clang-format on -static paint_struct* MiniGolfPaintUtil7C( - paint_session& session, uint8_t direction, ImageId imageId, int8_t x_offset, int8_t yOffset, int16_t boundBoxLengthX, +static PaintStruct* MiniGolfPaintUtil7C( + PaintSession& session, uint8_t direction, ImageId imageId, int8_t x_offset, int8_t yOffset, int16_t boundBoxLengthX, int16_t boundBoxLengthY, int8_t boundBoxLengthZ, int16_t zOffset, int16_t boundBoxOffsetX, int16_t boundBoxOffsetY, int16_t boundBoxOffsetZ, uint32_t rotation) { if (direction & 1) { return PaintAddImageAsParent( - session, imageId, { yOffset, x_offset, zOffset }, { boundBoxLengthY, boundBoxLengthX, boundBoxLengthZ }, - { boundBoxOffsetY, boundBoxOffsetX, boundBoxOffsetZ }); + session, imageId, { yOffset, x_offset, zOffset }, + { { boundBoxOffsetY, boundBoxOffsetX, boundBoxOffsetZ }, { boundBoxLengthY, boundBoxLengthX, boundBoxLengthZ } }); } return PaintAddImageAsParent( - session, imageId, { x_offset, yOffset, zOffset }, { boundBoxLengthX, boundBoxLengthY, boundBoxLengthZ }, - { boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ }); + session, imageId, { x_offset, yOffset, zOffset }, + { { boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ }, { boundBoxLengthX, boundBoxLengthY, boundBoxLengthZ } }); } -static bool MiniGolfPaintUtilShouldDrawFence(paint_session& session, const TrackElement& trackElement) +static bool MiniGolfPaintUtilShouldDrawFence(PaintSession& session, const TrackElement& trackElement) { if (!(session.Flags & PaintSessionFlags::PassedSurface)) { @@ -484,7 +485,7 @@ static bool MiniGolfPaintUtilShouldDrawFence(paint_session& session, const Track /** rct2: 0x0087F10C */ static void PaintMiniGolfTrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -492,29 +493,29 @@ static void PaintMiniGolfTrackFlat( if (direction & 1) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprMiniGolfFlatNwSe); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 6, 0, height }, { 20, 32, 1 } }); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprMiniGolfFlatSwNe); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 6, height }, { 32, 20, 1 } }); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); } - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); if (MiniGolfPaintUtilShouldDrawFence(session, trackElement)) { if (direction & 1) { imageId = session.TrackColours[SCHEME_MISC].WithIndex(SprMiniGolfFlatFenceBackNwSe); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 10, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 10, 0, height + 2 }, { 1, 32, 7 } }); imageId = session.TrackColours[SCHEME_MISC].WithIndex(SprMiniGolfFlatFenceFrontNwSe); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 22, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 22, 0, height + 2 }, { 1, 32, 7 } }); } else { @@ -526,12 +527,12 @@ static void PaintMiniGolfTrackFlat( } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0087F11C */ static void PaintMiniGolfTrack25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -539,9 +540,9 @@ static void PaintMiniGolfTrack25DegUp( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSprites25DegUp[direction][0]); MiniGolfPaintUtil7C(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height, session.CurrentRotation); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); imageId = session.TrackColours[SCHEME_MISC].WithIndex(MiniGolfTrackSprites25DegUp[direction][1]); MiniGolfPaintUtil7C(session, direction, imageId, 0, 0, 32, 1, 15, height, 0, 10, height + 2, session.CurrentRotation); @@ -552,25 +553,25 @@ static void PaintMiniGolfTrack25DegUp( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0087F12C */ static void PaintMiniGolfTrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -578,9 +579,9 @@ static void PaintMiniGolfTrackFlatTo25DegUp( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesFlatTo25DegUp[direction][0]); MiniGolfPaintUtil7C(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height, session.CurrentRotation); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); imageId = session.TrackColours[SCHEME_MISC].WithIndex(MiniGolfTrackSpritesFlatTo25DegUp[direction][1]); MiniGolfPaintUtil7C(session, direction, imageId, 0, 0, 32, 1, 11, height, 0, 10, height + 2, session.CurrentRotation); @@ -591,25 +592,25 @@ static void PaintMiniGolfTrackFlatTo25DegUp( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0087F13C */ static void PaintMiniGolfTrack25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -617,9 +618,9 @@ static void PaintMiniGolfTrack25DegUpToFlat( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSprites25DegUpToFlat[direction][0]); MiniGolfPaintUtil7C(session, direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height, session.CurrentRotation); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); imageId = session.TrackColours[SCHEME_MISC].WithIndex(MiniGolfTrackSprites25DegUpToFlat[direction][1]); MiniGolfPaintUtil7C(session, direction, imageId, 0, 0, 32, 1, 11, height, 0, 10, height + 2, session.CurrentRotation); @@ -630,25 +631,25 @@ static void PaintMiniGolfTrack25DegUpToFlat( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_0); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_PATH_AND_MINI_GOLF); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_PATH_AND_MINI_GOLF); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_0); break; } - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0087F14C */ static void PaintMiniGolfTrack25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniGolfTrack25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -656,7 +657,7 @@ static void PaintMiniGolfTrack25DegDown( /** rct2: 0x0087F15C */ static void PaintMiniGolfTrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniGolfTrack25DegUpToFlat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -664,7 +665,7 @@ static void PaintMiniGolfTrackFlatTo25DegDown( /** rct2: 0x0087F16C */ static void PaintMiniGolfTrack25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniGolfTrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -672,7 +673,7 @@ static void PaintMiniGolfTrack25DegDownToFlat( /** rct2: 0x0087F17C, 0x0087F18C, 0x0087F19C */ static void PaintMiniGolfStation( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const auto* stationObj = ride.GetStationObject(); @@ -702,7 +703,7 @@ static void PaintMiniGolfStation( track_paint_util_draw_station_covers(session, EDGE_SW, hasSWFence, stationObj, height); // Was leftwards tunnel in game, seems odd - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { @@ -723,18 +724,18 @@ static void PaintMiniGolfStation( track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, height); track_paint_util_draw_station_covers(session, EDGE_SE, hasSEFence, stationObj, height); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0087F1AC */ static void PaintMiniGolfTrackLeftQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -742,22 +743,22 @@ static void PaintMiniGolfTrackLeftQuarterTurn1Tile( track_paint_util_left_quarter_turn_1_tile_paint( session, 1, height, 0, direction, session.TrackColours[SCHEME_TRACK], MiniGolfTrackSpritesQuarterTurn1Tile); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); const bool shouldDrawFence = MiniGolfPaintUtilShouldDrawFence(session, trackElement); switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); if (!shouldDrawFence) break; imageId = session.TrackColours[SCHEME_MISC].WithIndex(SprMiniGolfQuarterTurn1TileFenceBackSwNw); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 26, 24, 1 }, { 6, 2, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 6, 2, height }, { 26, 24, 1 } }); break; @@ -766,26 +767,26 @@ static void PaintMiniGolfTrackLeftQuarterTurn1Tile( break; imageId = session.TrackColours[SCHEME_MISC].WithIndex(SprMiniGolfQuarterTurn1TileFenceBackNwNe); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 26, 26, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 26, 26, 1 } }); break; case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); if (!shouldDrawFence) break; imageId = session.TrackColours[SCHEME_MISC].WithIndex(SprMiniGolfQuarterTurn1TileFenceBackNeSe); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 24, 26, 1 }, { 2, 6, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 6, height }, { 24, 26, 1 } }); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); if (!shouldDrawFence) break; imageId = session.TrackColours[SCHEME_MISC].WithIndex(SprMiniGolfQuarterTurn1TileFenceBackSeSw); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 24, 24, 1 }, { 6, 6, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 6, 6, height }, { 24, 24, 1 } }); break; } @@ -809,36 +810,35 @@ static void PaintMiniGolfTrackLeftQuarterTurn1Tile( } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0087F1BC */ static void PaintMiniGolfTrackRightQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniGolfTrackLeftQuarterTurn1Tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } static void PaintMiniGolfHoleAb( - paint_session& session, uint8_t trackSequence, uint8_t direction, int32_t height, const uint32_t sprites[4][2][2]) + PaintSession& session, uint8_t trackSequence, uint8_t direction, int32_t height, const uint32_t sprites[4][2][2]) { ImageId imageId; CoordsXY boundBox, boundBoxOffset; - bool drewSupports = wooden_a_supports_paint_setup( - session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + bool drewSupports = WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); if ((direction == 0 && trackSequence == 0) || (direction == 2 && trackSequence == 1)) { - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); } else if ((direction == 3 && trackSequence == 0) || (direction == 1 && trackSequence == 1)) { - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); } if (direction & 1) @@ -852,32 +852,33 @@ static void PaintMiniGolfHoleAb( boundBoxOffset = { 0, 3 }; } + auto bb = BoundBoxXYZ{ { boundBoxOffset, height + 24 }, { boundBox, 0 } }; + imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][trackSequence][1]); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 0 }, { boundBoxOffset.x, boundBoxOffset.y, height + 24 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); + + bb.offset.z = height; + bb.length.z = 1; if (drewSupports) { imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex( ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS)); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][trackSequence][0]); - PaintAddImageAsChild( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][trackSequence][0]); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); } } /** rct2: 0x0087F1CC */ static void PaintMiniGolfHoleA( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniGolfHoleAb(session, trackSequence, direction, height, MiniGolfTrackSpritesHoleA); @@ -885,7 +886,7 @@ static void PaintMiniGolfHoleA( /** rct2: 0x0087F1DC */ static void PaintMiniGolfHoleB( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniGolfHoleAb(session, trackSequence, direction, height, MiniGolfTrackSpritesHoleB); @@ -893,25 +894,24 @@ static void PaintMiniGolfHoleB( /** rct2: 0x0087F1EC */ static void PaintMiniGolfHoleC( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; CoordsXY boundBox, boundBoxOffset; - bool drewSupports = wooden_a_supports_paint_setup( - session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + bool drewSupports = WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); if ((direction == 0 && trackSequence == 0) || (direction == 2 && trackSequence == 1)) { - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); } else if ((direction == 3 && trackSequence == 0) || (direction == 1 && trackSequence == 1)) { - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); } if (direction & 1) @@ -944,28 +944,26 @@ static void PaintMiniGolfHoleC( break; } + auto bb = BoundBoxXYZ{ { boundBoxOffset, height }, { boundBox.x, boundBox.y, 1 } }; if (drewSupports) { imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex( ((direction & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS)); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesHoleC[direction][trackSequence][0]); - PaintAddImageAsChild( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesHoleC[direction][trackSequence][0]); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); } } /** rct2: 0x0087F1FC */ static void PaintMiniGolfHoleD( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -974,21 +972,21 @@ static void PaintMiniGolfHoleD( 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]); + bool drewSupports = WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); switch ((direction << 4) | trackSequence) { case 0x00: case 0x12: - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); break; case 0x02: case 0x30: - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); break; } @@ -1038,28 +1036,27 @@ static void PaintMiniGolfHoleD( break; } + auto bb = BoundBoxXYZ{ { boundBoxOffset, height }, { boundBox.x, boundBox.y, 1 } }; + auto offset = CoordsXYZ{ 0, 0, height }; if (drewSupports) { imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex( ((supportType & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS)); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, offset, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesHoleD[direction][trackSequence][0]); - PaintAddImageAsChild( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsChild(session, imageId, offset, bb); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesHoleD[direction][trackSequence][0]); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, offset, bb); } } /** rct2: 0x0087F1FC */ static void PaintMiniGolfHoleE( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -1068,21 +1065,21 @@ static void PaintMiniGolfHoleE( 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]); + bool drewSupports = WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); switch ((direction << 4) | trackSequence) { - case 0x00: - case 0x12: - paint_util_push_tunnel_left(session, height, TUNNEL_PATH_AND_MINI_GOLF); + case (0 << 4 | 0): + case (3 << 4 | 2): + PaintUtilPushTunnelLeft(session, height, TUNNEL_PATH_AND_MINI_GOLF); break; - case 0x02: - case 0x30: - paint_util_push_tunnel_right(session, height, TUNNEL_PATH_AND_MINI_GOLF); + case (2 << 4 | 2): + case (3 << 4 | 0): + PaintUtilPushTunnelRight(session, height, TUNNEL_PATH_AND_MINI_GOLF); break; } @@ -1132,22 +1129,21 @@ static void PaintMiniGolfHoleE( break; } + auto bb = BoundBoxXYZ{ { boundBoxOffset, height }, { boundBox.x, boundBox.y, 1 } }; + auto offset = CoordsXYZ{ 0, 0, height }; if (drewSupports) { imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex( ((supportType & 1) ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS)); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, offset, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesHoleE[direction][trackSequence][0]); - PaintAddImageAsChild( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsChild(session, imageId, offset, bb); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MiniGolfTrackSpritesHoleE[direction][trackSequence][0]); - PaintAddImageAsParent( - session, imageId, { 0, 0, height }, { boundBox.x, boundBox.y, 1 }, { boundBoxOffset.x, boundBoxOffset.y, height }); + PaintAddImageAsParent(session, imageId, offset, bb); } } @@ -1204,7 +1200,7 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionMiniGolf(int32_t trackType) * rct2: 0x006D42F0 */ void vehicle_visual_mini_golf_player( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle) + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle) { if (vehicle->num_peeps == 0) { @@ -1241,7 +1237,7 @@ void vehicle_visual_mini_golf_player( * rct2: 0x006D43C6 */ void VehicleVisualMiniGolfBall( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle) + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle) { if (vehicle->mini_golf_current_animation != MiniGolfAnimation::PlaceBallDown) { diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index de675a7237..c4948019ab 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -18,7 +18,7 @@ /** rct2: 0x */ static void PaintMiniHelicoptersTrackStation( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -29,11 +29,11 @@ static void PaintMiniHelicoptersTrackStation( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 20, 1 } }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else if (direction == 1 || direction == 3) { @@ -41,22 +41,22 @@ static void PaintMiniHelicoptersTrackStation( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 20, 32, 1 } }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0081F348 */ static void PaintMiniHelicoptersTrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -65,30 +65,30 @@ static void PaintMiniHelicoptersTrackFlat( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0081F368 */ static void PaintMiniHelicoptersTrackFlatTo25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -99,41 +99,41 @@ static void PaintMiniHelicoptersTrackFlatTo25DegUp( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SW_NE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NW_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_2); + PaintUtilPushTunnelRight(session, height, TUNNEL_2); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NE_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height, TUNNEL_2); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SE_NW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -4, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -4, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x0081F358 */ static void PaintMiniHelicoptersTrack25DegUp( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -143,38 +143,38 @@ static void PaintMiniHelicoptersTrack25DegUp( case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_SW_NE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_NW_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_NE_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_2); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_SE_NW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_1); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -9, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0081F378 */ static void PaintMiniHelicoptersTrack25DegUpToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -185,41 +185,41 @@ static void PaintMiniHelicoptersTrack25DegUpToFlat( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SW_NE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_0); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NW_SE); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_12); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_12); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NE_SW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_12); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_12); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SE_NW); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 20, 32, 3 }, { 6, 0, height }); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_0); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -7, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -7, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x */ static void PaintMiniHelicoptersTrackFlatTo25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniHelicoptersTrack25DegUpToFlat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -227,7 +227,7 @@ static void PaintMiniHelicoptersTrackFlatTo25DegDown( /** rct2: 0x0081F388 */ static void PaintMiniHelicoptersTrack25DegDown( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniHelicoptersTrack25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -235,7 +235,7 @@ static void PaintMiniHelicoptersTrack25DegDown( /** rct2: 0x0081F3A8 */ static void PaintMiniHelicoptersTrack25DegDownToFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniHelicoptersTrackFlatTo25DegUp(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -243,7 +243,7 @@ static void PaintMiniHelicoptersTrack25DegDownToFlat( /** rct2: 0x0081F3E8 */ static void PaintMiniHelicoptersTrackLeftQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -254,22 +254,22 @@ static void PaintMiniHelicoptersTrackLeftQuarterTurn3Tiles( switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint8_t MiniHelicoptersRightQuarterTurn3TilesToLeftTurnMap[] = { @@ -281,7 +281,7 @@ static constexpr const uint8_t MiniHelicoptersRightQuarterTurn3TilesToLeftTurnMa /** rct2: 0x0081F3F8 */ static void PaintMiniHelicoptersTrackRightQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = MiniHelicoptersRightQuarterTurn3TilesToLeftTurnMap[trackSequence]; @@ -290,7 +290,7 @@ static void PaintMiniHelicoptersTrackRightQuarterTurn3Tiles( /** rct2: 0x0081F408 */ static void PaintMiniHelicoptersTrackLeftQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -298,19 +298,44 @@ static void PaintMiniHelicoptersTrackLeftQuarterTurn1Tile( trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile); 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, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0081F418 */ static void PaintMiniHelicoptersTrackRightQuarterTurn1Tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintMiniHelicoptersTrackLeftQuarterTurn1Tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); } +static void PaintMiniHelicoptersTrackSpinningTunnel( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + const uint32_t sprites[NumOrthogonalDirections][2] = { + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW, 28773 }, + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW, 28774 }, + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW, 28773 }, + { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW, 28774 }, + }; + + ImageId imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][0]); + ImageId underlay = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); + + PaintAddImageAsParentRotated(session, direction, underlay, { 0, 6, height - 2 }, { 32, 20, 1 }, { 0, 6, height }); + PaintAddImageAsChildRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 3 }, { 0, 6, height }); + track_paint_util_spinning_tunnel_paint(session, 1, height, direction); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); + + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); +} + /** * rct2: 0x0081F268 */ @@ -349,6 +374,9 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionMiniHelicopters(int32_t trackType) return PaintMiniHelicoptersTrackLeftQuarterTurn1Tile; case TrackElemType::RightQuarterTurn1Tile: return PaintMiniHelicoptersTrackRightQuarterTurn1Tile; + + case TrackElemType::SpinningTunnel: + return PaintMiniHelicoptersTrackSpinningTunnel; } return nullptr; diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index 6721f1d723..d54d3d5937 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -159,8 +159,8 @@ static constexpr const uint32_t MonorailCyclesTrackPiecesFlatQuarterTurn3Tiles[4 }, }; -static paint_struct* PaintMonorailCyclesUtil7C( - paint_session& session, bool flip, ImageId imageId, int8_t xOffset, int8_t yOffset, int16_t boundBoxLengthX, +static PaintStruct* PaintMonorailCyclesUtil7C( + PaintSession& session, bool flip, ImageId imageId, int8_t xOffset, int8_t yOffset, int16_t boundBoxLengthX, int16_t boundBoxLengthY, int8_t boundBoxLengthZ, int16_t zOffset, int16_t boundBoxOffsetX, int16_t boundBoxOffsetY, int16_t boundBoxOffsetZ, uint32_t rotation) { @@ -178,7 +178,7 @@ static paint_struct* PaintMonorailCyclesUtil7C( /** rct2: 0x0088AD48 */ static void PaintMonorailCyclesTrackFlat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(MonorailCyclesTrackPiecesFlat[(direction & 1)]); @@ -187,25 +187,25 @@ static void PaintMonorailCyclesTrackFlat( if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0088ADD8 */ static void PaintMonorailCyclesStation( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -216,11 +216,11 @@ static void PaintMonorailCyclesStation( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 32, 28, 1 }, { 0, 2, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprMonorailCyclesFlatSwNe); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 20, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 20, 1 } }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else if (direction == 1 || direction == 3) { @@ -228,22 +228,22 @@ static void PaintMonorailCyclesStation( PaintAddImageAsParent(session, imageId, { 0, 0, height - 2 }, { 28, 32, 1 }, { 2, 0, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprMonorailCyclesFlatNwSe); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 20, 32, 1 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 20, 32, 1 } }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0088AD88 */ static void PaintMonorailCyclesTrackLeftQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -254,22 +254,22 @@ static void PaintMonorailCyclesTrackLeftQuarterTurn3Tiles( switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint8_t monorail_cycles_right_quarter_turn_3_tiles_to_left_turn_map[] = { @@ -281,7 +281,7 @@ static constexpr const uint8_t monorail_cycles_right_quarter_turn_3_tiles_to_lef /** rct2: 0x0088AD98 */ static void PaintMonorailCyclesTrackRightQuarterTurn3Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -304,7 +304,7 @@ static constexpr const int8_t MonorailCyclesTrackRightQuarterTurn5TilesSupportSp /** rct2: 0x0088ADB8 */ static void PaintMonorailCyclesTrackRightQuarterTurn5Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -317,48 +317,48 @@ static void PaintMonorailCyclesTrackRightQuarterTurn5Tiles( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: if (direction == 0) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 8, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 7, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 5, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 6, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; case 5: if (direction == 0) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK : METAL_SUPPORTS_STICK_ALT, 7, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK : METAL_SUPPORTS_STICK_ALT, 5, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK : METAL_SUPPORTS_STICK_ALT, 6, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK : METAL_SUPPORTS_STICK_ALT, 8, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; case 6: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK : METAL_SUPPORTS_STICK_ALT, 4, supportSpecial, supportHeight, session.TrackColours[SCHEME_SUPPORTS]); break; @@ -366,60 +366,58 @@ static void PaintMonorailCyclesTrackRightQuarterTurn5Tiles( if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0088ADA8 */ static void PaintMonorailCyclesTrackLeftQuarterTurn5Tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -428,7 +426,7 @@ static void PaintMonorailCyclesTrackLeftQuarterTurn5Tiles( /** rct2: 0x0088ADC8 */ static void PaintMonorailCyclesTrackSBendLeft( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -462,22 +460,19 @@ static void PaintMonorailCyclesTrackSBendLeft( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -485,21 +480,21 @@ static void PaintMonorailCyclesTrackSBendLeft( { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -508,36 +503,34 @@ static void PaintMonorailCyclesTrackSBendLeft( switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction & 1), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction & 1), 0xFFFF, 0); break; case 1: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, direction & 1), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction & 1), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0, direction & 1), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0, direction & 1), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x*/ static void PaintMonorailCyclesTrackSBendRight( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -571,22 +564,20 @@ static void PaintMonorailCyclesTrackSBendRight( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK, 8, 0, height - 2, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -594,21 +585,21 @@ static void PaintMonorailCyclesTrackSBendRight( { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_STICK_ALT, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -617,31 +608,29 @@ static void PaintMonorailCyclesTrackSBendRight( switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction & 1), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction & 1), 0xFFFF, 0); break; case 1: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction & 1), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, direction & 1), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8, direction & 1), 0xFFFF, - 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8, direction & 1), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index 99fdbc4ee8..25342647a4 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -61,7 +61,7 @@ static uint32_t GetObservationTowerVehicleBaseImageId(const Vehicle* vehicle, co * rct2: 0x006D6258 */ void VehicleVisualObservationTower( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { auto baseImageId = GetObservationTowerVehicleBaseImageId(vehicle, carEntry, imageDirection); @@ -80,7 +80,7 @@ void VehicleVisualObservationTower( /** rct2: 0x0070DD6C */ static void PaintObservationTowerBase( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -88,7 +88,7 @@ static void PaintObservationTowerBase( int32_t edges = edges_3x3[trackSequence]; CoordsXY position = session.MapPosition; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -110,10 +110,10 @@ static void PaintObservationTowerBase( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprObservationTowerSegment); 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); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); return; } @@ -146,14 +146,14 @@ static void PaintObservationTowerBase( blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, blockedSegments, 0xFFFF, 0); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0070DD7C */ static void PaintObservationTowerSection( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence == 1) @@ -168,13 +168,13 @@ static void PaintObservationTowerSection( if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SprObservationTowerSegmentTop); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 5d3746f57b..2996a08f4b 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -34,7 +34,7 @@ static constexpr const uint32_t SpaceRingsFenceSprites[] = { /** rct2: 0x00768A3B */ static void PaintSpaceRingsStructure( - paint_session& session, const Ride& ride, uint8_t direction, uint32_t segment, int32_t height) + PaintSession& session, const Ride& ride, uint8_t direction, uint32_t segment, int32_t height) { uint32_t vehicleIndex = (segment - direction) & 0x3; @@ -73,8 +73,8 @@ static void PaintSpaceRingsStructure( if (rider != nullptr) { imageColourFlags = ImageId(0, rider->TshirtColour, rider->TrousersColour); - imageId = imageColourFlags.WithIndex((baseImageId & 0x7FFFF) + 352 + frameNum); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 20, 20, 23 }, { -10, -10, height }); + imageId = imageColourFlags.WithIndex(baseImageId + 352 + frameNum); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { -10, -10, height }, { 20, 20, 23 } }); } } } @@ -85,7 +85,7 @@ static void PaintSpaceRingsStructure( /** rct2: 0x00767C40 */ static void PaintSpaceRings( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -95,7 +95,7 @@ static void PaintSpaceRings( ImageId imageId; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); track_paint_util_paint_floor(session, edges, session.TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); @@ -168,9 +168,9 @@ static void PaintSpaceRings( cornerSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 0fef5ad310..fdf9916d6f 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -49,7 +49,7 @@ enum }; static void SpiralSlidePaintTileRight( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto rideEntry = ride.GetRideEntry(); @@ -71,7 +71,7 @@ static void SpiralSlidePaintTileRight( } static void SpiralSlidePaintTileLeft( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto rideEntry = ride.GetRideEntry(); @@ -93,7 +93,7 @@ static void SpiralSlidePaintTileLeft( } static void SpiralSlidePaintTileFront( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto rideEntry = ride.GetRideEntry(); @@ -185,7 +185,7 @@ static void SpiralSlidePaintTileFront( imageId = ImageId(offset + slide_progress, ride.slide_peep_t_shirt_colour, COLOUR_GREY); - PaintAddImageAsChild(session, imageId, { 16, 16, height }, boundingBox, boundingBoxOffset); + PaintAddImageAsChild(session, imageId, { 16, 16, height }, { boundingBoxOffset, boundingBox }); } } } @@ -194,7 +194,7 @@ static void SpiralSlidePaintTileFront( * rct: 0x007485C8 */ static void PaintSpiralSlide( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto rideEntry = ride.GetRideEntry(); @@ -205,7 +205,7 @@ static void PaintSpiralSlide( int32_t edges = edges_2x2[trackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); // Base const StationObject* stationObject = ride.GetStationObject(); @@ -241,8 +241,8 @@ static void PaintSpiralSlide( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } /** diff --git a/src/openrct2/ride/gentle/meta/MiniHelicopters.h b/src/openrct2/ride/gentle/meta/MiniHelicopters.h index 537a6ca602..4a678027a7 100644 --- a/src/openrct2/ride/gentle/meta/MiniHelicopters.h +++ b/src/openrct2/ride/gentle/meta/MiniHelicopters.h @@ -21,7 +21,7 @@ constexpr const RideTypeDescriptor MiniHelicoptersRTD = SET_FIELD(AlternateType, RIDE_TYPE_NULL), SET_FIELD(Category, RIDE_CATEGORY_GENTLE), SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL}), - SET_FIELD(ExtraTrackPieces, {}), + SET_FIELD(ExtraTrackPieces, {TRACK_SPINNING_TUNNEL}), SET_FIELD(CoveredTrackPieces, {}), SET_FIELD(StartTrackPiece, TrackElemType::EndStation), SET_FIELD(TrackPaintFunction, GetTrackPaintFunctionMiniHelicopters), diff --git a/src/openrct2/ride/gentle/meta/MonsterTrucks.h b/src/openrct2/ride/gentle/meta/MonsterTrucks.h index 922b6ba407..0d1e11405b 100644 --- a/src/openrct2/ride/gentle/meta/MonsterTrucks.h +++ b/src/openrct2/ride/gentle/meta/MonsterTrucks.h @@ -30,7 +30,7 @@ constexpr const RideTypeDescriptor MonsterTrucksRTD = RIDE_TYPE_FLAG_ALLOW_MUSIC | RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT | RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS | RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER | RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT), - SET_FIELD(RideModes, (1ULL << static_cast(RideMode::ContinuousCircuit))), + SET_FIELD(RideModes, (1uLL << static_cast(RideMode::ContinuousCircuit))), SET_FIELD(DefaultMode, RideMode::ContinuousCircuit), SET_FIELD(OperatingSettings, { 0, 0, 0, 0, 0, 0 }), SET_FIELD(Naming, { STR_RIDE_NAME_MONSTER_TRUCKS, STR_RIDE_DESCRIPTION_MONSTER_TRUCKS_GROUP }), diff --git a/src/openrct2/ride/gentle/meta/SpiralSlide.h b/src/openrct2/ride/gentle/meta/SpiralSlide.h index 1c663a6955..9443e5e376 100644 --- a/src/openrct2/ride/gentle/meta/SpiralSlide.h +++ b/src/openrct2/ride/gentle/meta/SpiralSlide.h @@ -49,6 +49,7 @@ constexpr const RideTypeDescriptor SpiralSlideRTD = SET_FIELD(ColourPresets, TRACK_COLOUR_PRESETS( { COLOUR_BRIGHT_RED, COLOUR_YELLOW, COLOUR_DARK_BROWN }, { COLOUR_LIGHT_BLUE, COLOUR_BRIGHT_PINK, COLOUR_LIGHT_PURPLE }, + { COLOUR_WHITE, COLOUR_BORDEAUX_RED, COLOUR_GREY }, )), SET_FIELD(ColourPreview, { SPR_RIDE_DESIGN_PREVIEW_SPIRAL_SLIDE_TRACK, 0 }), SET_FIELD(ColourKey, RideColourKey::Ride), diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index 32fd6cadf0..266498fcbd 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -19,10 +19,10 @@ #include "../TrackPaint.h" static void PaintFacility( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + bool hasSupports = WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_3]); auto rideEntry = ride.GetRideEntry(); if (rideEntry == nullptr) @@ -56,15 +56,18 @@ static void PaintFacility( // Base image if door was drawn if (direction == 1) { - PaintAddImageAsParent(session, imageId.WithIndexOffset(2), offset, { 2, 28, 29 }, { 28, 2, height }); + PaintAddImageAsParent(session, imageId.WithIndexOffset(2), offset, { { 28, 2, height }, { 2, 28, 29 } }); } else if (direction == 2) { - PaintAddImageAsParent(session, imageId.WithIndexOffset(4), offset, { 28, 2, 29 }, { 2, 28, height }); + PaintAddImageAsParent(session, imageId.WithIndexOffset(4), offset, { { 2, 28, height }, { 28, 2, 29 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + + if (direction == 1 || direction == 2) + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } /* 0x00762D44 */ diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index a9ec193c59..8ef68de9dc 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -19,10 +19,10 @@ #include "../TrackPaint.h" static void PaintShop( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + bool hasSupports = WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_3]); auto rideEntry = ride.GetRideEntry(); if (rideEntry == nullptr) @@ -50,8 +50,11 @@ static void PaintShop( PaintAddImageAsParent(session, imageFlags.WithIndex(imageIndex), offset, bb); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); + + if (direction == 1 || direction == 2) + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } TRACK_PAINT_FUNCTION get_track_paint_function_shop(int32_t trackType) diff --git a/src/openrct2/ride/shops/meta/CashMachine.h b/src/openrct2/ride/shops/meta/CashMachine.h index 529751dc49..1103b087e8 100644 --- a/src/openrct2/ride/shops/meta/CashMachine.h +++ b/src/openrct2/ride/shops/meta/CashMachine.h @@ -32,7 +32,7 @@ constexpr const RideTypeDescriptor CashMachineRTD = SET_FIELD(NameConvention, { RideComponentType::Car, RideComponentType::Building, RideComponentType::Station }), SET_FIELD(EnumName, nameof(RIDE_TYPE_CASH_MACHINE)), SET_FIELD(AvailableBreakdowns, 0), - SET_FIELD(Heights, { 12, 32, 0, 0, }), + SET_FIELD(Heights, { 12, 64, 0, 0, }), SET_FIELD(MaxMass, 255), SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_cash_machine), diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index ac8cf32dfd..6d0bd895ed 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -18,7 +18,7 @@ #include "../Vehicle.h" static void Paint3dCinemaDome( - paint_session& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) { auto rideEntry = ride.GetRideEntry(); if (rideEntry == nullptr) @@ -39,7 +39,7 @@ static void Paint3dCinemaDome( auto imageId = imageTemplate.WithIndex(rideEntry->Cars[0].base_image_id + direction); PaintAddImageAsParent( - session, imageId, { xOffset, yOffset, height + 3 }, { 24, 24, 47 }, { xOffset + 16, yOffset + 16, height + 3 }); + session, imageId, { xOffset, yOffset, height + 3 }, { { xOffset + 16, yOffset + 16, height + 3 }, { 24, 24, 47 } }); session.CurrentlyDrawnEntity = nullptr; session.InteractionType = ViewportInteractionItem::Ride; @@ -49,14 +49,14 @@ static void Paint3dCinemaDome( * rct2: 0x0076574C */ static void Paint3dCinema( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -109,9 +109,9 @@ static void Paint3dCinema( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_3d_cinema(int32_t trackType) diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index 922bc99118..ee1f37454f 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -20,7 +20,7 @@ #include "../Vehicle.h" static void PaintEnterpriseRiders( - paint_session& session, const rct_ride_entry& rideEntry, Vehicle& vehicle, uint32_t imageOffset, const CoordsXYZ& offset, + PaintSession& session, const rct_ride_entry& rideEntry, Vehicle& vehicle, uint32_t imageOffset, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { if (session.DPI.zoom_level > ZoomLevel{ 0 }) @@ -43,7 +43,7 @@ static void PaintEnterpriseRiders( } static void PaintEnterpriseStructure( - paint_session& session, const Ride& ride, int8_t xOffset, int8_t yOffset, uint16_t height, const TrackElement& trackElement) + PaintSession& session, const Ride& ride, int8_t xOffset, int8_t yOffset, uint16_t height, const TrackElement& trackElement) { const auto* rideEntry = get_ride_entry(ride.subtype); if (rideEntry == nullptr) @@ -88,14 +88,14 @@ static void PaintEnterpriseStructure( } static void PaintEnterprise( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = track_map_4x4[direction][trackSequence]; int32_t edges = edges_4x4[trackSequence]; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); track_paint_util_paint_floor(session, edges, session.TrackColours[SCHEME_TRACK], height, floorSpritesCork, stationObject); @@ -162,9 +162,9 @@ static void PaintEnterprise( cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 160, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 160, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int32_t trackType) diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index a470990d25..02d5ae5f7d 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -126,63 +126,63 @@ static constexpr const uint32_t go_karts_track_pieces_25_deg_up_to_flat[4][2] = /** rct2: 0x0074A748 */ static void paint_go_karts_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; if (direction == 0 || direction == 2) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 28, 1 }, { 0, 2, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 2, height }, { 32, 28, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_FRONT_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 3 }, { 0, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 29, height + 2 }, { 32, 1, 3 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 32, 1 }, { 2, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 0, height }, { 28, 32, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_FRONT_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 3 }, { 29, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 0, height + 2 }, { 1, 32, 3 } }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0074A758 */ static void paint_go_karts_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; - paint_struct* ps; + PaintStruct* ps; imageId = session.TrackColours[SCHEME_TRACK].WithIndex(go_karts_track_pieces_25_deg_up[direction][0]); if (direction == 0 || direction == 2) { - ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 28, 1 }, { 0, 2, height }); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 2, height }, { 32, 28, 1 } }); } else { - ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 32, 1 }, { 2, 0, height }); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 0, height }, { 28, 32, 1 } }); } imageId = session.TrackColours[SCHEME_TRACK].WithIndex(go_karts_track_pieces_25_deg_up[direction][1]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 11 }, { 0, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 29, height + 2 }, { 32, 1, 11 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 11 }, { 29, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 0, height + 2 }, { 1, 32, 11 } }); } session.WoodenSupportsPrependTo = ps; @@ -190,53 +190,53 @@ 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]); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; case 1: - wooden_a_supports_paint_setup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 2: - wooden_a_supports_paint_setup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - wooden_a_supports_paint_setup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x0074A768 */ static void paint_go_karts_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; - paint_struct* ps; + PaintStruct* ps; imageId = session.TrackColours[SCHEME_TRACK].WithIndex(go_karts_track_pieces_flat_to_25_deg_up[direction][0]); if (direction == 0 || direction == 2) { - ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 28, 1 }, { 0, 2, height }); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 2, height }, { 32, 28, 1 } }); } else { - ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 32, 1 }, { 2, 0, height }); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 0, height }, { 28, 32, 1 } }); } imageId = session.TrackColours[SCHEME_TRACK].WithIndex(go_karts_track_pieces_flat_to_25_deg_up[direction][1]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 11 }, { 0, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 29, height + 2 }, { 32, 1, 11 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 11 }, { 29, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 0, height + 2 }, { 1, 32, 11 } }); } session.WoodenSupportsPrependTo = ps; @@ -244,53 +244,53 @@ 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]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 2: - wooden_a_supports_paint_setup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; case 3: - wooden_a_supports_paint_setup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x */ static void paint_go_karts_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; - paint_struct* ps; + PaintStruct* ps; imageId = session.TrackColours[SCHEME_TRACK].WithIndex(go_karts_track_pieces_25_deg_up_to_flat[direction][0]); if (direction == 0 || direction == 2) { - ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 28, 1 }, { 0, 2, height }); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 2, height }, { 32, 28, 1 } }); } else { - ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 32, 1 }, { 2, 0, height }); + ps = PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 0, height }, { 28, 32, 1 } }); } imageId = session.TrackColours[SCHEME_TRACK].WithIndex(go_karts_track_pieces_25_deg_up_to_flat[direction][1]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 11 }, { 0, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 29, height + 2 }, { 32, 1, 11 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 11 }, { 29, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 0, height + 2 }, { 1, 32, 11 } }); } session.WoodenSupportsPrependTo = ps; @@ -298,30 +298,30 @@ 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]); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: - wooden_a_supports_paint_setup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14); break; case 2: - wooden_a_supports_paint_setup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14); break; case 3: - wooden_a_supports_paint_setup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x0074A788 */ static void paint_go_karts_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { paint_go_karts_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -329,7 +329,7 @@ static void paint_go_karts_track_25_deg_down( /** rct2: 0x0074A798 */ static void paint_go_karts_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -337,7 +337,7 @@ static void paint_go_karts_track_flat_to_25_deg_down( /** rct2: 0x0074A7A8 */ static void paint_go_karts_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -345,7 +345,7 @@ static void paint_go_karts_track_25_deg_down_to_flat( /** rct2: 0x */ static void paint_go_karts_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const auto* stationObj = ride.GetStationObject(); @@ -362,11 +362,11 @@ static void paint_go_karts_station( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][0]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 28, 1 }, { 0, 2, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 2, height }, { 32, 28, 1 } }); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 32, 1 }, { 2, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 0, height }, { 28, 32, 1 } }); } if (direction == 0 || direction == 2) @@ -383,15 +383,15 @@ static void paint_go_karts_station( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); if (direction == 0 || direction == 2) { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 3 }, { 0, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 29, height + 2 }, { 32, 1, 3 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else { - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 3 }, { 29, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 0, height + 2 }, { 1, 32, 3 } }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 0 || direction == 2) @@ -414,47 +414,47 @@ static void paint_go_karts_station( case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (hasGreenLight ? SPR_GO_KARTS_START_POLE_GREEN_SW_NE : SPR_GO_KARTS_START_POLE_RED_SW_NE)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 1, 1, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 1, height + 4 }, { 3, 3, 13 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (hasGreenLight ? SPR_GO_KARTS_START_LIGHTS_GREEN_SW_NE : SPR_GO_KARTS_START_LIGHTS_RED_SW_NE)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 1, 28, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 28, height + 4 }, { 3, 3, 13 } }); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_START_POLE_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 1, 28, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 28, height + 4 }, { 3, 3, 13 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_START_LIGHTS_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 28, 28, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 28, height + 4 }, { 3, 3, 13 } }); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_START_POLE_NE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 28, 1, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 1, height + 4 }, { 3, 3, 13 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_START_LIGHTS_NE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 28, 28, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 28, height + 4 }, { 3, 3, 13 } }); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (hasGreenLight ? SPR_GO_KARTS_START_POLE_GREEN_SE_NW : SPR_GO_KARTS_START_POLE_RED_SE_NW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 1, 1, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 1, 1, height + 4 }, { 3, 3, 13 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (hasGreenLight ? SPR_GO_KARTS_START_LIGHTS_GREEN_SE_NW : SPR_GO_KARTS_START_LIGHTS_RED_SE_NW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 3, 3, 13 }, { 28, 1, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 1, height + 4 }, { 3, 3, 13 } }); break; } } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0074A7E8 */ static void paint_go_karts_track_left_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -463,40 +463,40 @@ static void paint_go_karts_track_left_quarter_turn_1_tile( { case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 28, 1 }, { 0, 2, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 2, height }, { 32, 28, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_A_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 3 }, { 29, 2, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 2, height + 2 }, { 1, 1, 3 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_B_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 16, 1, 3 }, { 14, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 29, height + 2 }, { 16, 1, 3 } }); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_NE_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 30, 1 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 30, 30, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_A_NE_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 16, 1, 3 }, { 2, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 29, height + 2 }, { 16, 1, 3 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_B_NE_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 16, 3 }, { 29, 2, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 2, height + 2 }, { 1, 16, 3 } }); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_SE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 32, 1 }, { 2, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 0, height }, { 28, 32, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_A_SE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 3 }, { 2, 2, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 2, height + 2 }, { 1, 1, 3 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_B_SE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 16, 3 }, { 29, 14, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 14, height + 2 }, { 1, 16, 3 } }); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_SW_NW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_GO_KARTS_FLAT_QUARTER_TURN_1_TILE_EDGE_A_SW_NW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 3 }, { 29, 29, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 29, 29, height + 2 }, { 1, 1, 3 } }); // The empty sprite isn't drawn break; @@ -505,26 +505,26 @@ static void paint_go_karts_track_left_quarter_turn_1_tile( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0074A7F8 */ static void paint_go_karts_track_right_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 3) % 4, height, trackElement); diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 0834e2fb6a..8607653278 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -30,7 +30,7 @@ enum * rct2: 0x006D5FAB */ void vehicle_visual_launched_freefall( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { auto imageFlags = ImageId(0, vehicle->colours.Body, vehicle->colours.Trim); @@ -42,11 +42,11 @@ void vehicle_visual_launched_freefall( // Draw back: int32_t baseImage_id = carEntry->base_image_id + ((vehicle->restraints_position / 64) * 2); auto image_id = imageFlags.WithIndex(baseImage_id + 2); - PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 2, 2, 41 }, { -11, -11, z + 1 }); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { { -11, -11, z + 1 }, { 2, 2, 41 } }); // Draw front: image_id = imageFlags.WithIndex(baseImage_id + 1); - PaintAddImageAsParent(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, { { -5, -5, z + 1 }, { 16, 16, 41 } }); // Draw peeps: if (session.DPI.zoom_level < ZoomLevel{ 2 } && vehicle->num_peeps > 0 && !vehicle->IsGhost()) @@ -59,27 +59,27 @@ void vehicle_visual_launched_freefall( auto directionOffset = OpenRCT2::Entity::Yaw::YawTo4(imageDirection); image_id = ImageId( baseImage_id + (((directionOffset + 0) & 3) * 3), vehicle->peep_tshirt_colours[0], vehicle->peep_tshirt_colours[1]); - PaintAddImageAsChild(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, { { -5, -5, z + 1 }, { 16, 16, 41 } }); if (vehicle->num_peeps > 2) { image_id = ImageId( baseImage_id + (((directionOffset + 1) & 3) * 3), vehicle->peep_tshirt_colours[2], vehicle->peep_tshirt_colours[3]); - PaintAddImageAsChild(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, { { -5, -5, z + 1 }, { 16, 16, 41 } }); } if (vehicle->num_peeps > 4) { image_id = ImageId( baseImage_id + (((directionOffset + 2) & 3) * 3), vehicle->peep_tshirt_colours[4], vehicle->peep_tshirt_colours[5]); - PaintAddImageAsChild(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, { { -5, -5, z + 1 }, { 16, 16, 41 } }); } if (vehicle->num_peeps > 6) { image_id = ImageId( baseImage_id + (((directionOffset + 3) & 3) * 3), vehicle->peep_tshirt_colours[6], vehicle->peep_tshirt_colours[7]); - PaintAddImageAsChild(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, { { -5, -5, z + 1 }, { 16, 16, 41 } }); } } @@ -88,14 +88,14 @@ void vehicle_visual_launched_freefall( /** rct2: 0x006FD1F8 */ static void paint_launched_freefall_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -109,17 +109,17 @@ static void paint_launched_freefall_base( if (trackSequence == 0) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_LAUNCHED_FREEFALL_TOWER_BASE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 8, 8, height + 3 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 8, 8, height + 3 }, { 2, 2, 27 } }); height += 32; imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); height += 32; imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); - paint_util_set_vertical_tunnel(session, height + 32); + PaintUtilSetVerticalTunnel(session, height + 32); height -= 64; } @@ -155,14 +155,14 @@ static void paint_launched_freefall_base( blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, blockedSegments, 0xFFFF, 0); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x006FD208 */ static void paint_launched_freefall_tower_section( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence == 1) @@ -171,19 +171,19 @@ static void paint_launched_freefall_tower_section( } auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); const TileElement* nextTileElement = reinterpret_cast(&trackElement) + 1; if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT_TOP); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 939fd9edc4..4ab68d4930 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -97,7 +97,7 @@ static Vehicle* GetFirstVehicle(const Ride& ride) } static void PaintMagicCarpetRiders( - paint_session& session, const rct_ride_entry& rideEntry, const Vehicle& vehicle, Direction direction, + PaintSession& session, const rct_ride_entry& rideEntry, const Vehicle& vehicle, Direction direction, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { if (session.DPI.zoom_level > ZoomLevel{ 1 }) @@ -114,7 +114,7 @@ static void PaintMagicCarpetRiders( } static void PaintMagicCarpetFrame( - paint_session& session, Plane plane, Direction direction, const CoordsXYZ& offset, const BoundBoxXYZ& bb) + PaintSession& session, Plane plane, Direction direction, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { auto imageIndex = GetMagicCarpetFrameImage(plane, direction); auto imageTemplate = session.TrackColours[SCHEME_TRACK]; @@ -130,7 +130,7 @@ static void PaintMagicCarpetFrame( } static void PaintMagicCarpetPendulum( - paint_session& session, Plane plane, int32_t swing, Direction direction, const CoordsXYZ& offset, const BoundBoxXYZ& bb) + PaintSession& session, Plane plane, int32_t swing, Direction direction, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { auto imageIndex = GetMagicCarpetPendulumImage(plane, direction, swing); auto imageTemplate = session.TrackColours[SCHEME_TRACK]; @@ -139,7 +139,7 @@ static void PaintMagicCarpetPendulum( } static void PaintMagicCarpetVehicle( - paint_session& session, const Ride& ride, uint8_t direction, int32_t swing, CoordsXYZ offset, const BoundBoxXYZ& bb) + PaintSession& session, const Ride& ride, uint8_t direction, int32_t swing, CoordsXYZ offset, const BoundBoxXYZ& bb) { const auto* rideEntry = ride.GetRideEntry(); if (rideEntry == nullptr) @@ -181,7 +181,7 @@ static void PaintMagicCarpetVehicle( } static void PaintMagicCarpetStructure( - paint_session& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) { auto swing = 0; auto* vehicle = GetFirstVehicle(ride); @@ -210,7 +210,7 @@ static void PaintMagicCarpetStructure( } static void PaintMagicCarpet( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -222,17 +222,13 @@ static void PaintMagicCarpet( case 2: 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } const StationObject* stationObject = ride.GetStationObject(); @@ -260,8 +256,8 @@ static void PaintMagicCarpet( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 176, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 176, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_magic_carpet(int32_t trackType) diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index ed309df2b3..e65b3b24f9 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -31,7 +31,7 @@ enum }; static void PaintMotionSimulatorVehicle( - paint_session& session, const Ride& ride, int8_t offsetX, int8_t offsetY, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, int8_t offsetX, int8_t offsetY, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto rideEntry = ride.GetRideEntry(); @@ -102,14 +102,14 @@ static void PaintMotionSimulatorVehicle( } static void PaintMotionSimulator( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -132,8 +132,8 @@ static void PaintMotionSimulator( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 128, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } /** diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index d465880385..f08e662b79 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -34,7 +34,7 @@ enum * rct2: 0x006D5DA9 */ void vehicle_visual_roto_drop( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { imageDirection = OpenRCT2::Entity::Yaw::YawTo32(imageDirection); @@ -88,7 +88,7 @@ void vehicle_visual_roto_drop( baseImage_id += vehicle->restraints_position / 64; } image_id = ImageId(baseImage_id, riding_peep_sprites[i]); - PaintAddImageAsChild(session, image_id, { 0, 0, z }, { 16, 16, 41 }, { -5, -5, z + 1 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, { { -5, -5, z + 1 }, { 16, 16, 41 } }); } } } @@ -100,14 +100,14 @@ void vehicle_visual_roto_drop( /** rct2: 0x00886194 */ static void paint_roto_drop_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -132,10 +132,10 @@ static void paint_roto_drop_base( (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT)); 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); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); return; } @@ -168,14 +168,14 @@ static void paint_roto_drop_base( blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, blockedSegments, 0xFFFF, 0); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008861A4 */ static void paint_roto_drop_tower_section( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence == 1) @@ -190,13 +190,13 @@ static void paint_roto_drop_tower_section( if (trackElement.IsLastForTile() || trackElement.GetClearanceZ() != nextTileElement->GetBaseZ()) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_ROTO_DROP_TOWER_SEGMENT_TOP); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 8, 8, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 9b8cf51d78..6abe1ecaaa 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -59,7 +59,7 @@ static constexpr const uint32_t SwingingInverterShipFrameSprites[] = { }; static void PaintSwingingInverterShipStructure( - paint_session& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) { rct_ride_entry* rideEntry = get_ride_entry(ride.subtype); if (rideEntry == nullptr) @@ -125,7 +125,7 @@ static void PaintSwingingInverterShipStructure( } static void PaintSwingingInverterShip( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x4[direction][trackSequence]; @@ -137,13 +137,13 @@ static void PaintSwingingInverterShip( { 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) @@ -163,11 +163,11 @@ static void PaintSwingingInverterShip( break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_STATION_PLATFORM_SW_NE); - PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { 32, 8, 1 }, { -2, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { { -2, 0, height }, { 32, 8, 1 } }); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_STATION_PLATFORM_NW_SE); - PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { 8, 32, 1 }, { 0, -2, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { { 0, -2, height }, { 8, 32, 1 } }); break; } } @@ -189,8 +189,8 @@ static void PaintSwingingInverterShip( break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 176, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 176, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_swinging_inverter_ship(int32_t trackType) diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index d268ce9aa1..63f76e174e 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -56,7 +56,7 @@ static constexpr const uint32_t SwingingShipFrameSprites[][2] = { }; static void PaintSwingingShipRiders( - paint_session& session, const Ride& ride, const Vehicle& vehicle, ImageIndex baseImageIndex, Direction direction, + PaintSession& session, const Ride& ride, const Vehicle& vehicle, ImageIndex baseImageIndex, Direction direction, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { if (session.DPI.zoom_level > ZoomLevel{ 1 }) @@ -84,7 +84,7 @@ static void PaintSwingingShipRiders( } static void PaintSwingingShipStructure( - paint_session& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t axisOffset, uint16_t height) { rct_ride_entry* rideEntry = get_ride_entry(ride.subtype); if (rideEntry == nullptr) @@ -151,7 +151,7 @@ static void PaintSwingingShipStructure( } static void PaintSwingingShip( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { uint8_t relativeTrackSequence = track_map_1x5[direction][trackSequence]; @@ -163,12 +163,12 @@ static void PaintSwingingShip( if (relativeTrackSequence == 1 || relativeTrackSequence == 4) { - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { @@ -178,8 +178,8 @@ static void PaintSwingingShip( } 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]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { @@ -188,7 +188,7 @@ static void PaintSwingingShip( } } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { @@ -208,7 +208,7 @@ static void PaintSwingingShip( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE)); } - PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { 8, 32, 1 }, { 0, -2, height + 9 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { { 0, -2, height + 9 }, { 8, 32, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_NW_SE : SPR_STATION_PLATFORM_NW_SE)); @@ -255,7 +255,7 @@ static void PaintSwingingShip( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE)); } - PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { 32, 8, 1 }, { -2, 0, height + 9 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height + 9 }, { { -2, 0, height + 9 }, { 32, 8, 1 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (relativeTrackSequence == 2 ? SPR_STATION_PLATFORM_BEGIN_SW_NE : SPR_STATION_PLATFORM_SW_NE)); @@ -306,7 +306,7 @@ static void PaintSwingingShip( break; } - paint_util_set_general_support_height(session, height + 112, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 112, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_swinging_ship(int32_t trackType) diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 64e635febe..f6f123ff42 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -35,7 +35,7 @@ static int8_t TopSpinSeatPositionOffset[] = { }; static void PaintTopSpinRiders( - paint_session& session, const Vehicle& vehicle, ImageIndex seatImageIndex, const CoordsXYZ& seatCoords, + PaintSession& session, const Vehicle& vehicle, ImageIndex seatImageIndex, const CoordsXYZ& seatCoords, const BoundBoxXYZ& bb) { if (session.DPI.zoom_level >= ZoomLevel{ 2 }) @@ -59,7 +59,7 @@ static void PaintTopSpinRiders( } static void PaintTopSpinSeat( - paint_session& session, const Ride& ride, const rct_ride_entry& rideEntry, const Vehicle* vehicle, Direction direction, + PaintSession& session, const Ride& ride, const rct_ride_entry& rideEntry, const Vehicle* vehicle, Direction direction, uint32_t armRotation, uint32_t seatRotation, const CoordsXYZ& offset, const BoundBoxXYZ& bb) { if (armRotation >= std::size(TopSpinSeatHeightOffset)) @@ -116,7 +116,7 @@ static void PaintTopSpinSeat( } static void PaintTopSpinVehicle( - paint_session& session, int32_t al, int32_t cl, const Ride& ride, uint8_t direction, int32_t height, + PaintSession& session, int32_t al, int32_t cl, const Ride& ride, uint8_t direction, int32_t height, const TrackElement& tileElement) { const auto* rideEntry = get_ride_entry(ride.subtype); @@ -182,14 +182,14 @@ static void PaintTopSpinVehicle( } static void PaintTopSpin( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); @@ -242,9 +242,9 @@ static void PaintTopSpin( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 112, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 112, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int32_t trackType) diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 0c569726b3..e20d1c1677 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -21,7 +21,7 @@ /** rct2: 0x0076E5C9 */ static void paint_twist_structure( - paint_session& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) + PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height) { rct_ride_entry* rideEntry = get_ride_entry(ride.subtype); Vehicle* vehicle = nullptr; @@ -82,7 +82,7 @@ static void paint_twist_structure( /** rct2: 0x0076D858 */ static void paint_twist( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -91,7 +91,7 @@ static void paint_twist( ImageId imageId; - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_MISC]); const StationObject* stationObject = ride.GetStationObject(); track_paint_util_paint_floor(session, edges, session.TrackColours[SCHEME_MISC], height, floorSpritesCork, stationObject); @@ -156,9 +156,9 @@ static void paint_twist( break; } - paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 9ccc84c529..a81fc88e86 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -16,6 +16,8 @@ #include "../Track.h" #include "../TrackPaint.h" +#include + enum { SPR_CHAIRLIFT_CABLE_FLAT_SW_NE = 20500, @@ -75,18 +77,18 @@ const uint32_t chairlift_bullwheel_frames[] = { SPR_CHAIRLIFT_BULLWHEEL_FRAME_4, }; -static void chairlift_paint_util_draw_supports(paint_session& session, int32_t segments, uint16_t height) +static void chairlift_paint_util_draw_supports(PaintSession& session, int32_t segments, uint16_t height) { bool success = false; - for (int32_t s = 0; s < 9; s++) + for (uint8_t s = 0; s < std::size(segment_offsets); s++) { if (!(segments & segment_offsets[s])) { continue; } - if (metal_a_supports_paint_setup(session, METAL_SUPPORTS_TRUSS, s, 0, height, session.TrackColours[SCHEME_SUPPORTS])) + if (MetalASupportsPaintSetup(session, METAL_SUPPORTS_TRUSS, s, 0, height, session.TrackColours[SCHEME_SUPPORTS])) { success = true; } @@ -97,8 +99,8 @@ static void chairlift_paint_util_draw_supports(paint_session& session, int32_t s return; } - support_height* supportSegments = session.SupportSegments; - for (int32_t s = 0; s < 9; s++) + SupportHeight* supportSegments = session.SupportSegments; + for (uint8_t s = 0; s < std::size(segment_offsets); s++) { if (!(segments & segment_offsets[s])) { @@ -106,7 +108,7 @@ static void chairlift_paint_util_draw_supports(paint_session& session, int32_t s } uint16_t temp = supportSegments[s].height; supportSegments[s].height = session.Support.height; - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TRUSS, s, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TRUSS, s, 0, height, session.TrackColours[SCHEME_SUPPORTS]); supportSegments[s].height = temp; } } @@ -114,7 +116,7 @@ static void chairlift_paint_util_draw_supports(paint_session& session, int32_t s static const TrackElement* chairlift_paint_util_map_get_track_element_at_from_ride_fuzzy( int32_t x, int32_t y, int32_t z, const Ride& ride) { - const TileElement* tileElement = map_get_first_element_at(CoordsXY{ x, y }); + const TileElement* tileElement = MapGetFirstElementAt(CoordsXY{ x, y }); if (tileElement == nullptr) { return nullptr; @@ -176,7 +178,7 @@ static bool chairlift_paint_util_is_last_track( } static void chairlift_paint_station_ne_sw( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const CoordsXY pos = session.MapPosition; @@ -188,36 +190,36 @@ static void chairlift_paint_station_ne_sw( const auto* stationObj = ride.GetStationObject(); - wooden_a_supports_paint_setup(session, 0, 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, 0, 0, height, session.TrackColours[SCHEME_MISC]); if (!isStart && !isEnd) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(((direction == 0) ? SPR_20502 : SPR_20504)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); } imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_FLOOR_METAL); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); bool hasFence = track_paint_util_has_fence(EDGE_NW, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_NW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 1, 7 }, { 0, 2, height + 2 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 0, 2, height + 2 }, { 32, 1, 7 } }); } track_paint_util_draw_station_covers(session, EDGE_NW, hasFence, stationObj, height); if ((direction == 2 && isStart) || (direction == 0 && isEnd)) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_NE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 2, 2, height + 4 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 2, height + 4 }, { 1, 28, 7 } }); } hasFence = track_paint_util_has_fence(EDGE_SE, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 27 }, { 0, 30, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 30, height + 2 }, { 32, 1, 27 } }); } track_paint_util_draw_station_covers(session, EDGE_SE, hasFence, stationObj, height); @@ -226,14 +228,14 @@ static void chairlift_paint_station_ne_sw( if ((direction == 0 && isStart) || (direction == 2 && isEnd)) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 27 }, { 30, 2, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 30, 2, height + 4 }, { 1, 28, 27 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex( chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 26 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_NE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 26 } }); drawFrontColumn = false; } @@ -241,10 +243,10 @@ static void chairlift_paint_station_ne_sw( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex( chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 26 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_SW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 26 } }); drawBackColumn = false; } @@ -252,23 +254,23 @@ static void chairlift_paint_station_ne_sw( if (drawBackColumn) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_COLUMN_NE_SW); - PaintAddImageAsParent(session, imageId, { 0, 16, height + 2 }, { 1, 1, 7 }, { 1, 16, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 16, height + 2 }, { { 1, 16, height + 2 }, { 1, 1, 7 } }); } if (drawFrontColumn) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_COLUMN_NE_SW); PaintAddImageAsParent( - session, imageId, { 30, 16, height + 2 }, { 1, 1, 7 }, { 1, 16, height + 2 }); // bound offset x is wrong? + session, imageId, { 30, 16, height + 2 }, { { 1, 16, height + 2 }, { 1, 1, 7 } }); // bound offset x is wrong? } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void chairlift_paint_station_se_nw( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const CoordsXY pos = session.MapPosition; @@ -280,36 +282,36 @@ static void chairlift_paint_station_se_nw( const auto* stationObj = ride.GetStationObject(); - wooden_a_supports_paint_setup(session, 1, 0, height, session.TrackColours[SCHEME_MISC]); + WoodenASupportsPaintSetup(session, 1, 0, height, session.TrackColours[SCHEME_MISC]); if (!isStart && !isEnd) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(((direction == 1) ? SPR_20503 : SPR_20505)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); } imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_FLOOR_METAL); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); bool hasFence = track_paint_util_has_fence(EDGE_NE, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_NE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 1, 32, 7 }, { 2, 0, height + 2 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 0, height + 2 }, { 1, 32, 7 } }); } track_paint_util_draw_station_covers(session, EDGE_NE, hasFence, stationObj, height); if ((direction == 1 && isStart) || (direction == 3 && isEnd)) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_NW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 28, 1, 7 }, { 2, 2, height + 4 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 2, 2, height + 4 }, { 28, 1, 7 } }); } hasFence = track_paint_util_has_fence(EDGE_SW, pos, trackElement, ride, session.CurrentRotation); if (hasFence) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 27 }, { 30, 0, height + 2 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 30, 0, height + 2 }, { 1, 32, 27 } }); } track_paint_util_draw_station_covers(session, EDGE_SW, hasFence, stationObj, height); @@ -319,24 +321,26 @@ static void chairlift_paint_station_se_nw( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex( chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 26 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_SE); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 14, 14, height + 4 }, { 4, 4, 26 } }); drawLeftColumn = false; } else if ((direction == 3 && isStart) || (direction == 1 && isEnd)) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_FENCE_METAL_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 1, 27 }, { 2, 30, height + 4 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 30, height + 4 }, { 28, 1, 27 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex( chairlift_bullwheel_frames[ride.chairlift_bullwheel_rotation / 16384]); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + + auto bb = BoundBoxXYZ{ { 14, 14, height + 4 }, { 4, 4, 26 } }; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_END_CAP_NW); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 4, 4, 26 }, { 14, 14, height + 4 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); drawRightColumn = false; } @@ -344,25 +348,25 @@ static void chairlift_paint_station_se_nw( if (drawLeftColumn) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_COLUMN_SE_NW); - PaintAddImageAsParent(session, imageId, { 16, 0, height + 2 }, { 1, 1, 7 }, { 16, 1, height + 2 }); + PaintAddImageAsParent(session, imageId, { 16, 0, height + 2 }, { { 16, 1, height + 2 }, { 1, 1, 7 } }); } if (drawRightColumn) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_STATION_COLUMN_SE_NW); PaintAddImageAsParent( - session, imageId, { 16, 30, height + 2 }, { 1, 1, 7 }, { 16, 1, height + 2 }); // bound offset x is wrong? + session, imageId, { 16, 30, height + 2 }, { { 16, 1, height + 2 }, { 1, 1, 7 } }); // bound offset x is wrong? - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00744068 */ static void chairlift_paint_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction % 2) @@ -376,30 +380,30 @@ static void chairlift_paint_station( } static void chairlift_paint_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; if (direction & 1) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CABLE_FLAT_SE_NW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CABLE_FLAT_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); + PaintUtilPushTunnelLeft(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00743FD8 */ static void chairlift_paint_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -408,36 +412,36 @@ static void chairlift_paint_25_deg_up( { case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CABLE_UP_SW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CABLE_UP_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CABLE_UP_NE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CABLE_UP_SE_NW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00743FD8 */ static void chairlift_paint_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -446,53 +450,53 @@ static void chairlift_paint_flat_to_25_deg_up( { case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20508); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20520); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20509); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20521); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20510); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20522); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20511); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20523); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } chairlift_paint_util_draw_supports(session, SEGMENT_C4, height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x00743FF8 */ static void chairlift_paint_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -501,53 +505,53 @@ static void chairlift_paint_25_deg_up_to_flat( { case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20512); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20524); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20513); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20525); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20514); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 6, 2 }, { 0, 13, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 13, height + 28 }, { 32, 6, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20526); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_20515); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 6, 32, 2 }, { 13, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 13, 0, height + 28 }, { 6, 32, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20527); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 4, 4, 25 }, { 14, 14, height + 1 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 14, 14, height + 1 }, { 4, 4, 25 } }); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT); break; } chairlift_paint_util_draw_supports(session, SEGMENT_C4, height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x00744008 */ static void chairlift_paint_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { chairlift_paint_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -555,7 +559,7 @@ static void chairlift_paint_25_deg_down( /** rct2: 0x00744018 */ static void chairlift_paint_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { chairlift_paint_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -563,7 +567,7 @@ static void chairlift_paint_flat_to_25_deg_down( /** rct2: 0x00744028 */ static void chairlift_paint_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { chairlift_paint_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -571,7 +575,7 @@ static void chairlift_paint_25_deg_down_to_flat( /** rct2: 0x00744038 */ static void chairlift_paint_left_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -580,65 +584,65 @@ static void chairlift_paint_left_quarter_turn_1_tile( { case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CORNER_NW_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 16, 16, 2 }, { 16, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 16, 0, height + 28 }, { 16, 16, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20532); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 16, 4, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 16, 4, height }, { 2, 2, 27 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20536); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 28, 4, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 4, height }, { 2, 2, 27 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CORNER_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 16, 16, 2 }, { 0, 0, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height + 28 }, { 16, 16, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20533); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 16, 4, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 16, 4, height }, { 2, 2, 27 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20537); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 4, 16, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 4, 16, height }, { 2, 2, 27 } }); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CORNER_SE_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 16, 16, 2 }, { 0, 16, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 16, height + 28 }, { 16, 16, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20534); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 4, 16, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 4, 16, height }, { 2, 2, 27 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20538); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 16, 28, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 16, 28, height }, { 2, 2, 27 } }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_CHAIRLIFT_CORNER_SW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 16, 16, 2 }, { 16, 16, height + 28 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 16, 16, height + 28 }, { 16, 16, 2 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20535); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 28, 16, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 16, height }, { 2, 2, 27 } }); imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_20539); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 27 }, { 16, 28, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 16, 28, height }, { 2, 2, 27 } }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - chairlift_paint_util_draw_supports(session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_D0, direction), height); + chairlift_paint_util_draw_supports(session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_D0, direction), height); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00744048 */ static void chairlift_paint_right_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { chairlift_paint_left_quarter_turn_1_tile(session, ride, trackSequence, (direction + 3) % 4, height, trackElement); diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index e49fc48b38..479c9a99e0 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -34,20 +34,20 @@ static constexpr const uint32_t lift_cage_sprites[][2] = { { SPR_LIFT_CAGE_NW_BACK, SPR_LIFT_CAGE_NW_FRONT }, }; -static void paint_lift_cage(paint_session& session, int8_t index, ImageId colourFlags, int32_t height, uint8_t rotation) +static void paint_lift_cage(PaintSession& session, int8_t index, ImageId colourFlags, int32_t height, uint8_t rotation) { ImageId imageId; imageId = colourFlags.WithIndex(lift_cage_sprites[1 + index][0]); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 2, 2, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 2, 2, height }, { 2, 2, 30 } }); imageId = colourFlags.WithIndex(lift_cage_sprites[1 + index][1]); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 2, 30 }, { 28, 28, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 28, 28, height }, { 2, 2, 30 } }); } /** rct2: 0x0076C6CC */ static void paint_lift_base( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = track_map_3x3[direction][trackSequence]; @@ -60,10 +60,10 @@ static void paint_lift_base( paint_lift_cage(session, -1, session.TrackColours[SCHEME_TRACK], height + 64, session.CurrentRotation); - paint_util_set_vertical_tunnel(session, height + 96); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetVerticalTunnel(session, height + 96); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 96, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); return; } @@ -71,7 +71,7 @@ static void paint_lift_base( int32_t edges = edges_3x3[trackSequence]; auto imageId = session.TrackColours[SCHEME_SUPPORTS].WithIndex(SPR_FLOOR_METAL_B); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 32, 32, 1 } }); track_paint_util_paint_fences( session, edges, session.MapPosition, trackElement, ride, session.TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, @@ -105,14 +105,14 @@ static void paint_lift_base( blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, blockedSegments, 0xFFFF, 0); - paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0076C6DC */ static void paint_lift_tower_section( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (trackSequence == 1) @@ -122,10 +122,10 @@ static void paint_lift_tower_section( paint_lift_cage(session, -1, session.TrackColours[SCHEME_TRACK], height, session.CurrentRotation); - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_vertical_tunnel(session, height + 32); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetVerticalTunnel(session, height + 32); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 4c337d95d8..9efe8757cb 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -623,7 +623,7 @@ static ImageId miniature_railway_track_to_grooved_indent(const TileElement* path /** rct2: 0x008AD0C0 */ static void paint_miniature_railway_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool paintAsGravel = false; @@ -635,7 +635,7 @@ static void paint_miniature_railway_track_flat( paintGrooved = true; } - bool isSupported = wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + bool isSupported = WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); ImageId imageId, imageIdAlt; // In the following 3 calls to PaintAddImageAsParentRotated/PaintAddImageAsChildRotated, we add 1 to the @@ -690,20 +690,20 @@ static void paint_miniature_railway_track_flat( } } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD170, 0x008AD180, 0x008AD190 */ static void paint_miniature_railway_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; - wooden_a_supports_paint_setup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); imageId = session.TrackColours[SCHEME_MISC].WithIndex(miniature_railway_station_floor[direction]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height - 2 }, { 32, 28, 2 }, { 0, 2, height }); @@ -711,18 +711,18 @@ static void paint_miniature_railway_station( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(miniature_railway_track_pieces_flat_station[direction]); PaintAddImageAsChildRotated(session, direction, imageId, { 0, 6, height }, { 32, 20, 2 }, { 0, 0, height }); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); 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); - paint_util_set_general_support_height(session, height + 30, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 30, 0x20); } /** rct2: 0x008AD0D0 */ static void paint_miniature_railway_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(miniature_railway_track_pieces_25_deg_up[direction]); @@ -732,28 +732,28 @@ static void paint_miniature_railway_track_25_deg_up( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; } - wooden_a_supports_paint_setup(session, direction & 1, 45 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AD0E0 */ static void paint_miniature_railway_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(miniature_railway_track_pieces_flat_to_25_deg_up[direction]); @@ -763,28 +763,28 @@ static void paint_miniature_railway_track_flat_to_25_deg_up( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - wooden_a_supports_paint_setup(session, direction & 1, 37 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AD0F0 */ static void paint_miniature_railway_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(miniature_railway_track_pieces_25_deg_up_to_flat[direction]); @@ -794,28 +794,28 @@ static void paint_miniature_railway_track_25_deg_up_to_flat( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT); break; } - wooden_a_supports_paint_setup(session, direction & 1, 41 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AD100 */ static void paint_miniature_railway_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { paint_miniature_railway_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -823,7 +823,7 @@ static void paint_miniature_railway_track_25_deg_down( /** rct2: 0x008AD110 */ static void paint_miniature_railway_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -831,7 +831,7 @@ static void paint_miniature_railway_track_flat_to_25_deg_down( /** rct2: 0x008AD120 */ static void paint_miniature_railway_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -974,12 +974,12 @@ static constexpr const int8_t miniature_railway_right_quarter_turn_5_tiles_sprit /** rct2: 0x008AD140 */ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( + bool isSupported = WoodenASupportsPaintSetup( session, right_quarter_turn_5_supports_type[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); @@ -1006,27 +1006,27 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( CoordsXYZ boundsOffset = CoordsXYZ(offset, 0); PaintAddImageAsChild( - session, imageId, { offset, height }, { boundsLength, 2 }, boundsOffset + CoordsXYZ{ 0, 0, height }); + session, imageId, { offset, height }, { boundsOffset + CoordsXYZ{ 0, 0, height }, { boundsLength, 2 } }); } } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } int32_t blockedSegments = 0; @@ -1056,14 +1056,14 @@ static void paint_miniature_railway_track_right_quarter_turn_5_tiles( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD130 */ static void paint_miniature_railway_track_left_quarter_turn_5_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1095,7 +1095,7 @@ static constexpr const uint32_t miniature_railway_s_bend_left_tiles_track_floor[ /** rct2: 0x8AD150 */ static void paint_miniature_railway_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -1103,7 +1103,7 @@ static void paint_miniature_railway_track_s_bend_left( trackSequence = 3 - trackSequence; } - bool isSupported = wooden_a_supports_paint_setup( + bool isSupported = WoodenASupportsPaintSetup( session, s_bend_left_supports_type[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); static constexpr const CoordsXY offsetList[] = { @@ -1148,14 +1148,14 @@ static void paint_miniature_railway_track_s_bend_left( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } } else { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } } @@ -1175,9 +1175,9 @@ static void paint_miniature_railway_track_s_bend_left( blockedSegments = SEGMENTS_ALL; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction & 1), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const int8_t s_bend_right_supports_type[4][4] = { @@ -1204,7 +1204,7 @@ static constexpr const uint32_t miniature_railway_s_bend_right_tiles_track_floor /** rct2: 0x008AD160 */ static void paint_miniature_railway_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -1212,7 +1212,7 @@ static void paint_miniature_railway_track_s_bend_right( trackSequence = 3 - trackSequence; } - bool isSupported = wooden_a_supports_paint_setup( + bool isSupported = WoodenASupportsPaintSetup( session, s_bend_right_supports_type[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); static constexpr const CoordsXY offsetList[] = { @@ -1257,14 +1257,14 @@ static void paint_miniature_railway_track_s_bend_right( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } } else { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } } @@ -1284,9 +1284,9 @@ static void paint_miniature_railway_track_s_bend_right( blockedSegments = SEGMENTS_ALL; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction & 1), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint32_t miniature_railway_right_quarter_turn_3_tile_track_floor[4][3] = { @@ -1337,14 +1337,14 @@ static constexpr const CoordsXYZ miniature_railway_right_quarter_turn_3_tile_bou /** rct2: 0x008AD1B0 */ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( + isSupported = WoodenASupportsPaintSetup( session, supportType[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } if (!isSupported) @@ -1359,7 +1359,7 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex( SPR_G2_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_3); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 8, 8, 2 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { 0, 0, height }, { 8, 8, 2 } }); } } else @@ -1380,7 +1380,7 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( CoordsXYZ boundsOffset(offset, 0); PaintAddImageAsChild( - session, imageId, { offset, height }, { boundsLength, 3 }, boundsOffset + CoordsXYZ{ 0, 0, height }); + session, imageId, { offset, height }, { boundsOffset + CoordsXYZ{ 0, 0, height }, { boundsLength, 3 } }); } track_paint_util_right_quarter_turn_3_tiles_tunnel(session, height, direction, trackSequence, TUNNEL_SQUARE_FLAT); @@ -1397,14 +1397,14 @@ static void paint_miniature_railway_track_right_quarter_turn_3_tiles( blockedSegments = SEGMENTS_ALL; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD1A0 */ static void paint_miniature_railway_track_left_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1511,7 +1511,7 @@ static constexpr const CoordsXY miniature_railway_track_floor_pieces_left_eight_ /** rct2: 0x008AD1C0 */ static void paint_miniature_railway_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t supportType[4][5] = { @@ -1527,7 +1527,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( // for track sequence 4 if (trackSequence != 4 || !isRightEighthToOrthog) { - isSupported = wooden_a_supports_paint_setup( + isSupported = WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } ImageId imageId; @@ -1545,7 +1545,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( bounds = miniature_railway_track_pieces_right_eight_to_orthog_bounds[direction][index]; offset = miniature_railway_track_pieces_right_eight_to_orthog_offset[direction][index]; } - PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { offset, height }, bounds }); } } else @@ -1554,7 +1554,7 @@ static void paint_miniature_railway_track_left_eighth_to_diag( miniature_railway_floor_track_pieces_left_eight_to_diag[direction][trackSequence]); CoordsXY offset = miniature_railway_track_floor_pieces_left_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_left_eight_to_diag_bounds[direction][trackSequence]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { offset, height }, bounds }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1563,21 +1563,21 @@ static void paint_miniature_railway_track_left_eighth_to_diag( miniature_railway_track_pieces_left_eight_to_diag[direction][index]); offset = miniature_railway_track_pieces_left_eight_to_diag_offset[direction][index]; bounds = miniature_railway_track_pieces_left_eight_to_diag_bounds[direction][index]; - PaintAddImageAsChild(session, imageId, { 0, 0, height }, bounds, { offset, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { offset, height }, bounds }); } } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static constexpr const uint32_t miniature_railway_floor_track_pieces_right_eight_to_diag[4][5] = { @@ -1675,7 +1675,7 @@ static constexpr const CoordsXY miniature_railway_track_floor_pieces_right_eight /** rct2: 0x008AD1D0 */ static void paint_miniature_railway_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t supportType[4][5] = { @@ -1691,7 +1691,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( // for track sequence 4 if (trackSequence != 4 || !isLeftEighthToOrthog) { - isSupported = wooden_a_supports_paint_setup( + isSupported = WoodenASupportsPaintSetup( session, supportType[direction][trackSequence], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } @@ -1710,7 +1710,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( bounds = miniature_railway_track_pieces_left_eight_to_orthog_bounds[direction][index]; offset = miniature_railway_track_pieces_left_eight_to_orthog_offset[direction][index]; } - PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { offset, height }, bounds }); } } else @@ -1719,7 +1719,7 @@ static void paint_miniature_railway_track_right_eighth_to_diag( miniature_railway_floor_track_pieces_right_eight_to_diag[direction][trackSequence]); CoordsXY offset = miniature_railway_track_floor_pieces_right_eight_to_diag_offset[direction][trackSequence]; CoordsXYZ bounds = miniature_railway_track_floor_pieces_right_eight_to_diag_bounds[direction][trackSequence]; - PaintAddImageAsParent(session, imageId, { 0, 0, height }, bounds, { offset, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { { offset, height }, bounds }); int8_t index = paint_miniature_railway_eighth_to_diag_index[trackSequence]; if (index >= 0) @@ -1728,26 +1728,26 @@ static void paint_miniature_railway_track_right_eighth_to_diag( miniature_railway_track_pieces_right_eight_to_diag[direction][index]); offset = miniature_railway_track_pieces_right_eight_to_diag_offset[direction][index]; bounds = miniature_railway_track_pieces_right_eight_to_diag_bounds[direction][index]; - PaintAddImageAsChild(session, imageId, { 0, 0, height }, bounds, { offset, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { offset, height }, bounds }); } } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AD1E0 */ static void paint_miniature_railway_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1756,7 +1756,7 @@ static void paint_miniature_railway_track_left_eighth_to_orthogonal( /** rct2: 0x008AD1F0 */ static void paint_miniature_railway_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1805,7 +1805,7 @@ static constexpr const floor_desc floors[] = { /** rct2: 0x008AD200 */ static void miniature_railway_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isSupported = false; @@ -1820,7 +1820,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]); + isSupported = WoodenASupportsPaintSetup(session, supportType, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -1835,23 +1835,23 @@ static void miniature_railway_track_diag_flat( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), { 0, 0, height }, - { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); + { { floorBoundOffset, height }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } enum @@ -1861,15 +1861,15 @@ enum }; static bool wooden_supports_paint_setup( - paint_session& session, int32_t woodType, int32_t supportType, int32_t special, int32_t height, ImageId imageColourFlags) + PaintSession& session, int32_t woodType, int32_t supportType, int32_t special, int32_t height, ImageId imageColourFlags) { switch (woodType) { case WOOD_A: - return wooden_a_supports_paint_setup(session, supportType, special, height, imageColourFlags); + return WoodenASupportsPaintSetup(session, supportType, special, height, imageColourFlags); case WOOD_B: - return wooden_b_supports_paint_setup(session, supportType, special, height, imageColourFlags); + return WoodenBSupportsPaintSetup(session, supportType, special, height, imageColourFlags); } return false; @@ -1877,7 +1877,7 @@ static bool wooden_supports_paint_setup( /** rct2: 0x008AD230 */ static void miniature_railway_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { // TODO: The supports are inconsistent for different rotations @@ -1935,29 +1935,29 @@ static void miniature_railway_track_diag_25_deg_up( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), - { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, - { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + offsetB[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + offsetB[direction] }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + offsetB[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + offsetB[direction] }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AD210 */ static void miniature_railway_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool hasSupports = false; @@ -1972,7 +1972,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]); + hasSupports = WoodenASupportsPaintSetup(session, supportType, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -1987,28 +1987,28 @@ static void miniature_railway_track_diag_flat_to_25_deg_up( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), { 0, 0, height }, - { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); + { { floorBoundOffset, height }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AD220 */ static void miniature_railway_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t supportOffsets[][4] = { @@ -2062,29 +2062,29 @@ static void miniature_railway_track_diag_25_deg_up_to_flat( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), - { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, - { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + railOffsets[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + railOffsets[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AD260 */ static void miniature_railway_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t supportOffsets[][4] = { @@ -2137,29 +2137,29 @@ static void miniature_railway_track_diag_25_deg_down( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), - { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, - { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + railOffsets[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + railOffsets[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AD240 */ static void miniature_railway_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr int8_t supportOffsets[][4] = { @@ -2211,28 +2211,28 @@ static void miniature_railway_track_diag_flat_to_25_deg_down( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), - { 0, 0, height + offsetsB[direction][trackSequence][0] }, { floorBoundSize, (drawRail ? 2 : 0) }, - { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }); + { 0, 0, height + offsetsB[direction][trackSequence][0] }, + { { floorBoundOffset, height + offsetsB[direction][trackSequence][1] }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + railOffsets[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height + railOffsets[direction] }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void miniature_railway_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool hasSupports = false; @@ -2246,7 +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]); + hasSupports = WoodenASupportsPaintSetup(session, supportType, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 1 && trackSequence == 3) @@ -2261,23 +2261,23 @@ static void miniature_railway_track_diag_25_deg_down_to_flat( { PaintAddImageAsParent( session, session.TrackColours[SCHEME_SUPPORTS].WithIndex(floorImage), { 0, 0, height }, - { floorBoundSize, (drawRail ? 2 : 0) }, { floorBoundOffset, height }); + { { floorBoundOffset, height }, { floorBoundSize, (drawRail ? 2 : 0) } }); if (drawRail) { PaintAddImageAsChild( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 2 } }); } } else if (drawRail) { PaintAddImageAsParent( - session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, { 32, 32, 2 }, - { -16, -16, height }); + session, session.TrackColours[SCHEME_TRACK].WithIndex(imageId), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 2 } }); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index b1f980340d..2f7c52af63 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -385,7 +385,7 @@ static constexpr const uint32_t monorail_track_pieces_diag_25_deg_up[4] = { /** rct2: 0x008AE1AC */ static void paint_monorail_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(monorail_track_pieces_flat[direction]); @@ -401,26 +401,26 @@ static void paint_monorail_track_flat( if (direction == 0 || direction == 2) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE25C, 0x008AE26C, 0x008AE27C */ static void paint_monorail_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -445,42 +445,42 @@ static void paint_monorail_station( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(monorail_track_pieces_flat[direction]); if (direction == 0 || direction == 2) { - PaintAddImageAsChild(session, imageId, { 0, 6, height }, { 32, 20, 2 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 6, height }, { { 0, 0, height }, { 32, 20, 2 } }); } else { - PaintAddImageAsChild(session, imageId, { 6, 0, height }, { 20, 32, 2 }, { 0, 0, height }); + PaintAddImageAsChild(session, imageId, { 6, 0, height }, { { 0, 0, height }, { 20, 32, 2 } }); } if (direction == 0 || direction == 2) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 0 || direction == 2) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE1BC */ static void paint_monorail_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(monorail_track_pieces_25_deg_up[direction]); @@ -497,32 +497,32 @@ static void paint_monorail_track_25_deg_up( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE1CC */ static void paint_monorail_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(monorail_track_pieces_flat_to_25_deg_up[direction]); @@ -539,32 +539,32 @@ static void paint_monorail_track_flat_to_25_deg_up( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; case 3: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE1DC */ static void paint_monorail_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(monorail_track_pieces_25_deg_up_to_flat[direction]); @@ -581,32 +581,32 @@ static void paint_monorail_track_25_deg_up_to_flat( switch (direction) { case 0: - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: - paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14); break; case 2: - paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14); break; case 3: - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT); break; } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } /** rct2: 0x008AE1EC */ static void paint_monorail_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { paint_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -614,7 +614,7 @@ static void paint_monorail_track_25_deg_down( /** rct2: 0x008AE1FC */ static void paint_monorail_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -622,7 +622,7 @@ static void paint_monorail_track_flat_to_25_deg_down( /** rct2: 0x008AE20C */ static void paint_monorail_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -630,7 +630,7 @@ static void paint_monorail_track_25_deg_down_to_flat( /** rct2: 0x008AE22C */ static void paint_monorail_track_right_quarter_turn_5_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -642,28 +642,28 @@ static void paint_monorail_track_right_quarter_turn_5_tiles( { case 0: case 6: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } int32_t blockedSegments = 0; @@ -686,14 +686,14 @@ static void paint_monorail_track_right_quarter_turn_5_tiles( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE21C */ static void paint_monorail_track_left_quarter_turn_5_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -702,7 +702,7 @@ static void paint_monorail_track_left_quarter_turn_5_tiles( /** rct2: 0x */ static void paint_monorail_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -734,22 +734,19 @@ static void paint_monorail_track_s_bend_left( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -757,22 +754,19 @@ static void paint_monorail_track_s_bend_left( { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -793,14 +787,14 @@ static void paint_monorail_track_s_bend_left( blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction & 1), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE24C */ static void paint_monorail_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction == 2 || direction == 3) @@ -829,22 +823,19 @@ static void paint_monorail_track_s_bend_right( { if (trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -852,22 +843,19 @@ static void paint_monorail_track_s_bend_right( { if (trackSequence == 3) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } } @@ -888,14 +876,14 @@ static void paint_monorail_track_s_bend_right( blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction & 1), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE29C */ static void paint_monorail_track_right_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -908,7 +896,7 @@ static void paint_monorail_track_right_quarter_turn_3_tiles( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -925,14 +913,14 @@ static void paint_monorail_track_right_quarter_turn_3_tiles( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE28C */ static void paint_monorail_track_left_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -945,7 +933,7 @@ static constexpr const int8_t paint_monorail_eighth_to_diag_index[] = { /** rct2: 0x008AE31C */ static void paint_monorail_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -961,31 +949,27 @@ static void paint_monorail_track_left_eighth_to_diag( switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 4: if (direction == 0) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -1008,13 +992,13 @@ static void paint_monorail_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE32C */ static void paint_monorail_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -1030,31 +1014,27 @@ static void paint_monorail_track_right_eighth_to_diag( switch (trackSequence) { case 0: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; case 4: if (direction == 0) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 1) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 2) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 3) - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } int32_t blockedSegments = 0; @@ -1077,13 +1057,13 @@ static void paint_monorail_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE33C */ static void paint_monorail_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; @@ -1093,7 +1073,7 @@ static void paint_monorail_track_left_eighth_to_orthogonal( /** rct2: 0x008AE34C */ static void paint_monorail_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr uint8_t map[] = { 4, 2, 3, 1, 0 }; @@ -1124,7 +1104,7 @@ static constexpr const int32_t monorail_diag_blocked_segments[] = { /** rct2: 0x008AE2AC */ static void paint_monorail_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1135,19 +1115,19 @@ static void paint_monorail_track_diag_flat( if (trackSequence == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008AE2DC */ static void paint_monorail_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1158,19 +1138,19 @@ static void paint_monorail_track_diag_25_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 8, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE2BC */ static void paint_monorail_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1181,19 +1161,19 @@ static void paint_monorail_track_diag_flat_to_25_deg_up( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008AE2CC */ static void paint_monorail_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1204,19 +1184,19 @@ static void paint_monorail_track_diag_25_deg_up_to_flat( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE30C */ static void paint_monorail_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1227,19 +1207,19 @@ static void paint_monorail_track_diag_25_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 8, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE2EC */ static void paint_monorail_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1251,19 +1231,19 @@ static void paint_monorail_track_diag_flat_to_25_deg_down( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 4, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x008AE2FC */ static void paint_monorail_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (monorail_diag_image_segment[direction][trackSequence]) @@ -1275,14 +1255,14 @@ static void paint_monorail_track_diag_25_deg_down_to_flat( if (trackSequence == 3) { - metal_b_supports_paint_setup( + MetalBSupportsPaintSetup( session, METAL_SUPPORTS_BOXED, monorail_diag_support_segment[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); } int32_t blockedSegments = monorail_diag_blocked_segments[trackSequence]; - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index cfe3dd34bc..f13f4bc9a6 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -21,7 +21,7 @@ /** rct2: 0x008636F4 */ static void suspended_monorail_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -40,20 +40,20 @@ static void suspended_monorail_track_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x008637A4, 0x008637B4, 0x008637C4 */ static void suspended_monorail_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -74,14 +74,14 @@ static void suspended_monorail_track_station( { 32, 20, 3 }, { 0, 6, height + 32 }); track_paint_util_draw_station_metal_supports_2(session, direction, height, session.TrackColours[SCHEME_SUPPORTS], 3); track_paint_util_draw_station_inverted(session, ride, direction, height, 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x00863704 */ static void suspended_monorail_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -108,26 +108,26 @@ static void suspended_monorail_track_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 60, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 60, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 60, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 60, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -135,18 +135,18 @@ static void suspended_monorail_track_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x00863714 */ static void suspended_monorail_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -173,26 +173,26 @@ static void suspended_monorail_track_flat_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 52, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -200,18 +200,18 @@ static void suspended_monorail_track_flat_to_25_deg_up( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } /** rct2: 0x00863724 */ static void suspended_monorail_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -238,26 +238,26 @@ static void suspended_monorail_track_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); if (track_paint_util_should_paint_supports(session.MapPosition)) { switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -265,18 +265,18 @@ static void suspended_monorail_track_25_deg_up_to_flat( if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_INVERTED_9); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_15); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_15); } - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } /** rct2: 0x00863734 */ static void suspended_monorail_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { suspended_monorail_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -284,7 +284,7 @@ static void suspended_monorail_track_25_deg_down( /** rct2: 0x00863744 */ static void suspended_monorail_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -292,7 +292,7 @@ static void suspended_monorail_track_flat_to_25_deg_down( /** rct2: 0x00863754 */ static void suspended_monorail_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); @@ -300,7 +300,7 @@ static void suspended_monorail_track_25_deg_down_to_flat( /** rct2: 0x00863764 */ static void suspended_monorail_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -330,20 +330,19 @@ static void suspended_monorail_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -369,12 +368,11 @@ static void suspended_monorail_track_left_quarter_turn_5( { 32, 16, 3 }, { 0, 16, height + 32 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -400,12 +398,12 @@ static void suspended_monorail_track_left_quarter_turn_5( { 16, 16, 3 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 5: switch (direction) @@ -431,12 +429,11 @@ static void suspended_monorail_track_left_quarter_turn_5( { 16, 32, 3 }, { 16, 0, height + 32 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 6: switch (direction) @@ -463,29 +460,28 @@ static void suspended_monorail_track_left_quarter_turn_5( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00863774 */ static void suspended_monorail_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -494,7 +490,7 @@ static void suspended_monorail_track_right_quarter_turn_5( /** rct2: 0x00863784 */ static void suspended_monorail_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -524,16 +520,15 @@ static void suspended_monorail_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -560,24 +555,23 @@ static void suspended_monorail_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -604,24 +598,23 @@ static void suspended_monorail_track_s_bend_left( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 6, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -648,28 +641,27 @@ static void suspended_monorail_track_s_bend_left( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00863794 */ static void suspended_monorail_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -699,16 +691,15 @@ static void suspended_monorail_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -735,24 +726,23 @@ static void suspended_monorail_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -779,24 +769,23 @@ static void suspended_monorail_track_s_bend_right( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 7, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -823,28 +812,27 @@ static void suspended_monorail_track_s_bend_right( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 1: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 2: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008637D4 */ static void suspended_monorail_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -874,20 +862,19 @@ static void suspended_monorail_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -913,9 +900,9 @@ static void suspended_monorail_track_left_quarter_turn_3( { 16, 16, 3 }, { 16, 16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -942,29 +929,28 @@ static void suspended_monorail_track_left_quarter_turn_3( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); switch (direction) { case 2: - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); break; case 3: - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x008637E4 */ static void suspended_monorail_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -973,7 +959,7 @@ static void suspended_monorail_track_right_quarter_turn_3( /** rct2: 0x00863864 */ static void suspended_monorail_track_left_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1003,16 +989,15 @@ static void suspended_monorail_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1038,12 +1023,11 @@ static void suspended_monorail_track_left_eighth_to_diag( { 32, 16, 3 }, { 0, 16, height + 32 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1069,15 +1053,15 @@ static void suspended_monorail_track_left_eighth_to_diag( { 16, 16, 3 }, { 0, 0, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -1104,39 +1088,38 @@ static void suspended_monorail_track_left_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00863874 */ static void suspended_monorail_track_right_eighth_to_diag( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1166,16 +1149,15 @@ static void suspended_monorail_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1201,12 +1183,11 @@ static void suspended_monorail_track_right_eighth_to_diag( { 32, 16, 3 }, { 0, 0, height + 32 }); break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1232,15 +1213,15 @@ static void suspended_monorail_track_right_eighth_to_diag( { 16, 16, 3 }, { 0, 16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: switch (direction) @@ -1267,39 +1248,38 @@ static void suspended_monorail_track_right_eighth_to_diag( break; } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00863884 */ static void suspended_monorail_track_left_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1308,7 +1288,7 @@ static void suspended_monorail_track_left_eighth_to_orthogonal( /** rct2: 0x00863894 */ static void suspended_monorail_track_right_eighth_to_orthogonal( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; @@ -1317,7 +1297,7 @@ static void suspended_monorail_track_right_eighth_to_orthogonal( /** rct2: 0x008637F4 */ static void suspended_monorail_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1331,9 +1311,9 @@ static void suspended_monorail_track_diag_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1344,9 +1324,9 @@ static void suspended_monorail_track_diag_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1357,9 +1337,9 @@ static void suspended_monorail_track_diag_flat( { 32, 32, 3 }, { -16, -16, height + 32 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) @@ -1371,36 +1351,36 @@ static void suspended_monorail_track_diag_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 42, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } } /** rct2: 0x00863824 */ static void suspended_monorail_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1414,9 +1394,9 @@ static void suspended_monorail_track_diag_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 48 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -1427,9 +1407,9 @@ static void suspended_monorail_track_diag_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 48 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1440,9 +1420,9 @@ static void suspended_monorail_track_diag_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 48 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1454,36 +1434,36 @@ static void suspended_monorail_track_diag_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 55, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 57, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x00863804 */ static void suspended_monorail_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1497,9 +1477,9 @@ static void suspended_monorail_track_diag_flat_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -1510,9 +1490,9 @@ static void suspended_monorail_track_diag_flat_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -1523,9 +1503,9 @@ static void suspended_monorail_track_diag_flat_to_25_deg_up( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -1537,36 +1517,36 @@ static void suspended_monorail_track_diag_flat_to_25_deg_up( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 50, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } /** rct2: 0x00863814 */ static void suspended_monorail_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1580,9 +1560,9 @@ static void suspended_monorail_track_diag_25_deg_up_to_flat( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -1593,9 +1573,9 @@ static void suspended_monorail_track_diag_25_deg_up_to_flat( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1606,9 +1586,9 @@ static void suspended_monorail_track_diag_25_deg_up_to_flat( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1620,36 +1600,36 @@ static void suspended_monorail_track_diag_25_deg_up_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x00863854 */ static void suspended_monorail_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1663,9 +1643,9 @@ static void suspended_monorail_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 48 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: switch (direction) @@ -1676,9 +1656,9 @@ static void suspended_monorail_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 48 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: switch (direction) @@ -1689,9 +1669,9 @@ static void suspended_monorail_track_diag_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 48 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: switch (direction) @@ -1703,36 +1683,36 @@ static void suspended_monorail_track_diag_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 54, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 51, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 58, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } } /** rct2: 0x00863834 */ static void suspended_monorail_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1746,8 +1726,8 @@ static void suspended_monorail_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -1758,8 +1738,8 @@ static void suspended_monorail_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -1770,8 +1750,8 @@ static void suspended_monorail_track_diag_flat_to_25_deg_down( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -1783,36 +1763,36 @@ static void suspended_monorail_track_diag_flat_to_25_deg_down( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 48, session.TrackColours[SCHEME_SUPPORTS]); break; } break; } - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } /** rct2: 0x00863844 */ static void suspended_monorail_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (trackSequence) @@ -1826,9 +1806,9 @@ static void suspended_monorail_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: switch (direction) @@ -1839,9 +1819,9 @@ static void suspended_monorail_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: switch (direction) @@ -1852,9 +1832,9 @@ static void suspended_monorail_track_diag_25_deg_down_to_flat( { 32, 32, 3 }, { -16, -16, height + 40 }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: switch (direction) @@ -1866,29 +1846,29 @@ static void suspended_monorail_track_diag_25_deg_down_to_flat( break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); switch (direction) { case 0: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 1, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 1: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 0, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 2: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 2, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; case 3: - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 3, 0, height + 46, session.TrackColours[SCHEME_SUPPORTS]); break; } - paint_util_set_general_support_height(session, height + 64, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index 7945704e48..f5ade9c22a 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -32,7 +32,7 @@ enum /** rct2: 0x008B0E40 */ static void paint_boat_hire_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -41,52 +41,52 @@ static void paint_boat_hire_track_flat( if (direction & 1) { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_BACK_NW_SE); - PaintAddImageAsParent(session, imageId, offset, { 1, 32, 3 }, { 4, 0, height }); + PaintAddImageAsParent(session, imageId, offset, { { 4, 0, height }, { 1, 32, 3 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_FRONT_NW_SE); - PaintAddImageAsParent(session, imageId, offset, { 1, 32, 3 }, { 28, 0, height }); + PaintAddImageAsParent(session, imageId, offset, { { 28, 0, height }, { 1, 32, 3 } }); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_BACK_SW_NE); - PaintAddImageAsParent(session, imageId, offset, { 32, 1, 3 }, { 0, 4, height }); + PaintAddImageAsParent(session, imageId, offset, { { 0, 4, height }, { 32, 1, 3 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_FRONT_SW_NE); - PaintAddImageAsParent(session, imageId, offset, { 32, 1, 3 }, { 0, 28, height }); + PaintAddImageAsParent(session, imageId, offset, { { 0, 28, height }, { 32, 1, 3 } }); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 16, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } /** rct2: 0x008B0E50 */ static void paint_boat_hire_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const auto* stationObj = ride.GetStationObject(); if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( session, ride, stationObj, session.MapPosition, direction, height, trackElement, session.CurrentRotation); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( session, ride, stationObj, session.MapPosition, direction, height, trackElement, session.CurrentRotation); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x008B0E80 */ static void paint_boat_hire_track_left_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -95,42 +95,42 @@ static void paint_boat_hire_track_left_quarter_turn_1_tile( { case 0: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_BACK_SW_NW); - PaintAddImageAsParent(session, imageId, offset, { 32, 32, 0 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, offset, { { 0, 0, height }, { 32, 32, 0 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_FRONT_SW_NW); - PaintAddImageAsParent(session, imageId, offset, { 3, 3, 3 }, { 28, 28, height + 2 }); + PaintAddImageAsParent(session, imageId, offset, { { 28, 28, height + 2 }, { 3, 3, 3 } }); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_BACK_NW_NE); - PaintAddImageAsParent(session, imageId, offset, { 32, 32, 0 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, offset, { { 0, 0, height }, { 32, 32, 0 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_FRONT_NW_NE); - PaintAddImageAsParent(session, imageId, offset, { 3, 3, 3 }, { 28, 28, height + 2 }); + PaintAddImageAsParent(session, imageId, offset, { { 28, 28, height + 2 }, { 3, 3, 3 } }); break; case 2: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_BACK_NE_SE); - PaintAddImageAsParent(session, imageId, offset, { 32, 32, 0 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, offset, { { 0, 0, height }, { 32, 32, 0 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_FRONT_NE_SE); - PaintAddImageAsParent(session, imageId, offset, { 3, 3, 3 }, { 28, 28, height + 2 }); + PaintAddImageAsParent(session, imageId, offset, { { 28, 28, height + 2 }, { 3, 3, 3 } }); break; case 3: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_FRONT_SE_SW); - PaintAddImageAsParent(session, imageId, offset, { 3, 3, 3 }, { 28, 28, height + 2 }); + PaintAddImageAsParent(session, imageId, offset, { { 28, 28, height + 2 }, { 3, 3, 3 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_BOAT_HIRE_FLAT_QUARTER_TURN_1_TILE_BACK_SE_SW); - PaintAddImageAsParent(session, imageId, offset, { 32, 32, 0 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, offset, { { 0, 0, height }, { 32, 32, 0 } }); break; } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C8, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 16, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C8, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } /** rct2: 0x008B0E90 */ static void paint_boat_hire_track_right_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 3) % 4, height, trackElement); diff --git a/src/openrct2/ride/water/DingySlide.cpp b/src/openrct2/ride/water/DingySlide.cpp index af5e1f60eb..62b8170c70 100644 --- a/src/openrct2/ride/water/DingySlide.cpp +++ b/src/openrct2/ride/water/DingySlide.cpp @@ -349,7 +349,7 @@ enum }; static void dinghy_slide_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -376,18 +376,18 @@ static void dinghy_slide_track_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -404,21 +404,21 @@ static void dinghy_slide_track_station( session, direction, session.TrackColours[SCHEME_MISC].WithIndex(imageIds[direction][1]), { 0, 0, height }, { 32, 32, 1 }); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5 + (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8 - (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); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -445,25 +445,25 @@ static void dinghy_slide_track_25_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void dinghy_slide_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -481,25 +481,25 @@ static void dinghy_slide_track_60_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void dinghy_slide_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -526,25 +526,25 @@ static void dinghy_slide_track_flat_to_25_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void dinghy_slide_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -562,25 +562,25 @@ static void dinghy_slide_track_25_deg_up_to_60_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void dinghy_slide_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -598,25 +598,25 @@ static void dinghy_slide_track_60_deg_up_to_25_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void dinghy_slide_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -643,63 +643,63 @@ static void dinghy_slide_track_25_deg_up_to_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void dinghy_slide_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { dinghy_slide_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { dinghy_slide_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_right_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][5] = { + static constexpr const SpriteBb imageIds[4][5] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_5_SW_SE_PART_0, { 0, 2, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_SW_SE_PART_1, { 0, 16, 0 }, { 0, 16, 0 }, { 32, 16, 2 } }, @@ -729,7 +729,7 @@ static void dinghy_slide_track_right_quarter_turn_5( { 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] = { + static constexpr const SpriteBb frontImageIds[4][5] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_5_FRONT_SW_SE_PART_0, { 0, 2, 0 }, { 0, 6, 27 }, { 32, 30, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_FRONT_SW_SE_PART_1, { 0, 16, 0 }, { 0, 16, 27 }, { 32, 16, 0 } }, @@ -769,62 +769,60 @@ static void dinghy_slide_track_right_quarter_turn_5( { case 0: case 6: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_left_quarter_turn_5( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -832,14 +830,14 @@ static void dinghy_slide_track_left_quarter_turn_5( } static void dinghy_slide_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -879,9 +877,9 @@ static void dinghy_slide_track_s_bend_left( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -890,14 +888,13 @@ static void dinghy_slide_track_s_bend_left( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 0 || direction == 1) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5 + (direction & 1), (direction & 1), height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 2: @@ -907,23 +904,22 @@ static void dinghy_slide_track_s_bend_left( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 2 || direction == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5 + (direction & 1), (direction & 1), height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; } @@ -931,22 +927,22 @@ static void dinghy_slide_track_s_bend_left( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -986,9 +982,9 @@ static void dinghy_slide_track_s_bend_right( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -997,13 +993,12 @@ static void dinghy_slide_track_s_bend_right( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 0 || direction == 1) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 2: @@ -1013,22 +1008,21 @@ static void dinghy_slide_track_s_bend_right( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 2 || direction == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; } @@ -1036,25 +1030,25 @@ static void dinghy_slide_track_s_bend_right( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_right_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][3] = { + static constexpr const SpriteBb imageIds[4][3] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_3_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_SW_SE_PART_1, { 0, 0, 0 }, { 16, 16, 0 }, { 16, 16, 2 } }, @@ -1076,7 +1070,7 @@ static void dinghy_slide_track_right_quarter_turn_3( { 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] = { + static constexpr const SpriteBb frontImageIds[4][3] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_3_FRONT_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 27 }, { 32, 20, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_FRONT_SW_SE_PART_1, { 0, 0, 0 }, { 16, 16, 27 }, { 16, 16, 0 } }, @@ -1109,7 +1103,7 @@ static void dinghy_slide_track_right_quarter_turn_3( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1126,13 +1120,13 @@ static void dinghy_slide_track_right_quarter_turn_3( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_left_quarter_turn_3( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1140,7 +1134,7 @@ static void dinghy_slide_track_left_quarter_turn_3( } static void dinghy_slide_track_flat_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1158,18 +1152,18 @@ static void dinghy_slide_track_flat_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_25_deg_up_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1187,25 +1181,25 @@ static void dinghy_slide_track_25_deg_up_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void dinghy_slide_track_60_deg_up_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1223,25 +1217,25 @@ static void dinghy_slide_track_60_deg_up_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 32, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void dinghy_slide_track_flat_to_25_deg_up_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1259,25 +1253,25 @@ static void dinghy_slide_track_flat_to_25_deg_up_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void dinghy_slide_track_25_deg_up_to_60_deg_up_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1295,25 +1289,25 @@ static void dinghy_slide_track_25_deg_up_to_60_deg_up_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void dinghy_slide_track_60_deg_up_to_25_deg_up_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1331,25 +1325,25 @@ static void dinghy_slide_track_60_deg_up_to_25_deg_up_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void dinghy_slide_track_25_deg_up_to_flat_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -1367,63 +1361,63 @@ static void dinghy_slide_track_25_deg_up_to_flat_covered( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void dinghy_slide_track_25_deg_down_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { dinghy_slide_track_25_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_60_deg_down_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { dinghy_slide_track_60_deg_up_covered(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_flat_to_25_deg_down_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_60_deg_down_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_25_deg_down_to_flat_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void dinghy_slide_track_right_quarter_turn_5_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][5] = { + static constexpr const SpriteBb imageIds[4][5] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_SW_SE_PART_1, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 } }, @@ -1453,7 +1447,7 @@ static void dinghy_slide_track_right_quarter_turn_5_covered( { 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] = { + static constexpr const SpriteBb frontImageIds[4][5] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_FRONT_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 27 }, { 32, 30, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_5_COVERED_FRONT_SW_SE_PART_1, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 } }, @@ -1493,62 +1487,60 @@ static void dinghy_slide_track_right_quarter_turn_5_covered( { case 0: case 6: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 0 && trackSequence == 6) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } if (direction == 1 && trackSequence == 6) { - paint_util_push_tunnel_left(session, height, TUNNEL_0); + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_right(session, height, TUNNEL_0); + PaintUtilPushTunnelRight(session, height, TUNNEL_0); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_left_quarter_turn_5_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; @@ -1556,7 +1548,7 @@ static void dinghy_slide_track_left_quarter_turn_5_covered( } static void dinghy_slide_track_s_bend_left_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -1596,9 +1588,9 @@ static void dinghy_slide_track_s_bend_left_covered( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -1607,14 +1599,13 @@ static void dinghy_slide_track_s_bend_left_covered( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 0 || direction == 1) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5 + (direction & 1), (direction & 1), height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 2: @@ -1624,23 +1615,22 @@ static void dinghy_slide_track_s_bend_left_covered( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 2 || direction == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 5 + (direction & 1), (direction & 1), height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; } @@ -1648,22 +1638,22 @@ static void dinghy_slide_track_s_bend_left_covered( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_s_bend_right_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -1703,9 +1693,9 @@ static void dinghy_slide_track_s_bend_right_covered( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -1714,13 +1704,12 @@ static void dinghy_slide_track_s_bend_right_covered( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 0 || direction == 1) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 2: @@ -1730,22 +1719,21 @@ static void dinghy_slide_track_s_bend_right_covered( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 2 || direction == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_TUBES, 8 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; } @@ -1753,25 +1741,25 @@ static void dinghy_slide_track_s_bend_right_covered( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_right_quarter_turn_3_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - static constexpr const sprite_bb imageIds[4][3] = { + static constexpr const SpriteBb imageIds[4][3] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 0 }, { 32, 20, 2 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_SW_SE_PART_1, { 0, 0, 0 }, { 16, 16, 0 }, { 16, 16, 2 } }, @@ -1793,7 +1781,7 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( { 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] = { + static constexpr const SpriteBb frontImageIds[4][3] = { { { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_FRONT_SW_SE_PART_0, { 0, 0, 0 }, { 0, 6, 27 }, { 32, 20, 0 } }, { SPR_DINGHY_SLIDE_QUARTER_TURN_3_COVERED_FRONT_SW_SE_PART_1, { 0, 0, 0 }, { 16, 16, 27 }, { 16, 16, 0 } }, @@ -1826,7 +1814,7 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( { case 0: case 3: - metal_a_supports_paint_setup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_TUBES, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); break; } @@ -1843,13 +1831,13 @@ static void dinghy_slide_track_right_quarter_turn_3_covered( blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; } - paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void dinghy_slide_track_left_quarter_turn_3_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; @@ -1857,7 +1845,7 @@ static void dinghy_slide_track_left_quarter_turn_3_covered( } static void dinghy_slide_track_60_deg_down_to_25_deg_down_covered( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 7d21fb7bbe..5e9a31814b 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -10,6 +10,7 @@ #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" +#include "../../sprites.h" #include "../Track.h" #include "../TrackPaint.h" @@ -161,7 +162,7 @@ static constexpr const uint32_t LogFlumeTrackFlatImageIds[4][2] = { }; static void paint_log_flume_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(LogFlumeTrackFlatImageIds[direction][0]); @@ -172,17 +173,17 @@ static void paint_log_flume_track_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_log_flume_track_station( - paint_session& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(LogFlumeTrackFlatImageIds[direction][0]); @@ -200,26 +201,26 @@ static void paint_log_flume_track_station( if (direction & 1) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } 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); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_log_flume_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -237,24 +238,24 @@ static void paint_log_flume_track_25_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void paint_log_flume_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -272,24 +273,24 @@ static void paint_log_flume_track_flat_to_25_deg_up( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void paint_log_flume_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -307,24 +308,24 @@ static void paint_log_flume_track_25_deg_up_to_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void paint_log_flume_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -342,24 +343,24 @@ static void paint_log_flume_track_25_deg_down( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void paint_log_flume_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -377,24 +378,24 @@ static void paint_log_flume_track_flat_to_25_deg_down( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void paint_log_flume_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -412,24 +413,24 @@ static void paint_log_flume_track_25_deg_down_to_flat( if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session.TrackColours[SCHEME_SUPPORTS]); } if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void paint_log_flume_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -469,9 +470,9 @@ static void paint_log_flume_track_s_bend_left( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -480,14 +481,13 @@ static void paint_log_flume_track_s_bend_left( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 0 || direction == 1) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5 + (direction & 1), (direction & 1), height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 2: @@ -497,23 +497,22 @@ static void paint_log_flume_track_s_bend_left( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 2 || direction == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 5 + (direction & 1), (direction & 1), height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; } @@ -521,22 +520,22 @@ static void paint_log_flume_track_s_bend_left( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_log_flume_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -576,9 +575,9 @@ static void paint_log_flume_track_s_bend_right( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -587,13 +586,12 @@ static void paint_log_flume_track_s_bend_right( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 0 || direction == 1) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 2: @@ -603,22 +601,21 @@ static void paint_log_flume_track_s_bend_right( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); if (direction == 2 || direction == 3) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, METAL_SUPPORTS_BOXED, 8 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; } @@ -626,22 +623,22 @@ static void paint_log_flume_track_s_bend_right( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_log_flume_track_left_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -681,7 +678,7 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles( if (trackSequence != 1 && trackSequence != 2) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (trackSequence) @@ -689,13 +686,13 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles( case 0: if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } break; case 3: if (direction == 2 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction ^ 1, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction ^ 1, height, TUNNEL_0); } break; } @@ -703,24 +700,24 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles( switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_log_flume_track_right_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][3] = { @@ -760,7 +757,7 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles( if (trackSequence != 1 && trackSequence != 2) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (trackSequence) @@ -768,13 +765,13 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles( case 0: if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } break; case 3: if (direction == 0 || direction == 1) { - paint_util_push_tunnel_rotated(session, direction ^ 1, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction ^ 1, height, TUNNEL_0); } break; } @@ -782,37 +779,37 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles( switch (trackSequence) { case 0: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_log_flume_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { PaintAddImageAsParent(session, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); if (direction & 1) { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 6, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK_ALT, 7, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } else { - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 5, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_FORK, 8, 6, height, session.TrackColours[SCHEME_SUPPORTS]); } auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(LogFlumeTrackFlatImageIds[direction][0]); @@ -823,13 +820,13 @@ static void paint_log_flume_track_on_ride_photo( 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void paint_log_flume_track_reverser( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { static constexpr const uint32_t imageIds[4][2] = { @@ -845,12 +842,134 @@ static void paint_log_flume_track_reverser( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); - metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); +} + +// Steep Additions added by OpenRCT2 + +static void log_flume_track_25_down_60( + PaintSession& 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_G2_FLUME_25_60_NW_SE_BACK, SPR_G2_FLUME_25_60_NW_SE_BACK_WATER }, + { SPR_G2_EMPTY, SPR_G2_FLUME_25_60_NW_SE }, + { SPR_G2_EMPTY, SPR_G2_FLUME_25_60_NE_SW }, + { SPR_G2_FLUME_25_60_NE_SW_BACK, SPR_G2_FLUME_25_60_NE_SW_BACK_WATER }, + }; + + auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][0]); + auto frontImageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][1]); + + PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height + 4 }); + PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height }); + + if (direction == 1 || direction == 2) + { + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + } + + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_14); + } + else + { + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height + 12, session.TrackColours[SCHEME_SUPPORTS]); + } + + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); +} + +static void log_flume_track_60_down( + PaintSession& 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_G2_FLUME_60_NW_SE_BACK, SPR_G2_EMPTY }, + { SPR_G2_EMPTY, SPR_G2_FLUME_60_NW_SE }, + { SPR_G2_EMPTY, SPR_G2_FLUME_60_NE_SW }, + { SPR_G2_FLUME_60_NE_SW_BACK, SPR_G2_EMPTY }, + }; + + auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][0]); + auto frontImageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][1]); + + PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height + 4 }); + PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); + + if (direction == 1 || direction == 2) + { + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + } + + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); + } + else + { + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height + 12, session.TrackColours[SCHEME_SUPPORTS]); + } + + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); +} + +static void log_flume_track_60_down_25( + PaintSession& 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_G2_FLUME_60_25_NW_SE_BACK, SPR_G2_FLUME_60_25_NW_SE_BACK_WATER }, + { SPR_G2_EMPTY, SPR_G2_FLUME_60_25_NW_SE }, + { SPR_G2_EMPTY, SPR_G2_FLUME_60_25_NE_SW }, + { SPR_G2_FLUME_60_25_NE_SW_BACK, SPR_G2_FLUME_60_25_NE_SW_BACK_WATER }, + }; + + auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][0]); + auto frontImageId = session.TrackColours[SCHEME_TRACK].WithIndex(imageIds[direction][1]); + + PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height + 4 }); + PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 20, 0 }, { 0, 6, height }); + + if (direction == 1 || direction == 2) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); + + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + } + } + else + { + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); + + if (track_paint_util_should_paint_supports(session.MapPosition)) + { + MetalASupportsPaintSetup(session, METAL_SUPPORTS_BOXED, 4, 8, height + 8, session.TrackColours[SCHEME_SUPPORTS]); + } + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int32_t trackType) @@ -888,6 +1007,14 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int32_t trackType) return paint_log_flume_track_on_ride_photo; case TrackElemType::LogFlumeReverser: return paint_log_flume_track_reverser; + + // Added by OpenRCT2 + case TrackElemType::Down25ToDown60: + return log_flume_track_25_down_60; + case TrackElemType::Down60: + return log_flume_track_60_down; + case TrackElemType::Down60ToDown25: + return log_flume_track_60_down_25; } return nullptr; diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index 8ef0b5e87c..96ca7f43d3 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -178,7 +178,7 @@ static constexpr const uint32_t river_rapids_track_pieces_25_deg_down_to_flat[][ * rct2: 0x006D5889 */ void vehicle_visual_river_rapids( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { imageDirection = OpenRCT2::Entity::Yaw::YawTo32(imageDirection); @@ -223,15 +223,15 @@ void vehicle_visual_river_rapids( } baseImage_id += carEntry->base_image_id; - const vehicle_boundbox* bb = &_riverRapidsBoundbox[j]; + const auto& riverRapidsBb = _riverRapidsBoundbox[j]; + auto bb = BoundBoxXYZ{ { riverRapidsBb.offset_x, riverRapidsBb.offset_y, riverRapidsBb.offset_z + z }, + { riverRapidsBb.length_x, riverRapidsBb.length_y, riverRapidsBb.length_z } }; image_id = ImageId(baseImage_id, vehicle->colours.Body, vehicle->colours.Trim); if (vehicle->IsGhost()) { image_id = ConstructionMarker.WithIndex(image_id.GetIndex()); } - PaintAddImageAsParent( - 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 }); + PaintAddImageAsParent(session, image_id, { 0, 0, z }, bb); if (session.DPI.zoom_level < ZoomLevel{ 2 } && vehicle->num_peeps > 0 && !vehicle->IsGhost()) { @@ -239,35 +239,27 @@ void vehicle_visual_river_rapids( // that's how the original does it...) int32_t peeps = ((ecx / 8) + 0) & 3; image_id = ImageId(baseImage_id + ((peeps + 1) * 72), vehicle->peep_tshirt_colours[0], vehicle->peep_tshirt_colours[1]); - PaintAddImageAsChild( - 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 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, bb); if (vehicle->num_peeps > 2) { peeps = ((ecx / 8) + 2) & 3; image_id = ImageId( baseImage_id + ((peeps + 1) * 72), vehicle->peep_tshirt_colours[2], vehicle->peep_tshirt_colours[3]); - PaintAddImageAsChild( - 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 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, bb); } if (vehicle->num_peeps > 4) { peeps = ((ecx / 8) + 1) & 3; image_id = ImageId( baseImage_id + ((peeps + 1) * 72), vehicle->peep_tshirt_colours[4], vehicle->peep_tshirt_colours[5]); - PaintAddImageAsChild( - 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 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, bb); } if (vehicle->num_peeps > 6) { peeps = ((ecx / 8) + 3) & 3; image_id = ImageId( baseImage_id + ((peeps + 1) * 72), vehicle->peep_tshirt_colours[6], vehicle->peep_tshirt_colours[7]); - PaintAddImageAsChild( - 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 }); + PaintAddImageAsChild(session, image_id, { 0, 0, z }, bb); } } @@ -277,7 +269,7 @@ void vehicle_visual_river_rapids( /** rct2: 0x00757650 */ static void paint_river_rapids_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -290,7 +282,7 @@ static void paint_river_rapids_track_flat( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 1 ? SPR_RIVER_RAPIDS_FLAT_FRONT_NW_SE : SPR_RIVER_RAPIDS_FLAT_FRONT_SE_NW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 3 }, { 27, 0, height + 17 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 2, 5 }, { 10, 10, height }); } else { @@ -300,39 +292,39 @@ static void paint_river_rapids_track_flat( imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 0 ? SPR_RIVER_RAPIDS_FLAT_FRONT_SW_NE : SPR_RIVER_RAPIDS_FLAT_FRONT_NE_SW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 3 }, { 0, 27, height + 17 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 2, 5 }, { 10, 10, height }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x007576C0 */ static void paint_river_rapids_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { paint_river_rapids_track_flat(session, ride, trackSequence, direction, height, trackElement); track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 12, trackElement); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_river_rapids_track_25_deg( - paint_session& session, uint8_t direction, int32_t height, const uint32_t sprites[4][2]) + PaintSession& session, uint8_t direction, int32_t height, const uint32_t sprites[4][2]) { ImageId imageId; - paint_struct* ps; + PaintStruct* ps; switch (direction) { @@ -343,8 +335,8 @@ static void paint_river_rapids_track_25_deg( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_7); + WoodenASupportsPaintSetup(session, 0, 9, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_7); break; case 1: @@ -355,8 +347,8 @@ static void paint_river_rapids_track_25_deg( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 1, 10, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_SQUARE_8); break; case 2: @@ -367,8 +359,8 @@ static void paint_river_rapids_track_25_deg( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 0, 11, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; case 3: @@ -378,20 +370,20 @@ static void paint_river_rapids_track_25_deg( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_7); + WoodenASupportsPaintSetup(session, 1, 12, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_7); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void paint_river_rapids_track_25_deg_to_flat_a( - paint_session& session, uint8_t direction, int32_t height, const uint32_t sprites[4][2]) + PaintSession& session, uint8_t direction, int32_t height, const uint32_t sprites[4][2]) { ImageId imageId; - paint_struct* ps; + PaintStruct* ps; switch (direction) { @@ -402,8 +394,8 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_left(session, height - 8, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 0, 5, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_SQUARE_FLAT); break; case 1: @@ -414,8 +406,8 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); + WoodenASupportsPaintSetup(session, 1, 6, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height + 8, TUNNEL_14); break; case 2: @@ -424,10 +416,11 @@ static void paint_river_rapids_track_25_deg_to_flat_a( session.WoodenSupportsPrependTo = ps; imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); - 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]); - paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 18 }, { 0, 27, height }); + + WoodenASupportsPaintSetup(session, 0, 7, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_14); break; case 3: @@ -437,20 +430,20 @@ static void paint_river_rapids_track_25_deg_to_flat_a( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_right(session, height - 8, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height - 8, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void paint_river_rapids_track_25_deg_to_flat_b( - paint_session& session, uint8_t direction, int32_t height, const uint32_t sprites[4][2]) + PaintSession& session, uint8_t direction, int32_t height, const uint32_t sprites[4][2]) { ImageId imageId; - paint_struct* ps; + PaintStruct* ps; switch (direction) { @@ -461,8 +454,8 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 0, 1, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: @@ -473,8 +466,8 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 1, 2, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_8); break; case 2: @@ -485,8 +478,8 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_8); + WoodenASupportsPaintSetup(session, 0, 3, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; case 3: @@ -496,18 +489,18 @@ static void paint_river_rapids_track_25_deg_to_flat_b( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(sprites[direction][1]); 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]); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + WoodenASupportsPaintSetup(session, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x00757660 */ static void paint_river_rapids_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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); @@ -515,7 +508,7 @@ static void paint_river_rapids_track_25_deg_up( /** rct2: 0x00757670 */ static void paint_river_rapids_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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); @@ -523,7 +516,7 @@ static void paint_river_rapids_track_flat_to_25_deg_up( /** rct2: 0x00757680 */ static void paint_river_rapids_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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); @@ -531,7 +524,7 @@ static void paint_river_rapids_track_25_deg_up_to_flat( /** rct2: 0x00757690 */ static void paint_river_rapids_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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); @@ -539,7 +532,7 @@ static void paint_river_rapids_track_25_deg_down( /** rct2: 0x007576A0 */ static void paint_river_rapids_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -548,7 +541,7 @@ static void paint_river_rapids_track_flat_to_25_deg_down( /** rct2: 0x007576B0 */ static void paint_river_rapids_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -557,7 +550,7 @@ static void paint_river_rapids_track_25_deg_down_to_flat( /** rct2: 0x007576F0 */ static void paint_river_rapids_track_left_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -568,20 +561,20 @@ static void paint_river_rapids_track_left_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 26, 11 }, { 4, 2, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_LEFT_QUARTER_TURN_1_TILE_FRONT_SW_NW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 1, 7 }, { 28, 27, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 1, 7 }, { 28, 27, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 1: imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_LEFT_QUARTER_TURN_1_TILE_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 28, 11 }, { 0, 0, height }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 25, 25, 5 }, { 0, 0, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_QUARTER_TURN_1_TILE_FRONT_LEFT_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 30, 7 }, { 27, 1, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 30, 7 }, { 27, 1, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_QUARTER_TURN_1_TILE_FRONT_RIGHT_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 1, 7 }, { 1, 27, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 1, 7 }, { 1, 27, height }); break; case 2: @@ -589,9 +582,9 @@ static void paint_river_rapids_track_left_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 28, 11 }, { 2, 4, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_LEFT_QUARTER_TURN_1_TILE_FRONT_NE_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 2, 7 }, { 27, 28, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 2, 5 }, { 10, 10, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 3: @@ -599,21 +592,21 @@ static void paint_river_rapids_track_left_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 28, 11 }, { 4, 4, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_LEFT_QUARTER_TURN_1_TILE_FRONT_SE_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 7 }, { 28, 28, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 7 }, { 28, 28, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - 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); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00757700 */ static void paint_river_rapids_track_right_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -625,10 +618,10 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 28, 11 }, { 4, 4, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_RIGHT_QUARTER_TURN_1_TILE_FRONT_SW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 7 }, { 28, 28, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 1, 7 }, { 28, 28, height + 2 }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; case 1: @@ -636,9 +629,9 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 26, 11 }, { 4, 2, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_RIGHT_QUARTER_TURN_1_TILE_FRONT_SE_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 1, 7 }, { 28, 27, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 2, 1, 7 }, { 28, 27, height }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; case 2: @@ -646,10 +639,10 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 28, 28, 11 }, { 0, 0, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_QUARTER_TURN_1_TILE_FRONT_LEFT_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 30, 7 }, { 27, 1, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 22, 7 }, { 27, 1, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_QUARTER_TURN_1_TILE_FRONT_RIGHT_NW_NE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 30, 1, 7 }, { 1, 27, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 22, 1, 7 }, { 1, 27, height }); break; case 3: @@ -657,20 +650,20 @@ static void paint_river_rapids_track_right_quarter_turn_1_tile( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 26, 28, 11 }, { 2, 4, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_RIVER_RAPIDS_RIGHT_QUARTER_TURN_1_TILE_FRONT_NW_SW); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 27, 2, height + 13 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 28, 7 }, { 27, 2, height }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); break; } - 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); + WoodenASupportsPaintSetup(session, 1 - (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00757710 */ static void paint_river_rapids_track_waterfall( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -684,7 +677,7 @@ static void paint_river_rapids_track_waterfall( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 24, 32, 11 }, { 4, 0, height }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_WATERFALL_BASE_NE_FRAME_0 + frameNum)); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 24, 32, 11 }, { 4, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 4, 0, height }, { 24, 32, 11 } }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_WATERFALL_TOP_NE_FRAME_0 + frameNum)); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 27 }, { 4, 0, height + 17 }); @@ -694,46 +687,53 @@ static void paint_river_rapids_track_waterfall( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 27 }, { 27, 0, height + 17 }); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_WATERFALL_SIDE_SW_FRAME_0 + frameNum)); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 1, 32, 27 }, { 27, 0, height + 17 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 27, 0, height + 17 }, { 1, 32, 27 } }); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 0 ? SPR_RIVER_RAPIDS_WATERFALL_SW_NE : SPR_RIVER_RAPIDS_WATERFALL_NE_SW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 24, 11 }, { 0, 4, height }); + + auto bb = BoundBoxXYZ{ { 0, 4, height }, { 32, 24, 11 } }; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_WATERFALL_BASE_NW_FRAME_0 + frameNum)); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 24, 11 }, { 0, 4, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); + + bb.offset = { 0, 4, height + 17 }; + bb.length = { 32, 1, 27 }; imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_WATERFALL_TOP_NW_FRAME_0 + frameNum)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 27 }, { 0, 4, height + 17 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); + + bb.offset = { 0, 27, height + 17 }; imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 0 ? SPR_RIVER_RAPIDS_WATERFALL_FRONT_SW_NE : SPR_RIVER_RAPIDS_WATERFALL_FRONT_NE_SW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 27 }, { 0, 27, height + 17 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_WATERFALL_SIDE_SE_FRAME_0 + frameNum)); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 1, 27 }, { 0, 27, height + 17 }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_INVERTED_9); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_INVERTED_9); + PaintUtilPushTunnelLeft(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x00757720 */ static void paint_river_rapids_track_rapids( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -757,34 +757,34 @@ 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]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x00757740 */ static void paint_river_rapids_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { 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); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** rct2: 0x */ static void paint_river_rapids_track_whirlpool( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -795,42 +795,52 @@ static void paint_river_rapids_track_whirlpool( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 1 ? SPR_RIVER_RAPIDS_FLAT_NW_SE : SPR_RIVER_RAPIDS_FLAT_SE_NW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 24, 32, 11 }, { 4, 0, height }); + + auto bb = BoundBoxXYZ{ { 4, 0, height }, { 24, 32, 11 } }; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_RAPIDS_WHIRLPOOL_FRAME_0 + frameNum)); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 24, 32, 11 }, { 4, 0, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); + + bb.offset = { 10, 10, height }; + bb.length = { 1, 2, 5 }; imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 1 ? SPR_RIVER_RAPIDS_FLAT_FRONT_NW_SE : SPR_RIVER_RAPIDS_FLAT_FRONT_SE_NW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 1, 32, 3 }, { 27, 0, height + 17 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 0 ? SPR_RIVER_RAPIDS_FLAT_SW_NE : SPR_RIVER_RAPIDS_FLAT_NE_SW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 24, 11 }, { 0, 4, height }); + + auto bb = BoundBoxXYZ{ { 0, 4, height }, { 32, 24, 11 } }; + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); imageId = session.TrackColours[SCHEME_TRACK].WithIndex((SPR_RIVER_RAPIDS_RAPIDS_WHIRLPOOL_FRAME_0 + frameNum)); - PaintAddImageAsChild(session, imageId, { 0, 0, height }, { 32, 24, 11 }, { 0, 4, height }); + PaintAddImageAsChild(session, imageId, { 0, 0, height }, bb); + + bb.offset = { 10, 10, height }; + bb.length = { 1, 2, 5 }; imageId = session.TrackColours[SCHEME_TRACK].WithIndex( (direction == 0 ? SPR_RIVER_RAPIDS_FLAT_FRONT_SW_NE : SPR_RIVER_RAPIDS_FLAT_FRONT_NE_SW)); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 3 }, { 0, 27, height + 17 }); + PaintAddImageAsParent(session, imageId, { 0, 0, height }, bb); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 8f3d8b7caa..cd288d0dab 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -350,7 +350,7 @@ static constexpr const uint32_t SplashBoats25DegDownToFlatFrontImageId[4] = { SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NW_SE, }; -static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Top[4][5] = { +static constexpr const SpriteBb RiverRaftsLeftQuarterTurn5_Top[4][5] = { { SPR_SPLASH_BOATS_TURN_LEFT_5_TOP_SW_NW_SEQ_0, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 27, 2 }, SPR_SPLASH_BOATS_TURN_LEFT_5_TOP_SW_NW_SEQ_2, { 0, 0, 0 }, { 0, 0, 0 }, { 32, 16, 2 }, @@ -381,7 +381,7 @@ static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Top[4][5] = { }, }; -static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Side[4][5] = { +static constexpr const SpriteBb RiverRaftsLeftQuarterTurn5_Side[4][5] = { { SPR_SPLASH_BOATS_TURN_LEFT_5_SIDE_SW_NW_SEQ_0, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 27, 0 }, SPR_SPLASH_BOATS_TURN_LEFT_5_SIDE_SW_NW_SEQ_2, { 0, 0, 0 }, { 0, 0, 27 }, { 32, 16, 0 }, @@ -412,7 +412,7 @@ static constexpr const sprite_bb RiverRaftsLeftQuarterTurn5_Side[4][5] = { }, }; -static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Top[4][5] = { +static constexpr const SpriteBb RiverRaftsRightQuarterTurn5_Top[4][5] = { { SPR_SPLASH_BOATS_TURN_RIGHT_5_TOP_SW_SE_SEQ_0, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 }, SPR_SPLASH_BOATS_TURN_RIGHT_5_TOP_SW_SE_SEQ_2, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 }, @@ -443,7 +443,7 @@ static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Top[4][5] = { }, }; -static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = { +static constexpr const SpriteBb RiverRaftsRightQuarterTurn5_Side[4][5] = { { SPR_SPLASH_BOATS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_0, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 }, SPR_SPLASH_BOATS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_2, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 }, @@ -475,7 +475,7 @@ static constexpr const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = { }; static void paint_splash_boats_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats25DegUpImageId[direction]); @@ -484,22 +484,22 @@ static void paint_splash_boats_track_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, (direction & 1), 9 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void paint_splash_boats_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats60DegUpImageId[direction]); @@ -509,22 +509,22 @@ static void paint_splash_boats_track_60_deg_up( session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 98 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, (direction & 1), 21 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 56, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 104, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } static void paint_splash_boats_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoatsFlatTo25DegUpImageId[direction]); @@ -533,22 +533,22 @@ static void paint_splash_boats_track_flat_to_25_deg_up( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, (direction & 1), 1 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 48, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void paint_splash_boats_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats25DegUpToFlatImageId[direction]); @@ -557,22 +557,22 @@ static void paint_splash_boats_track_25_deg_up_to_flat( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, (direction & 1), 5 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void paint_splash_boats_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats25DegUpTo60DegUpImageId[direction]); @@ -582,22 +582,22 @@ static void paint_splash_boats_track_25_deg_up_to_60_deg_up( session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, (direction & 1), 13 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void paint_splash_boats_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats60DegUpTo25DegUpImageId[direction]); @@ -607,22 +607,22 @@ static void paint_splash_boats_track_60_deg_up_to_25_deg_up( session, direction, imageId, { 0, 0, height }, { 32, 20, 2 }, { 0, 6, height }); PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 66 }, { 0, 27, height }); - wooden_a_supports_paint_setup(session, (direction & 1), 17 + direction, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(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); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } else { - paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 72, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } static void paint_splash_boats_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats25DegDownImageId[direction]); @@ -632,30 +632,30 @@ static void paint_splash_boats_track_25_deg_down( PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 50 }, { 0, 27, height }); static constexpr const uint8_t specialSupport[] = { 11, 12, 9, 10 }; - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, (direction & 1), specialSupport[direction], height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_7); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 56, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void paint_splash_boats_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { paint_splash_boats_track_60_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void paint_splash_boats_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoatsFlatTo25DegDownImageId[direction]); @@ -665,37 +665,37 @@ static void paint_splash_boats_track_flat_to_25_deg_down( PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 34 }, { 0, 27, height }); static constexpr const uint8_t specialSupport[] = { 7, 8, 5, 6 }; - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, (direction & 1), specialSupport[direction], height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_14); + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } else { - paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 40, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } static void paint_splash_boats_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void paint_splash_boats_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void paint_splash_boats_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { auto imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SplashBoats25DegDownToFlatImageId[direction]); @@ -705,25 +705,25 @@ static void paint_splash_boats_track_25_deg_down_to_flat( PaintAddImageAsParentRotated(session, direction, frontImageId, { 0, 0, height }, { 32, 1, 42 }, { 0, 27, height }); static constexpr const uint8_t specialSupport[] = { 3, 4, 1, 2 }; - wooden_a_supports_paint_setup( + WoodenASupportsPaintSetup( session, (direction & 1), specialSupport[direction], height, session.TrackColours[SCHEME_SUPPORTS]); if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_8); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } else { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } /** Start of elements originally from River Rafts */ /** rct2: 0x0089B170 */ static void paint_splash_boats_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { ImageId imageId; @@ -749,24 +749,24 @@ static void paint_splash_boats_track_flat( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 1, 26 }, { 0, 27, height }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); if (direction & 1) { - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } else { - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, 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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0089B1A0 */ static void paint_splash_boats_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { if (direction & 1) @@ -788,19 +788,19 @@ static void paint_splash_boats_station( PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } - wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, (direction & 1), 0, height, session.TrackColours[SCHEME_SUPPORTS]); track_paint_util_draw_narrow_station_platform(session, ride, direction, height, 7, trackElement); - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(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); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0089B1D0 */ static void paint_splash_boats_track_left_quarter_turn_5_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -817,46 +817,44 @@ 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]); + WoodenASupportsPaintSetup(session, supportType, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_D0, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_B8, direction), + PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } @@ -865,23 +863,23 @@ static void paint_splash_boats_track_left_quarter_turn_5_tiles( case 0: if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } break; case 6: if (direction == 2 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction ^ 1, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction ^ 1, height, TUNNEL_SQUARE_FLAT); } break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0089B1D0 */ static void paint_splash_boats_track_right_quarter_turn_5_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -898,46 +896,44 @@ 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]); + WoodenASupportsPaintSetup(session, supportType, 0, height, session.TrackColours[SCHEME_SUPPORTS]); } switch (trackSequence) { case 0: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 3: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( + PaintUtilRotateSegments( SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 4: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break; case 5: - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break; case 6: - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } @@ -946,23 +942,23 @@ static void paint_splash_boats_track_right_quarter_turn_5_tiles( case 0: if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } break; case 6: if (direction == 0 || direction == 1) { - paint_util_push_tunnel_rotated(session, direction ^ 1, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction ^ 1, height, TUNNEL_SQUARE_FLAT); } break; } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0089B180 */ static void paint_splash_boats_track_s_bend_left( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -1004,8 +1000,8 @@ static void paint_splash_boats_track_s_bend_left( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -1013,12 +1009,11 @@ static void paint_splash_boats_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); - wooden_a_supports_paint_setup(session, supportTypes1[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, supportTypes1[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 2: @@ -1027,20 +1022,19 @@ static void paint_splash_boats_track_s_bend_left( PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); - wooden_a_supports_paint_setup(session, supportTypes2[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, supportTypes2[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } @@ -1048,23 +1042,23 @@ static void paint_splash_boats_track_s_bend_left( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } /** rct2: 0x0089B190 */ static void paint_splash_boats_track_s_bend_right( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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] = { @@ -1106,8 +1100,8 @@ static void paint_splash_boats_track_s_bend_right( PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -1115,12 +1109,11 @@ static void paint_splash_boats_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); - wooden_a_supports_paint_setup(session, supportTypes1[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, supportTypes1[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; case 2: @@ -1129,20 +1122,19 @@ static void paint_splash_boats_track_s_bend_right( PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 26, 0 }, { 0, bboy, height + 27 }); - wooden_a_supports_paint_setup(session, supportTypes2[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); + WoodenASupportsPaintSetup(session, supportTypes2[direction], 0, height, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( + PaintUtilSetSegmentSupportHeight( session, - paint_util_rotate_segments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; case 3: PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { 32, 27, 2 }, { 0, 2, height }); PaintAddImageAsParentRotated( session, direction, frontImageId, { 0, 0, height }, { 32, 27, 0 }, { 0, 2, height + 27 }); - 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); + WoodenASupportsPaintSetup(session, direction & 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); break; } @@ -1150,22 +1142,22 @@ static void paint_splash_boats_track_s_bend_right( { if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } } else if (trackSequence == 3) { if (direction == 1 || direction == 2) { - paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } } - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void paint_splash_boats_track_on_ride_photo( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { switch (direction) @@ -1191,9 +1183,9 @@ static void paint_splash_boats_track_on_ride_photo( paint_splash_boats_track_flat(session, ride, trackSequence, direction, height, trackElement); 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); + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int32_t trackType) @@ -1255,7 +1247,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int32_t trackType) * rct2: 0x006D4295 */ void vehicle_visual_splash_boats_or_water_coaster( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { auto* vehicleToPaint = vehicle->IsHead() ? GetEntity(vehicle->next_vehicle_on_ride) diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 3fb4ca526c..5de1e66312 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -42,7 +42,7 @@ static uint32_t SubmarineVehicleGetBaseImageId(const Vehicle* vehicle, const Car * rct2: 0x006D44D5 */ void vehicle_visual_submarine( - paint_session& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, + PaintSession& session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const Vehicle* vehicle, const CarEntry* carEntry) { auto baseImageId = SubmarineVehicleGetBaseImageId(vehicle, carEntry, imageDirection); @@ -64,7 +64,7 @@ void vehicle_visual_submarine( } static void submarine_ride_paint_track_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { const auto* stationObj = ride.GetStationObject(); @@ -76,7 +76,7 @@ static void submarine_ride_paint_track_station( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW); PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 20, 32, 3 }, { 6, 0, heightLower }); - paint_util_push_tunnel_right(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( session, ride, stationObj, session.MapPosition, direction, height, trackElement, session.CurrentRotation); } @@ -85,17 +85,17 @@ static void submarine_ride_paint_track_station( imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW); PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 32, 20, 3 }, { 0, 6, heightLower }); - paint_util_push_tunnel_left(session, height, TUNNEL_SQUARE_FLAT); + PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); track_paint_util_draw_pier( session, ride, stationObj, session.MapPosition, direction, height, trackElement, session.CurrentRotation); } - paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 32, 0x20); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void submarine_ride_paint_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { int32_t heightLower = height - 16; @@ -105,29 +105,29 @@ static void submarine_ride_paint_track_flat( { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW); PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 20, 32, 3 }, { 6, 0, heightLower }); - paint_util_push_tunnel_right(session, heightLower, TUNNEL_0); + PaintUtilPushTunnelRight(session, heightLower, TUNNEL_0); } else { imageId = session.TrackColours[SCHEME_TRACK].WithIndex(SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW); PaintAddImageAsParent(session, imageId, { 0, 0, heightLower }, { 32, 20, 3 }, { 0, 6, heightLower }); - paint_util_push_tunnel_left(session, heightLower, TUNNEL_0); + PaintUtilPushTunnelLeft(session, heightLower, TUNNEL_0); } if (track_paint_util_should_paint_supports(session.MapPosition)) { - metal_a_supports_paint_setup( + MetalASupportsPaintSetup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, heightLower, session.TrackColours[SCHEME_SUPPORTS]); } - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 16, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } static void submarine_ride_paint_track_left_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -138,24 +138,22 @@ static void submarine_ride_paint_track_left_quarter_turn_3_tiles( switch (trackSequence) { case 0: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, -1, height - 16, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -1, height - 16, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); break; case 2: - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 3: - metal_a_supports_paint_setup( - session, METAL_SUPPORTS_STICK, 4, -1, height - 16, session.TrackColours[SCHEME_SUPPORTS]); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); + MetalASupportsPaintSetup(session, METAL_SUPPORTS_STICK, 4, -1, height - 16, session.TrackColours[SCHEME_SUPPORTS]); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); break; } - paint_util_set_general_support_height(session, height + 16, 0x20); + PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } static constexpr const uint8_t submarine_ride_right_quarter_turn_3_tiles_to_left_turn_map[] = { @@ -165,7 +163,7 @@ static constexpr const uint8_t submarine_ride_right_quarter_turn_3_tiles_to_left 0, }; static void submarine_ride_paint_track_right_quarter_turn_3_tiles( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -174,7 +172,7 @@ static void submarine_ride_paint_track_right_quarter_turn_3_tiles( } static void submarine_ride_paint_track_left_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -182,13 +180,13 @@ static void submarine_ride_paint_track_left_quarter_turn_1_tile( trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile); track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height - 16, 0, TUNNEL_0, 0, TUNNEL_0); - paint_util_set_segment_support_height( - session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(session, height + 16, 0x20); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } static void submarine_ride_paint_track_right_quarter_turn_1_tile( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( diff --git a/src/openrct2/ride/water/WaterCoaster.cpp b/src/openrct2/ride/water/WaterCoaster.cpp index 06e63c9607..bd21ba2980 100644 --- a/src/openrct2/ride/water/WaterCoaster.cpp +++ b/src/openrct2/ride/water/WaterCoaster.cpp @@ -14,7 +14,7 @@ #include "../coaster/JuniorRollerCoaster.h" static void water_rc_track_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -24,7 +24,7 @@ static void water_rc_track_flat( } static void water_rc_track_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -34,7 +34,7 @@ static void water_rc_track_25_deg_up( } static void water_rc_track_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -44,7 +44,7 @@ static void water_rc_track_flat_to_25_deg_up( } static void water_rc_track_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -54,28 +54,28 @@ static void water_rc_track_25_deg_up_to_flat( } static void water_rc_track_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { water_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void water_rc_track_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void water_rc_track_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) & 3, height, trackElement); } static void water_rc_track_diag_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -85,7 +85,7 @@ static void water_rc_track_diag_flat( } static void water_rc_track_diag_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -95,7 +95,7 @@ static void water_rc_track_diag_25_deg_up( } static void water_rc_track_diag_flat_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -105,7 +105,7 @@ static void water_rc_track_diag_flat_to_25_deg_up( } static void water_rc_track_diag_25_deg_up_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -115,7 +115,7 @@ static void water_rc_track_diag_25_deg_up_to_flat( } static void water_rc_track_diag_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -125,7 +125,7 @@ static void water_rc_track_diag_25_deg_down( } static void water_rc_track_diag_flat_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -135,7 +135,7 @@ static void water_rc_track_diag_flat_to_25_deg_down( } static void water_rc_track_diag_25_deg_down_to_flat( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { bool isChained = trackElement.HasChain(); @@ -145,21 +145,21 @@ static void water_rc_track_diag_25_deg_down_to_flat( } static void water_rc_track_station( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_paint_station(session, ride, trackSequence, direction, height, trackElement, false); } static void water_rc_track_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_paint_track_60_deg_up(session, ride, trackSequence, direction, height, trackElement, JuniorRcChainType::None); } static void water_rc_track_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -167,7 +167,7 @@ static void water_rc_track_25_deg_up_to_60_deg_up( } static void water_rc_track_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -175,21 +175,21 @@ static void water_rc_track_60_deg_up_to_25_deg_up( } static void water_rc_track_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { water_rc_track_60_deg_up(session, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void water_rc_track_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); } static void water_rc_track_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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, ride, trackSequence, (direction + 2) % 4, height, trackElement); @@ -198,7 +198,7 @@ static void water_rc_track_60_deg_down_to_25_deg_down( // 5 tile turns static void water_rc_track_left_quarter_turn_5_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -206,7 +206,7 @@ static void water_rc_track_left_quarter_turn_5_tiles_25_deg_up( } static void water_rc_track_right_quarter_turn_5_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -218,7 +218,7 @@ static constexpr const uint8_t water_rc_left_quarter_turn_5_tiles_to_right_turn_ }; static void water_rc_track_left_quarter_turn_5_tiles_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -227,7 +227,7 @@ static void water_rc_track_left_quarter_turn_5_tiles_25_deg_down( } static void water_rc_track_right_quarter_turn_5_tiles_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -238,7 +238,7 @@ static void water_rc_track_right_quarter_turn_5_tiles_25_deg_down( // 3 tile turns static void water_rc_track_right_quarter_turn_3_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -246,7 +246,7 @@ static void water_rc_track_right_quarter_turn_3_tiles_25_deg_up( } static void water_rc_track_right_quarter_turn_3_tiles_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -261,7 +261,7 @@ static constexpr const uint8_t water_rc_left_quarter_turn_3_tiles_to_right_turn_ }; static void water_rc_track_left_quarter_turn_3_tiles_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -270,7 +270,7 @@ static void water_rc_track_left_quarter_turn_3_tiles_25_deg_up( } static void water_rc_track_left_quarter_turn_3_tiles_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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]; @@ -279,7 +279,7 @@ static void water_rc_track_left_quarter_turn_3_tiles_25_deg_down( } static void water_rc_track_diag_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_up( @@ -287,7 +287,7 @@ static void water_rc_track_diag_60_deg_up( } static void water_rc_track_diag_25_deg_up_to_60_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -295,7 +295,7 @@ static void water_rc_track_diag_25_deg_up_to_60_deg_up( } static void water_rc_track_diag_60_deg_up_to_25_deg_up( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -303,7 +303,7 @@ static void water_rc_track_diag_60_deg_up_to_25_deg_up( } static void water_rc_track_diag_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { junior_rc_paint_track_diag_60_deg_down( @@ -311,7 +311,7 @@ static void water_rc_track_diag_60_deg_down( } static void water_rc_track_diag_25_deg_down_to_60_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( @@ -319,7 +319,7 @@ static void water_rc_track_diag_25_deg_down_to_60_deg_down( } static void water_rc_track_diag_60_deg_down_to_25_deg_down( - paint_session& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + PaintSession& 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( diff --git a/src/openrct2/ride/water/meta/LogFlume.h b/src/openrct2/ride/water/meta/LogFlume.h index c0e2620210..3f75328362 100644 --- a/src/openrct2/ride/water/meta/LogFlume.h +++ b/src/openrct2/ride/water/meta/LogFlume.h @@ -19,7 +19,7 @@ constexpr const RideTypeDescriptor LogFlumeRTD = { SET_FIELD(AlternateType, RIDE_TYPE_NULL), SET_FIELD(Category, RIDE_CATEGORY_WATER), - SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_ON_RIDE_PHOTO, TRACK_LOG_FLUME_REVERSER}), + SET_FIELD(EnabledTrackPieces, {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_ON_RIDE_PHOTO, TRACK_LOG_FLUME_REVERSER, TRACK_SLOPE_STEEP_DOWN}), SET_FIELD(ExtraTrackPieces, {}), SET_FIELD(CoveredTrackPieces, {}), SET_FIELD(StartTrackPiece, TrackElemType::EndStation), @@ -37,7 +37,7 @@ constexpr const RideTypeDescriptor LogFlumeRTD = SET_FIELD(NameConvention, { RideComponentType::Boat, RideComponentType::Track, RideComponentType::Station }), SET_FIELD(EnumName, nameof(RIDE_TYPE_LOG_FLUME)), SET_FIELD(AvailableBreakdowns, (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_CONTROL_FAILURE)), - SET_FIELD(Heights, { 9, 24, 7, 9, }), + SET_FIELD(Heights, { 10, 24, 7, 9, }), SET_FIELD(MaxMass, 255), SET_FIELD(LiftData, { OpenRCT2::Audio::SoundId::Null, 5, 5 }), SET_FIELD(RatingsCalculationFunction, ride_ratings_calculate_log_flume), diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 4397a7c328..986ddace72 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -60,8 +60,7 @@ const StringId ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT] = { STR_BEGINNER_PARKS, STR_CHALLENGING_PARKS, STR_EXPERT_PARKS, STR_REAL_PARKS, STR_OTHER_PARKS, - - STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS, + STR_DLC_PARKS, STR_BUILD_YOUR_OWN_PARKS, STR_COMPETITIONS, STR_UCES_TM, STR_UCES_KD, }; SCENARIO_CATEGORY gScenarioCategory; @@ -94,7 +93,7 @@ void scenario_begin() scenario_reset(); if (gScenarioObjective.Type != OBJECTIVE_NONE && !gLoadKeepWindowsOpen) - context_open_window_view(WV_PARK_OBJECTIVE); + ContextOpenWindowView(WV_PARK_OBJECTIVE); gScreenAge = 0; } @@ -106,7 +105,7 @@ void scenario_reset() gScenarioRand.seed(s); research_reset_current_item(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); News::InitQueue(); auto& park = GetContext()->GetGameState()->GetPark(); @@ -160,8 +159,8 @@ void scenario_reset() reset_all_ride_build_dates(); date_reset(); Duck::RemoveAll(); - park_calculate_size(); - map_count_remaining_land_rights(); + ParkCalculateSize(); + MapCountRemainingLandRights(); Staff::ResetStats(); auto& objManager = GetContext()->GetObjectManager(); @@ -191,7 +190,7 @@ static void scenario_end() game_reset_speed(); window_close_by_class(WindowClass::Dropdown); window_close_all_except_flags(WF_STICK_TO_BACK | WF_STICK_TO_FRONT); - context_open_window_view(WV_PARK_OBJECTIVE); + ContextOpenWindowView(WV_PARK_OBJECTIVE); } /** @@ -245,7 +244,7 @@ static void scenario_entrance_fee_too_high_check() { const auto max_fee = add_clamp_money16(gTotalRideValueForMoney, gTotalRideValueForMoney / 2); - if ((gParkFlags & PARK_FLAGS_PARK_OPEN) && park_get_entrance_fee() > max_fee) + if ((gParkFlags & PARK_FLAGS_PARK_OPEN) && ParkGetEntranceFee() > max_fee) { if (!gParkEntrances.empty()) { @@ -254,7 +253,7 @@ static void scenario_entrance_fee_too_high_check() auto y = entrance.y + 16; uint32_t packed_xy = (y << 16) | x; - if (gConfigNotifications.park_warnings) + if (gConfigNotifications.ParkWarnings) { News::AddItemToQueue(News::ItemType::Blank, STR_ENTRANCE_FEE_TOO_HI, packed_xy, {}); } @@ -271,7 +270,7 @@ void scenario_autosave_check() uint32_t timeSinceSave = Platform::GetTicks() - gLastAutoSaveUpdate; bool shouldSave = false; - switch (gConfigGeneral.autosave_frequency) + switch (gConfigGeneral.AutosaveFrequency) { case AUTOSAVE_EVERY_MINUTE: shouldSave = timeSinceSave >= 1 * 60 * 1000; @@ -321,7 +320,7 @@ static void scenario_day_update() gParkRatingCasualtyPenalty = std::max(0, gParkRatingCasualtyPenalty - casualtyPenaltyModifier); auto intent = Intent(INTENT_ACTION_UPDATE_DATE); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } static void scenario_week_update() @@ -367,7 +366,7 @@ static void scenario_update_daynight_cycle() float currentDayNightCycle = gDayNightCycle; gDayNightCycle = 0; - if (gScreenFlags == SCREEN_FLAGS_PLAYING && gConfigGeneral.day_night_cycle) + if (gScreenFlags == SCREEN_FLAGS_PLAYING && gConfigGeneral.DayNightCycle) { float monthFraction = gDateMonthTicks / static_cast(TICKS_PER_MONTH); if (monthFraction < (1 / 8.0f)) @@ -443,12 +442,12 @@ bool scenario_create_ducks() centrePos.x = SquareRadiusSize + (scenario_rand_max(gMapSize.x - SquareCentre) * 32); centrePos.y = SquareRadiusSize + (scenario_rand_max(gMapSize.y - SquareCentre) * 32); - Guard::Assert(map_is_location_valid(centrePos)); + Guard::Assert(MapIsLocationValid(centrePos)); - if (!map_is_location_in_park(centrePos)) + if (!MapIsLocationInPark(centrePos)) return false; - int32_t centreWaterZ = (tile_element_water_height(centrePos)); + int32_t centreWaterZ = (TileElementWaterHeight(centrePos)); if (centreWaterZ == 0) return false; @@ -458,13 +457,13 @@ bool scenario_create_ducks() { for (int32_t x = 0; x < SquareSize; x++) { - if (!map_is_location_valid(innerPos)) + if (!MapIsLocationValid(innerPos)) continue; - if (!map_is_location_in_park(innerPos)) + if (!MapIsLocationInPark(innerPos)) continue; - int32_t waterZ = (tile_element_water_height(innerPos)); + int32_t waterZ = (TileElementWaterHeight(innerPos)); if (waterZ == centreWaterZ) waterTiles++; @@ -491,7 +490,7 @@ bool scenario_create_ducks() CoordsXY targetPos{ centrePos.x + innerPos.x - SquareRadiusSize, centrePos.y + innerPos.y - SquareRadiusSize }; - Guard::Assert(map_is_location_valid(targetPos)); + Guard::Assert(MapIsLocationValid(targetPos)); Duck::Create(targetPos); } @@ -568,7 +567,7 @@ static ResultWithMessage scenario_prepare_rides_for_save() bool markTrackAsIndestructible; tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() == TileElementType::Track) @@ -588,7 +587,7 @@ static ResultWithMessage scenario_prepare_rides_for_save() it.element->AsTrack()->SetIsIndestructible(markTrackAsIndestructible); } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); return { true }; } @@ -700,28 +699,28 @@ ObjectiveStatus Objective::CheckGuestsAndRating() const gScenarioParkRatingWarningDays++; if (gScenarioParkRatingWarningDays == 1) { - if (gConfigNotifications.park_rating_warnings) + if (gConfigNotifications.ParkRatingWarnings) { News::AddItemToQueue(News::ItemType::Graph, STR_PARK_RATING_WARNING_4_WEEKS_REMAINING, 0, {}); } } else if (gScenarioParkRatingWarningDays == 8) { - if (gConfigNotifications.park_rating_warnings) + if (gConfigNotifications.ParkRatingWarnings) { News::AddItemToQueue(News::ItemType::Graph, STR_PARK_RATING_WARNING_3_WEEKS_REMAINING, 0, {}); } } else if (gScenarioParkRatingWarningDays == 15) { - if (gConfigNotifications.park_rating_warnings) + if (gConfigNotifications.ParkRatingWarnings) { News::AddItemToQueue(News::ItemType::Graph, STR_PARK_RATING_WARNING_2_WEEKS_REMAINING, 0, {}); } } else if (gScenarioParkRatingWarningDays == 22) { - if (gConfigNotifications.park_rating_warnings) + if (gConfigNotifications.ParkRatingWarnings) { News::AddItemToQueue(News::ItemType::Graph, STR_PARK_RATING_WARNING_1_WEEK_REMAINING, 0, {}); } @@ -862,7 +861,7 @@ bool AllowEarlyCompletion() case NETWORK_MODE_NONE: case NETWORK_MODE_SERVER: default: - return gConfigGeneral.allow_early_completion; + return gConfigGeneral.AllowEarlyCompletion; } } diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index b3c75d9c54..de06b3d147 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -53,6 +53,9 @@ enum SCENARIO_CATEGORY // OpenRCT2 categories SCENARIO_CATEGORY_DLC, SCENARIO_CATEGORY_BUILD_YOUR_OWN, + SCENARIO_CATEGORY_COMPETITIONS, + SCENARIO_CATEGORY_TIME_MACHINE, + SCENARIO_CATEGORY_KATYS_DREAMWORLD, SCENARIO_CATEGORY_COUNT }; @@ -169,7 +172,6 @@ extern uint32_t gLastAutoSaveUpdate; extern std::string gScenarioFileName; -void load_from_sc6(const char* path); void scenario_begin(); void scenario_reset(); void scenario_update(); diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 9eaa27198f..e053502aa4 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -126,7 +126,7 @@ class ScenarioFileIndex final : public FileIndex { private: static constexpr uint32_t MAGIC_NUMBER = 0x58444953; // SIDX - static constexpr uint16_t VERSION = 6; + static constexpr uint16_t VERSION = 8; static constexpr auto PATTERN = "*.sc4;*.sc6;*.sea;*.park"; public: @@ -578,7 +578,7 @@ private: void Sort() { - if (gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN) + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) { std::sort( _scenarios.begin(), _scenarios.end(), [](const scenario_index_entry& a, const scenario_index_entry& b) -> bool { diff --git a/src/openrct2/scenario/ScenarioRepository.h b/src/openrct2/scenario/ScenarioRepository.h index a8fa3375b9..41620ead6f 100644 --- a/src/openrct2/scenario/ScenarioRepository.h +++ b/src/openrct2/scenario/ScenarioRepository.h @@ -32,6 +32,7 @@ enum class ScenarioSource : uint8_t RCT2, RCT2_WW, RCT2_TT, + UCES, Real, Extras, Other diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index 0aebcd289c..d02eec5a74 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -215,20 +215,20 @@ namespace ScenarioSources // RCT2 static constexpr const ScenarioTitleDescriptor ScenarioTitlesRCT2[] = { - { SC_UNIDENTIFIED, "Crazy Castle", SCENARIO_CATEGORY_BEGINNER }, { SC_UNIDENTIFIED, "Electric Fields", SCENARIO_CATEGORY_BEGINNER }, { SC_UNIDENTIFIED, "Factory Capers", SCENARIO_CATEGORY_BEGINNER }, - { SC_UNIDENTIFIED, "Amity Airfield", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Botany Breakers", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Bumbly Bazaar", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Dusty Greens", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Fungus Woods", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Gravity Gardens", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "Crazy Castle", SCENARIO_CATEGORY_BEGINNER }, + { SC_UNIDENTIFIED, "Dusty Greens", SCENARIO_CATEGORY_BEGINNER }, + { SC_UNIDENTIFIED, "Bumbly Bazaar", SCENARIO_CATEGORY_BEGINNER }, { SC_UNIDENTIFIED, "Infernal Views", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Alpine Adventures", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "Lucky Lake", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "Botany Breakers", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "Alpine Adventures", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "Gravity Gardens", SCENARIO_CATEGORY_EXPERT }, { SC_UNIDENTIFIED, "Extreme Heights", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "Amity Airfield", SCENARIO_CATEGORY_EXPERT }, { SC_UNIDENTIFIED, "Ghost Town", SCENARIO_CATEGORY_EXPERT }, - { SC_UNIDENTIFIED, "Lucky Lake", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "Fungus Woods", SCENARIO_CATEGORY_EXPERT }, { SC_UNIDENTIFIED, "Rainbow Summit", SCENARIO_CATEGORY_EXPERT }, }; @@ -273,6 +273,29 @@ namespace ScenarioSources { SC_UNIDENTIFIED, "Rock 'n' Roll - Rock 'n' Roll", SCENARIO_CATEGORY_EXPERT }, }; + // User Created Expansion Sets + static constexpr const ScenarioTitleDescriptor ScenarioTitlesUCES[] = + { + { SC_UNIDENTIFIED, "Lighthouse of Alexandria by Katatude for UCES", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Cleveland's Luna Park", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Mount Vesuvius 1700 A.D. by Katatude for UCES", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "The Sandbox by Katatude for UCES", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Niagara Falls & Gorge by Katatude for UCES", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Rocky Mountain Miners", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "The Time Machine by Katatude for UCES", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Tower of Babel", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Transformation", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Urbis Incognitus", SCENARIO_CATEGORY_TIME_MACHINE }, + { SC_UNIDENTIFIED, "Beneath the Christmas Tree by Katatude for UCES", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "Bigrock Blast", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "Camp Mockingbird for UCES by Katatude", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "Choo Choo Town", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "Dragon Islands", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "Kiddy Karnival II", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "Sand Dune", SCENARIO_CATEGORY_KATYS_DREAMWORLD }, + { SC_UNIDENTIFIED, "UCES Halloween", SCENARIO_CATEGORY_OTHER }, + }; + // Real parks static constexpr const ScenarioTitleDescriptor ScenarioTitlesRealParks[] = { @@ -294,25 +317,26 @@ namespace ScenarioSources { SC_PCGW, "PC Gaming World", SCENARIO_CATEGORY_DLC }, { SC_GAMEPLAY, "gameplay", SCENARIO_CATEGORY_DLC }, { SC_UNIDENTIFIED, "Panda World", SCENARIO_CATEGORY_DLC }, - { SC_UNIDENTIFIED, "Competition Land 1", SCENARIO_CATEGORY_DLC }, - { SC_UNIDENTIFIED, "Competition Land 2", SCENARIO_CATEGORY_DLC }, - { SC_STEEL_TWISTER_COMPETITION, "Steel Twister Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_GO_KARTS_COMPETITION, "Go Karts Competition", SCENARIO_CATEGORY_DLC }, - { SC_STEEL_CORKSCREW_COMPETITION, "Steel Corkscrew Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_MINE_TRAIN_COMPETITION, "Mine Train Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_STEEL_ROLLER_COASTER_COMPETITION, "Steel Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_BOBSLED_COMPETITION, "Bobsled Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_INVERTED_ROLLER_COASTER_COMPETITION, "Inverted Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_SUSPENDED_ROLLER_COASTER_COMPETITION, "Suspended Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_STAND_UP_STEEL_ROLLER_COASTER_COMPETITION, "Stand-Up Steel Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_WOODEN_ROLLER_COASTER_COMPETITION, "Wooden Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, - { SC_STEEL_MINI_ROLLER_COASTER_COMPETITION, "Steel Mini Roller Coaster Competition", SCENARIO_CATEGORY_DLC }, { SC_UNIDENTIFIED, "Build your own Six Flags Belgium", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, { SC_UNIDENTIFIED, "Build your own Six Flags Great Adventure", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, { SC_UNIDENTIFIED, "Build your own Six Flags Holland", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, { SC_UNIDENTIFIED, "Build your own Six Flags Magic Mountain", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, { SC_UNIDENTIFIED, "Build your own Six Flags Park", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, { SC_UNIDENTIFIED, "Build your own Six Flags over Texas", SCENARIO_CATEGORY_BUILD_YOUR_OWN }, + { SC_UNIDENTIFIED, "Competition Land 1", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_UNIDENTIFIED, "Competition Land 2", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_BOBSLED_COMPETITION, "Bobsled Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_GO_KARTS_COMPETITION, "Go Karts Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_INVERTED_ROLLER_COASTER_COMPETITION, "Inverted Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_MINE_TRAIN_COMPETITION, "Mine Train Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_STAND_UP_STEEL_ROLLER_COASTER_COMPETITION, "Stand-Up Steel Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_STEEL_CORKSCREW_COMPETITION, "Steel Corkscrew Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_STEEL_MINI_ROLLER_COASTER_COMPETITION, "Steel Mini Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_STEEL_ROLLER_COASTER_COMPETITION, "Steel Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_STEEL_TWISTER_COMPETITION, "Steel Twister Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_SUSPENDED_ROLLER_COASTER_COMPETITION, "Suspended Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_WOODEN_ROLLER_COASTER_COMPETITION, "Wooden Roller Coaster Competition", SCENARIO_CATEGORY_COMPETITIONS }, + { SC_UNIDENTIFIED, "Tycoon Park", SCENARIO_CATEGORY_OTHER }, }; #define DEFINE_SCENARIO_TITLE_DESC_GROUP(x) { std::size(x), x } @@ -326,6 +350,7 @@ namespace ScenarioSources DEFINE_SCENARIO_TITLE_DESC_GROUP(ScenarioTitlesRCT2), DEFINE_SCENARIO_TITLE_DESC_GROUP(ScenarioTitlesRCT2WW), DEFINE_SCENARIO_TITLE_DESC_GROUP(ScenarioTitlesRCT2TT), + DEFINE_SCENARIO_TITLE_DESC_GROUP(ScenarioTitlesUCES), DEFINE_SCENARIO_TITLE_DESC_GROUP(ScenarioTitlesRealParks), DEFINE_SCENARIO_TITLE_DESC_GROUP(ScenarioTitlesExtrasParks), }; diff --git a/src/openrct2/scripting/Duktape.hpp b/src/openrct2/scripting/Duktape.hpp index e15e44bdb6..d9b01fb4de 100644 --- a/src/openrct2/scripting/Duktape.hpp +++ b/src/openrct2/scripting/Duktape.hpp @@ -465,6 +465,8 @@ namespace OpenRCT2::Scripting return OBJECT_ENTRY_INDEX_NULL; } + uint32_t ImageFromDuk(const DukValue& d); + } // namespace OpenRCT2::Scripting #endif diff --git a/src/openrct2/scripting/IconNames.hpp b/src/openrct2/scripting/IconNames.hpp new file mode 100644 index 0000000000..6a2ec42f5c --- /dev/null +++ b/src/openrct2/scripting/IconNames.hpp @@ -0,0 +1,241 @@ +/***************************************************************************** + * Copyright (c) 2014-2022 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/EnumMap.hpp" +#include "../sprites.h" + +#include +#include + +namespace OpenRCT2::Scripting +{ + // When adding to this map, also add to IconName in openrct2.d.ts + + static EnumMap G2SpriteLookupTable = { + { "empty", SPR_G2_EMPTY }, + { "placeholder", SPR_G2_PLACEHOLDER }, + { "logo", SPR_G2_LOGO }, + { "logo_text", SPR_G2_TITLE }, + { "fast_forward", SPR_G2_FASTFORWARD }, + { "game_speed_indicator", SPR_G2_SPEED_ARROW }, + { "game_speed_indicator_double", SPR_G2_HYPER_ARROW }, + { "map_gen_land", SPR_G2_TAB_LAND }, + { "zoom_in", SPR_G2_ZOOM_IN }, + { "zoom_in_background", SPR_G2_ZOOM_IN_DISABLED }, + { "zoom_out", SPR_G2_ZOOM_OUT }, + { "zoom_out_background", SPR_G2_ZOOM_OUT_DISABLED }, + { "map_gen_trees", SPR_G2_TAB_TREE }, + { "map_gen_noise", SPR_G2_TAB_PENCIL }, + { "large_scenery", SPR_G2_BUTTON_LARGE_SCENERY }, + { "small_scenery", SPR_G2_BUTTON_TREES }, + { "paths", SPR_G2_BUTTON_FOOTPATH }, + { "rct1_close_off", SPR_G2_RCT1_CLOSE_BUTTON_0 }, + { "rct1_close_off_pressed", SPR_G2_RCT1_CLOSE_BUTTON_1 }, + { "rct1_close_on", SPR_G2_RCT1_CLOSE_BUTTON_2 }, + { "rct1_close_on_pressed", SPR_G2_RCT1_CLOSE_BUTTON_3 }, + { "rct1_test_off", SPR_G2_RCT1_TEST_BUTTON_0 }, + { "rct1_test_off_pressed", SPR_G2_RCT1_TEST_BUTTON_1 }, + { "rct1_test_on", SPR_G2_RCT1_TEST_BUTTON_2 }, + { "rct1_test_on_pressed", SPR_G2_RCT1_TEST_BUTTON_3 }, + { "rct1_open_off", SPR_G2_RCT1_OPEN_BUTTON_0 }, + { "rct1_open_off_pressed", SPR_G2_RCT1_OPEN_BUTTON_1 }, + { "rct1_open_on", SPR_G2_RCT1_OPEN_BUTTON_2 }, + { "rct1_open_on_pressed", SPR_G2_RCT1_OPEN_BUTTON_3 }, + { "title_restart", SPR_G2_TITLE_RESTART }, + { "title_stop", SPR_G2_TITLE_STOP }, + { "title_play", SPR_G2_TITLE_PLAY }, + { "title_skip", SPR_G2_TITLE_SKIP }, + { "cheats", SPR_G2_SANDBOX }, + { "news_messages", SPR_G2_TAB_NEWS }, + { "server_password", SPR_G2_LOCKED }, + { "multiplayer", SPR_G2_MENU_MULTIPLAYER }, + { "sort", SPR_G2_SORT }, + { "copy", SPR_G2_COPY }, + { "paste", SPR_G2_PASTE }, + { "mute", SPR_G2_TOOLBAR_MUTE }, + { "mute_pressed", SPR_G2_TOOLBAR_MUTE_PRESSED }, + { "unmute", SPR_G2_TOOLBAR_UNMUTE }, + { "unmute_pressed", SPR_G2_TOOLBAR_UNMUTE_PRESSED }, + { "search", SPR_G2_SEARCH }, + { "eyedropper", SPR_G2_EYEDROPPER }, + { "chat", SPR_G2_CHAT }, + { "map_north", SPR_G2_MAP_NORTH }, + { "map_north_pressed", SPR_G2_MAP_NORTH_PRESSED }, + { "map_west", SPR_G2_MAP_WEST }, + { "map_west_pressed", SPR_G2_MAP_WEST_PRESSED }, + { "map_south", SPR_G2_MAP_SOUTH }, + { "map_south_pressed", SPR_G2_MAP_SOUTH_PRESSED }, + { "map_east", SPR_G2_MAP_EAST }, + { "map_east_pressed", SPR_G2_MAP_EAST_PRESSED }, + { "multiplayer_toolbar", SPR_G2_TOOLBAR_MULTIPLAYER }, + { "multiplayer_toolbar_pressed", SPR_G2_TOOLBAR_MULTIPLAYER_PRESSED }, + { "multiplayer_sync", SPR_G2_MULTIPLAYER_SYNC }, + { "multiplayer_desync", SPR_G2_MULTIPLAYER_DESYNC }, + { "simulate", SPR_G2_SIMULATE }, + { "rct1_simulate_off", SPR_G2_RCT1_SIMULATE_BUTTON_0 }, + { "rct1_simulate_off_pressed", SPR_G2_RCT1_SIMULATE_BUTTON_1 }, + { "rct1_simulate_on", SPR_G2_RCT1_SIMULATE_BUTTON_2 }, + { "rct1_simulate_on_pressed", SPR_G2_RCT1_SIMULATE_BUTTON_3 }, + { "normal_selection_6x6", SPR_G2_LAND_TOOL_SIZE_6 }, + { "mountain_tool_even", SPR_G2_MOUNTAIN_TOOL_EVEN }, + { "mountain_tool_odd", SPR_G2_MOUNTAIN_TOOL_ODD }, + { "scenery_scatter_low", SPR_G2_SCENERY_SCATTER_LOW }, + { "scenery_scatter_medium", SPR_G2_SCENERY_SCATTER_MEDIUM }, + { "scenery_scatter_high", SPR_G2_SCENERY_SCATTER_HIGH }, + { "view", SPR_G2_VIEW }, + { "path_railings", SPR_G2_PATH_RAILINGS_TAB }, + { "legacy_paths", SPR_G2_LEGACY_PATH_TAB }, + { "path_surfaces", SPR_G2_PATH_SURFACE_TAB }, + { "ride_stations", SPR_G2_RIDE_STATION_TAB }, + { "terrain_edges", SPR_G2_TERRAIN_EDGE_TAB }, + { "hide_vegetation", SPR_G2_BUTTON_HIDE_VEGETATION }, + { "hide_scenery", SPR_G2_BUTTON_HIDE_SCENERY }, + { "hide_vehicles", SPR_G2_BUTTON_HIDE_VEHICLES }, + { "hide_supports", SPR_G2_BUTTON_HIDE_SUPPORTS }, + { "hide_partial", SPR_G2_BUTTON_HIDE_PARTIAL }, + { "hide_full", SPR_G2_BUTTON_HIDE_FULL }, + { "link_chain", SPR_G2_LINK_CHAIN }, + { "sideways_tab", SPR_G2_SIDEWAYS_TAB }, + { "sideways_tab_active", SPR_G2_SIDEWAYS_TAB_ACTIVE }, + { "arrow_up", SPR_G2_ARROW_UP }, + { "arrow_down", SPR_G2_ARROW_DOWN }, + { "reload", SPR_G2_RELOAD }, + { "glassy_recolourable", SPR_G2_SURFACE_GLASSY_RECOLOURABLE }, + { "selection_edge_nw", SPR_G2_SELECTION_EDGE_NW }, + { "selection_edge_ne", SPR_G2_SELECTION_EDGE_NE }, + { "selection_edge_sw", SPR_G2_SELECTION_EDGE_SW }, + { "selection_edge_se", SPR_G2_SELECTION_EDGE_SE }, + }; + + // Maps legacy G2 icons sprite indices to new sprite indices + + static std::map LegacyIconMap{ + { 32248, SPR_G2_EMPTY }, + { 29363, SPR_G2_PLACEHOLDER }, + { 29357, SPR_G2_LOGO }, + { 29358, SPR_G2_TITLE }, + { 29359, SPR_G2_FASTFORWARD }, + { 29360, SPR_G2_SPEED_ARROW }, + { 29361, SPR_G2_HYPER_ARROW }, + { 29362, SPR_G2_TAB_LAND }, + { 29364, SPR_G2_ZOOM_IN }, + { 29365, SPR_G2_ZOOM_IN_DISABLED }, + { 29366, SPR_G2_ZOOM_OUT }, + { 29367, SPR_G2_ZOOM_OUT_DISABLED }, + { 29368, SPR_G2_TAB_TREE }, + { 29369, SPR_G2_TAB_PENCIL }, + { 29370, SPR_G2_BUTTON_LARGE_SCENERY }, + { 29371, SPR_G2_BUTTON_TREES }, + { 29372, SPR_G2_BUTTON_FOOTPATH }, + { 29373, SPR_G2_RCT1_CLOSE_BUTTON_0 }, + { 29374, SPR_G2_RCT1_CLOSE_BUTTON_1 }, + { 29375, SPR_G2_RCT1_CLOSE_BUTTON_2 }, + { 29376, SPR_G2_RCT1_CLOSE_BUTTON_3 }, + { 29377, SPR_G2_RCT1_TEST_BUTTON_0 }, + { 29378, SPR_G2_RCT1_TEST_BUTTON_1 }, + { 29379, SPR_G2_RCT1_TEST_BUTTON_2 }, + { 29380, SPR_G2_RCT1_TEST_BUTTON_3 }, + { 29381, SPR_G2_RCT1_OPEN_BUTTON_0 }, + { 29382, SPR_G2_RCT1_OPEN_BUTTON_1 }, + { 29383, SPR_G2_RCT1_OPEN_BUTTON_2 }, + { 29384, SPR_G2_RCT1_OPEN_BUTTON_3 }, + { 29385, SPR_G2_TITLE_RESTART }, + { 29386, SPR_G2_TITLE_STOP }, + { 29387, SPR_G2_TITLE_PLAY }, + { 29388, SPR_G2_TITLE_SKIP }, + { 29389, SPR_G2_SANDBOX }, + { 29414, SPR_G2_TAB_NEWS }, + { 29415, SPR_G2_LOCKED }, + { 29416, SPR_G2_MENU_MULTIPLAYER }, + { 29433, SPR_G2_SORT }, + { 29434, SPR_G2_COPY }, + { 29435, SPR_G2_PASTE }, + { 29442, SPR_G2_TOOLBAR_MUTE }, + { 29443, SPR_G2_TOOLBAR_MUTE_PRESSED }, + { 29444, SPR_G2_TOOLBAR_UNMUTE }, + { 29445, SPR_G2_TOOLBAR_UNMUTE_PRESSED }, + { 29461, SPR_G2_SEARCH }, + { 29467, SPR_G2_EYEDROPPER }, + { 29468, SPR_G2_CHAT }, + { 29469, SPR_G2_MAP_NORTH }, + { 29470, SPR_G2_MAP_NORTH_PRESSED }, + { 29471, SPR_G2_MAP_WEST }, + { 29472, SPR_G2_MAP_WEST_PRESSED }, + { 29473, SPR_G2_MAP_SOUTH }, + { 29474, SPR_G2_MAP_SOUTH_PRESSED }, + { 29475, SPR_G2_MAP_EAST }, + { 29476, SPR_G2_MAP_EAST_PRESSED }, + { 29477, SPR_G2_TOOLBAR_MULTIPLAYER }, + { 29478, SPR_G2_TOOLBAR_MULTIPLAYER_PRESSED }, + { 29479, SPR_G2_MULTIPLAYER_SYNC }, + { 29480, SPR_G2_MULTIPLAYER_DESYNC }, + { 29481, SPR_G2_SIMULATE }, + { 29482, SPR_G2_RCT1_SIMULATE_BUTTON_0 }, + { 29483, SPR_G2_RCT1_SIMULATE_BUTTON_1 }, + { 29484, SPR_G2_RCT1_SIMULATE_BUTTON_2 }, + { 29485, SPR_G2_RCT1_SIMULATE_BUTTON_3 }, + { 29486, SPR_G2_LAND_TOOL_SIZE_6 }, + { 29487, SPR_G2_MOUNTAIN_TOOL_EVEN }, + { 29488, SPR_G2_MOUNTAIN_TOOL_ODD }, + { 29489, SPR_G2_SCENERY_SCATTER_LOW }, + { 29490, SPR_G2_SCENERY_SCATTER_MEDIUM }, + { 29491, SPR_G2_SCENERY_SCATTER_HIGH }, + { 29494, SPR_G2_VIEW }, + { 29495, SPR_G2_PATH_RAILINGS_TAB }, + { 29496, SPR_G2_LEGACY_PATH_TAB }, + { 29497, SPR_G2_PATH_SURFACE_TAB }, + { 29498, SPR_G2_RIDE_STATION_TAB }, + { 29499, SPR_G2_TERRAIN_EDGE_TAB }, + { 29500, SPR_G2_BUTTON_HIDE_VEGETATION }, + { 29501, SPR_G2_BUTTON_HIDE_SCENERY }, + { 29502, SPR_G2_BUTTON_HIDE_VEHICLES }, + { 29503, SPR_G2_BUTTON_HIDE_SUPPORTS }, + { 29504, SPR_G2_BUTTON_HIDE_PARTIAL }, + { 29505, SPR_G2_BUTTON_HIDE_FULL }, + { 29506, SPR_G2_LINK_CHAIN }, + { 29507, SPR_G2_SIDEWAYS_TAB }, + { 29508, SPR_G2_SIDEWAYS_TAB_ACTIVE }, + { 29509, SPR_G2_ARROW_UP }, + { 29510, SPR_G2_ARROW_DOWN }, + { 29511, SPR_G2_RELOAD }, + }; + + inline uint32_t GetIconByName(const std::string& input) + { + auto result = G2SpriteLookupTable.find(input); + if (result != G2SpriteLookupTable.end()) + return result->second; + return SPR_G2_EMPTY; + } + + inline uint32_t NewIconIndex(const uint32_t& input) + { + auto result = LegacyIconMap.find(input); + if (result != LegacyIconMap.end()) + return result->second; + return input; + } + + inline uint32_t LegacyIconIndex(const uint32_t& input) + { + uint32_t result = input; + for (auto& i : LegacyIconMap) + { + if (i.second == input) + { + result = i.first; + break; + } + } + return result; + } + +} // namespace OpenRCT2::Scripting diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index 901a4e5419..76eee91c90 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -555,7 +555,7 @@ void ScriptEngine::RefreshPlugins() } // Turn on hot reload if not already enabled - if (!_hotReloadingInitialised && gConfigPlugin.enable_hot_reloading && network_get_mode() == NETWORK_MODE_NONE) + if (!_hotReloadingInitialised && gConfigPlugin.EnableHotReloading && network_get_mode() == NETWORK_MODE_NONE) { SetupHotReloading(); } @@ -771,8 +771,8 @@ void ScriptEngine::SetupHotReloading() if (Path::DirectoryExists(base)) { _pluginFileWatcher = std::make_unique(base); - _pluginFileWatcher->OnFileChanged = [this](const std::string& path) { - std::lock_guard guard(_changedPluginFilesMutex); + _pluginFileWatcher->OnFileChanged = [this](u8string_view path) { + std::lock_guard guard(_changedPluginFilesMutex); _changedPluginFiles.emplace(path); }; _hotReloadingInitialised = true; @@ -799,10 +799,10 @@ void ScriptEngine::DoAutoReloadPluginCheck() void ScriptEngine::AutoReloadPlugins() { - if (_changedPluginFiles.size() > 0) + if (!_changedPluginFiles.empty()) { - std::lock_guard guard(_changedPluginFilesMutex); - for (auto& path : _changedPluginFiles) + std::lock_guard guard(_changedPluginFilesMutex); + for (const auto& path : _changedPluginFiles) { auto findResult = std::find_if(_plugins.begin(), _plugins.end(), [&path](const std::shared_ptr& plugin) { return Path::Equals(path, plugin->GetPath()); diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 02e7bb8c03..f2a0db4c1d 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -46,10 +46,11 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 62; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 65; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; + static constexpr int32_t API_VERSION_63_G2_REORDER = 63; # ifndef DISABLE_NETWORK class ScSocketBase; diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp index 5898ba4926..c738074bcc 100644 --- a/src/openrct2/scripting/bindings/entity/ScStaff.cpp +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -176,7 +176,7 @@ namespace OpenRCT2::Scripting { auto coord = FromDuk(dukCoord); staff->SetPatrolArea(coord, value); - map_invalidate_tile_full(coord); + MapInvalidateTileFull(coord); } } else @@ -188,7 +188,7 @@ namespace OpenRCT2::Scripting { CoordsXY coord(x, y); staff->SetPatrolArea(coord, value); - map_invalidate_tile_full(coord); + MapInvalidateTileFull(coord); } } } diff --git a/src/openrct2/scripting/bindings/game/ScConfiguration.hpp b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp index b58278220d..07a0db5466 100644 --- a/src/openrct2/scripting/bindings/game/ScConfiguration.hpp +++ b/src/openrct2/scripting/bindings/game/ScConfiguration.hpp @@ -173,8 +173,8 @@ namespace OpenRCT2::Scripting DukObject obj(ctx); if (ns == "general") { - obj.Set("general.language", gConfigGeneral.language); - obj.Set("general.showFps", gConfigGeneral.show_fps); + obj.Set("general.language", gConfigGeneral.Language); + obj.Set("general.showFps", gConfigGeneral.ShowFPS); } result = obj.Take(); } @@ -205,7 +205,7 @@ namespace OpenRCT2::Scripting } if (key == "general.showFps") { - duk_push_boolean(ctx, gConfigGeneral.show_fps); + duk_push_boolean(ctx, gConfigGeneral.ShowFPS); return DukValue::take_from_stack(ctx); } } @@ -246,7 +246,7 @@ namespace OpenRCT2::Scripting { if (key == "general.showFps") { - gConfigGeneral.show_fps = value.as_bool(); + gConfigGeneral.ShowFPS = value.as_bool(); } else { diff --git a/src/openrct2/scripting/bindings/game/ScContext.hpp b/src/openrct2/scripting/bindings/game/ScContext.hpp index 999e6fedfd..14eb4c22a4 100644 --- a/src/openrct2/scripting/bindings/game/ScContext.hpp +++ b/src/openrct2/scripting/bindings/game/ScContext.hpp @@ -19,6 +19,7 @@ # include "../../../scenario/Scenario.h" # include "../../Duktape.hpp" # include "../../HookEngine.h" +# include "../../IconNames.hpp" # include "../../ScriptEngine.h" # include "../game/ScConfiguration.hpp" # include "../game/ScDisposable.hpp" @@ -460,6 +461,11 @@ namespace OpenRCT2::Scripting ClearIntervalOrTimeout(handle); } + int32_t getIcon(const std::string& iconName) + { + return GetIconByName(iconName); + } + public: static void Register(duk_context* ctx) { @@ -482,8 +488,27 @@ namespace OpenRCT2::Scripting dukglue_register_method(ctx, &ScContext::setTimeout, "setTimeout"); dukglue_register_method(ctx, &ScContext::clearInterval, "clearInterval"); dukglue_register_method(ctx, &ScContext::clearTimeout, "clearTimeout"); + dukglue_register_method(ctx, &ScContext::getIcon, "getIcon"); } }; + + uint32_t ImageFromDuk(const DukValue& d) + { + uint32_t img{}; + if (d.type() == DukValue::Type::NUMBER) + { + img = d.as_uint(); + if (GetTargetAPIVersion() <= API_VERSION_63_G2_REORDER) + { + img = NewIconIndex(d.as_uint()); + } + } + else if (d.type() == DukValue::Type::STRING) + { + img = GetIconByName(d.as_c_string()); + } + return img; + } } // namespace OpenRCT2::Scripting #endif diff --git a/src/openrct2/scripting/bindings/network/ScSocket.hpp b/src/openrct2/scripting/bindings/network/ScSocket.hpp index 9e0d5b820f..15febcd85a 100644 --- a/src/openrct2/scripting/bindings/network/ScSocket.hpp +++ b/src/openrct2/scripting/bindings/network/ScSocket.hpp @@ -90,15 +90,15 @@ namespace OpenRCT2::Scripting constexpr char delimiter = ','; size_t start_pos = 0; size_t end_pos = 0; - while ((end_pos = gConfigPlugin.allowed_hosts.find(delimiter, start_pos)) != std::string::npos) + while ((end_pos = gConfigPlugin.AllowedHosts.find(delimiter, start_pos)) != std::string::npos) { - if (host == gConfigPlugin.allowed_hosts.substr(start_pos, end_pos - start_pos)) + if (host == gConfigPlugin.AllowedHosts.substr(start_pos, end_pos - start_pos)) { return true; } start_pos = end_pos + 1; } - return host == gConfigPlugin.allowed_hosts.substr(start_pos, gConfigPlugin.allowed_hosts.length() - start_pos); + return host == gConfigPlugin.AllowedHosts.substr(start_pos, gConfigPlugin.AllowedHosts.length() - start_pos); } public: diff --git a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp index e1953fe07d..ec7585d479 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp +++ b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp @@ -22,7 +22,7 @@ using namespace OpenRCT2::TrackMetaData; std::shared_ptr ScTrackIterator::FromElement(const CoordsXY& position, int32_t elementIndex) { - auto el = map_get_nth_element_at(position, elementIndex); + auto el = MapGetNthElementAt(position, elementIndex); auto origin = GetTrackSegmentOrigin(CoordsXYE(position, el)); if (!origin) return nullptr; @@ -75,7 +75,7 @@ DukValue ScTrackIterator::previousPosition_get() const auto& seq0 = ted.Block; auto pos = _position + CoordsXYZ(seq0->x, seq0->y, seq0->z); - auto el = map_get_track_element_at_of_type_seq(pos, _type, 0); + auto el = MapGetTrackElementAtOfTypeSeq(pos, _type, 0); if (el == nullptr) return ToDuk(ctx, nullptr); @@ -95,7 +95,7 @@ DukValue ScTrackIterator::nextPosition_get() const auto& seq0 = ted.Block; auto pos = _position + CoordsXYZ(seq0->x, seq0->y, seq0->z); - auto el = map_get_track_element_at_of_type_seq(pos, _type, 0); + auto el = MapGetTrackElementAtOfTypeSeq(pos, _type, 0); if (el == nullptr) return ToDuk(ctx, nullptr); @@ -114,7 +114,7 @@ bool ScTrackIterator::previous() auto& seq0 = ted.Block; auto pos = _position + CoordsXYZ(seq0->x, seq0->y, seq0->z); - auto el = map_get_track_element_at_of_type_seq(pos, _type, 0); + auto el = MapGetTrackElementAtOfTypeSeq(pos, _type, 0); if (el == nullptr) return false; @@ -140,7 +140,7 @@ bool ScTrackIterator::next() auto& seq0 = ted.Block; auto pos = _position + CoordsXYZ(seq0->x, seq0->y, seq0->z); - auto el = map_get_track_element_at_of_type_seq(pos, _type, 0); + auto el = MapGetTrackElementAtOfTypeSeq(pos, _type, 0); if (el == nullptr) return false; diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index 91d6b68317..629e187c61 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Scripting { gCash = value; auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -73,7 +73,7 @@ namespace OpenRCT2::Scripting { gParkRating = std::min(std::max(0, value), 999); auto intent = Intent(INTENT_ACTION_UPDATE_PARK_RATING); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -89,7 +89,7 @@ namespace OpenRCT2::Scripting { gBankLoan = value; auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -105,7 +105,7 @@ namespace OpenRCT2::Scripting { gMaxBankLoan = value; auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -171,7 +171,7 @@ namespace OpenRCT2::Scripting { gParkValue = value; auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -187,7 +187,7 @@ namespace OpenRCT2::Scripting { gCompanyValue = value; auto intent = Intent(INTENT_ACTION_UPDATE_CASH); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } diff --git a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp index 927d0f1e8b..8a607e5294 100644 --- a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp @@ -23,7 +23,7 @@ namespace OpenRCT2::Scripting { static constexpr const char* ParkMessageTypeStrings[] = { - "attraction", "peep_on_attraction", "peep", "money", "blank", "research", "guests", "award", "chart", + "attraction", "peep_on_attraction", "peep", "money", "blank", "research", "guests", "award", "chart", "campaign", }; inline News::ItemType GetParkMessageType(const std::string& key) diff --git a/src/openrct2/scripting/bindings/world/ScTile.cpp b/src/openrct2/scripting/bindings/world/ScTile.cpp index 07ecc2c290..902e0234aa 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.cpp +++ b/src/openrct2/scripting/bindings/world/ScTile.cpp @@ -69,7 +69,7 @@ namespace OpenRCT2::Scripting DukValue ScTile::data_get() const { auto ctx = GetDukContext(); - auto first = map_get_first_element_at(_coords); + auto first = MapGetFirstElementAt(_coords); auto dataLen = GetNumElements(first) * sizeof(TileElement); auto data = duk_push_fixed_buffer(ctx, dataLen); if (first != nullptr) @@ -92,7 +92,7 @@ namespace OpenRCT2::Scripting auto numElements = dataLen / sizeof(TileElement); if (numElements == 0) { - map_set_tile_element(TileCoordsXY(_coords), nullptr); + MapSetTileElement(TileCoordsXY(_coords), nullptr); } else { @@ -105,11 +105,11 @@ namespace OpenRCT2::Scripting auto numToInsert = numElements - currentNumElements; for (size_t i = 0; i < numToInsert; i++) { - tile_element_insert(pos, 0, TileElementType::Surface); + TileElementInsert(pos, 0, TileElementType::Surface); } // Copy data to element span - first = map_get_first_element_at(_coords); + first = MapGetFirstElementAt(_coords); currentNumElements = GetNumElements(first); if (currentNumElements != 0) { @@ -125,7 +125,7 @@ namespace OpenRCT2::Scripting first[numElements - 1].SetLastForTile(true); } } - map_invalidate_tile_full(_coords); + MapInvalidateTileFull(_coords); } } @@ -150,7 +150,7 @@ namespace OpenRCT2::Scripting std::vector data(first, first + origNumElements); auto pos = TileCoordsXYZ(TileCoordsXY(_coords), 0).ToCoordsXYZ(); - auto newElement = tile_element_insert(pos, 0, TileElementType::Surface); + auto newElement = TileElementInsert(pos, 0, TileElementType::Surface); if (newElement == nullptr) { auto ctx = GetDukContext(); @@ -177,7 +177,7 @@ namespace OpenRCT2::Scripting first[i].SetLastForTile(false); } first[origNumElements].SetLastForTile(true); - map_invalidate_tile_full(_coords); + MapInvalidateTileFull(_coords); result = std::make_shared(_coords, &first[index]); } } @@ -195,14 +195,14 @@ namespace OpenRCT2::Scripting auto first = GetFirstElement(); if (index < GetNumElements(first)) { - tile_element_remove(&first[index]); - map_invalidate_tile_full(_coords); + TileElementRemove(&first[index]); + MapInvalidateTileFull(_coords); } } TileElement* ScTile::GetFirstElement() const { - return map_get_first_element_at(_coords); + return MapGetFirstElementAt(_coords); } size_t ScTile::GetNumElements(const TileElement* first) diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 6fb5594b60..82f76ed6c1 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -2005,7 +2005,7 @@ namespace OpenRCT2::Scripting void ScTileElement::Invalidate() { - map_invalidate_tile_full(_coords); + MapInvalidateTileFull(_coords); } void ScTileElement::Register(duk_context* ctx) diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 99ab63297a..11daeece9e 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -696,6 +696,15 @@ enum SPR_LAND_OWNERSHIP_AVAILABLE = 22955, SPR_LAND_CONSTRUCTION_RIGHTS_AVAILABLE = 22956, + SPR_WATER_PARTICLES_DENSE_0 = 22965, + SPR_WATER_PARTICLES_DENSE_1 = SPR_WATER_PARTICLES_DENSE_0 + 1, + SPR_WATER_PARTICLES_DENSE_2 = SPR_WATER_PARTICLES_DENSE_0 + 2, + SPR_WATER_PARTICLES_DENSE_3 = SPR_WATER_PARTICLES_DENSE_0 + 3, + SPR_WATER_PARTICLES_DENSE_4 = SPR_WATER_PARTICLES_DENSE_0 + 4, + SPR_WATER_PARTICLES_DENSE_5 = SPR_WATER_PARTICLES_DENSE_0 + 5, + SPR_WATER_PARTICLES_DENSE_6 = SPR_WATER_PARTICLES_DENSE_0 + 6, + SPR_WATER_PARTICLES_DENSE_7 = SPR_WATER_PARTICLES_DENSE_0 + 7, + SPR_LITTER_SICK = 23101, SPR_LITTER_SICK_ALT = 23103, SPR_LITTER_EMPTY_CAN = 23105, @@ -754,237 +763,303 @@ enum SPR_NEW_RIDE_MASK = 29013, + SPR_SPLASH_EFFECT_1_NE_0 = 29014, + SPR_SPLASH_EFFECT_1_NE_1 = SPR_SPLASH_EFFECT_1_NE_0 + 1, + SPR_SPLASH_EFFECT_1_NE_2 = SPR_SPLASH_EFFECT_1_NE_0 + 2, + SPR_SPLASH_EFFECT_1_NE_3 = SPR_SPLASH_EFFECT_1_NE_0 + 3, + SPR_SPLASH_EFFECT_1_NE_4 = SPR_SPLASH_EFFECT_1_NE_0 + 4, + SPR_SPLASH_EFFECT_1_NE_5 = SPR_SPLASH_EFFECT_1_NE_0 + 5, + SPR_SPLASH_EFFECT_1_NE_6 = SPR_SPLASH_EFFECT_1_NE_0 + 6, + SPR_SPLASH_EFFECT_1_NE_7 = SPR_SPLASH_EFFECT_1_NE_0 + 7, + + SPR_SPLASH_EFFECT_2_NW_0 = 29022, + SPR_SPLASH_EFFECT_2_NW_1 = SPR_SPLASH_EFFECT_2_NW_0 + 1, + SPR_SPLASH_EFFECT_2_NW_2 = SPR_SPLASH_EFFECT_2_NW_0 + 2, + SPR_SPLASH_EFFECT_2_NW_3 = SPR_SPLASH_EFFECT_2_NW_0 + 3, + SPR_SPLASH_EFFECT_2_NW_4 = SPR_SPLASH_EFFECT_2_NW_0 + 4, + SPR_SPLASH_EFFECT_2_NW_5 = SPR_SPLASH_EFFECT_2_NW_0 + 5, + SPR_SPLASH_EFFECT_2_NW_6 = SPR_SPLASH_EFFECT_2_NW_0 + 6, + SPR_SPLASH_EFFECT_2_NW_7 = SPR_SPLASH_EFFECT_2_NW_0 + 7, + + SPR_SPLASH_EFFECT_2_NE_0 = 29030, + SPR_SPLASH_EFFECT_2_NE_1 = SPR_SPLASH_EFFECT_2_NE_0 + 1, + SPR_SPLASH_EFFECT_2_NE_2 = SPR_SPLASH_EFFECT_2_NE_0 + 2, + SPR_SPLASH_EFFECT_2_NE_3 = SPR_SPLASH_EFFECT_2_NE_0 + 3, + SPR_SPLASH_EFFECT_2_NE_4 = SPR_SPLASH_EFFECT_2_NE_0 + 4, + SPR_SPLASH_EFFECT_2_NE_5 = SPR_SPLASH_EFFECT_2_NE_0 + 5, + SPR_SPLASH_EFFECT_2_NE_6 = SPR_SPLASH_EFFECT_2_NE_0 + 6, + SPR_SPLASH_EFFECT_2_NE_7 = SPR_SPLASH_EFFECT_2_NE_0 + 7, + + SPR_SPLASH_EFFECT_1_NW_0 = 29038, + SPR_SPLASH_EFFECT_1_NW_1 = SPR_SPLASH_EFFECT_1_NW_0 + 1, + SPR_SPLASH_EFFECT_1_NW_2 = SPR_SPLASH_EFFECT_1_NW_0 + 2, + SPR_SPLASH_EFFECT_1_NW_3 = SPR_SPLASH_EFFECT_1_NW_0 + 3, + SPR_SPLASH_EFFECT_1_NW_4 = SPR_SPLASH_EFFECT_1_NW_0 + 4, + SPR_SPLASH_EFFECT_1_NW_5 = SPR_SPLASH_EFFECT_1_NW_0 + 5, + SPR_SPLASH_EFFECT_1_NW_6 = SPR_SPLASH_EFFECT_1_NW_0 + 6, + SPR_SPLASH_EFFECT_1_NW_7 = SPR_SPLASH_EFFECT_1_NW_0 + 7, + + SPR_SPLASH_EFFECT_3_NE_0 = 29046, + SPR_SPLASH_EFFECT_3_NE_1 = SPR_SPLASH_EFFECT_3_NE_0 + 1, + SPR_SPLASH_EFFECT_3_NE_2 = SPR_SPLASH_EFFECT_3_NE_0 + 2, + SPR_SPLASH_EFFECT_3_NE_3 = SPR_SPLASH_EFFECT_3_NE_0 + 3, + SPR_SPLASH_EFFECT_3_NE_4 = SPR_SPLASH_EFFECT_3_NE_0 + 4, + SPR_SPLASH_EFFECT_3_NE_5 = SPR_SPLASH_EFFECT_3_NE_0 + 5, + SPR_SPLASH_EFFECT_3_NE_6 = SPR_SPLASH_EFFECT_3_NE_0 + 6, + SPR_SPLASH_EFFECT_3_NE_7 = SPR_SPLASH_EFFECT_3_NE_0 + 7, + + SPR_SPLASH_EFFECT_4_NW_0 = 29054, + SPR_SPLASH_EFFECT_4_NW_1 = SPR_SPLASH_EFFECT_4_NW_0 + 1, + SPR_SPLASH_EFFECT_4_NW_2 = SPR_SPLASH_EFFECT_4_NW_0 + 2, + SPR_SPLASH_EFFECT_4_NW_3 = SPR_SPLASH_EFFECT_4_NW_0 + 3, + SPR_SPLASH_EFFECT_4_NW_4 = SPR_SPLASH_EFFECT_4_NW_0 + 4, + SPR_SPLASH_EFFECT_4_NW_5 = SPR_SPLASH_EFFECT_4_NW_0 + 5, + SPR_SPLASH_EFFECT_4_NW_6 = SPR_SPLASH_EFFECT_4_NW_0 + 6, + SPR_SPLASH_EFFECT_4_NW_7 = SPR_SPLASH_EFFECT_4_NW_0 + 7, + + SPR_SPLASH_EFFECT_4_NE_0 = 29062, + SPR_SPLASH_EFFECT_4_NE_1 = SPR_SPLASH_EFFECT_4_NE_0 + 1, + SPR_SPLASH_EFFECT_4_NE_2 = SPR_SPLASH_EFFECT_4_NE_0 + 2, + SPR_SPLASH_EFFECT_4_NE_3 = SPR_SPLASH_EFFECT_4_NE_0 + 3, + SPR_SPLASH_EFFECT_4_NE_4 = SPR_SPLASH_EFFECT_4_NE_0 + 4, + SPR_SPLASH_EFFECT_4_NE_5 = SPR_SPLASH_EFFECT_4_NE_0 + 5, + SPR_SPLASH_EFFECT_4_NE_6 = SPR_SPLASH_EFFECT_4_NE_0 + 6, + SPR_SPLASH_EFFECT_4_NE_7 = SPR_SPLASH_EFFECT_4_NE_0 + 7, + + SPR_SPLASH_EFFECT_3_NW_0 = 29070, + SPR_SPLASH_EFFECT_3_NW_1 = SPR_SPLASH_EFFECT_3_NW_0 + 1, + SPR_SPLASH_EFFECT_3_NW_2 = SPR_SPLASH_EFFECT_3_NW_0 + 2, + SPR_SPLASH_EFFECT_3_NW_3 = SPR_SPLASH_EFFECT_3_NW_0 + 3, + SPR_SPLASH_EFFECT_3_NW_4 = SPR_SPLASH_EFFECT_3_NW_0 + 4, + SPR_SPLASH_EFFECT_3_NW_5 = SPR_SPLASH_EFFECT_3_NW_0 + 5, + SPR_SPLASH_EFFECT_3_NW_6 = SPR_SPLASH_EFFECT_3_NW_0 + 6, + SPR_SPLASH_EFFECT_3_NW_7 = SPR_SPLASH_EFFECT_3_NW_0 + 7, + + SPR_SPLASH_EFFECT_5_NE_0 = 29078, + SPR_SPLASH_EFFECT_5_NE_1 = SPR_SPLASH_EFFECT_5_NE_0 + 1, + SPR_SPLASH_EFFECT_5_NE_3 = SPR_SPLASH_EFFECT_5_NE_0 + 2, + SPR_SPLASH_EFFECT_5_NE_2 = SPR_SPLASH_EFFECT_5_NE_0 + 3, + SPR_SPLASH_EFFECT_5_NE_4 = SPR_SPLASH_EFFECT_5_NE_0 + 4, + SPR_SPLASH_EFFECT_5_NE_5 = SPR_SPLASH_EFFECT_5_NE_0 + 5, + SPR_SPLASH_EFFECT_5_NE_6 = SPR_SPLASH_EFFECT_5_NE_0 + 6, + SPR_SPLASH_EFFECT_5_NE_7 = SPR_SPLASH_EFFECT_5_NE_0 + 7, + + SPR_SPLASH_EFFECT_5_SE_0 = 29086, + SPR_SPLASH_EFFECT_5_SE_1 = SPR_SPLASH_EFFECT_5_SE_0 + 1, + SPR_SPLASH_EFFECT_5_SE_2 = SPR_SPLASH_EFFECT_5_SE_0 + 2, + SPR_SPLASH_EFFECT_5_SE_3 = SPR_SPLASH_EFFECT_5_SE_0 + 3, + SPR_SPLASH_EFFECT_5_SE_4 = SPR_SPLASH_EFFECT_5_SE_0 + 4, + SPR_SPLASH_EFFECT_5_SE_5 = SPR_SPLASH_EFFECT_5_SE_0 + 5, + SPR_SPLASH_EFFECT_5_SE_6 = SPR_SPLASH_EFFECT_5_SE_0 + 6, + SPR_SPLASH_EFFECT_5_SE_7 = SPR_SPLASH_EFFECT_5_SE_0 + 7, + + SPR_SPLASH_EFFECT_5_SW_0 = 29094, + SPR_SPLASH_EFFECT_5_SW_1 = SPR_SPLASH_EFFECT_5_SW_0 + 1, + SPR_SPLASH_EFFECT_5_SW_2 = SPR_SPLASH_EFFECT_5_SW_0 + 2, + SPR_SPLASH_EFFECT_5_SW_3 = SPR_SPLASH_EFFECT_5_SW_0 + 3, + SPR_SPLASH_EFFECT_5_SW_4 = SPR_SPLASH_EFFECT_5_SW_0 + 4, + SPR_SPLASH_EFFECT_5_SW_5 = SPR_SPLASH_EFFECT_5_SW_0 + 5, + SPR_SPLASH_EFFECT_5_SW_6 = SPR_SPLASH_EFFECT_5_SW_0 + 6, + SPR_SPLASH_EFFECT_5_SW_7 = SPR_SPLASH_EFFECT_5_SW_0 + 7, + + SPR_SPLASH_EFFECT_5_NW_0 = 29102, + SPR_SPLASH_EFFECT_5_NW_1 = SPR_SPLASH_EFFECT_5_NW_0 + 1, + SPR_SPLASH_EFFECT_5_NW_2 = SPR_SPLASH_EFFECT_5_NW_0 + 2, + SPR_SPLASH_EFFECT_5_NW_3 = SPR_SPLASH_EFFECT_5_NW_0 + 3, + SPR_SPLASH_EFFECT_5_NW_4 = SPR_SPLASH_EFFECT_5_NW_0 + 4, + SPR_SPLASH_EFFECT_5_NW_5 = SPR_SPLASH_EFFECT_5_NW_0 + 5, + SPR_SPLASH_EFFECT_5_NW_6 = SPR_SPLASH_EFFECT_5_NW_0 + 6, + SPR_SPLASH_EFFECT_5_NW_7 = SPR_SPLASH_EFFECT_5_NW_0 + 7, + SPR_G1_END = 29294, SPR_RCTC_G1_END = 29357, // The number of elements in RCTC's g1.dat file + // Start of OpenRCT2 additions (g2.dat) + SPR_G2_BEGIN = 29357, - SPR_G2_LOGO = SPR_G2_BEGIN + 0, - SPR_G2_TITLE = SPR_G2_BEGIN + 1, - SPR_G2_FASTFORWARD = SPR_G2_BEGIN + 2, - SPR_G2_SPEED_ARROW = SPR_G2_BEGIN + 3, - SPR_G2_HYPER_ARROW = SPR_G2_BEGIN + 4, - SPR_G2_TAB_LAND = SPR_G2_BEGIN + 5, + SPR_G2_EMPTY = SPR_G2_BEGIN, + SPR_G2_PLACEHOLDER, - SPR_G2_PLACEHOLDER = SPR_G2_BEGIN + 6, + // G2 UI Elements + // When adding UI elements to G2, insert them before fonts and give them a name in src/openrct2/scripting/IconNames.hpp - SPR_G2_ZOOM_IN = SPR_G2_BEGIN + 7, - SPR_G2_ZOOM_IN_DISABLED = SPR_G2_BEGIN + 8, - SPR_G2_ZOOM_OUT = SPR_G2_BEGIN + 9, - SPR_G2_ZOOM_OUT_DISABLED = SPR_G2_BEGIN + 10, + SPR_G2_LOGO, + SPR_G2_TITLE, + SPR_G2_FASTFORWARD, + SPR_G2_SPEED_ARROW, + SPR_G2_HYPER_ARROW, + SPR_G2_TAB_LAND, + SPR_G2_ZOOM_IN, + SPR_G2_ZOOM_IN_DISABLED, + SPR_G2_ZOOM_OUT, + SPR_G2_ZOOM_OUT_DISABLED, + SPR_G2_TAB_TREE, + SPR_G2_TAB_PENCIL, + SPR_G2_BUTTON_LARGE_SCENERY, + SPR_G2_BUTTON_TREES, + SPR_G2_BUTTON_FOOTPATH, + SPR_G2_RCT1_CLOSE_BUTTON_0, + SPR_G2_RCT1_CLOSE_BUTTON_1, + SPR_G2_RCT1_CLOSE_BUTTON_2, + SPR_G2_RCT1_CLOSE_BUTTON_3, + SPR_G2_RCT1_TEST_BUTTON_0, + SPR_G2_RCT1_TEST_BUTTON_1, + SPR_G2_RCT1_TEST_BUTTON_2, + SPR_G2_RCT1_TEST_BUTTON_3, + SPR_G2_RCT1_OPEN_BUTTON_0, + SPR_G2_RCT1_OPEN_BUTTON_1, + SPR_G2_RCT1_OPEN_BUTTON_2, + SPR_G2_RCT1_OPEN_BUTTON_3, + SPR_G2_TITLE_RESTART, + SPR_G2_TITLE_STOP, + SPR_G2_TITLE_PLAY, + SPR_G2_TITLE_SKIP, + SPR_G2_SANDBOX, + SPR_G2_TAB_NEWS, + SPR_G2_LOCKED, + SPR_G2_MENU_MULTIPLAYER, + SPR_G2_SORT, + SPR_G2_COPY, + SPR_G2_PASTE, + SPR_G2_TOOLBAR_MUTE, + SPR_G2_TOOLBAR_MUTE_PRESSED, + SPR_G2_TOOLBAR_UNMUTE, + SPR_G2_TOOLBAR_UNMUTE_PRESSED, + SPR_G2_SEARCH, + SPR_G2_EYEDROPPER, + SPR_G2_CHAT, + SPR_G2_MAP_NORTH, + SPR_G2_MAP_NORTH_PRESSED, + SPR_G2_MAP_WEST, + SPR_G2_MAP_WEST_PRESSED, + SPR_G2_MAP_SOUTH, + SPR_G2_MAP_SOUTH_PRESSED, + SPR_G2_MAP_EAST, + SPR_G2_MAP_EAST_PRESSED, + SPR_G2_TOOLBAR_MULTIPLAYER, + SPR_G2_TOOLBAR_MULTIPLAYER_PRESSED, + SPR_G2_MULTIPLAYER_SYNC, + SPR_G2_MULTIPLAYER_DESYNC, + SPR_G2_SIMULATE, + SPR_G2_RCT1_SIMULATE_BUTTON_0, + SPR_G2_RCT1_SIMULATE_BUTTON_1, + SPR_G2_RCT1_SIMULATE_BUTTON_2, + SPR_G2_RCT1_SIMULATE_BUTTON_3, + SPR_G2_LAND_TOOL_SIZE_6, + SPR_G2_MOUNTAIN_TOOL_EVEN, + SPR_G2_MOUNTAIN_TOOL_ODD, + SPR_G2_SCENERY_SCATTER_LOW, + SPR_G2_SCENERY_SCATTER_MEDIUM, + SPR_G2_SCENERY_SCATTER_HIGH, + SPR_G2_VIEW, + SPR_G2_PATH_RAILINGS_TAB, + SPR_G2_LEGACY_PATH_TAB, + SPR_G2_PATH_SURFACE_TAB, + SPR_G2_RIDE_STATION_TAB, + SPR_G2_TERRAIN_EDGE_TAB, + SPR_G2_BUTTON_HIDE_VEGETATION, + SPR_G2_BUTTON_HIDE_SCENERY, + SPR_G2_BUTTON_HIDE_VEHICLES, + SPR_G2_BUTTON_HIDE_SUPPORTS, + SPR_G2_BUTTON_HIDE_PARTIAL, + SPR_G2_BUTTON_HIDE_FULL, + SPR_G2_LINK_CHAIN, + SPR_G2_SIDEWAYS_TAB, + SPR_G2_SIDEWAYS_TAB_ACTIVE, + SPR_G2_ARROW_UP, + SPR_G2_ARROW_DOWN, + SPR_G2_RELOAD, - SPR_G2_TAB_TREE = SPR_G2_BEGIN + 11, - SPR_G2_TAB_PENCIL = SPR_G2_BEGIN + 12, - SPR_G2_BUTTON_LARGE_SCENERY = SPR_G2_BEGIN + 13, - SPR_G2_BUTTON_TREES = SPR_G2_BEGIN + 14, - SPR_G2_BUTTON_FOOTPATH = SPR_G2_BEGIN + 15, + // G2 Misc - SPR_G2_RCT1_CLOSE_BUTTON_0 = SPR_G2_BEGIN + 16, - SPR_G2_RCT1_CLOSE_BUTTON_1 = SPR_G2_BEGIN + 17, - SPR_G2_RCT1_CLOSE_BUTTON_2 = SPR_G2_BEGIN + 18, - SPR_G2_RCT1_CLOSE_BUTTON_3 = SPR_G2_BEGIN + 19, - SPR_G2_RCT1_TEST_BUTTON_0 = SPR_G2_BEGIN + 20, - SPR_G2_RCT1_TEST_BUTTON_1 = SPR_G2_BEGIN + 21, - SPR_G2_RCT1_TEST_BUTTON_2 = SPR_G2_BEGIN + 22, - SPR_G2_RCT1_TEST_BUTTON_3 = SPR_G2_BEGIN + 23, - SPR_G2_RCT1_OPEN_BUTTON_0 = SPR_G2_BEGIN + 24, - SPR_G2_RCT1_OPEN_BUTTON_1 = SPR_G2_BEGIN + 25, - SPR_G2_RCT1_OPEN_BUTTON_2 = SPR_G2_BEGIN + 26, - SPR_G2_RCT1_OPEN_BUTTON_3 = SPR_G2_BEGIN + 27, + SPR_G2_SURFACE_GLASSY_RECOLOURABLE, + SPR_G2_SELECTION_EDGE_NW, + SPR_G2_SELECTION_EDGE_NE, + SPR_G2_SELECTION_EDGE_SW, + SPR_G2_SELECTION_EDGE_SE, - SPR_G2_TITLE_RESTART = SPR_G2_BEGIN + 28, - SPR_G2_TITLE_STOP = SPR_G2_BEGIN + 29, - SPR_G2_TITLE_PLAY = SPR_G2_BEGIN + 30, - SPR_G2_TITLE_SKIP = SPR_G2_BEGIN + 31, + // G2 Characters - SPR_G2_SANDBOX = SPR_G2_BEGIN + 32, + SPR_G2_CHAR_BEGIN, + SPR_G2_AE_UPPER = SPR_G2_CHAR_BEGIN + 0, + SPR_G2_AE_LOWER, + SPR_G2_O_STROKE_UPPER, + SPR_G2_O_STROKE_LOWER, - SPR_G2_TAB_NEWS = SPR_G2_BEGIN + 57, - SPR_G2_LOCKED = SPR_G2_BEGIN + 58, - SPR_G2_MENU_MULTIPLAYER = SPR_G2_BEGIN + 59, + SPR_G2_CYRILLIC_BE_UPPER, + SPR_G2_CYRILLIC_GHE_UPPER, + SPR_G2_CYRILLIC_DE_UPPER, + SPR_G2_CYRILLIC_ZHE_UPPER, + SPR_G2_CYRILLIC_ZE_UPPER, + SPR_G2_CYRILLIC_I_UPPER, + SPR_G2_CYRILLIC_SHORT_I_UPPER, + SPR_G2_CYRILLIC_EL_UPPER, + SPR_G2_CYRILLIC_PE_UPPER, + SPR_G2_CYRILLIC_U_UPPER, + SPR_G2_CYRILLIC_EF_UPPER, + SPR_G2_CYRILLIC_TSE_UPPER, + SPR_G2_CYRILLIC_CHE_UPPER, + SPR_G2_CYRILLIC_SHA_UPPER, + SPR_G2_CYRILLIC_SHCHA_UPPER, + SPR_G2_CYRILLIC_HARD_SIGN_UPPER, + SPR_G2_CYRILLIC_YERU_UPPER, + SPR_G2_CYRILLIC_SOFT_SIGN_UPPER, + SPR_G2_CYRILLIC_E_UPPER, + SPR_G2_CYRILLIC_YU_UPPER, + SPR_G2_CYRILLIC_YA_UPPER, - SPR_G2_SORT = SPR_G2_BEGIN + 76, - SPR_G2_COPY = SPR_G2_BEGIN + 77, - SPR_G2_PASTE = SPR_G2_BEGIN + 78, + SPR_G2_CYRILLIC_BE_LOWER, + SPR_G2_CYRILLIC_VE_LOWER, + SPR_G2_CYRILLIC_GHE_LOWER, + SPR_G2_CYRILLIC_DE_LOWER, + SPR_G2_CYRILLIC_ZHE_LOWER, + SPR_G2_CYRILLIC_ZE_LOWER, + SPR_G2_CYRILLIC_I_LOWER, + SPR_G2_CYRILLIC_SHORT_I_LOWER, + SPR_G2_CYRILLIC_KA_LOWER, + SPR_G2_CYRILLIC_EL_LOWER, + SPR_G2_CYRILLIC_EM_LOWER, + SPR_G2_CYRILLIC_EN_LOWER, + SPR_G2_CYRILLIC_PE_LOWER, + SPR_G2_CYRILLIC_TE_LOWER, + SPR_G2_CYRILLIC_EF_LOWER, + SPR_G2_CYRILLIC_TSE_LOWER, + SPR_G2_CYRILLIC_CHE_LOWER, + SPR_G2_CYRILLIC_SHA_LOWER, + SPR_G2_CYRILLIC_SHCHA_LOWER, + SPR_G2_CYRILLIC_YERU_LOWER, + SPR_G2_CYRILLIC_SOFT_SIGN_LOWER, + SPR_G2_CYRILLIC_E_LOWER, + SPR_G2_CYRILLIC_YU_LOWER, + SPR_G2_CYRILLIC_YA_LOWER, - SPR_G2_GIGA_RC_BOOSTER_NE_SW = SPR_G2_BEGIN + 79, - SPR_G2_GIGA_RC_BOOSTER_NW_SE = SPR_G2_BEGIN + 80, - SPR_G2_BM_BOOSTER_NE_SW = SPR_G2_BEGIN + 81, - SPR_G2_BM_BOOSTER_NW_SE = SPR_G2_BEGIN + 82, + SPR_G2_GERMAN_OPENQUOTES, - SPR_G2_TOOLBAR_MUTE = SPR_G2_BEGIN + 85, - SPR_G2_TOOLBAR_MUTE_PRESSED = SPR_G2_BEGIN + 86, - SPR_G2_TOOLBAR_UNMUTE = SPR_G2_BEGIN + 87, - SPR_G2_TOOLBAR_UNMUTE_PRESSED = SPR_G2_BEGIN + 88, + SPR_G2_GUILDER_SIGN, - SPR_G2_MINI_RC_BOOSTER_NE_SW = SPR_G2_BEGIN + 89, - SPR_G2_MINI_RC_BOOSTER_NW_SE = SPR_G2_BEGIN + 90, + SPR_G2_G_BREVE_UPPER, + SPR_G2_I_WITH_DOT_UPPER, + SPR_G2_S_CEDILLA_UPPER, + SPR_G2_G_BREVE_LOWER, + SPR_G2_I_WITHOUT_DOT_LOWER, + SPR_G2_S_CEDILLA_LOWER, - SPR_G2_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_3 = SPR_G2_BEGIN + 91, + SPR_G2_INTERPUNCT, - SPR_G2_MINIATURE_RAILWAY_BEGIN = SPR_G2_BEGIN + 92, - SPR_G2_MINIATURE_RAILWAY_GRAVEL_SW_NE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 0, - SPR_G2_MINIATURE_RAILWAY_GRAVEL_NW_SE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 1, - SPR_G2_MINIATURE_RAILWAY_GROOVED_SW_NE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 2, - SPR_G2_MINIATURE_RAILWAY_GROOVED_NW_SE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 3, - SPR_G2_MINIATURE_RAILWAY_INSET_SW_NE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 4, - SPR_G2_MINIATURE_RAILWAY_INSET_NW_SE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 5, - SPR_G2_MINIATURE_RAILWAY_INSET_END_NE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 6, - SPR_G2_MINIATURE_RAILWAY_INSET_END_SE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 7, - SPR_G2_MINIATURE_RAILWAY_INSET_END_NW = SPR_G2_MINIATURE_RAILWAY_BEGIN + 8, - SPR_G2_MINIATURE_RAILWAY_INSET_END_SW = SPR_G2_MINIATURE_RAILWAY_BEGIN + 9, - SPR_G2_MINIATURE_RAILWAY_INSET_END_SW_NE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 10, - SPR_G2_MINIATURE_RAILWAY_INSET_END_NW_SE = SPR_G2_MINIATURE_RAILWAY_BEGIN + 11, - SPR_G2_MINIATURE_RAILWAY_LAST = SPR_G2_BEGIN + 103, + SPR_G2_A_BREVE_UPPER, + SPR_G2_T_COMMA_UPPER, + SPR_G2_T_COMMA_LOWER, - SPR_G2_SEARCH = SPR_G2_BEGIN + 104, + SPR_G2_ELLIPSIS, - SPR_G2_SURFACE_GLASSY_RECOLOURABLE = SPR_G2_BEGIN + 105, + SPR_G2_C_CARON_UPPER, + SPR_G2_C_CARON_LOWER, - SPR_G2_SELECTION_EDGE_NW = SPR_G2_BEGIN + 106, - SPR_G2_SELECTION_EDGE_NE = SPR_G2_BEGIN + 107, - SPR_G2_SELECTION_EDGE_SW = SPR_G2_BEGIN + 108, - SPR_G2_SELECTION_EDGE_SE = SPR_G2_BEGIN + 109, + SPR_G2_Y_ACUTE_UPPER, + SPR_G2_Y_ACUTE_LOWER, - SPR_G2_EYEDROPPER = SPR_G2_BEGIN + 110, - SPR_G2_CHAT = SPR_G2_BEGIN + 111, - - SPR_G2_MAP_NORTH = SPR_G2_BEGIN + 112, - SPR_G2_MAP_NORTH_PRESSED = SPR_G2_BEGIN + 113, - SPR_G2_MAP_WEST = SPR_G2_BEGIN + 114, - SPR_G2_MAP_WEST_PRESSED = SPR_G2_BEGIN + 115, - SPR_G2_MAP_SOUTH = SPR_G2_BEGIN + 116, - SPR_G2_MAP_SOUTH_PRESSED = SPR_G2_BEGIN + 117, - SPR_G2_MAP_EAST = SPR_G2_BEGIN + 118, - SPR_G2_MAP_EAST_PRESSED = SPR_G2_BEGIN + 119, - - SPR_G2_TOOLBAR_MULTIPLAYER = SPR_G2_BEGIN + 120, - SPR_G2_TOOLBAR_MULTIPLAYER_PRESSED = SPR_G2_BEGIN + 121, - SPR_G2_MULTIPLAYER_SYNC = SPR_G2_BEGIN + 122, - SPR_G2_MULTIPLAYER_DESYNC = SPR_G2_BEGIN + 123, - - SPR_G2_SIMULATE = SPR_G2_BEGIN + 124, - SPR_G2_RCT1_SIMULATE_BUTTON_0 = SPR_G2_BEGIN + 125, - SPR_G2_RCT1_SIMULATE_BUTTON_1 = SPR_G2_BEGIN + 126, - SPR_G2_RCT1_SIMULATE_BUTTON_2 = SPR_G2_BEGIN + 127, - SPR_G2_RCT1_SIMULATE_BUTTON_3 = SPR_G2_BEGIN + 128, - - SPR_G2_LAND_TOOL_SIZE_6 = SPR_G2_BEGIN + 129, - - SPR_G2_MOUNTAIN_TOOL_EVEN = SPR_G2_BEGIN + 130, - SPR_G2_MOUNTAIN_TOOL_ODD = SPR_G2_BEGIN + 131, - - SPR_G2_SCENERY_SCATTER_LOW = SPR_G2_BEGIN + 132, - SPR_G2_SCENERY_SCATTER_MEDIUM = SPR_G2_BEGIN + 133, - SPR_G2_SCENERY_SCATTER_HIGH = SPR_G2_BEGIN + 134, - - SPR_G2_WOODEN_RC_BOOSTER_SW_NE = SPR_G2_BEGIN + 135, - SPR_G2_WOODEN_RC_BOOSTER_NW_SE = SPR_G2_BEGIN + 136, - - SPR_G2_VIEW = SPR_G2_BEGIN + 137, - - SPR_G2_PATH_RAILINGS_TAB = SPR_G2_BEGIN + 138, - SPR_G2_LEGACY_PATH_TAB = SPR_G2_BEGIN + 139, - SPR_G2_PATH_SURFACE_TAB = SPR_G2_BEGIN + 140, - SPR_G2_RIDE_STATION_TAB = SPR_G2_BEGIN + 141, - SPR_G2_TERRAIN_EDGE_TAB = SPR_G2_BEGIN + 142, - - SPR_G2_BUTTON_HIDE_VEGETATION = SPR_G2_BEGIN + 143, - SPR_G2_BUTTON_HIDE_SCENERY = SPR_G2_BEGIN + 144, - SPR_G2_BUTTON_HIDE_VEHICLES = SPR_G2_BEGIN + 145, - SPR_G2_BUTTON_HIDE_SUPPORTS = SPR_G2_BEGIN + 146, - SPR_G2_BUTTON_HIDE_PARTIAL = SPR_G2_BEGIN + 147, - SPR_G2_BUTTON_HIDE_FULL = SPR_G2_BEGIN + 148, - - SPR_G2_LINK_CHAIN = SPR_G2_BEGIN + 149, - - SPR_G2_SIDEWAYS_TAB = SPR_G2_BEGIN + 150, - SPR_G2_SIDEWAYS_TAB_ACTIVE = SPR_G2_BEGIN + 151, - - SPR_G2_ARROW_UP = SPR_G2_BEGIN + 152, - SPR_G2_ARROW_DOWN = SPR_G2_BEGIN + 153, - SPR_G2_RELOAD = SPR_G2_BEGIN + 154, - - SPR_G2_CHAR_BEGIN = SPR_G2_BEGIN + 155, - - SPR_G2_AE_UPPER = SPR_G2_CHAR_BEGIN, - SPR_G2_AE_LOWER = SPR_G2_CHAR_BEGIN + 1, - SPR_G2_O_STROKE_UPPER = SPR_G2_CHAR_BEGIN + 2, - SPR_G2_O_STROKE_LOWER = SPR_G2_CHAR_BEGIN + 3, - - SPR_G2_CYRILLIC_BE_UPPER = SPR_G2_CHAR_BEGIN + 4, - SPR_G2_CYRILLIC_GHE_UPPER = SPR_G2_CHAR_BEGIN + 5, - SPR_G2_CYRILLIC_DE_UPPER = SPR_G2_CHAR_BEGIN + 6, - SPR_G2_CYRILLIC_ZHE_UPPER = SPR_G2_CHAR_BEGIN + 7, - SPR_G2_CYRILLIC_ZE_UPPER = SPR_G2_CHAR_BEGIN + 8, - SPR_G2_CYRILLIC_I_UPPER = SPR_G2_CHAR_BEGIN + 9, - SPR_G2_CYRILLIC_SHORT_I_UPPER = SPR_G2_CHAR_BEGIN + 10, - SPR_G2_CYRILLIC_EL_UPPER = SPR_G2_CHAR_BEGIN + 11, - SPR_G2_CYRILLIC_PE_UPPER = SPR_G2_CHAR_BEGIN + 12, - SPR_G2_CYRILLIC_U_UPPER = SPR_G2_CHAR_BEGIN + 13, - SPR_G2_CYRILLIC_EF_UPPER = SPR_G2_CHAR_BEGIN + 14, - SPR_G2_CYRILLIC_TSE_UPPER = SPR_G2_CHAR_BEGIN + 15, - SPR_G2_CYRILLIC_CHE_UPPER = SPR_G2_CHAR_BEGIN + 16, - SPR_G2_CYRILLIC_SHA_UPPER = SPR_G2_CHAR_BEGIN + 17, - SPR_G2_CYRILLIC_SHCHA_UPPER = SPR_G2_CHAR_BEGIN + 18, - SPR_G2_CYRILLIC_HARD_SIGN_UPPER = SPR_G2_CHAR_BEGIN + 19, - SPR_G2_CYRILLIC_YERU_UPPER = SPR_G2_CHAR_BEGIN + 20, - SPR_G2_CYRILLIC_SOFT_SIGN_UPPER = SPR_G2_CHAR_BEGIN + 21, - SPR_G2_CYRILLIC_E_UPPER = SPR_G2_CHAR_BEGIN + 22, - SPR_G2_CYRILLIC_YU_UPPER = SPR_G2_CHAR_BEGIN + 23, - SPR_G2_CYRILLIC_YA_UPPER = SPR_G2_CHAR_BEGIN + 24, - - SPR_G2_CYRILLIC_BE_LOWER = SPR_G2_CHAR_BEGIN + 25, - SPR_G2_CYRILLIC_VE_LOWER = SPR_G2_CHAR_BEGIN + 26, - SPR_G2_CYRILLIC_GHE_LOWER = SPR_G2_CHAR_BEGIN + 27, - SPR_G2_CYRILLIC_DE_LOWER = SPR_G2_CHAR_BEGIN + 28, - SPR_G2_CYRILLIC_ZHE_LOWER = SPR_G2_CHAR_BEGIN + 29, - SPR_G2_CYRILLIC_ZE_LOWER = SPR_G2_CHAR_BEGIN + 30, - SPR_G2_CYRILLIC_I_LOWER = SPR_G2_CHAR_BEGIN + 31, - SPR_G2_CYRILLIC_SHORT_I_LOWER = SPR_G2_CHAR_BEGIN + 32, - SPR_G2_CYRILLIC_KA_LOWER = SPR_G2_CHAR_BEGIN + 33, - SPR_G2_CYRILLIC_EL_LOWER = SPR_G2_CHAR_BEGIN + 34, - SPR_G2_CYRILLIC_EM_LOWER = SPR_G2_CHAR_BEGIN + 35, - SPR_G2_CYRILLIC_EN_LOWER = SPR_G2_CHAR_BEGIN + 36, - SPR_G2_CYRILLIC_PE_LOWER = SPR_G2_CHAR_BEGIN + 37, - SPR_G2_CYRILLIC_TE_LOWER = SPR_G2_CHAR_BEGIN + 38, - SPR_G2_CYRILLIC_EF_LOWER = SPR_G2_CHAR_BEGIN + 39, - SPR_G2_CYRILLIC_TSE_LOWER = SPR_G2_CHAR_BEGIN + 40, - SPR_G2_CYRILLIC_CHE_LOWER = SPR_G2_CHAR_BEGIN + 41, - SPR_G2_CYRILLIC_SHA_LOWER = SPR_G2_CHAR_BEGIN + 42, - SPR_G2_CYRILLIC_SHCHA_LOWER = SPR_G2_CHAR_BEGIN + 43, - SPR_G2_CYRILLIC_YERU_LOWER = SPR_G2_CHAR_BEGIN + 44, - SPR_G2_CYRILLIC_SOFT_SIGN_LOWER = SPR_G2_CHAR_BEGIN + 45, - SPR_G2_CYRILLIC_E_LOWER = SPR_G2_CHAR_BEGIN + 46, - SPR_G2_CYRILLIC_YU_LOWER = SPR_G2_CHAR_BEGIN + 47, - SPR_G2_CYRILLIC_YA_LOWER = SPR_G2_CHAR_BEGIN + 48, - - SPR_G2_GERMAN_OPENQUOTES = SPR_G2_CHAR_BEGIN + 49, - - SPR_G2_GUILDER_SIGN = SPR_G2_CHAR_BEGIN + 50, - - SPR_G2_G_BREVE_UPPER = SPR_G2_CHAR_BEGIN + 51, - SPR_G2_I_WITH_DOT_UPPER = SPR_G2_CHAR_BEGIN + 52, - SPR_G2_S_CEDILLA_UPPER = SPR_G2_CHAR_BEGIN + 53, - SPR_G2_G_BREVE_LOWER = SPR_G2_CHAR_BEGIN + 54, - SPR_G2_I_WITHOUT_DOT_LOWER = SPR_G2_CHAR_BEGIN + 55, - SPR_G2_S_CEDILLA_LOWER = SPR_G2_CHAR_BEGIN + 56, - - SPR_G2_INTERPUNCT = SPR_G2_CHAR_BEGIN + 57, - - SPR_G2_A_BREVE_UPPER = SPR_G2_CHAR_BEGIN + 58, - SPR_G2_T_COMMA_UPPER = SPR_G2_CHAR_BEGIN + 59, - SPR_G2_T_COMMA_LOWER = SPR_G2_CHAR_BEGIN + 60, - - SPR_G2_ELLIPSIS = SPR_G2_CHAR_BEGIN + 61, - - SPR_G2_C_CARON_UPPER = SPR_G2_CHAR_BEGIN + 62, - SPR_G2_C_CARON_LOWER = SPR_G2_CHAR_BEGIN + 63, - - SPR_G2_Y_ACUTE_UPPER = SPR_G2_CHAR_BEGIN + 64, - SPR_G2_Y_ACUTE_LOWER = SPR_G2_CHAR_BEGIN + 65, - - SPR_G2_O_DOUBLE_ACUTE_UPPER = SPR_G2_CHAR_BEGIN + 66, - SPR_G2_O_DOUBLE_ACUTE_LOWER = SPR_G2_CHAR_BEGIN + 67, + SPR_G2_O_DOUBLE_ACUTE_UPPER, + SPR_G2_O_DOUBLE_ACUTE_LOWER, SPR_G2_OE_UPPER, SPR_G2_OE_LOWER, @@ -1037,9 +1112,109 @@ enum SPR_G2_GLYPH_COUNT = (SPR_G2_EYE - SPR_G2_CHAR_BEGIN) + 1, SPR_G2_CHAR_END = SPR_G2_CHAR_BEGIN + SPR_G2_GLYPH_COUNT * 3, - SPR_G2_SUPPORT_BEGIN = SPR_G2_CHAR_END, + // G2 Track additions + + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_SW_NE = SPR_G2_CHAR_END, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NW_SE, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NE_SW, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_SE_NW, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NW_SE_PART_0_2, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_NE_SW_PART_0_2, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_SW_NE, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NW_SE, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NE_SW, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_SE_NW, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NW_SE_PART_0_2, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_NE_SW_PART_0_2, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_SW_NE, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NW_SE, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NE_SW, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_SE_NW, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NW_SE_PART_0_2, + SPR_JUNIOR_RC_FLAT_TO_60_DEG_UP_CHAIN_NE_SW_PART_0_2, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_SW_NE, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NW_SE, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NE_SW, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_SE_NW, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NW_SE_PART_0_2, + SPR_JUNIOR_RC_60_DEG_UP_TO_FLAT_CHAIN_NE_SW_PART_0_2, + SPR_JUNIOR_RC_BOOSTER_NW_SE, + SPR_JUNIOR_RC_BOOSTER_NE_SW, + + SPR_G2_GIGA_RC_BOOSTER_NE_SW, + SPR_G2_GIGA_RC_BOOSTER_NW_SE, + + SPR_G2_BM_BOOSTER_NE_SW, + SPR_G2_BM_BOOSTER_NW_SE, + + SPR_G2_MINI_RC_BOOSTER_NE_SW, + SPR_G2_MINI_RC_BOOSTER_NW_SE, + + SPR_G2_MINIATURE_RAILWAY_QUARTER_TURN_3_TILES_SW_SE_PART_3, + SPR_G2_MINIATURE_RAILWAY_GRAVEL_SW_NE, + SPR_G2_MINIATURE_RAILWAY_GRAVEL_NW_SE, + SPR_G2_MINIATURE_RAILWAY_GROOVED_SW_NE, + SPR_G2_MINIATURE_RAILWAY_GROOVED_NW_SE, + SPR_G2_MINIATURE_RAILWAY_INSET_SW_NE, + SPR_G2_MINIATURE_RAILWAY_INSET_NW_SE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_NE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_SE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_NW, + SPR_G2_MINIATURE_RAILWAY_INSET_END_SW, + SPR_G2_MINIATURE_RAILWAY_INSET_END_SW_NE, + SPR_G2_MINIATURE_RAILWAY_INSET_END_NW_SE, + + SPR_G2_WOODEN_RC_BOOSTER_SW_NE, + SPR_G2_WOODEN_RC_BOOSTER_NW_SE, + + SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_OPEN_SW_NE, + SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_OPEN_NW_SE, + SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_CLOSED_SW_NE, + SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_CLOSED_NW_SE, + + SPR_RIDE_DESIGN_PREVIEW_CLASSIC_WOODEN_ROLLER_COASTER_TRACK, + SPR_RIDE_DESIGN_PREVIEW_CLASSIC_WOODEN_ROLLER_COASTER_SUPPORTS, + + SPR_G2_BM_INVERT_BOOSTER_1, + SPR_G2_BM_INVERT_BOOSTER_2, + + SPR_G2_LIM_LAUNCHED_TRACK_BEGIN, + SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL = SPR_G2_LIM_LAUNCHED_TRACK_BEGIN + 0, + SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP = SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 48, + SPR_G2_LIM_LAUNCHED_TRACK_FLAT_TO_STEEP = SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP + 16, + SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW = SPR_G2_LIM_LAUNCHED_TRACK_FLAT_TO_STEEP + 32, + SPR_G2_LIM_LAUNCHED_TRACK_TURN_BANK_TRANSITION = SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 40, + SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP = SPR_G2_LIM_LAUNCHED_TRACK_TURN_BANK_TRANSITION + 18, + SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP = SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 40, + SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL = SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 56, + SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL = SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 32, + SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP = SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 40, + SPR_G2_LIM_LAUNCHED_TRACK_END = SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 20, + + SPR_G2_FLUME_25_60_NE_SW = SPR_G2_LIM_LAUNCHED_TRACK_END, + SPR_G2_FLUME_25_60_NW_SE, + SPR_G2_FLUME_25_60_NE_SW_BACK_WATER, + SPR_G2_FLUME_25_60_NE_SW_BACK, + SPR_G2_FLUME_25_60_NW_SE_BACK_WATER, + SPR_G2_FLUME_25_60_NW_SE_BACK, + SPR_G2_FLUME_60_NE_SW, + SPR_G2_FLUME_60_NW_SE, + SPR_G2_FLUME_60_NE_SW_BACK, + SPR_G2_FLUME_60_NW_SE_BACK, + SPR_G2_FLUME_60_25_NE_SW, + SPR_G2_FLUME_60_25_NW_SE, + SPR_G2_FLUME_60_25_NE_SW_BACK_WATER, + SPR_G2_FLUME_60_25_NE_SW_BACK, + SPR_G2_FLUME_60_25_NW_SE_BACK_WATER, + SPR_G2_FLUME_60_25_NW_SE_BACK, + + // G2 Supports + + SPR_G2_SUPPORT_BEGIN, SPR_G2_SUPPORT_END = SPR_G2_SUPPORT_BEGIN + 32, + // G2 New track types + SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_TRACK = SPR_G2_SUPPORT_END, SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_SUPPORTS = SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_TRACK + 1, SPR_G2_HYBRID_BEGIN = SPR_RIDE_DESIGN_PREVIEW_HYBRID_COASTER_TRACK + 2, @@ -1167,29 +1342,7 @@ enum SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL = SPR_G2_ALPINE_LIFT_TRACK_FLAT_DIAGONAL + 4, SPR_G2_ALPINE_END = SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 12, - SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_OPEN_SW_NE = SPR_G2_ALPINE_END, - SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_OPEN_NW_SE, - SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_CLOSED_SW_NE, - SPR_G2_WOODEN_RC_STATION_BLOCK_BRAKE_CLOSED_NW_SE, - SPR_G2_EMPTY, - - SPR_RIDE_DESIGN_PREVIEW_CLASSIC_WOODEN_ROLLER_COASTER_TRACK, - SPR_RIDE_DESIGN_PREVIEW_CLASSIC_WOODEN_ROLLER_COASTER_SUPPORTS, - - SPR_G2_LIM_LAUNCHED_TRACK_BEGIN = SPR_RIDE_DESIGN_PREVIEW_CLASSIC_WOODEN_ROLLER_COASTER_SUPPORTS + 1, - SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL = SPR_G2_LIM_LAUNCHED_TRACK_BEGIN, - SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP = SPR_G2_LIM_LAUNCHED_TRACK_BARREL_ROLL + 48, - SPR_G2_LIM_LAUNCHED_TRACK_FLAT_TO_STEEP = SPR_G2_LIM_LAUNCHED_TRACK_HALF_LOOP + 16, - SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW = SPR_G2_LIM_LAUNCHED_TRACK_FLAT_TO_STEEP + 32, - SPR_G2_LIM_LAUNCHED_TRACK_TURN_BANK_TRANSITION = SPR_G2_LIM_LAUNCHED_TRACK_LARGE_CORKSCREW + 40, - SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP = SPR_G2_LIM_LAUNCHED_TRACK_TURN_BANK_TRANSITION + 18, - SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP = SPR_G2_LIM_LAUNCHED_TRACK_MEDIUM_HALF_LOOP + 40, - SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL = SPR_G2_LIM_LAUNCHED_TRACK_LARGE_HALF_LOOP + 56, - SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL = SPR_G2_LIM_LAUNCHED_TRACK_ZERO_G_ROLL + 32, - SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP = SPR_G2_LIM_LAUNCHED_TRACK_LARGE_ZERO_G_ROLL + 40, - SPR_G2_LIM_LAUNCHED_TRACK_END = SPR_G2_LIM_LAUNCHED_TRACK_SMALL_FLAT_TO_STEEP + 20, - - SPR_G2_END = SPR_G2_LIM_LAUNCHED_TRACK_END, + SPR_G2_END = SPR_G2_ALPINE_END, SPR_CSG_BEGIN = SPR_G2_END, SPR_CSG_END = SPR_CSG_BEGIN + RCT1::Limits::Num_LL_CSG_Entries, diff --git a/src/openrct2/title/Command/SetLocation.cpp b/src/openrct2/title/Command/SetLocation.cpp index c5548f453f..67c52b56a8 100644 --- a/src/openrct2/title/Command/SetLocation.cpp +++ b/src/openrct2/title/Command/SetLocation.cpp @@ -22,7 +22,7 @@ namespace OpenRCT2::Title if (w != nullptr) { auto loc = TileCoordsXY(Location.X, Location.Y).ToCoordsXY().ToTileCentre(); - int32_t z = tile_element_height(loc); + int32_t z = TileElementHeight(loc); // Prevent scroll adjustment due to window placement when in-game auto oldScreenFlags = gScreenFlags; diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index d4ea5bcf24..5a95c3c095 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -131,7 +131,7 @@ void TitleScreen::Load() OpenRCT2::Audio::StopAll(); GetContext()->GetGameState()->InitAll(DEFAULT_MAP_SIZE); viewport_init_all(); - context_open_window(WindowClass::MainWindow); + ContextOpenWindow(WindowClass::MainWindow); CreateWindows(); TitleInitialise(); OpenRCT2::Audio::PlayTitleMusic(); @@ -139,7 +139,7 @@ void TitleScreen::Load() if (gOpenRCT2ShowChangelog) { gOpenRCT2ShowChangelog = false; - context_open_window(WindowClass::Changelog); + ContextOpenWindow(WindowClass::Changelog); } if (_sequencePlayer != nullptr) @@ -182,12 +182,12 @@ void TitleScreen::Tick() input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false); - context_update_map_tooltip(); + ContextUpdateMapTooltip(); window_dispatch_update_all(); gSavedAge++; - context_handle_input(); + ContextHandleInput(); gInUpdateCode = false; } @@ -201,8 +201,8 @@ void TitleScreen::ChangePresetSequence(size_t preset) } const utf8* configId = title_sequence_manager_get_config_id(preset); - SafeFree(gConfigInterface.current_title_sequence_preset); - gConfigInterface.current_title_sequence_preset = _strdup(configId); + SafeFree(gConfigInterface.CurrentTitleSequencePreset); + gConfigInterface.CurrentTitleSequencePreset = _strdup(configId); if (!_previewingSequence) _currentSequence = preset; @@ -215,11 +215,11 @@ void TitleScreen::ChangePresetSequence(size_t preset) */ void TitleScreen::CreateWindows() { - context_open_window(WindowClass::TitleMenu); - context_open_window(WindowClass::TitleExit); - context_open_window(WindowClass::TitleOptions); - context_open_window(WindowClass::TitleLogo); - window_resize_gui(context_get_width(), context_get_height()); + ContextOpenWindow(WindowClass::TitleMenu); + ContextOpenWindow(WindowClass::TitleExit); + ContextOpenWindow(WindowClass::TitleOptions); + ContextOpenWindow(WindowClass::TitleLogo); + window_resize_gui(ContextGetWidth(), ContextGetHeight()); _hideVersionInfo = false; } @@ -229,7 +229,7 @@ void TitleScreen::TitleInitialise() { _sequencePlayer = GetContext()->GetUiContext()->GetTitleSequencePlayer(); } - if (gConfigInterface.random_title_sequence) + if (gConfigInterface.RandomTitleSequence) { bool RCT1Installed = false, RCT1AAInstalled = false, RCT1LLInstalled = false; int RCT1Count = 0; @@ -319,8 +319,8 @@ bool TitleScreen::TryLoadSequence(bool loadPreview) { // Forcefully change the preset to a preset that works. const utf8* configId = title_sequence_manager_get_config_id(targetSequence); - SafeFree(gConfigInterface.current_title_sequence_preset); - gConfigInterface.current_title_sequence_preset = _strdup(configId); + SafeFree(gConfigInterface.CurrentTitleSequencePreset); + gConfigInterface.CurrentTitleSequencePreset = _strdup(configId); } _currentSequence = targetSequence; gfx_invalidate_screen(); @@ -397,7 +397,7 @@ void title_set_hide_version_info(bool value) size_t title_get_config_sequence() { - return title_sequence_manager_get_index_for_config_id(gConfigInterface.current_title_sequence_preset); + return title_sequence_manager_get_index_for_config_id(gConfigInterface.CurrentTitleSequencePreset); } size_t title_get_current_sequence() @@ -447,7 +447,7 @@ void DrawOpenRCT2(rct_drawpixelinfo* dpi, const ScreenCoordsXY& screenCoords) gfx_draw_string(dpi, screenCoords + ScreenCoordsXY(5, 5 - 13), buffer.c_str(), { COLOUR_BLACK }); // Invalidate screen area - int16_t width = static_cast(gfx_get_string_width(buffer, FontSpriteBase::MEDIUM)); + int16_t width = static_cast(gfx_get_string_width(buffer, FontStyle::Medium)); gfx_set_dirty_blocks( { screenCoords, screenCoords + ScreenCoordsXY{ width, 30 } }); // 30 is an arbitrary height to catch both strings diff --git a/src/openrct2/util/Math.hpp b/src/openrct2/util/Math.hpp index e43ead1e23..d92c278908 100644 --- a/src/openrct2/util/Math.hpp +++ b/src/openrct2/util/Math.hpp @@ -1,6 +1,6 @@ /***************************************************************************** - * Copyright (c) 2014-2021 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 diff --git a/src/openrct2/util/Util.cpp b/src/openrct2/util/Util.cpp index 9cd38de948..96746c14af 100644 --- a/src/openrct2/util/Util.cpp +++ b/src/openrct2/util/Util.cpp @@ -88,7 +88,7 @@ int32_t bitscanforward(int64_t source) // any intrinsic. // cf. https://github.com/OpenRCT2/OpenRCT2/pull/2093 for (int32_t i = 0; i < 64; i++) - if (source & (1ull << i)) + if (source & (1uLL << i)) return i; return -1; diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index 929deea43d..b82b1a08d8 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -65,7 +65,7 @@ size_t strcatftime(char* buffer, size_t bufferSize, const char* format, const st template [[nodiscard]] constexpr uint64_t EnumToFlag(T v) { static_assert(std::is_enum_v); - return 1ULL << static_cast>(v); + return 1uLL << static_cast>(v); } template [[nodiscard]] constexpr uint64_t EnumsToFlags(T... types) diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 32fd70ddc2..e3d2bb5545 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -64,12 +64,12 @@ money32 place_provisional_track_piece( viewport_set_visibility(2); // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); if (!scenery_tool_is_active()) { // Set new virtual floor height. - virtual_floor_set_height(trackPos.z); + VirtualFloorSetHeight(trackPos.z); } return result.Cost; @@ -106,12 +106,12 @@ money32 place_provisional_track_piece( viewport_set_visibility(2); // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); 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); + VirtualFloorSetHeight(trackPos.z - z_begin + z_end); } return res.Cost; @@ -120,7 +120,7 @@ money32 place_provisional_track_piece( static std::tuple window_ride_construction_update_state_get_track_element() { auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_UPDATE_PIECES); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); uint8_t startSlope = _previousTrackSlopeEnd; uint8_t endSlope = _currentTrackSlopeEnd; @@ -330,7 +330,7 @@ bool window_ride_construction_update_state( CoordsXY offsets = { trackCoordinates.x, trackCoordinates.y }; CoordsXY coords = { x, y }; - coords += offsets.Rotate(direction_reverse(trackDirection)); + coords += offsets.Rotate(DirectionReverse(trackDirection)); x = static_cast(coords.x); y = static_cast(coords.y); } @@ -397,7 +397,7 @@ bool window_ride_construction_update_state( void window_ride_construction_update_active_elements() { auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_UPDATE_ACTIVE_ELEMENTS); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** @@ -415,14 +415,14 @@ bool scenery_tool_is_active() return false; } -void init_scenery() +void SceneryInit() { auto intent = Intent(INTENT_ACTION_INIT_SCENERY); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } -void scenery_set_default_placement_configuration() +void ScenerySetDefaultPlacementConfiguration() { auto intent = Intent(INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index c569a30580..e4ed12b95f 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -89,7 +89,7 @@ void Banner::FormatTextTo(Formatter& ft) const */ static RideId BannerGetRideIndexAt(const CoordsXYZ& bannerCoords) { - TileElement* tileElement = map_get_first_element_at(bannerCoords); + TileElement* tileElement = MapGetFirstElementAt(bannerCoords); RideId resultRideIndex = RideId::GetNull(); if (tileElement == nullptr) return resultRideIndex; @@ -146,7 +146,7 @@ TileElement* BannerGetTileElement(BannerIndex bannerIndex) auto banner = GetBanner(bannerIndex); if (banner != nullptr) { - auto tileElement = map_get_first_element_at(banner->position); + auto tileElement = MapGetFirstElementAt(banner->position); if (tileElement != nullptr) { do @@ -167,7 +167,7 @@ WallElement* BannerGetScrollingWallTileElement(BannerIndex bannerIndex) if (banner == nullptr) return nullptr; - auto tileElement = map_get_first_element_at(banner->position); + auto tileElement = MapGetFirstElementAt(banner->position); if (tileElement == nullptr) return nullptr; @@ -318,7 +318,7 @@ BannerSceneryEntry* BannerElement::GetEntry() const auto banner = GetBanner(); if (banner != nullptr) { - return get_banner_entry(banner->type); + return GetBannerEntry(banner->type); } return nullptr; } diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index 33b82afa52..0adbba936f 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -132,7 +132,7 @@ void ClimateUpdate() if (gClimateUpdateTimer == 960) { auto intent = Intent(INTENT_ACTION_UPDATE_CLIMATE); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } gClimateUpdateTimer--; } @@ -151,7 +151,7 @@ void ClimateUpdate() gClimateCurrent.Weather = gClimateNext.Weather; ClimateDetermineFutureWeather(scenario_rand()); auto intent = Intent(INTENT_ACTION_UPDATE_CLIMATE); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } else if (gClimateNext.Level <= WeatherLevel::Heavy) { @@ -170,7 +170,7 @@ void ClimateUpdate() { gClimateCurrent.Temperature = ClimateStepWeatherLevel(gClimateCurrent.Temperature, gClimateNext.Temperature); auto intent = Intent(INTENT_ACTION_UPDATE_CLIMATE); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } } @@ -391,9 +391,9 @@ static void ClimateUpdateLightning() { if (_lightningTimer == 0) return; - if (gConfigGeneral.disable_lightning_effect) + if (gConfigGeneral.DisableLightningEffect) return; - if (!gConfigGeneral.render_weather_effects && !gConfigGeneral.render_weather_gloom) + if (!gConfigGeneral.RenderWeatherEffects && !gConfigGeneral.RenderWeatherGloom) return; _lightningTimer--; diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index e1faec8277..2d80b807a4 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -45,9 +45,9 @@ static int32_t MapPlaceClearFunc( if (!(flags & GAME_COMMAND_FLAG_APPLY)) return 0; - map_invalidate_tile({ coords, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ() }); + MapInvalidateTile({ coords, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ() }); - tile_element_remove(*tile_element); + TileElementRemove(*tile_element); (*tile_element)--; return 0; @@ -124,7 +124,7 @@ GameActions::Result MapCanConstructWithClearAt( res.SetData(ConstructClearResult{ groundFlags }); bool canBuildCrossing = false; - if (map_is_edge(pos)) + if (MapIsEdge(pos)) { res.Error = GameActions::Status::InvalidParameters; res.ErrorMessage = STR_OFF_EDGE_OF_MAP; @@ -137,7 +137,7 @@ GameActions::Result MapCanConstructWithClearAt( return res; } - TileElement* tileElement = map_get_first_element_at(pos); + TileElement* tileElement = MapGetFirstElementAt(pos); if (tileElement == nullptr) { res.Error = GameActions::Status::Unknown; diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 92cef6fb8b..fa2b12412a 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -54,7 +54,7 @@ static money32 RideEntranceExitPlaceGhost( * * rct2: 0x00666F9E */ -void park_entrance_remove_ghost() +void ParkEntranceRemoveGhost() { if (gParkEntranceGhostExists) { @@ -65,7 +65,7 @@ void park_entrance_remove_ghost() } } -int32_t park_entrance_get_index(const CoordsXYZ& entrancePos) +int32_t ParkEntranceGetIndex(const CoordsXYZ& entrancePos) { int32_t i = 0; for (const auto& entrance : gParkEntrances) @@ -79,12 +79,12 @@ int32_t park_entrance_get_index(const CoordsXYZ& entrancePos) return -1; } -void reset_park_entrance() +void ParkEntranceReset() { gParkEntrances.clear(); } -void ride_entrance_exit_place_provisional_ghost() +void RideEntranceExitPlaceProvisionalGhost() { if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) { @@ -94,7 +94,7 @@ void ride_entrance_exit_place_provisional_ghost() } } -void ride_entrance_exit_remove_ghost() +void RideEntranceExitRemoveGhost() { if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) { @@ -111,7 +111,7 @@ void ride_entrance_exit_remove_ghost() * * rct2: 0x006CA28C */ -money32 ride_entrance_exit_place_ghost( +money32 RideEntranceExitPlaceGhost( Ride* ride, const CoordsXY& entranceExitCoords, Direction direction, int32_t placeType, StationIndex stationNum) { ride_construction_remove_ghosts(); @@ -132,14 +132,14 @@ money32 ride_entrance_exit_place_ghost( * Replaces the outer hedge walls for an entrance placement removal. * rct2: 0x00666D6F */ -void maze_entrance_hedge_replacement(const CoordsXYE& entrance) +void MazeEntranceHedgeReplacement(const CoordsXYE& entrance) { int32_t direction = entrance.element->GetDirection(); auto hedgePos = entrance + CoordsDirectionDelta[direction]; int32_t z = entrance.element->GetBaseZ(); RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex(); - auto tileElement = map_get_first_element_at(hedgePos); + auto tileElement = MapGetFirstElementAt(hedgePos); if (tileElement == nullptr) return; do @@ -160,7 +160,7 @@ void maze_entrance_hedge_replacement(const CoordsXYE& entrance) // Add the bottom outer wall tileElement->AsTrack()->MazeEntryAdd(1 << ((mazeSection + 12) & 0x0F)); - map_invalidate_tile({ hedgePos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ hedgePos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); return; } while (!(tileElement++)->IsLastForTile()); } @@ -169,14 +169,14 @@ void maze_entrance_hedge_replacement(const CoordsXYE& entrance) * Removes the hedge walls for an entrance placement. * rct2: 0x00666CBE */ -void maze_entrance_hedge_removal(const CoordsXYE& entrance) +void MazeEntranceHedgeRemoval(const CoordsXYE& entrance) { int32_t direction = entrance.element->GetDirection(); auto hedgePos = entrance + CoordsDirectionDelta[direction]; int32_t z = entrance.element->GetBaseZ(); RideId rideIndex = entrance.element->AsEntrance()->GetRideIndex(); - auto tileElement = map_get_first_element_at(hedgePos); + auto tileElement = MapGetFirstElementAt(hedgePos); if (tileElement == nullptr) return; do @@ -203,27 +203,27 @@ void maze_entrance_hedge_removal(const CoordsXYE& entrance) // Remove the bottom hedge section tileElement->AsTrack()->MazeEntrySubtract(1 << ((mazeSection + 15) & 0x0F)); - map_invalidate_tile({ hedgePos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ hedgePos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); return; } while (!(tileElement++)->IsLastForTile()); } -void fix_park_entrance_locations(void) +void ParkEntranceFixLocations(void) { // Fix gParkEntrance locations for which the tile_element no longer exists gParkEntrances.erase( std::remove_if( gParkEntrances.begin(), gParkEntrances.end(), - [](const auto& entrance) { return map_get_park_entrance_element_at(entrance, false) == nullptr; }), + [](const auto& entrance) { return MapGetParkEntranceElementAt(entrance, false) == nullptr; }), gParkEntrances.end()); } -void UpdateParkEntranceLocations() +void ParkEntranceUpdateLocations() { gParkEntrances.clear(); tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it)) + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) { auto entranceElement = it.element->AsEntrance(); if (entranceElement != nullptr && entranceElement->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index b719311c46..538b78cae3 100644 --- a/src/openrct2/world/Entrance.h +++ b/src/openrct2/world/Entrance.h @@ -55,11 +55,11 @@ extern std::vector gParkEntrances; extern CoordsXYZD gRideEntranceExitGhostPosition; extern StationIndex gRideEntranceExitGhostStationIndex; -void park_entrance_remove_ghost(); +void ParkEntranceRemoveGhost(); -void reset_park_entrance(); -void maze_entrance_hedge_replacement(const CoordsXYE& entrance); -void maze_entrance_hedge_removal(const CoordsXYE& entrance); +void ParkEntranceReset(); +void MazeEntranceHedgeReplacement(const CoordsXYE& entrance); +void MazeEntranceHedgeRemoval(const CoordsXYE& entrance); -void fix_park_entrance_locations(); -void UpdateParkEntranceLocations(); +void ParkEntranceFixLocations(); +void ParkEntranceUpdateLocations(); diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 6eef675776..cec3b68fc9 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -33,6 +33,7 @@ #include "../ride/Track.h" #include "../ride/TrackData.h" #include "../util/Util.h" +#include "Location.hpp" #include "Map.h" #include "MapAnimation.h" #include "Park.h" @@ -44,7 +45,7 @@ #include using namespace OpenRCT2::TrackMetaData; -void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElement* tileElement); +void FootpathUpdateQueueEntranceBanner(const CoordsXY& footpathPos, TileElement* tileElement); FootpathSelection gFootpathSelection; ProvisionalFootpath gProvisionalFootpath; @@ -116,9 +117,9 @@ static bool entrance_has_direction(const EntranceElement& entranceElement, int32 return entranceElement.GetDirections() & (1 << (direction & 3)); } -TileElement* map_get_footpath_element(const CoordsXYZ& coords) +TileElement* MapGetFootpathElement(const CoordsXYZ& coords) { - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); do { if (tileElement == nullptr) @@ -134,13 +135,13 @@ TileElement* map_get_footpath_element(const CoordsXYZ& coords) * * rct2: 0x006A76FF */ -money32 footpath_provisional_set( +money32 FootpathProvisionalSet( ObjectEntryIndex type, ObjectEntryIndex railingsType, const CoordsXYZ& footpathLoc, int32_t slope, PathConstructFlags constructFlags) { money32 cost; - footpath_provisional_remove(); + FootpathProvisionalRemove(); auto footpathPlaceAction = FootpathPlaceAction(footpathLoc, slope, type, railingsType, INVALID_DIRECTION, constructFlags); footpathPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); @@ -166,26 +167,26 @@ money32 footpath_provisional_set( } // Invalidate previous footpath piece. - virtual_floor_invalidate(); + VirtualFloorInvalidate(); if (!scenery_tool_is_active()) { if (res.Error != GameActions::Status::Ok) { // If we can't build this, don't show a virtual floor. - virtual_floor_set_height(0); + VirtualFloorSetHeight(0); } else if ( gFootpathConstructSlope == TILE_ELEMENT_SLOPE_FLAT || gProvisionalFootpath.Position.z < gFootpathConstructFromPosition.z) { // Going either straight on, or down. - virtual_floor_set_height(gProvisionalFootpath.Position.z); + VirtualFloorSetHeight(gProvisionalFootpath.Position.z); } else { // Going up in the world! - virtual_floor_set_height(gProvisionalFootpath.Position.z + LAND_HEIGHT_STEP); + VirtualFloorSetHeight(gProvisionalFootpath.Position.z + LAND_HEIGHT_STEP); } } @@ -196,7 +197,7 @@ money32 footpath_provisional_set( * * rct2: 0x006A77FF */ -void footpath_provisional_remove() +void FootpathProvisionalRemove() { if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) { @@ -212,16 +213,16 @@ void footpath_provisional_remove() * * rct2: 0x006A7831 */ -void footpath_provisional_update() +void FootpathProvisionalUpdate() { if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) { gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_SHOW_ARROW; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - map_invalidate_tile_full(gFootpathConstructFromPosition); + MapInvalidateTileFull(gFootpathConstructFromPosition); } - footpath_provisional_remove(); + FootpathProvisionalRemove(); } /** @@ -238,7 +239,7 @@ void footpath_provisional_update() * direction: ecx * tileElement: edx */ -CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) +CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) { rct_window* window = window_find_from_point(screenCoords); if (window == nullptr || window->viewport == nullptr) @@ -282,7 +283,7 @@ CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, i { if (info.SpriteType != ViewportInteractionItem::Footpath) { - z = tile_element_height(position); + z = TileElementHeight(position); } position = viewport_coord_to_map_coord(start_vp_pos, z); position.x = std::clamp(position.x, minPosition.x, maxPosition.x); @@ -335,7 +336,7 @@ CoordsXY footpath_get_coordinates_from_pos(const ScreenCoordsXY& screenCoords, i * direction: cl * tileElement: edx */ -CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) +CoordsXY FootpathBridgeGetInfoFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement) { // First check if we point at an entrance or exit. In that case, we would want the path coming from the entrance/exit. rct_window* window = window_find_from_point(screenCoords); @@ -380,14 +381,14 @@ CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, i } // We point at something else - return footpath_get_coordinates_from_pos(screenCoords, direction, tileElement); + return FootpathGetCoordinatesFromPos(screenCoords, direction, tileElement); } /** * * rct2: 0x00673883 */ -void footpath_remove_litter(const CoordsXYZ& footpathPos) +void FootpathRemoveLitter(const CoordsXYZ& footpathPos) { std::vector removals; for (auto litter : EntityTileList(footpathPos)) @@ -409,7 +410,7 @@ void footpath_remove_litter(const CoordsXYZ& footpathPos) * * rct2: 0x0069A48B */ -void footpath_interrupt_peeps(const CoordsXYZ& footpathPos) +void FootpathInterruptPeeps(const CoordsXYZ& footpathPos) { auto quad = EntityTileList(footpathPos); for (auto peep : quad) @@ -436,11 +437,11 @@ void footpath_interrupt_peeps(const CoordsXYZ& footpathPos) * * rct2: 0x006E59DC */ -bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction) +bool WallInTheWay(const CoordsXYRangedZ& fencePos, int32_t direction) { TileElement* tileElement; - tileElement = map_get_first_element_at(fencePos); + tileElement = MapGetFirstElementAt(fencePos); if (tileElement == nullptr) return false; do @@ -461,14 +462,14 @@ bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction) return false; } -static PathElement* footpath_connect_corners_get_neighbour(const CoordsXYZ& footpathPos, int32_t requireEdges) +static PathElement* FootpathConnectCornersGetNeighbour(const CoordsXYZ& footpathPos, int32_t requireEdges) { - if (!map_is_location_valid(footpathPos)) + if (!MapIsLocationValid(footpathPos)) { return nullptr; } - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return nullptr; do @@ -497,7 +498,7 @@ static PathElement* footpath_connect_corners_get_neighbour(const CoordsXYZ& foot * * rct2: 0x006A70EB */ -static void footpath_connect_corners(const CoordsXY& footpathPos, PathElement* initialTileElement) +static void FootpathConnectCorners(const CoordsXY& footpathPos, PathElement* initialTileElement) { using PathElementCoordsPair = std::pair; std::array tileElements; @@ -509,60 +510,53 @@ static void footpath_connect_corners(const CoordsXY& footpathPos, PathElement* i std::get<0>(tileElements) = { initialTileElement, footpathPos }; int32_t z = initialTileElement->GetBaseZ(); - for (int32_t initialDirection = 0; initialDirection < 4; initialDirection++) + for (int32_t initialDirection = 0; initialDirection < NumOrthogonalDirections; initialDirection++) { int32_t direction = initialDirection; auto currentPos = footpathPos + CoordsDirectionDelta[direction]; - std::get<1>(tileElements) = { - footpath_connect_corners_get_neighbour({ currentPos, z }, (1 << direction_reverse(direction))), currentPos - }; + std::get<1>(tileElements) = { FootpathConnectCornersGetNeighbour({ currentPos, z }, (1 << DirectionReverse(direction))), + currentPos }; if (std::get<1>(tileElements).first == nullptr) continue; - direction = direction_next(direction); + direction = DirectionNext(direction); currentPos += CoordsDirectionDelta[direction]; - std::get<2>(tileElements) = { - footpath_connect_corners_get_neighbour({ currentPos, z }, (1 << direction_reverse(direction))), currentPos - }; + std::get<2>(tileElements) = { FootpathConnectCornersGetNeighbour({ currentPos, z }, (1 << DirectionReverse(direction))), + currentPos }; if (std::get<2>(tileElements).first == nullptr) continue; - direction = direction_next(direction); + direction = DirectionNext(direction); currentPos += CoordsDirectionDelta[direction]; // First check link to previous tile - std::get<3>(tileElements) = { - footpath_connect_corners_get_neighbour({ currentPos, z }, (1 << direction_reverse(direction))), currentPos - }; + std::get<3>(tileElements) = { FootpathConnectCornersGetNeighbour({ currentPos, z }, (1 << DirectionReverse(direction))), + currentPos }; if (std::get<3>(tileElements).first == nullptr) continue; // Second check link to initial tile - std::get<3>(tileElements) = { footpath_connect_corners_get_neighbour({ currentPos, z }, (1 << ((direction + 1) & 3))), + std::get<3>(tileElements) = { FootpathConnectCornersGetNeighbour({ currentPos, z }, (1 << ((direction + 1) & 3))), currentPos }; if (std::get<3>(tileElements).first == nullptr) continue; - direction = direction_next(direction); + direction = DirectionNext(direction); std::get<3>(tileElements).first->SetCorners(std::get<3>(tileElements).first->GetCorners() | (1 << (direction))); - map_invalidate_element( - std::get<3>(tileElements).second, reinterpret_cast(std::get<3>(tileElements).first)); + MapInvalidateElement(std::get<3>(tileElements).second, reinterpret_cast(std::get<3>(tileElements).first)); - direction = direction_prev(direction); + direction = DirectionPrev(direction); std::get<2>(tileElements).first->SetCorners(std::get<2>(tileElements).first->GetCorners() | (1 << (direction))); - map_invalidate_element( - std::get<2>(tileElements).second, reinterpret_cast(std::get<2>(tileElements).first)); + MapInvalidateElement(std::get<2>(tileElements).second, reinterpret_cast(std::get<2>(tileElements).first)); - direction = direction_prev(direction); + direction = DirectionPrev(direction); std::get<1>(tileElements).first->SetCorners(std::get<1>(tileElements).first->GetCorners() | (1 << (direction))); - map_invalidate_element( - std::get<1>(tileElements).second, reinterpret_cast(std::get<1>(tileElements).first)); + MapInvalidateElement(std::get<1>(tileElements).second, reinterpret_cast(std::get<1>(tileElements).first)); direction = initialDirection; std::get<0>(tileElements).first->SetCorners(std::get<0>(tileElements).first->GetCorners() | (1 << (direction))); - map_invalidate_element( - std::get<0>(tileElements).second, reinterpret_cast(std::get<0>(tileElements).first)); + MapInvalidateElement(std::get<0>(tileElements).second, reinterpret_cast(std::get<0>(tileElements).first)); } } @@ -580,7 +574,7 @@ struct rct_neighbour_list size_t count; }; -static int32_t rct_neighbour_compare(const void* a, const void* b) +static int32_t FootpathNeighbourCompare(const void* a, const void* b) { uint8_t va = (static_cast(a))->order; uint8_t vb = (static_cast(b))->order; @@ -598,12 +592,12 @@ static int32_t rct_neighbour_compare(const void* a, const void* b) return 0; } -static void neighbour_list_init(rct_neighbour_list* neighbourList) +static void FootpathNeighbourListInit(rct_neighbour_list* neighbourList) { neighbourList->count = 0; } -static void neighbour_list_push( +static void FootpathNeighbourListPush( rct_neighbour_list* neighbourList, int32_t order, int32_t direction, RideId rideIndex, ::StationIndex entrance_index) { Guard::Assert(neighbourList->count < std::size(neighbourList->items)); @@ -614,7 +608,7 @@ static void neighbour_list_push( neighbourList->count++; } -static bool neighbour_list_pop(rct_neighbour_list* neighbourList, rct_neighbour* outNeighbour) +static bool FootpathNeighbourListPop(rct_neighbour_list* neighbourList, rct_neighbour* outNeighbour) { if (neighbourList->count == 0) return false; @@ -626,7 +620,7 @@ static bool neighbour_list_pop(rct_neighbour_list* neighbourList, rct_neighbour* return true; } -static void neighbour_list_remove(rct_neighbour_list* neighbourList, size_t index) +static void FootpathNeighbourListRemove(rct_neighbour_list* neighbourList, size_t index) { Guard::ArgumentInRange(index, 0, neighbourList->count - 1); int32_t itemsRemaining = static_cast(neighbourList->count - index) - 1; @@ -637,14 +631,14 @@ static void neighbour_list_remove(rct_neighbour_list* neighbourList, size_t inde neighbourList->count--; } -static void neighbour_list_sort(rct_neighbour_list* neighbourList) +static void FoopathNeighbourListSort(rct_neighbour_list* neighbourList) { - qsort(neighbourList->items, neighbourList->count, sizeof(rct_neighbour), rct_neighbour_compare); + qsort(neighbourList->items, neighbourList->count, sizeof(rct_neighbour), FootpathNeighbourCompare); } -static TileElement* footpath_get_element(const CoordsXYRangedZ& footpathPos, int32_t direction) +static TileElement* FootpathGetElement(const CoordsXYRangedZ& footpathPos, int32_t direction) { - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return nullptr; do @@ -667,7 +661,7 @@ static TileElement* footpath_get_element(const CoordsXYRangedZ& footpathPos, int if (!tileElement->AsPath()->IsSloped()) break; - auto slope = direction_reverse(tileElement->AsPath()->GetSlopeDirection()); + auto slope = DirectionReverse(tileElement->AsPath()->GetSlopeDirection()); if (slope != direction) break; @@ -680,7 +674,7 @@ static TileElement* footpath_get_element(const CoordsXYRangedZ& footpathPos, int /** * Attempt to connect a newly disconnected queue tile to the specified path tile */ -static bool footpath_reconnect_queue_to_path( +static bool FootpathReconnectQueueToPath( const CoordsXY& footpathPos, TileElement* tileElement, int32_t action, int32_t direction) { if (((tileElement->AsPath()->GetEdges() & (1 << direction)) == 0) ^ (action < 0)) @@ -690,16 +684,16 @@ static bool footpath_reconnect_queue_to_path( if (action < 0) { - if (fence_in_the_way({ footpathPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }, direction)) + if (WallInTheWay({ footpathPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }, direction)) return false; - if (fence_in_the_way( - { targetQueuePos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }, direction_reverse(direction))) + if (WallInTheWay( + { targetQueuePos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }, DirectionReverse(direction))) return false; } int32_t z = tileElement->GetBaseZ(); - TileElement* targetFootpathElement = footpath_get_element({ targetQueuePos, z - LAND_HEIGHT_STEP, z }, direction); + TileElement* targetFootpathElement = FootpathGetElement({ targetQueuePos, z - LAND_HEIGHT_STEP, z }, direction); if (targetFootpathElement != nullptr && !targetFootpathElement->AsPath()->IsQueue()) { auto targetQueueElement = targetFootpathElement->AsPath(); @@ -707,23 +701,23 @@ static bool footpath_reconnect_queue_to_path( if (action > 0) { tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() & ~(1 << direction)); - targetQueueElement->SetEdges(targetQueueElement->GetEdges() & ~(1 << (direction_reverse(direction) & 3))); + targetQueueElement->SetEdges(targetQueueElement->GetEdges() & ~(1 << (DirectionReverse(direction) & 3))); if (action >= 2) tileElement->AsPath()->SetSlopeDirection(direction); } else if (action < 0) { tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() | (1 << direction)); - targetQueueElement->SetEdges(targetQueueElement->GetEdges() | (1 << (direction_reverse(direction) & 3))); + targetQueueElement->SetEdges(targetQueueElement->GetEdges() | (1 << (DirectionReverse(direction) & 3))); } if (action != 0) - map_invalidate_tile_full(targetQueuePos); + MapInvalidateTileFull(targetQueuePos); return true; } return false; } -static bool footpath_disconnect_queue_from_path(const CoordsXY& footpathPos, TileElement* tileElement, int32_t action) +static bool FootpathDisconnectQueueFromPath(const CoordsXY& footpathPos, TileElement* tileElement, int32_t action) { if (!tileElement->AsPath()->IsQueue()) return false; @@ -738,7 +732,7 @@ static bool footpath_disconnect_queue_from_path(const CoordsXY& footpathPos, Til if (action < 0) { uint8_t direction = tileElement->AsPath()->GetSlopeDirection(); - if (footpath_reconnect_queue_to_path(footpathPos, tileElement, action, direction)) + if (FootpathReconnectQueueToPath(footpathPos, tileElement, action, direction)) return true; } @@ -746,7 +740,7 @@ static bool footpath_disconnect_queue_from_path(const CoordsXY& footpathPos, Til { if ((action < 0) && (direction == tileElement->AsPath()->GetSlopeDirection())) continue; - if (footpath_reconnect_queue_to_path(footpathPos, tileElement, action, direction)) + if (FootpathReconnectQueueToPath(footpathPos, tileElement, action, direction)) return true; } @@ -765,7 +759,7 @@ static void loc_6A6FD2(const CoordsXYZ& initialTileElementPos, int32_t direction if (!query) { initialTileElement->AsPath()->SetEdges(initialTileElement->AsPath()->GetEdges() | (1 << direction)); - map_invalidate_element(initialTileElementPos, initialTileElement); + MapInvalidateElement(initialTileElementPos, initialTileElement); } } } @@ -776,8 +770,7 @@ static void loc_6A6F1F( { if (query) { - if (fence_in_the_way( - { targetPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }, direction_reverse(direction))) + if (WallInTheWay({ targetPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }, DirectionReverse(direction))) { return; } @@ -785,7 +778,7 @@ static void loc_6A6F1F( { if (connected_path_count[tileElement->AsPath()->GetEdges()] < 2) { - neighbour_list_push( + FootpathNeighbourListPush( neighbourList, 4, direction, tileElement->AsPath()->GetRideIndex(), tileElement->AsPath()->GetStationIndex()); } @@ -793,9 +786,9 @@ static void loc_6A6F1F( { if ((initialTileElement)->GetType() == TileElementType::Path && initialTileElement->AsPath()->IsQueue()) { - if (footpath_disconnect_queue_from_path(targetPos, tileElement, 0)) + if (FootpathDisconnectQueueFromPath(targetPos, tileElement, 0)) { - neighbour_list_push( + FootpathNeighbourListPush( neighbourList, 3, direction, tileElement->AsPath()->GetRideIndex(), tileElement->AsPath()->GetStationIndex()); } @@ -804,23 +797,23 @@ static void loc_6A6F1F( } else { - neighbour_list_push(neighbourList, 2, direction, RideId::GetNull(), StationIndex::GetNull()); + FootpathNeighbourListPush(neighbourList, 2, direction, RideId::GetNull(), StationIndex::GetNull()); } } else { - footpath_disconnect_queue_from_path(targetPos, tileElement, 1 + ((flags >> 6) & 1)); - tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() | (1 << direction_reverse(direction))); + FootpathDisconnectQueueFromPath(targetPos, tileElement, 1 + ((flags >> 6) & 1)); + tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() | (1 << DirectionReverse(direction))); if (tileElement->AsPath()->IsQueue()) { - footpath_queue_chain_push(tileElement->AsPath()->GetRideIndex()); + FootpathQueueChainPush(tileElement->AsPath()->GetRideIndex()); } } if (!(flags & (GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED))) { - footpath_interrupt_peeps({ targetPos, tileElement->GetBaseZ() }); + FootpathInterruptPeeps({ targetPos, tileElement->GetBaseZ() }); } - map_invalidate_element(targetPos, tileElement); + MapInvalidateElement(targetPos, tileElement); loc_6A6FD2(initialTileElementPos, direction, initialTileElement, query); } @@ -829,17 +822,17 @@ static void loc_6A6D7E( rct_neighbour_list* neighbourList) { auto targetPos = CoordsXY{ initialTileElementPos } + CoordsDirectionDelta[direction]; - if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && map_is_edge(targetPos)) + if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && MapIsEdge(targetPos)) { if (query) { - neighbour_list_push(neighbourList, 7, direction, RideId::GetNull(), StationIndex::GetNull()); + FootpathNeighbourListPush(neighbourList, 7, direction, RideId::GetNull(), StationIndex::GetNull()); } loc_6A6FD2(initialTileElementPos, direction, initialTileElement, query); } else { - TileElement* tileElement = map_get_first_element_at(targetPos); + TileElement* tileElement = MapGetFirstElementAt(targetPos); if (tileElement == nullptr) return; do @@ -860,7 +853,7 @@ static void loc_6A6D7E( if (tileElement->GetBaseZ() == initialTileElementPos.z - LAND_HEIGHT_STEP) { if (tileElement->AsPath()->IsSloped() - && tileElement->AsPath()->GetSlopeDirection() == direction_reverse(direction)) + && tileElement->AsPath()->GetSlopeDirection() == DirectionReverse(direction)) { loc_6A6F1F( initialTileElementPos, direction, tileElement, initialTileElement, targetPos, flags, query, @@ -890,8 +883,7 @@ static void loc_6A6D7E( { return; } - uint16_t dx = direction_reverse( - (direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); + uint16_t dx = DirectionReverse((direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); if (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { @@ -899,7 +891,7 @@ static void loc_6A6D7E( } if (query) { - neighbour_list_push( + FootpathNeighbourListPush( neighbourList, 1, direction, tileElement->AsTrack()->GetRideIndex(), StationIndex::GetNull()); } loc_6A6FD2(initialTileElementPos, direction, initialTileElement, query); @@ -910,11 +902,11 @@ static void loc_6A6D7E( if (initialTileElementPos.z == tileElement->GetBaseZ()) { if (entrance_has_direction( - *(tileElement->AsEntrance()), direction_reverse(direction - tileElement->GetDirection()))) + *(tileElement->AsEntrance()), DirectionReverse(direction - tileElement->GetDirection()))) { if (query) { - neighbour_list_push( + FootpathNeighbourListPush( neighbourList, 8, direction, tileElement->AsEntrance()->GetRideIndex(), tileElement->AsEntrance()->GetStationIndex()); } @@ -922,7 +914,7 @@ static void loc_6A6D7E( { if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) { - footpath_queue_chain_push(tileElement->AsEntrance()->GetRideIndex()); + FootpathQueueChainPush(tileElement->AsEntrance()->GetRideIndex()); } } loc_6A6FD2(initialTileElementPos, direction, initialTileElement, query); @@ -944,7 +936,7 @@ static void loc_6A6C85( const CoordsXYE& tileElementPos, int32_t direction, int32_t flags, bool query, rct_neighbour_list* neighbourList) { if (query - && fence_in_the_way( + && WallInTheWay( { tileElementPos, tileElementPos.element->GetBaseZ(), tileElementPos.element->GetClearanceZ() }, direction)) return; @@ -1007,22 +999,22 @@ static void loc_6A6C85( * * rct2: 0x006A6C66 */ -void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags) +void FootpathConnectEdges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags) { rct_neighbour_list neighbourList; rct_neighbour neighbour; - footpath_update_queue_chains(); + FootpathUpdateQueueChains(); - neighbour_list_init(&neighbourList); + FootpathNeighbourListInit(&neighbourList); - footpath_update_queue_entrance_banner(footpathPos, tileElement); + FootpathUpdateQueueEntranceBanner(footpathPos, tileElement); for (Direction direction : ALL_DIRECTIONS) { loc_6A6C85({ footpathPos, tileElement }, direction, flags, true, &neighbourList); } - neighbour_list_sort(&neighbourList); + FoopathNeighbourListSort(&neighbourList); if (tileElement->GetType() == TileElementType::Path && tileElement->AsPath()->IsQueue()) { @@ -1039,13 +1031,13 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen } else if (rideIndex != neighbourList.items[i].ride_index) { - neighbour_list_remove(&neighbourList, i); + FootpathNeighbourListRemove(&neighbourList, i); } else if ( rideIndex == neighbourList.items[i].ride_index && entranceIndex != neighbourList.items[i].entrance_index && !neighbourList.items[i].entrance_index.IsNull()) { - neighbour_list_remove(&neighbourList, i); + FootpathNeighbourListRemove(&neighbourList, i); } } } @@ -1053,14 +1045,14 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen neighbourList.count = std::min(neighbourList.count, 2); } - while (neighbour_list_pop(&neighbourList, &neighbour)) + while (FootpathNeighbourListPop(&neighbourList, &neighbour)) { loc_6A6C85({ footpathPos, tileElement }, neighbour.direction, flags, false, nullptr); } if (tileElement->GetType() == TileElementType::Path) { - footpath_connect_corners(footpathPos, tileElement->AsPath()); + FootpathConnectCorners(footpathPos, tileElement->AsPath()); } } @@ -1068,7 +1060,7 @@ void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElemen * * rct2: 0x006A742F */ -void footpath_chain_ride_queue( +void FootpathChainRideQueue( RideId rideIndex, StationIndex entranceIndex, const CoordsXY& initialFootpathPos, TileElement* const initialTileElement, int32_t direction) { @@ -1098,7 +1090,7 @@ void footpath_chain_ride_queue( } auto targetQueuePos = curQueuePos + CoordsDirectionDelta[direction]; - tileElement = map_get_first_element_at(targetQueuePos); + tileElement = MapGetFirstElementAt(targetQueuePos); bool foundQueue = false; if (tileElement != nullptr) { @@ -1123,7 +1115,7 @@ void footpath_chain_ride_queue( if (!tileElement->AsPath()->IsSloped()) break; - if (direction_reverse(tileElement->AsPath()->GetSlopeDirection()) != direction) + if (DirectionReverse(tileElement->AsPath()->GetSlopeDirection()) != direction) break; baseZ -= LAND_HEIGHT_STEP; @@ -1143,7 +1135,7 @@ void footpath_chain_ride_queue( int32_t numEdges = bitcount(edges); if (numEdges >= 2) { - int32_t requiredEdgeMask = 1 << direction_reverse(direction); + int32_t requiredEdgeMask = 1 << DirectionReverse(direction); if (!(edges & requiredEdgeMask)) { break; @@ -1151,12 +1143,12 @@ void footpath_chain_ride_queue( } tileElement->AsPath()->SetHasQueueBanner(false); - tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() | (1 << direction_reverse(direction))); + tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() | (1 << DirectionReverse(direction))); tileElement->AsPath()->SetRideIndex(rideIndex); tileElement->AsPath()->SetStationIndex(entranceIndex); curQueuePos = targetQueuePos; - map_invalidate_element(targetQueuePos, tileElement); + MapInvalidateElement(targetQueuePos, tileElement); if (lastQueuePathElement == nullptr) { @@ -1170,7 +1162,7 @@ void footpath_chain_ride_queue( if (tileElement->AsPath()->GetEdges() & (1 << direction)) continue; - direction = direction_reverse(direction); + direction = DirectionReverse(direction); if (tileElement->AsPath()->GetEdges() & (1 << direction)) continue; } @@ -1184,12 +1176,12 @@ void footpath_chain_ride_queue( lastPathElement->AsPath()->SetHasQueueBanner(true); lastPathElement->AsPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction - map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, { lastPath, lastPathElement->GetBaseZ() }); + MapAnimationCreate(MAP_ANIMATION_TYPE_QUEUE_BANNER, { lastPath, lastPathElement->GetBaseZ() }); } } } -void footpath_queue_chain_reset() +void FootpathQueueChainReset() { _footpathQueueChainNext = _footpathQueueChain; } @@ -1198,7 +1190,7 @@ void footpath_queue_chain_reset() * * rct2: 0x006A76E9 */ -void footpath_queue_chain_push(RideId rideIndex) +void FootpathQueueChainPush(RideId rideIndex) { if (!rideIndex.IsNull()) { @@ -1214,7 +1206,7 @@ void footpath_queue_chain_push(RideId rideIndex) * * rct2: 0x006A759F */ -void footpath_update_queue_chains() +void FootpathUpdateQueueChains() { for (auto* queueChainPtr = _footpathQueueChain; queueChainPtr < _footpathQueueChainNext; queueChainPtr++) { @@ -1228,7 +1220,7 @@ void footpath_update_queue_chains() if (station.Entrance.IsNull()) continue; - TileElement* tileElement = map_get_first_element_at(station.Entrance); + TileElement* tileElement = MapGetFirstElementAt(station.Entrance); if (tileElement != nullptr) { do @@ -1240,8 +1232,8 @@ void footpath_update_queue_chains() if (tileElement->AsEntrance()->GetRideIndex() != rideIndex) continue; - Direction direction = direction_reverse(tileElement->GetDirection()); - footpath_chain_ride_queue( + Direction direction = DirectionReverse(tileElement->GetDirection()); + FootpathChainRideQueue( rideIndex, ride->GetStationIndex(&station), station.Entrance.ToCoordsXY(), tileElement, direction); } while (!(tileElement++)->IsLastForTile()); } @@ -1253,16 +1245,16 @@ void footpath_update_queue_chains() * * rct2: 0x0069ADBD */ -static void footpath_fix_ownership(const CoordsXY& mapPos) +static void FootpathFixOwnership(const CoordsXY& mapPos) { - const auto* surfaceElement = map_get_surface_element_at(mapPos); + const auto* surfaceElement = MapGetSurfaceElementAt(mapPos); uint16_t ownership; // Unlikely to be NULL unless deliberate. if (surfaceElement != nullptr) { // If the tile is not safe to own construction rights of, erase them. - if (check_max_allowable_land_rights_for_tile({ mapPos, surfaceElement->base_height << 3 }) == OWNERSHIP_UNOWNED) + if (CheckMaxAllowableLandRightsForTile({ mapPos, surfaceElement->base_height << 3 }) == OWNERSHIP_UNOWNED) { ownership = OWNERSHIP_UNOWNED; } @@ -1287,7 +1279,7 @@ static void footpath_fix_ownership(const CoordsXY& mapPos) GameActions::Execute(&landSetRightsAction); } -static bool get_next_direction(int32_t edges, int32_t* direction) +static bool GetNextDirection(int32_t edges, int32_t* direction) { int32_t index = bitscanforward(edges); if (index == -1) @@ -1304,7 +1296,7 @@ static bool get_next_direction(int32_t edges, int32_t* direction) * (1 << 5): Unown * (1 << 7): Ignore no entry signs */ -static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, int32_t direction, int32_t flags) +static int32_t FootpathIsConnectedToMapEdgeHelper(CoordsXYZ footpathPos, int32_t direction, int32_t flags) { int32_t returnVal = FOOTPATH_SEARCH_INCOMPLETE; @@ -1370,7 +1362,7 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i if (ste_tileElement->AsPath()->IsSloped() && (ste_slopeDirection = ste_tileElement->AsPath()->GetSlopeDirection()) != ste_direction) { - if (direction_reverse(ste_slopeDirection) != ste_direction) + if (DirectionReverse(ste_slopeDirection) != ste_direction) return true; if (ste_tileElement->GetBaseZ() + PATH_HEIGHT_STEP != ste_targetPos.z) return true; @@ -1402,12 +1394,12 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i // Return immediately if we are at the edge of the map and not unowning // Or if we are unowning and have no tiles left - if ((map_is_edge(targetPos) && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_UNOWN))) + if ((MapIsEdge(targetPos) && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_UNOWN))) { return FOOTPATH_SEARCH_SUCCESS; } - tileElement = map_get_first_element_at(targetPos); + tileElement = MapGetFirstElementAt(targetPos); if (tileElement == nullptr) return currentTile.level == 1 ? FOOTPATH_SEARCH_NOT_FOUND : FOOTPATH_SEARCH_INCOMPLETE; @@ -1419,10 +1411,10 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i // Unown the footpath if needed if (flags & FOOTPATH_CONNECTED_MAP_EDGE_UNOWN) - footpath_fix_ownership(targetPos); + FootpathFixOwnership(targetPos); edges = tileElement->AsPath()->GetEdges(); - currentTile.direction = direction_reverse(currentTile.direction); + currentTile.direction = DirectionReverse(currentTile.direction); if (!tileElement->IsLastForTile() && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY)) { int elementIndex = 1; @@ -1443,7 +1435,7 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i targetPos.z = tileElement->GetBaseZ(); edges &= ~(1 << currentTile.direction); - if (!get_next_direction(edges, ¤tTile.direction)) + if (!GetNextDirection(edges, ¤tTile.direction)) break; edges &= ~(1 << currentTile.direction); @@ -1487,7 +1479,7 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i currentTile.footpathPos = targetPos; currentTile.distanceFromJunction = 0; CaptureCurrentTileState(currentTile); - } while (get_next_direction(edges, ¤tTile.direction)); + } while (GetNextDirection(edges, ¤tTile.direction)); } break; } while (!(tileElement++)->IsLastForTile()); @@ -1502,10 +1494,10 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i } // TODO: Use GAME_COMMAND_FLAGS -int32_t footpath_is_connected_to_map_edge(const CoordsXYZ& footpathPos, int32_t direction, int32_t flags) +int32_t FootpathIsConnectedToMapEdge(const CoordsXYZ& footpathPos, int32_t direction, int32_t flags) { flags |= FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_QUEUES; - return footpath_is_connected_to_map_edge_helper(footpathPos, direction, flags); + return FootpathIsConnectedToMapEdgeHelper(footpathPos, direction, flags); } bool PathElement::IsSloped() const @@ -1629,7 +1621,7 @@ PathBitEntry* PathElement::GetAdditionEntry() const { if (!HasAddition()) return nullptr; - return get_footpath_item_entry(GetAdditionEntryIndex()); + return GetFootpathItemEntry(GetAdditionEntryIndex()); } void PathElement::SetAddition(uint8_t newAddition) @@ -1781,9 +1773,9 @@ void PathElement::SetShouldDrawPathOverSupports(bool on) * clears the wide footpath flag for all footpaths * at location */ -static void footpath_clear_wide(const CoordsXY& footpathPos) +static void FootpathClearWide(const CoordsXY& footpathPos) { - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return; do @@ -1800,9 +1792,9 @@ static void footpath_clear_wide(const CoordsXY& footpathPos) * returns footpath element if it can be made wide * returns NULL if it can not be made wide */ -static TileElement* footpath_can_be_wide(const CoordsXYZ& footpathPos) +static TileElement* FootpathCanBeWide(const CoordsXYZ& footpathPos) { - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return nullptr; do @@ -1825,12 +1817,12 @@ static TileElement* footpath_can_be_wide(const CoordsXYZ& footpathPos) * * rct2: 0x006A87BB */ -void footpath_update_path_wide_flags(const CoordsXY& footpathPos) +void FootpathUpdatePathWideFlags(const CoordsXY& footpathPos) { - if (map_is_location_at_edge(footpathPos)) + if (MapIsLocationAtEdge(footpathPos)) return; - footpath_clear_wide(footpathPos); + FootpathClearWide(footpathPos); /* Rather than clearing the wide flag of the following tiles and * checking the state of them later, leave them intact and assume * they were cleared. Consequently only the wide flag for this single @@ -1842,14 +1834,14 @@ void footpath_update_path_wide_flags(const CoordsXY& footpathPos) * Note: indexes 3, 4, 5 are reset in the current call; * index 2 is reset in the previous call. */ // x += 0x20; - // footpath_clear_wide(x, y); + // FootpathClearWide(x, y); // y += 0x20; - // footpath_clear_wide(x, y); + // FootpathClearWide(x, y); // x -= 0x20; - // footpath_clear_wide(x, y); + // FootpathClearWide(x, y); // y -= 0x20; - TileElement* tileElement = map_get_first_element_at(footpathPos); + TileElement* tileElement = MapGetFirstElementAt(footpathPos); if (tileElement == nullptr) return; do @@ -1871,11 +1863,10 @@ void footpath_update_path_wide_flags(const CoordsXY& footpathPos) // pathList is a list of elements, set by sub_6A8ACF adjacent to x,y // Spanned from 0x00F3EFA8 to 0x00F3EFC7 (8 elements) in the original std::array pathList; - - for (int32_t direction = 0; direction < 8; ++direction) + for (std::size_t direction = 0; direction < pathList.size(); ++direction) { auto footpathLoc = CoordsXYZ(footpathPos + CoordsDirectionDelta[direction], height); - pathList[direction] = footpath_can_be_wide(footpathLoc); + pathList[direction] = FootpathCanBeWide(footpathLoc); } uint8_t pathConnections = 0; @@ -2021,7 +2012,7 @@ void footpath_update_path_wide_flags(const CoordsXY& footpathPos) } while (!(tileElement++)->IsLastForTile()); } -bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position) +bool FootpathIsBlockedByVehicle(const TileCoordsXYZ& position) { auto pathElement = MapGetFirstTileElementWithBaseHeightBetween({ position, position.z + PATH_HEIGHT_STEP }); return pathElement != nullptr && pathElement->IsBlockedByVehicle(); @@ -2031,19 +2022,19 @@ bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position) * * rct2: 0x006A7642 */ -void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElement* tileElement) +void FootpathUpdateQueueEntranceBanner(const CoordsXY& footpathPos, TileElement* tileElement) { const auto elementType = tileElement->GetType(); if (elementType == TileElementType::Path) { if (tileElement->AsPath()->IsQueue()) { - footpath_queue_chain_push(tileElement->AsPath()->GetRideIndex()); - for (int32_t direction = 0; direction < 4; direction++) + FootpathQueueChainPush(tileElement->AsPath()->GetRideIndex()); + for (int32_t direction = 0; direction < NumOrthogonalDirections; direction++) { if (tileElement->AsPath()->GetEdges() & (1 << direction)) { - footpath_chain_ride_queue( + FootpathChainRideQueue( RideId::GetNull(), StationIndex::FromUnderlying(0), footpathPos, tileElement, direction); } } @@ -2054,10 +2045,10 @@ void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElem { if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) { - footpath_queue_chain_push(tileElement->AsEntrance()->GetRideIndex()); - footpath_chain_ride_queue( + FootpathQueueChainPush(tileElement->AsEntrance()->GetRideIndex()); + FootpathChainRideQueue( RideId::GetNull(), StationIndex::FromUnderlying(0), footpathPos, tileElement, - direction_reverse(tileElement->GetDirection())); + DirectionReverse(tileElement->GetDirection())); } } } @@ -2066,29 +2057,29 @@ void footpath_update_queue_entrance_banner(const CoordsXY& footpathPos, TileElem * * rct2: 0x006A6B7F */ -static void footpath_remove_edges_towards_here( +static void FootpathRemoveEdgesTowardsHere( const CoordsXYZ& footpathPos, int32_t direction, TileElement* tileElement, bool isQueue) { if (tileElement->AsPath()->IsQueue()) { - footpath_queue_chain_push(tileElement->AsPath()->GetRideIndex()); + FootpathQueueChainPush(tileElement->AsPath()->GetRideIndex()); } - auto d = direction_reverse(direction); + auto d = DirectionReverse(direction); tileElement->AsPath()->SetEdges(tileElement->AsPath()->GetEdges() & ~(1 << d)); int32_t cd = ((d - 1) & 3); tileElement->AsPath()->SetCorners(tileElement->AsPath()->GetCorners() & ~(1 << cd)); cd = ((cd + 1) & 3); tileElement->AsPath()->SetCorners(tileElement->AsPath()->GetCorners() & ~(1 << cd)); - map_invalidate_tile({ footpathPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ footpathPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); if (isQueue) - footpath_disconnect_queue_from_path(footpathPos, tileElement, -1); + FootpathDisconnectQueueFromPath(footpathPos, tileElement, -1); Direction shiftedDirection = (direction + 1) & 3; auto targetFootPathPos = CoordsXYZ{ CoordsXY{ footpathPos } + CoordsDirectionDelta[shiftedDirection], footpathPos.z }; - tileElement = map_get_first_element_at(targetFootPathPos); + tileElement = MapGetFirstElementAt(targetFootPathPos); if (tileElement == nullptr) return; do @@ -2103,7 +2094,7 @@ static void footpath_remove_edges_towards_here( cd = ((shiftedDirection + 1) & 3); tileElement->AsPath()->SetCorners(tileElement->AsPath()->GetCorners() & ~(1 << cd)); - map_invalidate_tile({ targetFootPathPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ targetFootPathPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); break; } while (!(tileElement++)->IsLastForTile()); } @@ -2112,14 +2103,14 @@ static void footpath_remove_edges_towards_here( * * rct2: 0x006A6B14 */ -static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, int32_t direction, bool isQueue) +static void FootpathRemoveEdgesTowards(const CoordsXYRangedZ& footPathPos, int32_t direction, bool isQueue) { - if (!map_is_location_valid(footPathPos)) + if (!MapIsLocationValid(footPathPos)) { return; } - TileElement* tileElement = map_get_first_element_at(footPathPos); + TileElement* tileElement = MapGetFirstElementAt(footPathPos); if (tileElement == nullptr) return; do @@ -2135,7 +2126,7 @@ static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, in if (slope != direction) break; } - footpath_remove_edges_towards_here({ footPathPos, footPathPos.clearanceZ }, direction, tileElement, isQueue); + FootpathRemoveEdgesTowardsHere({ footPathPos, footPathPos.clearanceZ }, direction, tileElement, isQueue); break; } @@ -2144,11 +2135,11 @@ static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, in if (!tileElement->AsPath()->IsSloped()) break; - uint8_t slope = direction_reverse(tileElement->AsPath()->GetSlopeDirection()); + uint8_t slope = DirectionReverse(tileElement->AsPath()->GetSlopeDirection()); if (slope != direction) break; - footpath_remove_edges_towards_here({ footPathPos, footPathPos.clearanceZ }, direction, tileElement, isQueue); + FootpathRemoveEdgesTowardsHere({ footPathPos, footPathPos.clearanceZ }, direction, tileElement, isQueue); break; } } while (!(tileElement++)->IsLastForTile()); @@ -2156,9 +2147,9 @@ static void footpath_remove_edges_towards(const CoordsXYRangedZ& footPathPos, in // Returns true when there is an element at the given coordinates that want to connect to a path with the given direction (ride // entrances and exits, shops, paths). -bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved) +bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved) { - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement == nullptr) return false; do @@ -2175,7 +2166,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; - if (tileElement->AsPath()->GetSlopeDirection() == direction_reverse(coords.direction)) + if (tileElement->AsPath()->GetSlopeDirection() == DirectionReverse(coords.direction)) // The footpath is sloped and its lowest point matches the edge connection return true; } @@ -2229,7 +2220,7 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co } // fix up the corners around the given path element that gets removed -static void footpath_fix_corners_around(const TileCoordsXY& footpathPos, TileElement* pathElement) +static void FootpathFixCornersAround(const TileCoordsXY& footpathPos, TileElement* pathElement) { // A mask for the paths' corners of each possible neighbour static constexpr uint8_t cornersTouchingTile[3][3] = { @@ -2250,7 +2241,7 @@ static void footpath_fix_corners_around(const TileCoordsXY& footpathPos, TileEle if (xOffset == 0 && yOffset == 0) continue; - TileElement* tileElement = map_get_first_element_at( + TileElement* tileElement = MapGetFirstElementAt( TileCoordsXY{ footpathPos.x + xOffset, footpathPos.y + yOffset }.ToCoordsXY()); if (tileElement == nullptr) continue; @@ -2277,7 +2268,7 @@ static void footpath_fix_corners_around(const TileCoordsXY& footpathPos, TileEle * @param x x-coordinate in units (not tiles) * @param y y-coordinate in units (not tiles) */ -void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElement) +void FootpathRemoveEdgesAt(const CoordsXY& footpathPos, TileElement* tileElement) { if (tileElement->GetType() == TileElementType::Track) { @@ -2290,10 +2281,10 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem return; } - footpath_update_queue_entrance_banner(footpathPos, tileElement); + FootpathUpdateQueueEntranceBanner(footpathPos, tileElement); bool fixCorners = false; - for (uint8_t direction = 0; direction < 4; direction++) + for (uint8_t direction = 0; direction < NumOrthogonalDirections; direction++) { int32_t z1 = tileElement->base_height; if (tileElement->GetType() == TileElementType::Path) @@ -2313,11 +2304,11 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem // When clearance checks were disabled a neighbouring path can be connected to both the path-ghost and to something // else, so before removing edges from neighbouring paths we have to make sure there is nothing else they are connected // to. - if (!tile_element_wants_path_connection_towards({ TileCoordsXY{ footpathPos }, z1, direction }, tileElement)) + if (!TileElementWantsPathConnectionTowards({ TileCoordsXY{ footpathPos }, z1, direction }, tileElement)) { bool isQueue = tileElement->GetType() == TileElementType::Path ? tileElement->AsPath()->IsQueue() : false; int32_t z0 = z1 - 2; - footpath_remove_edges_towards( + FootpathRemoveEdgesTowards( { footpathPos + CoordsDirectionDelta[direction], z0 * COORDS_Z_STEP, z1 * COORDS_Z_STEP }, direction, isQueue); } else @@ -2331,7 +2322,7 @@ void footpath_remove_edges_at(const CoordsXY& footpathPos, TileElement* tileElem if (fixCorners && tileElement->IsGhost()) { auto tileFootpathPos = TileCoordsXY{ footpathPos }; - footpath_fix_corners_around(tileFootpathPos, tileElement); + FootpathFixCornersAround(tileFootpathPos, tileElement); } if (tileElement->GetType() == TileElementType::Path) @@ -2558,7 +2549,7 @@ void PathElement::SetEdgesAndCorners(uint8_t newEdgesAndCorners) bool PathElement::IsLevelCrossing(const CoordsXY& coords) const { - auto trackElement = map_get_track_element_at({ coords, GetBaseZ() }); + auto trackElement = MapGetTrackElementAt({ coords, GetBaseZ() }); if (trackElement == nullptr) { return false; diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 47d384c9ac..5c6cc1a083 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -231,31 +231,31 @@ extern const CoordsXY DirectionOffsets[NumOrthogonalDirections]; extern const CoordsXY BinUseOffsets[NumOrthogonalDirections]; extern const CoordsXY BenchUseOffsets[NumOrthogonalDirections * 2]; -TileElement* map_get_footpath_element(const CoordsXYZ& coords); -void footpath_interrupt_peeps(const CoordsXYZ& footpathPos); -money32 footpath_provisional_set( +TileElement* MapGetFootpathElement(const CoordsXYZ& coords); +void FootpathInterruptPeeps(const CoordsXYZ& footpathPos); +money32 FootpathProvisionalSet( 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); -CoordsXY footpath_bridge_get_info_from_pos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement); -void footpath_remove_litter(const CoordsXYZ& footpathPos); -void footpath_connect_edges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags); -void footpath_update_queue_chains(); -bool fence_in_the_way(const CoordsXYRangedZ& fencePos, int32_t direction); -void footpath_chain_ride_queue( +void FootpathProvisionalRemove(); +void FootpathProvisionalUpdate(); +CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement); +CoordsXY FootpathBridgeGetInfoFromPos(const ScreenCoordsXY& screenCoords, int32_t* direction, TileElement** tileElement); +void FootpathRemoveLitter(const CoordsXYZ& footpathPos); +void FootpathConnectEdges(const CoordsXY& footpathPos, TileElement* tileElement, int32_t flags); +void FootpathUpdateQueueChains(); +bool WallInTheWay(const CoordsXYRangedZ& fencePos, int32_t direction); +void FootpathChainRideQueue( RideId rideIndex, StationIndex entranceIndex, const CoordsXY& footpathPos, TileElement* tileElement, int32_t direction); -void footpath_update_path_wide_flags(const CoordsXY& footpathPos); -bool footpath_is_blocked_by_vehicle(const TileCoordsXYZ& position); +void FootpathUpdatePathWideFlags(const CoordsXY& footpathPos); +bool FootpathIsBlockedByVehicle(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 FootpathIsConnectedToMapEdge(const CoordsXYZ& footpathPos, int32_t direction, int32_t flags); +void FootpathRemoveEdgesAt(const CoordsXY& footpathPos, TileElement* tileElement); bool FootpathSelectDefault(); 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(RideId rideIndex); +void FootpathQueueChainReset(); +void FootpathQueueChainPush(RideId rideIndex); diff --git a/src/openrct2/world/LargeScenery.cpp b/src/openrct2/world/LargeScenery.cpp index 2fb3f0e35d..559172ed47 100644 --- a/src/openrct2/world/LargeScenery.cpp +++ b/src/openrct2/world/LargeScenery.cpp @@ -88,7 +88,7 @@ ObjectEntryIndex LargeSceneryElement::GetEntryIndex() const LargeSceneryEntry* LargeSceneryElement::GetEntry() const { - return get_large_scenery_entry(GetEntryIndex()); + return GetLargeSceneryEntry(GetEntryIndex()); } const LargeSceneryObject* LargeSceneryElement::GetObject() const @@ -111,7 +111,7 @@ void LargeSceneryElement::SetSequenceIndex(uint8_t sequence) SequenceIndex = sequence; } -LargeSceneryEntry* get_large_scenery_entry(ObjectEntryIndex entryIndex) +LargeSceneryEntry* GetLargeSceneryEntry(ObjectEntryIndex entryIndex) { LargeSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); diff --git a/src/openrct2/world/LargeScenery.h b/src/openrct2/world/LargeScenery.h index 442c46cb70..a46449b039 100644 --- a/src/openrct2/world/LargeScenery.h +++ b/src/openrct2/world/LargeScenery.h @@ -13,7 +13,7 @@ #include "Map.h" #include "TileElement.h" -LargeSceneryEntry* get_large_scenery_entry(ObjectEntryIndex entryIndex); +LargeSceneryEntry* GetLargeSceneryEntry(ObjectEntryIndex entryIndex); enum { diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index b3d947e725..7a7ec141e2 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -545,12 +545,12 @@ constexpr Direction ALL_DIRECTIONS[] = { * Given a direction, return the direction that points the other way, * on the same axis. */ -inline constexpr Direction direction_reverse(Direction dir) +inline constexpr Direction DirectionReverse(Direction dir) { return dir ^ 2; } -inline constexpr bool direction_valid(Direction dir) +inline constexpr bool DirectionValid(Direction dir) { return dir < NumOrthogonalDirections; } @@ -559,7 +559,7 @@ inline constexpr bool direction_valid(Direction dir) * Given a direction, return the next cardinal direction, wrapping around if necessary. * (TODO: Figure out if this is CW or CCW) */ -inline constexpr Direction direction_next(Direction dir) +inline constexpr Direction DirectionNext(Direction dir) { return (dir + 1) & 0x03; } @@ -568,7 +568,7 @@ inline constexpr Direction direction_next(Direction dir) * Given a direction, return the previous cardinal direction, wrapping around if necessary. * (TODO: Figure out if this is CW or CCW) */ -inline constexpr Direction direction_prev(Direction dir) +inline constexpr Direction DirectionPrev(Direction dir) { return (dir - 1) & 0x03; } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 349972ba77..f84f7beadb 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -174,7 +174,7 @@ std::vector GetReorganisedTileElementsWithoutGhosts() auto oldSize = newElements.size(); // Add all non-ghost elements - const auto* element = map_get_first_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + const auto* element = MapGetFirstElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (element != nullptr) { do @@ -203,7 +203,7 @@ std::vector GetReorganisedTileElementsWithoutGhosts() static void ReorganiseTileElements(size_t capacity) { - context_setcurrentcursor(CursorID::ZZZ); + ContextSetCurrentCursor(CursorID::ZZZ); std::vector newElements; newElements.reserve(std::max(MIN_TILE_ELEMENTS, capacity)); @@ -211,7 +211,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 }); + const auto* element = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (element == nullptr) { newElements.push_back(GetDefaultSurfaceElement()); @@ -234,7 +234,7 @@ void ReorganiseTileElements() ReorganiseTileElements(_tileElements.size()); } -static bool map_check_free_elements_and_reorganise(size_t numElementsOnTile, size_t numNewElements) +static bool MapCheckFreeElementsAndReorganise(size_t numElementsOnTile, size_t numNewElements) { // 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) @@ -272,24 +272,24 @@ static size_t CountElementsOnTile(const CoordsXY& loc); bool MapCheckCapacityAndReorganise(const CoordsXY& loc, size_t numElements) { auto numElementsOnTile = CountElementsOnTile(loc); - return map_check_free_elements_and_reorganise(numElementsOnTile, numElements); + return MapCheckFreeElementsAndReorganise(numElementsOnTile, numElements); } -static void clear_elements_at(const CoordsXY& loc); -static ScreenCoordsXY translate_3d_to_2d(int32_t rotation, const CoordsXY& pos); +static void ClearElementsAt(const CoordsXY& loc); +static ScreenCoordsXY Translate3DTo2D(int32_t rotation, const CoordsXY& pos); -void tile_element_iterator_begin(tile_element_iterator* it) +void TileElementIteratorBegin(tile_element_iterator* it) { it->x = 0; it->y = 0; - it->element = map_get_first_element_at(TileCoordsXY{ 0, 0 }); + it->element = MapGetFirstElementAt(TileCoordsXY{ 0, 0 }); } -int32_t tile_element_iterator_next(tile_element_iterator* it) +int32_t TileElementIteratorNext(tile_element_iterator* it) { if (it->element == nullptr) { - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); + it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y }); return 1; } @@ -302,7 +302,7 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) if (it->y < (MAXIMUM_MAP_SIZE_TECHNICAL - 1)) { it->y++; - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); + it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y }); return 1; } @@ -310,14 +310,14 @@ int32_t tile_element_iterator_next(tile_element_iterator* it) { it->y = 0; it->x++; - it->element = map_get_first_element_at(TileCoordsXY{ it->x, it->y }); + it->element = MapGetFirstElementAt(TileCoordsXY{ it->x, it->y }); return 1; } return 0; } -void tile_element_iterator_restart_for_tile(tile_element_iterator* it) +void TileElementIteratorRestartForTile(tile_element_iterator* it) { it->element = nullptr; } @@ -329,7 +329,7 @@ static bool IsTileLocationValid(const TileCoordsXY& coords) return is_x_valid && is_y_valid; } -TileElement* map_get_first_element_at(const TileCoordsXY& tilePos) +TileElement* MapGetFirstElementAt(const TileCoordsXY& tilePos) { if (!IsTileLocationValid(tilePos)) { @@ -339,14 +339,14 @@ TileElement* map_get_first_element_at(const TileCoordsXY& tilePos) return _tileIndex.GetFirstElementAt(tilePos); } -TileElement* map_get_first_element_at(const CoordsXY& elementPos) +TileElement* MapGetFirstElementAt(const CoordsXY& elementPos) { - return map_get_first_element_at(TileCoordsXY{ elementPos }); + return MapGetFirstElementAt(TileCoordsXY{ elementPos }); } -TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n) +TileElement* MapGetNthElementAt(const CoordsXY& coords, int32_t n) { - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement == nullptr) { return nullptr; @@ -373,7 +373,7 @@ TileElement* map_get_nth_element_at(const CoordsXY& coords, int32_t n) TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc, TileElementType type) { - TileElement* tileElement = map_get_first_element_at(loc.ToCoordsXY()); + TileElement* tileElement = MapGetFirstElementAt(loc.ToCoordsXY()); if (tileElement == nullptr) return nullptr; do @@ -387,9 +387,9 @@ TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRange return nullptr; } -void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements) +void MapSetTileElement(const TileCoordsXY& tilePos, TileElement* elements) { - if (!map_is_location_valid(tilePos.ToCoordsXY())) + if (!MapIsLocationValid(tilePos.ToCoordsXY())) { log_error("Trying to access element outside of range"); return; @@ -397,14 +397,14 @@ void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements) _tileIndex.SetTile(tilePos, elements); } -SurfaceElement* map_get_surface_element_at(const CoordsXY& coords) +SurfaceElement* MapGetSurfaceElementAt(const CoordsXY& coords) { auto view = TileElementsView(coords); return *view.begin(); } -PathElement* map_get_path_element_at(const TileCoordsXYZ& loc) +PathElement* MapGetPathElementAt(const TileCoordsXYZ& loc) { for (auto* element : TileElementsView(loc.ToCoordsXY())) { @@ -417,7 +417,7 @@ PathElement* map_get_path_element_at(const TileCoordsXYZ& loc) return nullptr; } -BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t position) +BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t position) { const auto bannerTilePos = TileCoordsXYZ{ bannerPos }; for (auto* element : TileElementsView(bannerPos)) @@ -435,7 +435,7 @@ BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t pos * * rct2: 0x0068AB4C */ -void map_init(const TileCoordsXY& size) +void MapInit(const TileCoordsXY& size) { auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; SetTileElements(std::vector(numTiles, GetDefaultSurfaceElement())); @@ -444,11 +444,11 @@ void map_init(const TileCoordsXY& size) gWidePathTileLoopPosition = {}; gMapSize = size; gMapBaseZ = 7; - map_remove_out_of_range_elements(); - AutoCreateMapAnimations(); + MapRemoveOutOfRangeElements(); + MapAnimationAutoCreate(); auto intent = Intent(INTENT_ACTION_MAP); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } /** @@ -456,7 +456,7 @@ void map_init(const TileCoordsXY& size) * but haven't been bought yet. It updates gLandRemainingOwnershipSales and * gLandRemainingConstructionSales. */ -void map_count_remaining_land_rights() +void MapCountRemainingLandRights() { gLandRemainingOwnershipSales = 0; gLandRemainingConstructionSales = 0; @@ -465,7 +465,7 @@ void map_count_remaining_land_rights() { for (int32_t x = 0; x < gMapSize.x; x++) { - auto* surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto* surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); // Surface elements are sometimes hacked out to save some space for other map elements if (surfaceElement == nullptr) { @@ -501,7 +501,7 @@ void map_count_remaining_land_rights() * This is less invasive than removing ghost elements themselves, as they can * contain valid data. */ -void map_strip_ghost_flag_from_elements() +void MapStripGhostFlagFromElements() { for (auto& element : _tileElements) { @@ -517,14 +517,14 @@ void map_strip_ghost_flag_from_elements() * dx: return remember to & with 0xFFFF if you don't want water affecting results * rct2: 0x00662783 */ -int16_t tile_element_height(const CoordsXY& loc) +int16_t TileElementHeight(const CoordsXY& loc) { // Off the map - if (!map_is_location_valid(loc)) + if (!MapIsLocationValid(loc)) return MINIMUM_LAND_HEIGHT_BIG; // Get the surface element for the tile - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { @@ -654,14 +654,14 @@ int16_t tile_element_height(const CoordsXY& loc) return height; } -int16_t tile_element_water_height(const CoordsXY& loc) +int16_t TileElementWaterHeight(const CoordsXY& loc) { // Off the map - if (!map_is_location_valid(loc)) + if (!MapIsLocationValid(loc)) return 0; // Get the surface element for the tile - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { @@ -675,9 +675,9 @@ int16_t tile_element_water_height(const CoordsXY& loc) * Checks if the tile at coordinate at height counts as connected. * @return 1 if connected, 0 otherwise */ -bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection) +bool MapCoordIsConnected(const TileCoordsXYZ& loc, uint8_t faceDirection) { - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return false; @@ -696,7 +696,7 @@ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection) if (loc.z == tileElement->base_height + 2) return true; } - else if (direction_reverse(slopeDirection) == faceDirection && loc.z == tileElement->base_height) + else if (DirectionReverse(slopeDirection) == faceDirection && loc.z == tileElement->base_height) { return true; } @@ -715,7 +715,7 @@ bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection) * * rct2: 0x006A876D */ -void map_update_path_wide_flags() +void MapUpdatePathWideFlags() { PROFILED_FUNCTION(); @@ -731,7 +731,7 @@ void map_update_path_wide_flags() auto y = gWidePathTileLoopPosition.y; for (int32_t i = 0; i < 128; i++) { - footpath_update_path_wide_flags({ x, y }); + FootpathUpdatePathWideFlags({ x, y }); // Next x, y tile x += COORDS_XY_STEP; @@ -753,7 +753,7 @@ void map_update_path_wide_flags() * * rct2: 0x006A7B84 */ -int32_t map_height_from_slope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped) +int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped) { if (!isSloped) return 0; @@ -772,26 +772,26 @@ int32_t map_height_from_slope(const CoordsXY& coords, int32_t slopeDirection, bo return 0; } -bool map_is_location_valid(const CoordsXY& coords) +bool MapIsLocationValid(const CoordsXY& coords) { const bool is_x_valid = coords.x < MAXIMUM_MAP_SIZE_BIG && coords.x >= 0; const bool is_y_valid = coords.y < MAXIMUM_MAP_SIZE_BIG && coords.y >= 0; return is_x_valid && is_y_valid; } -bool map_is_edge(const CoordsXY& coords) +bool MapIsEdge(const CoordsXY& coords) { auto mapSizeUnits = GetMapSizeUnits(); return (coords.x < 32 || coords.y < 32 || coords.x >= mapSizeUnits.x || coords.y >= mapSizeUnits.y); } -bool map_can_build_at(const CoordsXYZ& loc) +bool MapCanBuildAt(const CoordsXYZ& loc) { if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) return true; if (gCheatsSandboxMode) return true; - if (map_is_location_owned(loc)) + if (MapIsLocationOwned(loc)) return true; return false; } @@ -800,12 +800,12 @@ bool map_can_build_at(const CoordsXYZ& loc) * * rct2: 0x00664F72 */ -bool map_is_location_owned(const CoordsXYZ& loc) +bool MapIsLocationOwned(const CoordsXYZ& loc) { // This check is to avoid throwing lots of messages in logs. - if (map_is_location_valid(loc)) + if (MapIsLocationValid(loc)) { - auto* surfaceElement = map_get_surface_element_at(loc); + auto* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement != nullptr) { if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED) @@ -825,11 +825,11 @@ bool map_is_location_owned(const CoordsXYZ& loc) * * rct2: 0x00664F2C */ -bool map_is_location_in_park(const CoordsXY& coords) +bool MapIsLocationInPark(const CoordsXY& coords) { - if (map_is_location_valid(coords)) + if (MapIsLocationValid(coords)) { - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) return false; if (surfaceElement->GetOwnership() & OWNERSHIP_OWNED) @@ -838,11 +838,11 @@ bool map_is_location_in_park(const CoordsXY& coords) return false; } -bool map_is_location_owned_or_has_rights(const CoordsXY& loc) +bool MapIsLocationOwnedOrHasRights(const CoordsXY& loc) { - if (map_is_location_valid(loc)) + if (MapIsLocationValid(loc)) { - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { return false; @@ -942,7 +942,7 @@ const uint8_t tile_element_lower_styles[9][32] = { }, // MAP_SELECT_TYPE_EDGE_3 }; -int32_t map_get_corner_height(int32_t z, int32_t slope, int32_t direction) +int32_t MapGetCornerHeight(int32_t z, int32_t slope, int32_t direction) { switch (direction) { @@ -990,14 +990,14 @@ int32_t map_get_corner_height(int32_t z, int32_t slope, int32_t direction) return z; } -int32_t tile_element_get_corner_height(const SurfaceElement* surfaceElement, int32_t direction) +int32_t TileElementGetCornerHeight(const SurfaceElement* surfaceElement, int32_t direction) { int32_t z = surfaceElement->base_height; int32_t slope = surfaceElement->GetSlope(); - return map_get_corner_height(z, slope, direction); + return MapGetCornerHeight(z, slope, direction); } -uint8_t map_get_lowest_land_height(const MapRange& range) +uint8_t MapGetLowestLandHeight(const MapRange& range) { auto mapSizeMax = GetMapSizeMaxXY(); MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), @@ -1008,13 +1008,13 @@ uint8_t map_get_lowest_land_height(const MapRange& range) { for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += COORDS_XY_STEP) { - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ xi, yi }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); if (surfaceElement != nullptr && min_height > surfaceElement->base_height) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ xi, yi })) + if (!MapIsLocationInPark(CoordsXY{ xi, yi })) { continue; } @@ -1027,7 +1027,7 @@ uint8_t map_get_lowest_land_height(const MapRange& range) return min_height; } -uint8_t map_get_highest_land_height(const MapRange& range) +uint8_t MapGetHighestLandHeight(const MapRange& range) { auto mapSizeMax = GetMapSizeMaxXY(); MapRange validRange = { std::max(range.GetLeft(), 32), std::max(range.GetTop(), 32), @@ -1038,12 +1038,12 @@ uint8_t map_get_highest_land_height(const MapRange& range) { for (int32_t xi = validRange.GetLeft(); xi <= validRange.GetRight(); xi += COORDS_XY_STEP) { - auto* surfaceElement = map_get_surface_element_at(CoordsXY{ xi, yi }); + auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); if (surfaceElement != nullptr) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { - if (!map_is_location_in_park(CoordsXY{ xi, yi })) + if (!MapIsLocationInPark(CoordsXY{ xi, yi })) { continue; } @@ -1062,7 +1062,7 @@ uint8_t map_get_highest_land_height(const MapRange& range) return max_height; } -bool map_is_location_at_edge(const CoordsXY& loc) +bool MapIsLocationAtEdge(const CoordsXY& loc) { return loc.x < 32 || loc.y < 32 || loc.x >= (MAXIMUM_TILE_START_XY) || loc.y >= (MAXIMUM_TILE_START_XY); } @@ -1071,7 +1071,7 @@ bool map_is_location_at_edge(const CoordsXY& loc) * * rct2: 0x0068B280 */ -void tile_element_remove(TileElement* tileElement) +void TileElementRemove(TileElement* tileElement) { // Replace Nth element by (N+1)th element. // This loop will make tileElement point to the old last element position, @@ -1098,11 +1098,11 @@ void tile_element_remove(TileElement* tileElement) * * rct2: 0x00675A8E */ -void map_remove_all_rides() +void MapRemoveAllRides() { tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { switch (it.element->GetType()) @@ -1119,31 +1119,31 @@ void map_remove_all_rides() break; [[fallthrough]]; case TileElementType::Track: - footpath_queue_chain_reset(); - footpath_remove_edges_at(TileCoordsXY{ it.x, it.y }.ToCoordsXY(), it.element); - tile_element_remove(it.element); - tile_element_iterator_restart_for_tile(&it); + FootpathQueueChainReset(); + FootpathRemoveEdgesAt(TileCoordsXY{ it.x, it.y }.ToCoordsXY(), it.element); + TileElementRemove(it.element); + TileElementIteratorRestartForTile(&it); break; default: break; } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); } /** * * rct2: 0x0068AB1B */ -void map_invalidate_map_selection_tiles() +void MapInvalidateMapSelectionTiles() { if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT)) return; for (const auto& position : gMapSelectionTiles) - map_invalidate_tile_full(position); + MapInvalidateTileFull(position); } -static void map_get_bounding_box(const MapRange& _range, int32_t* left, int32_t* top, int32_t* right, int32_t* bottom) +static void MapGetBoundingBox(const MapRange& _range, int32_t* left, int32_t* top, int32_t* right, int32_t* bottom) { uint32_t rotation = get_current_rotation(); const std::array corners{ @@ -1160,7 +1160,7 @@ static void map_get_bounding_box(const MapRange& _range, int32_t* left, int32_t* for (const auto& corner : corners) { - auto screenCoord = translate_3d_to_2d(rotation, corner); + auto screenCoord = Translate3DTo2D(rotation, corner); if (screenCoord.x < *left) *left = screenCoord.x; if (screenCoord.x > *right) @@ -1176,7 +1176,7 @@ static void map_get_bounding_box(const MapRange& _range, int32_t* left, int32_t* * * rct2: 0x0068AAE1 */ -void map_invalidate_selection_rect() +void MapInvalidateSelectionRect() { int32_t x0, y0, x1, y1, left, right, top, bottom; @@ -1187,7 +1187,7 @@ void map_invalidate_selection_rect() y0 = gMapSelectPositionA.y + 16; x1 = gMapSelectPositionB.x + 16; y1 = gMapSelectPositionB.y + 16; - map_get_bounding_box({ x0, y0, x1, y1 }, &left, &top, &right, &bottom); + MapGetBoundingBox({ x0, y0, x1, y1 }, &left, &top, &right, &bottom); left -= 32; right += 32; bottom += 32; @@ -1209,7 +1209,7 @@ static size_t CountElementsOnTile(const CoordsXY& loc) static TileElement* AllocateTileElements(size_t numElementsOnTile, size_t numNewElements) { - if (!map_check_free_elements_and_reorganise(numElementsOnTile, numNewElements)) + if (!MapCheckFreeElementsAndReorganise(numElementsOnTile, numNewElements)) { log_error("Cannot insert new element"); return nullptr; @@ -1225,7 +1225,7 @@ static TileElement* AllocateTileElements(size_t numElementsOnTile, size_t numNew * * rct2: 0x0068B1F6 */ -TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type) +TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type) { const auto& tileLoc = TileCoordsXYZ(loc); @@ -1301,7 +1301,7 @@ TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants * * rct2: 0x006646E1 */ -void map_update_tiles() +void MapUpdateTiles() { PROFILED_FUNCTION(); @@ -1330,11 +1330,11 @@ void map_update_tiles() for (int32_t blockX = 0; blockX < gMapSize.x; blockX += 256) { auto mapPos = TileCoordsXY{ blockX + x, blockY + y }.ToCoordsXY(); - auto* surfaceElement = map_get_surface_element_at(mapPos); + auto* surfaceElement = MapGetSurfaceElementAt(mapPos); if (surfaceElement != nullptr) { surfaceElement->UpdateGrassLength(mapPos); - scenery_update_tile(mapPos); + SceneryUpdateTile(mapPos); } } } @@ -1344,51 +1344,51 @@ void map_update_tiles() } } -void map_remove_provisional_elements() +void MapRemoveProvisionalElements() { PROFILED_FUNCTION(); if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) { - footpath_provisional_remove(); + FootpathProvisionalRemove(); gProvisionalFootpath.Flags |= PROVISIONAL_PATH_FLAG_1; } if (window_find_by_class(WindowClass::RideConstruction) != nullptr) { ride_remove_provisional_track_piece(); - ride_entrance_exit_remove_ghost(); + RideEntranceExitRemoveGhost(); } // This is in non performant so only make network games suffer for it // non networked games do not need this as its to prevent desyncs. if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WindowClass::TrackDesignPlace) != nullptr) { auto intent = Intent(INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } -void map_restore_provisional_elements() +void MapRestoreProvisionalElements() { PROFILED_FUNCTION(); if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) { gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_1; - footpath_provisional_set( + FootpathProvisionalSet( gProvisionalFootpath.SurfaceIndex, gProvisionalFootpath.RailingsIndex, gProvisionalFootpath.Position, gProvisionalFootpath.Slope, gProvisionalFootpath.ConstructFlags); } if (window_find_by_class(WindowClass::RideConstruction) != nullptr) { ride_restore_provisional_track_piece(); - ride_entrance_exit_place_provisional_ghost(); + RideEntranceExitPlaceProvisionalGhost(); } // This is in non performant so only make network games suffer for it // non networked games do not need this as its to prevent desyncs. if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WindowClass::TrackDesignPlace) != nullptr) { auto intent = Intent(INTENT_ACTION_TRACK_DESIGN_RESTORE_PROVISIONAL); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } } @@ -1396,7 +1396,7 @@ void map_restore_provisional_elements() * Removes elements that are out of the map size range and crops the park perimeter. * rct2: 0x0068ADBC */ -void map_remove_out_of_range_elements() +void MapRemoveOutOfRangeElements() { auto mapSizeMax = GetMapSizeMaxXY(); @@ -1415,13 +1415,13 @@ void map_remove_out_of_range_elements() if (x == 0 || y == 0 || x >= mapSizeMax.x || y >= mapSizeMax.y) { // Note this purposely does not use LandSetRightsAction as X Y coordinates are outside of normal range. - auto surfaceElement = map_get_surface_element_at(CoordsXY{ x, y }); + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); if (surfaceElement != nullptr) { surfaceElement->SetOwnership(OWNERSHIP_UNOWNED); - update_park_fences_around_tile({ x, y }); + ParkUpdateFencesAroundTile({ x, y }); } - clear_elements_at({ x, y }); + ClearElementsAt({ x, y }); } } } @@ -1430,7 +1430,7 @@ void map_remove_out_of_range_elements() gCheatsBuildInPauseMode = buildState; } -static void map_extend_boundary_surface_extend_tile(const SurfaceElement& sourceTile, SurfaceElement& destTile) +static void MapExtendBoundarySurfaceExtendTile(const SurfaceElement& sourceTile, SurfaceElement& destTile) { destTile.SetSurfaceStyle(sourceTile.GetSurfaceStyle()); destTile.SetEdgeStyle(sourceTile.GetEdgeStyle()); @@ -1470,38 +1470,38 @@ static void map_extend_boundary_surface_extend_tile(const SurfaceElement& source /** * Copies the terrain and slope from the Y edge of the map to the new tiles. Used when increasing the size of the map. */ -void map_extend_boundary_surface_y() +void MapExtendBoundarySurfaceY() { auto y = gMapSize.y - 2; for (auto x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { - auto existingTileElement = map_get_surface_element_at(TileCoordsXY{ x, y - 1 }.ToCoordsXY()); - auto newTileElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y - 1 }.ToCoordsXY()); + auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (existingTileElement != nullptr && newTileElement != nullptr) { - map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); + MapExtendBoundarySurfaceExtendTile(*existingTileElement, *newTileElement); } - update_park_fences({ x << 5, y << 5 }); + ParkUpdateFences({ x << 5, y << 5 }); } } /** * Copies the terrain and slope from the X edge of the map to the new tiles. Used when increasing the size of the map. */ -void map_extend_boundary_surface_x() +void MapExtendBoundarySurfaceX() { auto x = gMapSize.x - 2; for (auto y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { - auto existingTileElement = map_get_surface_element_at(TileCoordsXY{ x - 1, y }.ToCoordsXY()); - auto newTileElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y }.ToCoordsXY()); + auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (existingTileElement != nullptr && newTileElement != nullptr) { - map_extend_boundary_surface_extend_tile(*existingTileElement, *newTileElement); + MapExtendBoundarySurfaceExtendTile(*existingTileElement, *newTileElement); } - update_park_fences({ x << 5, y << 5 }); + ParkUpdateFences({ x << 5, y << 5 }); } } @@ -1509,7 +1509,7 @@ void map_extend_boundary_surface_x() * Clears the provided element properly from a certain tile, and updates * the pointer (when needed) passed to this function to point to the next element. */ -static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) +static void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) { TileElement* element = *elementPtr; switch (element->GetType()) @@ -1547,7 +1547,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result.Error != GameActions::Status::Ok) { - tile_element_remove(element); + TileElementRemove(element); } break; } @@ -1559,7 +1559,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result.Error != GameActions::Status::Ok) { - tile_element_remove(element); + TileElementRemove(element); } } break; @@ -1571,7 +1571,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result.Error != GameActions::Status::Ok) { - tile_element_remove(element); + TileElementRemove(element); } } break; @@ -1583,12 +1583,12 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) // If asking nicely did not work, forcibly remove this to avoid an infinite loop. if (result.Error != GameActions::Status::Ok) { - tile_element_remove(element); + TileElementRemove(element); } break; } default: - tile_element_remove(element); + TileElementRemove(element); break; } } @@ -1597,7 +1597,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr) * Clears all elements properly from a certain tile. * rct2: 0x0068AE2A */ -static void clear_elements_at(const CoordsXY& loc) +static void ClearElementsAt(const CoordsXY& loc) { // Remove the spawn point (if there is one in the current tile) gPeepSpawns.erase( @@ -1606,21 +1606,21 @@ static void clear_elements_at(const CoordsXY& loc) [loc](const CoordsXY& spawn) { return spawn.ToTileStart() == loc.ToTileStart(); }), gPeepSpawns.end()); - TileElement* tileElement = map_get_first_element_at(loc); + TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return; // Remove all elements except the last one while (!tileElement->IsLastForTile()) - clear_element_at(loc, &tileElement); + ClearElementAt(loc, &tileElement); // Remove the last element - clear_element_at(loc, &tileElement); + ClearElementAt(loc, &tileElement); } -int32_t map_get_highest_z(const CoordsXY& loc) +int32_t MapGetHighestZ(const CoordsXY& loc) { - auto surfaceElement = map_get_surface_element_at(loc); + auto surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) return -1; @@ -1636,9 +1636,9 @@ int32_t map_get_highest_z(const CoordsXY& loc) return z; } -LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos, int32_t sequence) +LargeSceneryElement* MapGetLargeScenerySegment(const CoordsXYZD& sceneryPos, int32_t sequence) { - TileElement* tileElement = map_get_first_element_at(sceneryPos); + TileElement* tileElement = MapGetFirstElementAt(sceneryPos); if (tileElement == nullptr) { return nullptr; @@ -1660,10 +1660,10 @@ LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos, return nullptr; } -EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost) +EntranceElement* MapGetParkEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost) { auto entranceTileCoords = TileCoordsXYZ(entranceCoords); - TileElement* tileElement = map_get_first_element_at(entranceCoords); + TileElement* tileElement = MapGetFirstElementAt(entranceCoords); if (tileElement != nullptr) { do @@ -1686,10 +1686,10 @@ EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoord return nullptr; } -EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost) +EntranceElement* MapGetRideEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost) { auto entranceTileCoords = TileCoordsXYZ{ entranceCoords }; - TileElement* tileElement = map_get_first_element_at(entranceCoords); + TileElement* tileElement = MapGetFirstElementAt(entranceCoords); if (tileElement != nullptr) { do @@ -1712,10 +1712,10 @@ EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoord return nullptr; } -EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool ghost) +EntranceElement* MapGetRideExitElementAt(const CoordsXYZ& exitCoords, bool ghost) { auto exitTileCoords = TileCoordsXYZ{ exitCoords }; - TileElement* tileElement = map_get_first_element_at(exitCoords); + TileElement* tileElement = MapGetFirstElementAt(exitCoords); if (tileElement != nullptr) { do @@ -1738,10 +1738,10 @@ EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool return nullptr; } -SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant) +SmallSceneryElement* MapGetSmallSceneryElementAt(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant) { auto sceneryTileCoords = TileCoordsXYZ{ sceneryCoords }; - TileElement* tileElement = map_get_first_element_at(sceneryCoords); + TileElement* tileElement = MapGetFirstElementAt(sceneryCoords); if (tileElement != nullptr) { do @@ -1761,12 +1761,12 @@ SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCo return nullptr; } -std::optional map_large_scenery_get_origin( +std::optional MapLargeSceneryGetOrigin( const CoordsXYZD& sceneryPos, int32_t sequence, LargeSceneryElement** outElement) { rct_large_scenery_tile* tile; - auto tileElement = map_get_large_scenery_segment(sceneryPos, sequence); + auto tileElement = MapGetLargeScenerySegment(sceneryPos, sequence); if (tileElement == nullptr) return std::nullopt; @@ -1787,12 +1787,12 @@ std::optional map_large_scenery_get_origin( * * rct2: 0x006B9B05 */ -bool map_large_scenery_sign_set_colour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour) +bool MapLargeScenerySignSetColour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour) { LargeSceneryElement* tileElement; rct_large_scenery_tile *sceneryTiles, *tile; - auto sceneryOrigin = map_large_scenery_get_origin(signPos, sequence, &tileElement); + auto sceneryOrigin = MapLargeSceneryGetOrigin(signPos, sequence, &tileElement); if (!sceneryOrigin) { return false; @@ -1810,32 +1810,32 @@ bool map_large_scenery_sign_set_colour(const CoordsXYZD& signPos, int32_t sequen auto tmpSignPos = CoordsXYZD{ sceneryOrigin->x + rotatedOffsetPos.x, sceneryOrigin->y + rotatedOffsetPos.y, sceneryOrigin->z + tile->z_offset, signPos.direction }; - tileElement = map_get_large_scenery_segment(tmpSignPos, sequence); + tileElement = MapGetLargeScenerySegment(tmpSignPos, sequence); if (tileElement != nullptr) { tileElement->SetPrimaryColour(mainColour); tileElement->SetSecondaryColour(textColour); - map_invalidate_tile({ tmpSignPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ tmpSignPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); } } return true; } -static ScreenCoordsXY translate_3d_to_2d(int32_t rotation, const CoordsXY& pos) +static ScreenCoordsXY Translate3DTo2D(int32_t rotation, const CoordsXY& pos) { - return translate_3d_to_2d_with_z(rotation, CoordsXYZ{ pos, 0 }); + return Translate3DTo2DWithZ(rotation, CoordsXYZ{ pos, 0 }); } -ScreenCoordsXY translate_3d_to_2d_with_z(int32_t rotation, const CoordsXYZ& pos) +ScreenCoordsXY Translate3DTo2DWithZ(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 }; } -static void map_invalidate_tile_under_zoom(int32_t x, int32_t y, int32_t z0, int32_t z1, ZoomLevel maxZoom) +static void MapInvalidateTileUnderZoom(int32_t x, int32_t y, int32_t z0, int32_t z1, ZoomLevel maxZoom) { if (gOpenRCT2Headless) return; @@ -1844,7 +1844,7 @@ static void map_invalidate_tile_under_zoom(int32_t x, int32_t y, int32_t z0, int x += 16; y += 16; - auto screenCoord = translate_3d_to_2d(get_current_rotation(), { x, y }); + auto screenCoord = Translate3DTo2D(get_current_rotation(), { x, y }); x1 = screenCoord.x - 32; y1 = screenCoord.y - 32 - z1; @@ -1858,44 +1858,44 @@ static void map_invalidate_tile_under_zoom(int32_t x, int32_t y, int32_t z0, int * * rct2: 0x006EC847 */ -void map_invalidate_tile(const CoordsXYRangedZ& tilePos) +void MapInvalidateTile(const CoordsXYRangedZ& tilePos) { - map_invalidate_tile_under_zoom(tilePos.x, tilePos.y, tilePos.baseZ, tilePos.clearanceZ, ZoomLevel{ -1 }); + MapInvalidateTileUnderZoom(tilePos.x, tilePos.y, tilePos.baseZ, tilePos.clearanceZ, ZoomLevel{ -1 }); } /** * * rct2: 0x006ECB60 */ -void map_invalidate_tile_zoom1(const CoordsXYRangedZ& tilePos) +void MapInvalidateTileZoom1(const CoordsXYRangedZ& tilePos) { - map_invalidate_tile_under_zoom(tilePos.x, tilePos.y, tilePos.baseZ, tilePos.clearanceZ, ZoomLevel{ 1 }); + MapInvalidateTileUnderZoom(tilePos.x, tilePos.y, tilePos.baseZ, tilePos.clearanceZ, ZoomLevel{ 1 }); } /** * * rct2: 0x006EC9CE */ -void map_invalidate_tile_zoom0(const CoordsXYRangedZ& tilePos) +void MapInvalidateTileZoom0(const CoordsXYRangedZ& tilePos) { - map_invalidate_tile_under_zoom(tilePos.x, tilePos.y, tilePos.baseZ, tilePos.clearanceZ, ZoomLevel{ 0 }); + MapInvalidateTileUnderZoom(tilePos.x, tilePos.y, tilePos.baseZ, tilePos.clearanceZ, ZoomLevel{ 0 }); } /** * * rct2: 0x006EC6D7 */ -void map_invalidate_tile_full(const CoordsXY& tilePos) +void MapInvalidateTileFull(const CoordsXY& tilePos) { - map_invalidate_tile({ tilePos, 0, 2080 }); + MapInvalidateTile({ tilePos, 0, 2080 }); } -void map_invalidate_element(const CoordsXY& elementPos, TileElement* tileElement) +void MapInvalidateElement(const CoordsXY& elementPos, TileElement* tileElement) { - map_invalidate_tile({ elementPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); + MapInvalidateTile({ elementPos, tileElement->GetBaseZ(), tileElement->GetClearanceZ() }); } -void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs) +void MapInvalidateRegion(const CoordsXY& mins, const CoordsXY& maxs) { int32_t x0, y0, x1, y1, left, right, top, bottom; @@ -1905,7 +1905,7 @@ void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs) x1 = maxs.x + 16; y1 = maxs.y + 16; - map_get_bounding_box({ x0, y0, x1, y1 }, &left, &top, &right, &bottom); + MapGetBoundingBox({ x0, y0, x1, y1 }, &left, &top, &right, &bottom); left -= 32; right += 32; @@ -1915,14 +1915,14 @@ void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs) viewports_invalidate({ { left, top }, { right, bottom } }); } -int32_t map_get_tile_side(const CoordsXY& mapPos) +int32_t MapGetTileSide(const CoordsXY& mapPos) { int32_t subMapX = mapPos.x & (32 - 1); int32_t subMapY = mapPos.y & (32 - 1); return (subMapX < subMapY) ? ((subMapX + subMapY) < 32 ? 0 : 1) : ((subMapX + subMapY) < 32 ? 3 : 2); } -int32_t map_get_tile_quadrant(const CoordsXY& mapPos) +int32_t MapGetTileQuadrant(const CoordsXY& mapPos) { int32_t subMapX = mapPos.x & (32 - 1); int32_t subMapY = mapPos.y & (32 - 1); @@ -1933,12 +1933,12 @@ int32_t map_get_tile_quadrant(const CoordsXY& mapPos) * * rct2: 0x00693BFF */ -bool map_surface_is_blocked(const CoordsXY& mapCoords) +bool MapSurfaceIsBlocked(const CoordsXY& mapCoords) { - if (!map_is_location_valid(mapCoords)) + if (!MapIsLocationValid(mapCoords)) return true; - auto surfaceElement = map_get_surface_element_at(mapCoords); + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); if (surfaceElement == nullptr) { @@ -1980,13 +1980,13 @@ bool map_surface_is_blocked(const CoordsXY& mapCoords) } /* Clears all map elements, to be used before generating a new map */ -void map_clear_all_elements() +void MapClearAllElements() { for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_BIG; y += COORDS_XY_STEP) { for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_BIG; x += COORDS_XY_STEP) { - clear_elements_at({ x, y }); + ClearElementsAt({ x, y }); } } } @@ -1997,9 +1997,9 @@ void map_clear_all_elements() * @param y y units, not tiles. * @param z Base height. */ -TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos) +TrackElement* MapGetTrackElementAt(const CoordsXYZ& trackPos) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; do @@ -2021,9 +2021,9 @@ TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos) * @param y y units, not tiles. * @param z Base height. */ -TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_type_t trackType) +TileElement* MapGetTrackElementAtOfType(const CoordsXYZ& trackPos, track_type_t trackType) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2048,9 +2048,9 @@ TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_t * @param y y units, not tiles. * @param z Base height. */ -TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence) +TileElement* MapGetTrackElementAtOfTypeSeq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); auto trackTilePos = TileCoordsXYZ{ trackPos }; do { @@ -2071,9 +2071,9 @@ TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, tra return nullptr; } -TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track_type_t trackType) +TrackElement* MapGetTrackElementAtOfType(const CoordsXYZD& location, track_type_t trackType) { - auto tileElement = map_get_first_element_at(location); + auto tileElement = MapGetFirstElementAt(location); if (tileElement != nullptr) { do @@ -2094,9 +2094,9 @@ TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track return nullptr; } -TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence) +TrackElement* MapGetTrackElementAtOfTypeSeq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence) { - auto tileElement = map_get_first_element_at(location); + auto tileElement = MapGetFirstElementAt(location); if (tileElement != nullptr) { do @@ -2125,9 +2125,9 @@ TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, t * @param y y units, not tiles. * @param z Base height. */ -TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex) +TileElement* MapGetTrackElementAtOfTypeFromRide(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2154,9 +2154,9 @@ TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPo * @param y y units, not tiles. * @param z Base height. */ -TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex) +TileElement* MapGetTrackElementAtFromRide(const CoordsXYZ& trackPos, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2182,9 +2182,9 @@ TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideI * @param z Base height. * @param direction The direction (0 - 3). */ -TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex) +TileElement* MapGetTrackElementAtWithDirectionFromRide(const CoordsXYZD& trackPos, RideId rideIndex) { - TileElement* tileElement = map_get_first_element_at(trackPos); + TileElement* tileElement = MapGetFirstElementAt(trackPos); if (tileElement == nullptr) return nullptr; auto trackTilePos = TileCoordsXYZ{ trackPos }; @@ -2205,9 +2205,9 @@ TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& return nullptr; }; -WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords) +WallElement* MapGetWallElementAt(const CoordsXYRangedZ& coords) { - auto tileElement = map_get_first_element_at(coords); + auto tileElement = MapGetFirstElementAt(coords); if (tileElement != nullptr) { @@ -2224,10 +2224,10 @@ WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords) return nullptr; } -WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords) +WallElement* MapGetWallElementAt(const CoordsXYZD& wallCoords) { auto tileWallCoords = TileCoordsXYZ(wallCoords); - TileElement* tileElement = map_get_first_element_at(wallCoords); + TileElement* tileElement = MapGetFirstElementAt(wallCoords); if (tileElement == nullptr) return nullptr; do @@ -2244,9 +2244,9 @@ WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords) return nullptr; } -uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos) +uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos) { - TileElement* tileElement = map_get_first_element_at(tileMapPos); + TileElement* tileElement = MapGetFirstElementAt(tileMapPos); uint16_t destOwnership = OWNERSHIP_OWNED; // Sometimes done deliberately. @@ -2285,14 +2285,14 @@ void FixLandOwnershipTilesWithOwnership(std::initializer_list tile { for (const TileCoordsXY* tile = tiles.begin(); tile != tiles.end(); ++tile) { - auto surfaceElement = map_get_surface_element_at(tile->ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(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 }); + ParkUpdateFencesAroundTile({ (*tile).x * 32, (*tile).y * 32 }); } } } diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 6b8bd1f8a3..58ac7022b0 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -157,46 +157,46 @@ void StashMap(); void UnstashMap(); std::vector GetReorganisedTileElementsWithoutGhosts(); -void map_init(const TileCoordsXY& size); +void MapInit(const TileCoordsXY& size); -void map_count_remaining_land_rights(); -void map_strip_ghost_flag_from_elements(); -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 MapCountRemainingLandRights(); +void MapStripGhostFlagFromElements(); +TileElement* MapGetFirstElementAt(const CoordsXY& tilePos); +TileElement* MapGetFirstElementAt(const TileCoordsXY& tilePos); +TileElement* MapGetNthElementAt(const CoordsXY& coords, int32_t n); TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc, TileElementType type); -void map_set_tile_element(const TileCoordsXY& tilePos, TileElement* elements); -int32_t map_height_from_slope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped); -BannerElement* map_get_banner_element_at(const CoordsXYZ& bannerPos, uint8_t direction); -SurfaceElement* map_get_surface_element_at(const CoordsXY& coords); -PathElement* map_get_path_element_at(const TileCoordsXYZ& loc); -WallElement* map_get_wall_element_at(const CoordsXYZD& wallCoords); -WallElement* map_get_wall_element_at(const CoordsXYRangedZ& coords); -SmallSceneryElement* map_get_small_scenery_element_at(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant); -EntranceElement* map_get_park_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost); -EntranceElement* map_get_ride_entrance_element_at(const CoordsXYZ& entranceCoords, bool ghost); -EntranceElement* map_get_ride_exit_element_at(const CoordsXYZ& exitCoords, bool ghost); -int16_t tile_element_height(const CoordsXY& loc); -int16_t tile_element_water_height(const CoordsXY& loc); -uint8_t map_get_highest_land_height(const MapRange& range); -uint8_t map_get_lowest_land_height(const MapRange& range); -bool map_coord_is_connected(const TileCoordsXYZ& loc, uint8_t faceDirection); -void map_remove_provisional_elements(); -void map_restore_provisional_elements(); -void map_update_path_wide_flags(); -bool map_is_location_valid(const CoordsXY& coords); -bool map_is_edge(const CoordsXY& coords); -bool map_can_build_at(const CoordsXYZ& loc); -bool map_is_location_owned(const CoordsXYZ& loc); -bool map_is_location_in_park(const CoordsXY& coords); -bool map_is_location_owned_or_has_rights(const CoordsXY& loc); -bool map_surface_is_blocked(const CoordsXY& mapCoords); -void tile_element_remove(TileElement* tileElement); -void map_remove_all_rides(); -void map_invalidate_map_selection_tiles(); -void map_invalidate_selection_rect(); +void MapSetTileElement(const TileCoordsXY& tilePos, TileElement* elements); +int32_t MapHeightFromSlope(const CoordsXY& coords, int32_t slopeDirection, bool isSloped); +BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t direction); +SurfaceElement* MapGetSurfaceElementAt(const CoordsXY& coords); +PathElement* MapGetPathElementAt(const TileCoordsXYZ& loc); +WallElement* MapGetWallElementAt(const CoordsXYZD& wallCoords); +WallElement* MapGetWallElementAt(const CoordsXYRangedZ& coords); +SmallSceneryElement* MapGetSmallSceneryElementAt(const CoordsXYZ& sceneryCoords, int32_t type, uint8_t quadrant); +EntranceElement* MapGetParkEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost); +EntranceElement* MapGetRideEntranceElementAt(const CoordsXYZ& entranceCoords, bool ghost); +EntranceElement* MapGetRideExitElementAt(const CoordsXYZ& exitCoords, bool ghost); +uint8_t MapGetHighestLandHeight(const MapRange& range); +uint8_t MapGetLowestLandHeight(const MapRange& range); +bool MapCoordIsConnected(const TileCoordsXYZ& loc, uint8_t faceDirection); +void MapRemoveProvisionalElements(); +void MapRestoreProvisionalElements(); +void MapUpdatePathWideFlags(); +bool MapIsLocationValid(const CoordsXY& coords); +bool MapIsEdge(const CoordsXY& coords); +bool MapCanBuildAt(const CoordsXYZ& loc); +bool MapIsLocationOwned(const CoordsXYZ& loc); +bool MapIsLocationInPark(const CoordsXY& coords); +bool MapIsLocationOwnedOrHasRights(const CoordsXY& loc); +bool MapSurfaceIsBlocked(const CoordsXY& mapCoords); +void MapRemoveAllRides(); +void MapInvalidateMapSelectionTiles(); +void MapInvalidateSelectionRect(); bool MapCheckCapacityAndReorganise(const CoordsXY& loc, size_t numElements = 1); -TileElement* tile_element_insert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type); +int16_t TileElementHeight(const CoordsXY& loc); +int16_t TileElementWaterHeight(const CoordsXY& loc); +void TileElementRemove(TileElement* tileElement); +TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, TileElementType type); template T* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc) { @@ -206,7 +206,7 @@ template T* MapGetFirstTileElementWithBaseHeightBetwee template T* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants) { - auto* element = tile_element_insert(loc, occupiedQuadrants, T::ElementType); + auto* element = TileElementInsert(loc, occupiedQuadrants, T::ElementType); return (element != nullptr) ? element->template as() : nullptr; } @@ -220,56 +220,56 @@ struct tile_element_iterator assert_struct_size(tile_element_iterator, 12); #endif -void tile_element_iterator_begin(tile_element_iterator* it); -int32_t tile_element_iterator_next(tile_element_iterator* it); -void tile_element_iterator_restart_for_tile(tile_element_iterator* it); +void TileElementIteratorBegin(tile_element_iterator* it); +int32_t TileElementIteratorNext(tile_element_iterator* it); +void TileElementIteratorRestartForTile(tile_element_iterator* it); -void map_update_tiles(); -int32_t map_get_highest_z(const CoordsXY& loc); +void MapUpdateTiles(); +int32_t MapGetHighestZ(const CoordsXY& loc); -bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved); +bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const TileElement* const elementToBeRemoved); -void map_remove_out_of_range_elements(); -void map_extend_boundary_surface_x(); -void map_extend_boundary_surface_y(); +void MapRemoveOutOfRangeElements(); +void MapExtendBoundarySurfaceX(); +void MapExtendBoundarySurfaceY(); -bool map_large_scenery_sign_set_colour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour); -void wall_remove_at(const CoordsXYRangedZ& wallPos); -void wall_remove_at_z(const CoordsXYZ& wallPos); -void wall_remove_intersecting_walls(const CoordsXYRangedZ& wallPos, Direction direction); +bool MapLargeScenerySignSetColour(const CoordsXYZD& signPos, int32_t sequence, uint8_t mainColour, uint8_t textColour); +void WallRemoveAt(const CoordsXYRangedZ& wallPos); +void WallRemoveAtZ(const CoordsXYZ& wallPos); +void WallRemoveIntersectingWalls(const CoordsXYRangedZ& wallPos, Direction direction); -void map_invalidate_tile(const CoordsXYRangedZ& tilePos); -void map_invalidate_tile_zoom1(const CoordsXYRangedZ& tilePos); -void map_invalidate_tile_zoom0(const CoordsXYRangedZ& tilePos); -void map_invalidate_tile_full(const CoordsXY& tilePos); -void map_invalidate_element(const CoordsXY& elementPos, TileElement* tileElement); -void map_invalidate_region(const CoordsXY& mins, const CoordsXY& maxs); +void MapInvalidateTile(const CoordsXYRangedZ& tilePos); +void MapInvalidateTileZoom1(const CoordsXYRangedZ& tilePos); +void MapInvalidateTileZoom0(const CoordsXYRangedZ& tilePos); +void MapInvalidateTileFull(const CoordsXY& tilePos); +void MapInvalidateElement(const CoordsXY& elementPos, TileElement* tileElement); +void MapInvalidateRegion(const CoordsXY& mins, const CoordsXY& maxs); -int32_t map_get_tile_side(const CoordsXY& mapPos); -int32_t map_get_tile_quadrant(const CoordsXY& mapPos); -int32_t map_get_corner_height(int32_t z, int32_t slope, int32_t direction); -int32_t tile_element_get_corner_height(const SurfaceElement* surfaceElement, int32_t direction); +int32_t MapGetTileSide(const CoordsXY& mapPos); +int32_t MapGetTileQuadrant(const CoordsXY& mapPos); +int32_t MapGetCornerHeight(int32_t z, int32_t slope, int32_t direction); +int32_t TileElementGetCornerHeight(const SurfaceElement* surfaceElement, int32_t direction); -void map_clear_all_elements(); +void MapClearAllElements(); -LargeSceneryElement* map_get_large_scenery_segment(const CoordsXYZD& sceneryPos, int32_t sequence); -std::optional map_large_scenery_get_origin( +LargeSceneryElement* MapGetLargeScenerySegment(const CoordsXYZD& sceneryPos, int32_t sequence); +std::optional MapLargeSceneryGetOrigin( const CoordsXYZD& sceneryPos, int32_t sequence, LargeSceneryElement** outElement); -ScreenCoordsXY translate_3d_to_2d_with_z(int32_t rotation, const CoordsXYZ& pos); +ScreenCoordsXY Translate3DTo2DWithZ(int32_t rotation, const CoordsXYZ& pos); -TrackElement* map_get_track_element_at(const CoordsXYZ& trackPos); -TileElement* map_get_track_element_at_of_type(const CoordsXYZ& trackPos, track_type_t trackType); -TileElement* map_get_track_element_at_of_type_seq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence); -TrackElement* map_get_track_element_at_of_type(const CoordsXYZD& location, track_type_t trackType); -TrackElement* map_get_track_element_at_of_type_seq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence); -TileElement* map_get_track_element_at_of_type_from_ride(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex); -TileElement* map_get_track_element_at_from_ride(const CoordsXYZ& trackPos, RideId rideIndex); -TileElement* map_get_track_element_at_with_direction_from_ride(const CoordsXYZD& trackPos, RideId rideIndex); +TrackElement* MapGetTrackElementAt(const CoordsXYZ& trackPos); +TileElement* MapGetTrackElementAtOfType(const CoordsXYZ& trackPos, track_type_t trackType); +TileElement* MapGetTrackElementAtOfTypeSeq(const CoordsXYZ& trackPos, track_type_t trackType, int32_t sequence); +TrackElement* MapGetTrackElementAtOfType(const CoordsXYZD& location, track_type_t trackType); +TrackElement* MapGetTrackElementAtOfTypeSeq(const CoordsXYZD& location, track_type_t trackType, int32_t sequence); +TileElement* MapGetTrackElementAtOfTypeFromRide(const CoordsXYZ& trackPos, track_type_t trackType, RideId rideIndex); +TileElement* MapGetTrackElementAtFromRide(const CoordsXYZ& trackPos, RideId rideIndex); +TileElement* MapGetTrackElementAtWithDirectionFromRide(const CoordsXYZD& trackPos, RideId rideIndex); -bool map_is_location_at_edge(const CoordsXY& loc); +bool MapIsLocationAtEdge(const CoordsXY& loc); -uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos); +uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos); void FixLandOwnershipTiles(std::initializer_list tiles); void FixLandOwnershipTilesWithOwnership( diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 635909c07d..56917fddda 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -48,7 +48,7 @@ static bool DoesAnimationExist(int32_t type, const CoordsXYZ& location) return false; } -void map_animation_create(int32_t type, const CoordsXYZ& loc) +void MapAnimationCreate(int32_t type, const CoordsXYZ& loc) { if (!DoesAnimationExist(type, loc)) { @@ -68,7 +68,7 @@ void map_animation_create(int32_t type, const CoordsXYZ& loc) * * rct2: 0x0068AFAD */ -void map_animation_invalidate_all() +void MapAnimationInvalidateAll() { PROFILED_FUNCTION(); @@ -91,10 +91,10 @@ void map_animation_invalidate_all() * * rct2: 0x00666670 */ -static bool map_animation_invalidate_ride_entrance(const CoordsXYZ& loc) +static bool MapAnimationInvalidateRideEntrance(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; - auto tileElement = map_get_first_element_at(loc); + auto tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -113,7 +113,7 @@ static bool map_animation_invalidate_ride_entrance(const CoordsXYZ& loc) if (stationObj != nullptr) { int32_t height = loc.z + stationObj->Height + 8; - map_invalidate_tile_zoom1({ loc, height, height + 16 }); + MapInvalidateTileZoom1({ loc, height, height + 16 }); } } return false; @@ -126,12 +126,12 @@ static bool map_animation_invalidate_ride_entrance(const CoordsXYZ& loc) * * rct2: 0x006A7BD4 */ -static bool map_animation_invalidate_queue_banner(const CoordsXYZ& loc) +static bool MapAnimationInvalidateQueueBanner(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -148,7 +148,7 @@ static bool map_animation_invalidate_queue_banner(const CoordsXYZ& loc) int32_t direction = (tileElement->AsPath()->GetQueueBannerDirection() + get_current_rotation()) & 3; if (direction == TILE_ELEMENT_DIRECTION_NORTH || direction == TILE_ELEMENT_DIRECTION_EAST) { - map_invalidate_tile_zoom1({ loc, loc.z + 16, loc.z + 30 }); + MapInvalidateTileZoom1({ loc, loc.z + 16, loc.z + 30 }); } return false; } while (!(tileElement++)->IsLastForTile()); @@ -160,11 +160,11 @@ static bool map_animation_invalidate_queue_banner(const CoordsXYZ& loc) * * rct2: 0x006E32C9 */ -static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) +static bool MapAnimationInvalidateSmallScenery(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; - auto tileElement = map_get_first_element_at(loc); + auto tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -184,7 +184,7 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_1 | SMALL_SCENERY_FLAG_FOUNTAIN_SPRAY_4 | SMALL_SCENERY_FLAG_SWAMP_GOO | SMALL_SCENERY_FLAG_HAS_FRAME_OFFSETS)) { - map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() }); + MapInvalidateTileZoom1({ loc, loc.z, tileElement->GetClearanceZ() }); return false; } @@ -212,7 +212,7 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) break; } } - map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() }); + MapInvalidateTileZoom1({ loc, loc.z, tileElement->GetClearanceZ() }); return false; } @@ -224,12 +224,12 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) * * rct2: 0x00666C63 */ -static bool map_animation_invalidate_park_entrance(const CoordsXYZ& loc) +static bool MapAnimationInvalidateParkEntrance(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -243,7 +243,7 @@ static bool map_animation_invalidate_park_entrance(const CoordsXYZ& loc) if (tileElement->AsEntrance()->GetSequenceIndex()) continue; - map_invalidate_tile_zoom1({ loc, loc.z + 32, loc.z + 64 }); + MapInvalidateTileZoom1({ loc, loc.z + 32, loc.z + 64 }); return false; } while (!(tileElement++)->IsLastForTile()); @@ -254,12 +254,12 @@ static bool map_animation_invalidate_park_entrance(const CoordsXYZ& loc) * * rct2: 0x006CE29E */ -static bool map_animation_invalidate_track_waterfall(const CoordsXYZ& loc) +static bool MapAnimationInvalidateTrackWaterfall(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -271,7 +271,7 @@ static bool map_animation_invalidate_track_waterfall(const CoordsXYZ& loc) if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Waterfall) { - map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 46 }); + MapInvalidateTileZoom1({ loc, loc.z + 14, loc.z + 46 }); return false; } } while (!(tileElement++)->IsLastForTile()); @@ -283,12 +283,12 @@ static bool map_animation_invalidate_track_waterfall(const CoordsXYZ& loc) * * rct2: 0x006CE2F3 */ -static bool map_animation_invalidate_track_rapids(const CoordsXYZ& loc) +static bool MapAnimationInvalidateTrackRapids(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -300,7 +300,7 @@ static bool map_animation_invalidate_track_rapids(const CoordsXYZ& loc) if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Rapids) { - map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 18 }); + MapInvalidateTileZoom1({ loc, loc.z + 14, loc.z + 18 }); return false; } } while (!(tileElement++)->IsLastForTile()); @@ -312,12 +312,12 @@ static bool map_animation_invalidate_track_rapids(const CoordsXYZ& loc) * * rct2: 0x006CE39D */ -static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc) +static bool MapAnimationInvalidateTrackOnRidePhoto(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -329,7 +329,7 @@ static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc) if (tileElement->AsTrack()->GetTrackType() == TrackElemType::OnRidePhoto) { - map_invalidate_tile_zoom1({ loc, loc.z, tileElement->GetClearanceZ() }); + MapInvalidateTileZoom1({ loc, loc.z, tileElement->GetClearanceZ() }); if (game_is_paused()) { return false; @@ -351,12 +351,12 @@ static bool map_animation_invalidate_track_onridephoto(const CoordsXYZ& loc) * * rct2: 0x006CE348 */ -static bool map_animation_invalidate_track_whirlpool(const CoordsXYZ& loc) +static bool MapAnimationInvalidateTrackWhirlpool(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -368,7 +368,7 @@ static bool map_animation_invalidate_track_whirlpool(const CoordsXYZ& loc) if (tileElement->AsTrack()->GetTrackType() == TrackElemType::Whirlpool) { - map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 18 }); + MapInvalidateTileZoom1({ loc, loc.z + 14, loc.z + 18 }); return false; } } while (!(tileElement++)->IsLastForTile()); @@ -380,12 +380,12 @@ static bool map_animation_invalidate_track_whirlpool(const CoordsXYZ& loc) * * rct2: 0x006CE3FA */ -static bool map_animation_invalidate_track_spinningtunnel(const CoordsXYZ& loc) +static bool MapAnimationInvalidateTrackSpinningTunnel(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -397,7 +397,7 @@ static bool map_animation_invalidate_track_spinningtunnel(const CoordsXYZ& loc) if (tileElement->AsTrack()->GetTrackType() == TrackElemType::SpinningTunnel) { - map_invalidate_tile_zoom1({ loc, loc.z + 14, loc.z + 32 }); + MapInvalidateTileZoom1({ loc, loc.z + 14, loc.z + 32 }); return false; } } while (!(tileElement++)->IsLastForTile()); @@ -409,7 +409,7 @@ static bool map_animation_invalidate_track_spinningtunnel(const CoordsXYZ& loc) * * rct2: 0x0068DF8F */ -static bool map_animation_invalidate_remove([[maybe_unused]] const CoordsXYZ& loc) +static bool MapAnimationInvalidateRemove([[maybe_unused]] const CoordsXYZ& loc) { return true; } @@ -418,12 +418,12 @@ static bool map_animation_invalidate_remove([[maybe_unused]] const CoordsXYZ& lo * * rct2: 0x006BA2BB */ -static bool map_animation_invalidate_banner(const CoordsXYZ& loc) +static bool MapAnimationInvalidateBanner(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -432,7 +432,7 @@ static bool map_animation_invalidate_banner(const CoordsXYZ& loc) continue; if (tileElement->GetType() != TileElementType::Banner) continue; - map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 }); + MapInvalidateTileZoom1({ loc, loc.z, loc.z + 16 }); return false; } while (!(tileElement++)->IsLastForTile()); @@ -443,13 +443,13 @@ static bool map_animation_invalidate_banner(const CoordsXYZ& loc) * * rct2: 0x006B94EB */ -static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc) +static bool MapAnimationInvalidateLargeScenery(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; bool wasInvalidated = false; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -462,7 +462,7 @@ static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc) auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); if (sceneryEntry != nullptr && sceneryEntry->flags & LARGE_SCENERY_FLAG_ANIMATED) { - map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 }); + MapInvalidateTileZoom1({ loc, loc.z, loc.z + 16 }); wasInvalidated = true; } } while (!(tileElement++)->IsLastForTile()); @@ -474,7 +474,7 @@ static bool map_animation_invalidate_large_scenery(const CoordsXYZ& loc) * * rct2: 0x006E5B50 */ -static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc) +static bool MapAnimationInvalidateWallDoor(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; @@ -483,7 +483,7 @@ static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc) return false; bool removeAnimation = true; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return removeAnimation; do @@ -527,7 +527,7 @@ static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc) tileElement->AsWall()->SetAnimationFrame(currentFrame); if (invalidate) { - map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 32 }); + MapInvalidateTileZoom1({ loc, loc.z, loc.z + 32 }); } } while (!(tileElement++)->IsLastForTile()); @@ -538,13 +538,13 @@ static bool map_animation_invalidate_wall_door(const CoordsXYZ& loc) * * rct2: 0x006E5EE4 */ -static bool map_animation_invalidate_wall(const CoordsXYZ& loc) +static bool MapAnimationInvalidateWall(const CoordsXYZ& loc) { TileCoordsXYZ tileLoc{ loc }; TileElement* tileElement; bool wasInvalidated = false; - tileElement = map_get_first_element_at(loc); + tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) return true; do @@ -560,7 +560,7 @@ static bool map_animation_invalidate_wall(const CoordsXYZ& loc) || (!(wallEntry->flags2 & WALL_SCENERY_2_ANIMATED) && wallEntry->scrolling_mode == SCROLLING_MODE_NONE)) continue; - map_invalidate_tile_zoom1({ loc, loc.z, loc.z + 16 }); + MapInvalidateTileZoom1({ loc, loc.z, loc.z + 16 }); wasInvalidated = true; } while (!(tileElement++)->IsLastForTile()); @@ -572,20 +572,11 @@ static bool map_animation_invalidate_wall(const CoordsXYZ& loc) * rct2: 0x009819DC */ static constexpr const map_animation_invalidate_event_handler _animatedObjectEventHandlers[MAP_ANIMATION_TYPE_COUNT] = { - map_animation_invalidate_ride_entrance, - map_animation_invalidate_queue_banner, - map_animation_invalidate_small_scenery, - map_animation_invalidate_park_entrance, - map_animation_invalidate_track_waterfall, - map_animation_invalidate_track_rapids, - map_animation_invalidate_track_onridephoto, - map_animation_invalidate_track_whirlpool, - map_animation_invalidate_track_spinningtunnel, - map_animation_invalidate_remove, - map_animation_invalidate_banner, - map_animation_invalidate_large_scenery, - map_animation_invalidate_wall_door, - map_animation_invalidate_wall, + MapAnimationInvalidateRideEntrance, MapAnimationInvalidateQueueBanner, MapAnimationInvalidateSmallScenery, + MapAnimationInvalidateParkEntrance, MapAnimationInvalidateTrackWaterfall, MapAnimationInvalidateTrackRapids, + MapAnimationInvalidateTrackOnRidePhoto, MapAnimationInvalidateTrackWhirlpool, MapAnimationInvalidateTrackSpinningTunnel, + MapAnimationInvalidateRemove, MapAnimationInvalidateBanner, MapAnimationInvalidateLargeScenery, + MapAnimationInvalidateWallDoor, MapAnimationInvalidateWall, }; /** @@ -610,20 +601,20 @@ static void ClearMapAnimations() _mapAnimations.clear(); } -void AutoCreateMapAnimations() +void MapAnimationAutoCreate() { ClearMapAnimations(); tile_element_iterator it; - tile_element_iterator_begin(&it); - while (tile_element_iterator_next(&it)) + TileElementIteratorBegin(&it); + while (TileElementIteratorNext(&it)) { auto el = it.element; auto loc = CoordsXYZ{ TileCoordsXY(it.x, it.y).ToCoordsXY(), el->GetBaseZ() }; switch (el->GetType()) { case TileElementType::Banner: - map_animation_create(MAP_ANIMATION_TYPE_BANNER, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_BANNER, loc); break; case TileElementType::Wall: { @@ -632,7 +623,7 @@ void AutoCreateMapAnimations() if (entry != nullptr && ((entry->flags2 & WALL_SCENERY_2_ANIMATED) || entry->scrolling_mode != SCROLLING_MODE_NONE)) { - map_animation_create(MAP_ANIMATION_TYPE_WALL, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_WALL, loc); } break; } @@ -642,7 +633,7 @@ void AutoCreateMapAnimations() auto* sceneryEntry = sceneryEl->GetEntry(); if (sceneryEntry != nullptr && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED)) { - map_animation_create(MAP_ANIMATION_TYPE_SMALL_SCENERY, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_SMALL_SCENERY, loc); } break; } @@ -652,7 +643,7 @@ void AutoCreateMapAnimations() auto entry = sceneryEl->GetEntry(); if (entry != nullptr && (entry->flags & LARGE_SCENERY_FLAG_ANIMATED)) { - map_animation_create(MAP_ANIMATION_TYPE_LARGE_SCENERY, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_LARGE_SCENERY, loc); } break; } @@ -661,7 +652,7 @@ void AutoCreateMapAnimations() auto path = el->AsPath(); if (path->HasQueueBanner()) { - map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_QUEUE_BANNER, loc); } break; } @@ -673,11 +664,11 @@ void AutoCreateMapAnimations() case ENTRANCE_TYPE_PARK_ENTRANCE: if (entrance->GetSequenceIndex() == 0) { - map_animation_create(MAP_ANIMATION_TYPE_PARK_ENTRANCE, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_PARK_ENTRANCE, loc); } break; case ENTRANCE_TYPE_RIDE_ENTRANCE: - map_animation_create(MAP_ANIMATION_TYPE_RIDE_ENTRANCE, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_RIDE_ENTRANCE, loc); break; } break; @@ -688,16 +679,16 @@ void AutoCreateMapAnimations() switch (track->GetTrackType()) { case TrackElemType::Waterfall: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_WATERFALL, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_WATERFALL, loc); break; case TrackElemType::Rapids: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_RAPIDS, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_RAPIDS, loc); break; case TrackElemType::Whirlpool: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_WHIRLPOOL, loc); break; case TrackElemType::SpinningTunnel: - map_animation_create(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, loc); + MapAnimationCreate(MAP_ANIMATION_TYPE_TRACK_SPINNINGTUNNEL, loc); break; } break; diff --git a/src/openrct2/world/MapAnimation.h b/src/openrct2/world/MapAnimation.h index 37613bb0d0..bb8ff9e8df 100644 --- a/src/openrct2/world/MapAnimation.h +++ b/src/openrct2/world/MapAnimation.h @@ -39,7 +39,7 @@ enum MAP_ANIMATION_TYPE_COUNT }; -void map_animation_create(int32_t type, const CoordsXYZ& loc); -void map_animation_invalidate_all(); +void MapAnimationCreate(int32_t type, const CoordsXYZ& loc); +void MapAnimationInvalidateAll(); const std::vector& GetMapAnimations(); -void AutoCreateMapAnimations(); +void MapAnimationAutoCreate(); diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 22f0b3764a..645e4ab23d 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -90,18 +90,18 @@ static constexpr const std::string_view BaseTerrain[] = { "rct2.terrain_surface.dirt", "rct2.terrain_surface.ice", }; -static void mapgen_place_trees(); -static void mapgen_set_water_level(int32_t waterLevel); -static void mapgen_smooth_height(int32_t iterations); -static void mapgen_set_height(mapgen_settings* settings); +static void MapGenPlaceTrees(); +static void MapGenSetWaterLevel(int32_t waterLevel); +static void MapGenSmoothHeight(int32_t iterations); +static void MapGenSetHeight(mapgen_settings* settings); -static float fractal_noise(int32_t x, int32_t y, float frequency, int32_t octaves, float lacunarity, float persistence); -static void mapgen_simplex(mapgen_settings* settings); +static float FractalNoise(int32_t x, int32_t y, float frequency, int32_t octaves, float lacunarity, float persistence); +static void MapGenSimplex(mapgen_settings* settings); static TileCoordsXY _heightSize; static uint8_t* _height; -static int32_t get_height(int32_t x, int32_t y) +static int32_t GetHeight(int32_t x, int32_t y) { if (x >= 0 && y >= 0 && x < _heightSize.x && y < _heightSize.y) return _height[x + y * _heightSize.x]; @@ -109,23 +109,23 @@ static int32_t get_height(int32_t x, int32_t y) return 0; } -static void set_height(int32_t x, int32_t y, int32_t height) +static void SetHeight(int32_t x, int32_t y, int32_t height) { if (x >= 0 && y >= 0 && x < _heightSize.x && y < _heightSize.y) _height[x + y * _heightSize.x] = height; } -void mapgen_generate_blank(mapgen_settings* settings) +void MapGenGenerateBlank(mapgen_settings* settings) { int32_t x, y; - map_clear_all_elements(); + MapClearAllElements(); - map_init(settings->mapSize); + MapInit(settings->mapSize); for (y = 1; y < settings->mapSize.y - 1; y++) { for (x = 1; x < settings->mapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr) { surfaceElement->SetSurfaceStyle(settings->floor); @@ -136,10 +136,10 @@ void mapgen_generate_blank(mapgen_settings* settings) } } - mapgen_set_water_level(settings->water_level); + MapGenSetWaterLevel(settings->water_level); } -void mapgen_generate(mapgen_settings* settings) +void MapGenGenerate(mapgen_settings* settings) { const auto& mapSize = settings->mapSize; auto waterLevel = settings->water_level; @@ -181,15 +181,15 @@ void mapgen_generate(mapgen_settings* settings) auto floorTextureId = objectManager.GetLoadedObjectEntryIndex(ObjectEntryDescriptor(floorTexture)); auto edgeTextureId = objectManager.GetLoadedObjectEntryIndex(ObjectEntryDescriptor(edgeTexture)); - map_clear_all_elements(); + MapClearAllElements(); // Initialise the base map - map_init(mapSize); + MapInit(mapSize); for (auto y = 1; y < mapSize.y - 1; y++) { for (auto x = 1; x < mapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr) { surfaceElement->SetSurfaceStyle(floorTextureId); @@ -205,20 +205,20 @@ void mapgen_generate(mapgen_settings* settings) _height = new uint8_t[_heightSize.y * _heightSize.x]; std::fill_n(_height, _heightSize.y * _heightSize.x, 0x00); - mapgen_simplex(settings); - mapgen_smooth_height(2 + (util_rand() % 6)); + MapGenSimplex(settings); + MapGenSmoothHeight(2 + (util_rand() % 6)); // Set the game map to the height map - mapgen_set_height(settings); + MapGenSetHeight(settings); delete[] _height; // Set the tile slopes so that there are no cliffs - while (map_smooth(1, 1, mapSize.x - 1, mapSize.y - 1)) + while (MapSmooth(1, 1, mapSize.x - 1, mapSize.y - 1)) { } // Add the water - mapgen_set_water_level(waterLevel); + MapGenSetWaterLevel(waterLevel); // Add sandy beaches std::string_view beachTexture = floorTexture; @@ -239,7 +239,7 @@ void mapgen_generate(mapgen_settings* settings) { for (auto x = 1; x < mapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr && surfaceElement->base_height < waterLevel + 6) surfaceElement->SetSurfaceStyle(beachTextureId); @@ -248,18 +248,18 @@ void mapgen_generate(mapgen_settings* settings) // Place the trees if (settings->trees != 0) - mapgen_place_trees(); + MapGenPlaceTrees(); } -static void mapgen_place_tree(ObjectEntryIndex type, const CoordsXY& loc) +static void MapGenPlaceTree(ObjectEntryIndex type, const CoordsXY& loc) { - auto* sceneryEntry = get_small_scenery_entry(type); + auto* sceneryEntry = GetSmallSceneryEntry(type); if (sceneryEntry == nullptr) { return; } - int32_t surfaceZ = tile_element_height(loc.ToTileCentre()); + int32_t surfaceZ = TileElementHeight(loc.ToTileCentre()); auto* sceneryElement = TileElementInsert({ loc, surfaceZ }, 0b1111); Guard::Assert(sceneryElement != nullptr); @@ -303,7 +303,7 @@ template static bool TryFindTreeInList(std::string_view id, const T& /** * Randomly places a selection of preset trees on the map. Picks the right tree for the terrain it is placing it on. */ -static void mapgen_place_trees() +static void MapGenPlaceTrees() { std::vector grassTreeIds; std::vector desertTreeIds; @@ -311,7 +311,7 @@ static void mapgen_place_trees() for (int32_t i = 0; i < object_entry_group_counts[EnumValue(ObjectType::SmallScenery)]; i++) { - auto* sceneryEntry = get_small_scenery_entry(i); + auto* sceneryEntry = GetSmallSceneryEntry(i); auto entry = object_entry_get_object(ObjectType::SmallScenery, i); if (sceneryEntry == nullptr) @@ -341,7 +341,7 @@ static void mapgen_place_trees() pos.x = x * COORDS_XY_STEP; pos.y = y * COORDS_XY_STEP; - auto* surfaceElement = map_get_surface_element_at(pos); + auto* surfaceElement = MapGetSurfaceElementAt(pos); if (surfaceElement == nullptr) continue; @@ -368,7 +368,7 @@ static void mapgen_place_trees() neighbourPos.x = std::clamp(neighbourPos.x, COORDS_XY_STEP, COORDS_XY_STEP * (gMapSize.x - 1)); neighbourPos.y = std::clamp(neighbourPos.y, COORDS_XY_STEP, COORDS_XY_STEP * (gMapSize.y - 1)); - const auto neighboutSurface = map_get_surface_element_at(neighbourPos); + const auto neighboutSurface = MapGetSurfaceElementAt(neighbourPos); if (neighboutSurface->GetWaterHeight() > 0) { float distance = std::sqrt(offsetX * offsetX + offsetY * offsetY); @@ -384,7 +384,7 @@ static void mapgen_place_trees() continue; // Use fractal noise to group tiles that are likely to spawn trees together - float noiseValue = fractal_noise(x, y, 0.025f, 2, 2.0f, 0.65f); + float noiseValue = FractalNoise(x, y, 0.025f, 2, 2.0f, 0.65f); // Reduces the range to rarely stray further than 0.5 from the mean. float noiseOffset = util_rand_normal_distributed() * 0.25f; if (noiseValue + oasisScore < noiseOffset) @@ -404,7 +404,7 @@ static void mapgen_place_trees() } if (treeObjectEntryIndex != OBJECT_ENTRY_INDEX_NULL) - mapgen_place_tree(treeObjectEntryIndex, pos); + MapGenPlaceTree(treeObjectEntryIndex, pos); } } } @@ -412,13 +412,13 @@ static void mapgen_place_trees() /** * Sets each tile's water level to the specified water level if underneath that water level. */ -static void mapgen_set_water_level(int32_t waterLevel) +static void MapGenSetWaterLevel(int32_t waterLevel) { for (int32_t y = 1; y < gMapSize.y - 1; y++) { for (int32_t x = 1; x < gMapSize.x - 1; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement != nullptr && surfaceElement->base_height < waterLevel) surfaceElement->SetWaterHeight(waterLevel * COORDS_Z_STEP); } @@ -428,7 +428,7 @@ static void mapgen_set_water_level(int32_t waterLevel) /** * Smooths the height map. */ -static void mapgen_smooth_height(int32_t iterations) +static void MapGenSmoothHeight(int32_t iterations) { int32_t i, x, y, xx, yy, avg; int32_t arraySize = _heightSize.y * _heightSize.x * sizeof(uint8_t); @@ -450,7 +450,7 @@ static void mapgen_smooth_height(int32_t iterations) } } avg /= 9; - set_height(x, y, avg); + SetHeight(x, y, avg); } } } @@ -461,7 +461,7 @@ static void mapgen_smooth_height(int32_t iterations) /** * Sets the height of the actual game map tiles to the height map. */ -static void mapgen_set_height(mapgen_settings* settings) +static void MapGenSetHeight(mapgen_settings* settings) { int32_t x, y, heightX, heightY; @@ -472,14 +472,14 @@ static void mapgen_set_height(mapgen_settings* settings) heightX = x * 2; heightY = y * 2; - uint8_t q00 = get_height(heightX + 0, heightY + 0); - uint8_t q01 = get_height(heightX + 0, heightY + 1); - uint8_t q10 = get_height(heightX + 1, heightY + 0); - uint8_t q11 = get_height(heightX + 1, heightY + 1); + uint8_t q00 = GetHeight(heightX + 0, heightY + 0); + uint8_t q01 = GetHeight(heightX + 0, heightY + 1); + uint8_t q10 = GetHeight(heightX + 1, heightY + 0); + uint8_t q11 = GetHeight(heightX + 1, heightY + 1); uint8_t baseHeight = (q00 + q01 + q10 + q11) / 4; - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; surfaceElement->base_height = std::max(2, baseHeight * 2); @@ -515,13 +515,13 @@ static void mapgen_set_height(mapgen_settings* settings) * - https://code.google.com/p/fractalterraingeneration/wiki/Fractional_Brownian_Motion */ -static float generate(float x, float y); -static int32_t fast_floor(float x); -static float grad(int32_t hash, float x, float y); +static float Generate(float x, float y); +static int32_t FastFloor(float x); +static float Grad(int32_t hash, float x, float y); static uint8_t perm[512]; -static void noise_rand() +static void NoiseRand() { for (auto& i : perm) { @@ -529,20 +529,20 @@ static void noise_rand() } } -static float fractal_noise(int32_t x, int32_t y, float frequency, int32_t octaves, float lacunarity, float persistence) +static float FractalNoise(int32_t x, int32_t y, float frequency, int32_t octaves, float lacunarity, float persistence) { float total = 0.0f; float amplitude = persistence; for (int32_t i = 0; i < octaves; i++) { - total += generate(x * frequency, y * frequency) * amplitude; + total += Generate(x * frequency, y * frequency) * amplitude; frequency *= lacunarity; amplitude *= persistence; } return total; } -static float generate(float x, float y) +static float Generate(float x, float y) { const float F2 = 0.366025403f; // F2 = 0.5*(sqrt(3.0)-1.0) const float G2 = 0.211324865f; // G2 = (3.0-sqrt(3.0))/6.0 @@ -553,8 +553,8 @@ static float generate(float x, float y) float s = (x + y) * F2; // Hairy factor for 2D float xs = x + s; float ys = y + s; - int32_t i = fast_floor(xs); - int32_t j = fast_floor(ys); + int32_t i = FastFloor(xs); + int32_t j = FastFloor(ys); float t = static_cast(i + j) * G2; float X0 = i - t; // Unskew the cell origin back to (x,y) space @@ -598,7 +598,7 @@ static float generate(float x, float y) else { t0 *= t0; - n0 = t0 * t0 * grad(perm[ii + perm[jj]], x0, y0); + n0 = t0 * t0 * Grad(perm[ii + perm[jj]], x0, y0); } float t1 = 0.5f - x1 * x1 - y1 * y1; @@ -609,7 +609,7 @@ static float generate(float x, float y) else { t1 *= t1; - n1 = t1 * t1 * grad(perm[ii + i1 + perm[jj + j1]], x1, y1); + n1 = t1 * t1 * Grad(perm[ii + i1 + perm[jj + j1]], x1, y1); } float t2 = 0.5f - x2 * x2 - y2 * y2; @@ -620,7 +620,7 @@ static float generate(float x, float y) else { t2 *= t2; - n2 = t2 * t2 * grad(perm[ii + 1 + perm[jj + 1]], x2, y2); + n2 = t2 * t2 * Grad(perm[ii + 1 + perm[jj + 1]], x2, y2); } // Add contributions from each corner to get the final noise value. @@ -628,12 +628,12 @@ static float generate(float x, float y) return 40.0f * (n0 + n1 + n2); // TODO: The scale factor is preliminary! } -static int32_t fast_floor(float x) +static int32_t FastFloor(float x) { return (x > 0) ? (static_cast(x)) : ((static_cast(x)) - 1); } -static float grad(int32_t hash, float x, float y) +static float Grad(int32_t hash, float x, float y) { int32_t h = hash & 7; // Convert low 3 bits of hash code float u = h < 4 ? x : y; // into 8 simple gradient directions, @@ -641,7 +641,7 @@ static float grad(int32_t hash, float x, float y) return ((h & 1) != 0 ? -u : u) + ((h & 2) != 0 ? -2.0f * v : 2.0f * v); } -static void mapgen_simplex(mapgen_settings* settings) +static void MapGenSimplex(mapgen_settings* settings) { int32_t x, y; @@ -651,15 +651,15 @@ static void mapgen_simplex(mapgen_settings* settings) int32_t low = settings->simplex_low; int32_t high = settings->simplex_high; - noise_rand(); + NoiseRand(); for (y = 0; y < _heightSize.y; y++) { for (x = 0; x < _heightSize.x; x++) { - float noiseValue = std::clamp(fractal_noise(x, y, freq, octaves, 2.0f, 0.65f), -1.0f, 1.0f); + float noiseValue = std::clamp(FractalNoise(x, y, freq, octaves, 2.0f, 0.65f), -1.0f, 1.0f); float normalisedNoiseValue = (noiseValue + 1.0f) / 2.0f; - set_height(x, y, low + static_cast(normalisedNoiseValue * high)); + SetHeight(x, y, low + static_cast(normalisedNoiseValue * high)); } } } @@ -677,7 +677,7 @@ static TileCoordsXY MapgenHeightmapCoordToTileCoordsXY(uint32_t x, uint32_t y) return TileCoordsXY(static_cast(y + 1), static_cast(x + 1)); } -bool mapgen_load_heightmap(const utf8* path) +bool MapGenLoadHeightmap(const utf8* path) { auto format = Imaging::GetImageFormatFromPath(path); if (format == IMAGE_FORMAT::PNG) @@ -693,7 +693,7 @@ bool mapgen_load_heightmap(const utf8* path) auto height = std::min(image.Height, MAXIMUM_MAP_SIZE_PRACTICAL); if (width != image.Width || height != image.Height) { - context_show_error(STR_HEIGHT_MAP_ERROR, STR_ERROR_HEIHGT_MAP_TOO_BIG, {}); + ContextShowError(STR_HEIGHT_MAP_ERROR, STR_ERROR_HEIHGT_MAP_TOO_BIG, {}); } // Allocate memory for the height map values, one byte pixel @@ -722,10 +722,10 @@ bool mapgen_load_heightmap(const utf8* path) switch (format) { case IMAGE_FORMAT::BITMAP: - context_show_error(STR_HEIGHT_MAP_ERROR, STR_ERROR_READING_BITMAP, {}); + ContextShowError(STR_HEIGHT_MAP_ERROR, STR_ERROR_READING_BITMAP, {}); break; case IMAGE_FORMAT::PNG_32: - context_show_error(STR_HEIGHT_MAP_ERROR, STR_ERROR_READING_PNG, {}); + ContextShowError(STR_HEIGHT_MAP_ERROR, STR_ERROR_READING_PNG, {}); break; default: log_error("Unable to load height map image: %s", e.what()); @@ -738,7 +738,7 @@ bool mapgen_load_heightmap(const utf8* path) /** * Frees the memory used to store the selected height map */ -void mapgen_unload_heightmap() +void MapGenUnloadHeightmap() { _heightMapData.mono_bitmap.clear(); _heightMapData.width = 0; @@ -748,7 +748,7 @@ void mapgen_unload_heightmap() /** * Applies box blur to the surface N times */ -static void mapgen_smooth_heightmap(std::vector& src, int32_t strength) +static void MapGenSmoothHeightmap(std::vector& src, int32_t strength) { // Create buffer to store one channel std::vector dest(src.size()); @@ -791,7 +791,7 @@ static void mapgen_smooth_heightmap(std::vector& src, int32_t strength) } } -void mapgen_generate_from_heightmap(mapgen_settings* settings) +void MapGenGenerateFromHeightmap(mapgen_settings* settings) { openrct2_assert(!_heightMapData.mono_bitmap.empty(), "No height map loaded"); openrct2_assert(settings->simplex_high != settings->simplex_low, "Low and high setting cannot be the same"); @@ -802,11 +802,11 @@ void mapgen_generate_from_heightmap(mapgen_settings* settings) // Get technical map size, +2 for the black tiles around the map auto maxWidth = static_cast(_heightMapData.width + 2); auto maxHeight = static_cast(_heightMapData.height + 2); - map_init({ maxHeight, maxWidth }); + MapInit({ maxHeight, maxWidth }); if (settings->smooth_height_map) { - mapgen_smooth_heightmap(dest, settings->smooth_strength); + MapGenSmoothHeightmap(dest, settings->smooth_strength); } uint8_t maxValue = 255; @@ -829,7 +829,7 @@ void mapgen_generate_from_heightmap(mapgen_settings* settings) if (minValue == maxValue) { - context_show_error(STR_HEIGHT_MAP_ERROR, STR_ERROR_CANNOT_NORMALIZE, {}); + ContextShowError(STR_HEIGHT_MAP_ERROR, STR_ERROR_CANNOT_NORMALIZE, {}); return; } } @@ -846,7 +846,7 @@ void mapgen_generate_from_heightmap(mapgen_settings* settings) { // The x and y axis are flipped in the world, so this uses y for x and x for y. auto tileCoords = MapgenHeightmapCoordToTileCoordsXY(x, y); - auto* const surfaceElement = map_get_surface_element_at(tileCoords.ToCoordsXY()); + auto* const surfaceElement = MapGetSurfaceElementAt(tileCoords.ToCoordsXY()); if (surfaceElement == nullptr) continue; @@ -880,7 +880,7 @@ void mapgen_generate_from_heightmap(mapgen_settings* settings) for (uint32_t x = 0; x < _heightMapData.width; x++) { auto tileCoords = MapgenHeightmapCoordToTileCoordsXY(x, y); - numTilesChanged += tile_smooth(tileCoords); + numTilesChanged += TileSmooth(tileCoords); } } diff --git a/src/openrct2/world/MapGen.h b/src/openrct2/world/MapGen.h index d202a68ef2..63854df50d 100644 --- a/src/openrct2/world/MapGen.h +++ b/src/openrct2/world/MapGen.h @@ -38,8 +38,8 @@ struct mapgen_settings bool normalize_height; }; -void mapgen_generate_blank(mapgen_settings* settings); -void mapgen_generate(mapgen_settings* settings); -bool mapgen_load_heightmap(const utf8* path); -void mapgen_unload_heightmap(); -void mapgen_generate_from_heightmap(mapgen_settings* settings); +void MapGenGenerateBlank(mapgen_settings* settings); +void MapGenGenerate(mapgen_settings* settings); +bool MapGenLoadHeightmap(const utf8* path); +void MapGenUnloadHeightmap(); +void MapGenGenerateFromHeightmap(mapgen_settings* settings); diff --git a/src/openrct2/world/MapHelpers.cpp b/src/openrct2/world/MapHelpers.cpp index 112a87ae7e..b35d308f2f 100644 --- a/src/openrct2/world/MapHelpers.cpp +++ b/src/openrct2/world/MapHelpers.cpp @@ -14,34 +14,34 @@ #include -static uint8_t getBaseHeightOrZero(int32_t x, int32_t y) +static uint8_t GetBaseHeightOrZero(int32_t x, int32_t y) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); return surfaceElement != nullptr ? surfaceElement->base_height : 0; } /** * Not perfect, this still leaves some particular tiles unsmoothed. */ -int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) +int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) { - int32_t i, x, y, count, doubleCorner, raisedLand = 0; + int32_t x, y, count, doubleCorner, raisedLand = 0; uint8_t highest, cornerHeights[4]; for (y = t; y < b; y++) { for (x = l; x < r; x++) { - auto surfaceElement = map_get_surface_element_at(TileCoordsXY{ x, y }.ToCoordsXY()); + auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; surfaceElement->SetSlope(TILE_ELEMENT_SLOPE_FLAT); // Raise to edge height - 2 highest = surfaceElement->base_height; - highest = std::max(highest, getBaseHeightOrZero(x - 1, y + 0)); - highest = std::max(highest, getBaseHeightOrZero(x + 1, y + 0)); - highest = std::max(highest, getBaseHeightOrZero(x + 0, y - 1)); - highest = std::max(highest, getBaseHeightOrZero(x + 0, y + 1)); + highest = std::max(highest, GetBaseHeightOrZero(x - 1, y + 0)); + highest = std::max(highest, GetBaseHeightOrZero(x + 1, y + 0)); + highest = std::max(highest, GetBaseHeightOrZero(x + 0, y - 1)); + highest = std::max(highest, GetBaseHeightOrZero(x + 0, y + 1)); if (surfaceElement->base_height < highest - 2) { raisedLand = 1; @@ -50,19 +50,19 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) // Check corners doubleCorner = -1; - cornerHeights[0] = getBaseHeightOrZero(x - 1, y - 1); - cornerHeights[1] = getBaseHeightOrZero(x + 1, y - 1); - cornerHeights[2] = getBaseHeightOrZero(x + 1, y + 1); - cornerHeights[3] = getBaseHeightOrZero(x - 1, y + 1); + cornerHeights[0] = GetBaseHeightOrZero(x - 1, y - 1); + cornerHeights[1] = GetBaseHeightOrZero(x + 1, y - 1); + cornerHeights[2] = GetBaseHeightOrZero(x + 1, y + 1); + cornerHeights[3] = GetBaseHeightOrZero(x - 1, y + 1); highest = surfaceElement->base_height; - for (i = 0; i < 4; i++) + for (std::size_t i = 0; i < std::size(cornerHeights); i++) highest = std::max(highest, cornerHeights[i]); if (highest >= surfaceElement->base_height + 4) { count = 0; int32_t canCompensate = 1; - for (i = 0; i < 4; i++) + for (std::size_t i = 0; i < std::size(cornerHeights); i++) if (cornerHeights[i] == highest) { count++; @@ -75,16 +75,16 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) { default: case 0: - highestOnLowestSide = std::max(getBaseHeightOrZero(x + 1, y), getBaseHeightOrZero(x, y + 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x + 1, y), GetBaseHeightOrZero(x, y + 1)); break; case 1: - highestOnLowestSide = std::max(getBaseHeightOrZero(x - 1, y), getBaseHeightOrZero(x, y + 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x - 1, y), GetBaseHeightOrZero(x, y + 1)); break; case 2: - highestOnLowestSide = std::max(getBaseHeightOrZero(x - 1, y), getBaseHeightOrZero(x, y - 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x - 1, y), GetBaseHeightOrZero(x, y - 1)); break; case 3: - highestOnLowestSide = std::max(getBaseHeightOrZero(x + 1, y), getBaseHeightOrZero(x, y - 1)); + highestOnLowestSide = std::max(GetBaseHeightOrZero(x + 1, y), GetBaseHeightOrZero(x, y - 1)); break; } @@ -146,36 +146,36 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) { uint8_t slope = surfaceElement->GetSlope(); // Corners - auto surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 1, y + 1 }.ToCoordsXY()); + auto surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y + 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_N_CORNER_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x - 1, y + 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y + 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_W_CORNER_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 1, y - 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y - 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_E_CORNER_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x - 1, y - 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y - 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_S_CORNER_UP; // Sides - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 1, y + 0 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y + 0 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_NE_SIDE_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x - 1, y + 0 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y + 0 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_SW_SIDE_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 0, y - 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 0, y - 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_SE_SIDE_UP; - surfaceElement2 = map_get_surface_element_at(TileCoordsXY{ x + 0, y + 1 }.ToCoordsXY()); + surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 0, y + 1 }.ToCoordsXY()); if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) slope |= TILE_ELEMENT_SLOPE_NW_SIDE_UP; @@ -198,9 +198,9 @@ int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b) * This does not change the base height, unless all corners have been raised. * @returns 0 if no edits were made, 1 otherwise */ -int32_t tile_smooth(const TileCoordsXY& tileCoords) +int32_t TileSmooth(const TileCoordsXY& tileCoords) { - auto* const surfaceElement = map_get_surface_element_at(tileCoords.ToCoordsXY()); + auto* const surfaceElement = MapGetSurfaceElementAt(tileCoords.ToCoordsXY()); if (surfaceElement == nullptr) return 0; @@ -241,7 +241,7 @@ int32_t tile_smooth(const TileCoordsXY& tileCoords) continue; // Get neighbour height. If the element is not valid (outside of map) assume the same height - auto* neighbourSurfaceElement = map_get_surface_element_at( + auto* neighbourSurfaceElement = MapGetSurfaceElementAt( (tileCoords + TileCoordsXY{ x_offset, y_offset }).ToCoordsXY()); neighbourHeightOffset.baseheight[index] = neighbourSurfaceElement != nullptr ? neighbourSurfaceElement->base_height : surfaceElement->base_height; diff --git a/src/openrct2/world/MapHelpers.h b/src/openrct2/world/MapHelpers.h index c770fdc4f3..dc0fd53a14 100644 --- a/src/openrct2/world/MapHelpers.h +++ b/src/openrct2/world/MapHelpers.h @@ -20,5 +20,5 @@ enum SLOPE_E_THRESHOLD_FLAGS = (1 << 3) }; -int32_t map_smooth(int32_t l, int32_t t, int32_t r, int32_t b); -int32_t tile_smooth(const TileCoordsXY& tileCoords); +int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b); +int32_t TileSmooth(const TileCoordsXY& tileCoords); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index bb916060cd..d497728742 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -82,7 +82,7 @@ int32_t _guestGenerationProbability; /** * Choose a random peep spawn and iterates through until defined spawn is found. */ -static PeepSpawn* get_random_peep_spawn() +static PeepSpawn* GetRandomPeepSpawn() { if (!gPeepSpawns.empty()) { @@ -92,7 +92,7 @@ static PeepSpawn* get_random_peep_spawn() return nullptr; } -void park_set_open(bool open) +void ParkSetOpen(bool open) { auto parkSetParameter = ParkSetParameterAction(open ? ParkParameter::Open : ParkParameter::Close); GameActions::Execute(&parkSetParameter); @@ -102,12 +102,12 @@ void park_set_open(bool open) * * rct2: 0x00664D05 */ -void update_park_fences(const CoordsXY& coords) +void ParkUpdateFences(const CoordsXY& coords) { - if (map_is_edge(coords)) + if (MapIsEdge(coords)) return; - auto surfaceElement = map_get_surface_element_at(coords); + auto surfaceElement = MapGetSurfaceElementAt(coords); if (surfaceElement == nullptr) return; @@ -116,7 +116,7 @@ void update_park_fences(const CoordsXY& coords) { bool fenceRequired = true; - TileElement* tileElement = map_get_first_element_at(coords); + TileElement* tileElement = MapGetFirstElementAt(coords); if (tileElement == nullptr) return; // If an entrance element do not place flags around surface @@ -137,22 +137,22 @@ void update_park_fences(const CoordsXY& coords) if (fenceRequired) { - if (map_is_location_in_park({ coords.x - COORDS_XY_STEP, coords.y })) + if (MapIsLocationInPark({ coords.x - COORDS_XY_STEP, coords.y })) { newFences |= 0x8; } - if (map_is_location_in_park({ coords.x, coords.y - COORDS_XY_STEP })) + if (MapIsLocationInPark({ coords.x, coords.y - COORDS_XY_STEP })) { newFences |= 0x4; } - if (map_is_location_in_park({ coords.x + COORDS_XY_STEP, coords.y })) + if (MapIsLocationInPark({ coords.x + COORDS_XY_STEP, coords.y })) { newFences |= 0x2; } - if (map_is_location_in_park({ coords.x, coords.y + COORDS_XY_STEP })) + if (MapIsLocationInPark({ coords.x, coords.y + COORDS_XY_STEP })) { newFences |= 0x1; } @@ -163,48 +163,48 @@ void update_park_fences(const CoordsXY& coords) { int32_t baseZ = surfaceElement->GetBaseZ(); int32_t clearZ = baseZ + 16; - map_invalidate_tile({ coords, baseZ, clearZ }); + MapInvalidateTile({ coords, baseZ, clearZ }); surfaceElement->SetParkFences(newFences); } } -void update_park_fences_around_tile(const CoordsXY& coords) +void ParkUpdateFencesAroundTile(const CoordsXY& coords) { - update_park_fences(coords); - update_park_fences({ coords.x + COORDS_XY_STEP, coords.y }); - update_park_fences({ coords.x - COORDS_XY_STEP, coords.y }); - update_park_fences({ coords.x, coords.y + COORDS_XY_STEP }); - update_park_fences({ coords.x, coords.y - COORDS_XY_STEP }); + ParkUpdateFences(coords); + ParkUpdateFences({ coords.x + COORDS_XY_STEP, coords.y }); + ParkUpdateFences({ coords.x - COORDS_XY_STEP, coords.y }); + ParkUpdateFences({ coords.x, coords.y + COORDS_XY_STEP }); + ParkUpdateFences({ coords.x, coords.y - COORDS_XY_STEP }); } -void set_forced_park_rating(int32_t rating) +void ParkSetForcedRating(int32_t rating) { _forcedParkRating = rating; auto& park = GetContext()->GetGameState()->GetPark(); gParkRating = park.CalculateParkRating(); auto intent = Intent(INTENT_ACTION_UPDATE_PARK_RATING); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } -int32_t get_forced_park_rating() +int32_t ParkGetForcedRating() { return _forcedParkRating; } -money16 park_get_entrance_fee() +money16 ParkGetEntranceFee() { if (gParkFlags & PARK_FLAGS_NO_MONEY) { return 0; } - if (!park_entry_price_unlocked()) + if (!ParkEntranceFeeUnlocked()) { return 0; } return gParkEntranceFee; } -bool park_ride_prices_unlocked() +bool ParkRidePricesUnlocked() { if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) { @@ -217,7 +217,7 @@ bool park_ride_prices_unlocked() return false; } -bool park_entry_price_unlocked() +bool ParkEntranceFeeUnlocked() { if (gParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) { @@ -278,7 +278,7 @@ void Park::Initialise() gParkEntranceFee = 10.00_GBP; gPeepSpawns.clear(); - reset_park_entrance(); + ParkEntranceReset(); gResearchPriorities = EnumsToFlags( ResearchCategory::Transport, ResearchCategory::Gentle, ResearchCategory::Rollercoaster, ResearchCategory::Thrill, @@ -325,7 +325,7 @@ void Park::Update(const Date& date) window_invalidate_by_class(WindowClass::Finances); auto intent = Intent(INTENT_ACTION_UPDATE_PARK_RATING); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); } // Every ~102 seconds @@ -342,7 +342,7 @@ uint32_t Park::CalculateParkSize() const { uint32_t tiles = 0; tile_element_iterator it; - tile_element_iterator_begin(&it); + TileElementIteratorBegin(&it); do { if (it.element->GetType() == TileElementType::Surface) @@ -352,7 +352,7 @@ uint32_t Park::CalculateParkSize() const tiles++; } } - } while (tile_element_iterator_next(&it)); + } while (TileElementIteratorNext(&it)); if (tiles != gParkSize) { @@ -519,7 +519,7 @@ money64 Park::CalculateCompanyValue() const money16 Park::CalculateTotalRideValueForMoney() const { money16 totalRideValue = 0; - bool ridePricesUnlocked = park_ride_prices_unlocked() && !(gParkFlags & PARK_FLAGS_NO_MONEY); + bool ridePricesUnlocked = ParkRidePricesUnlocked() && !(gParkFlags & PARK_FLAGS_NO_MONEY); for (auto& ride : GetRideManager()) { if (ride.status != RideStatus::Open) @@ -616,7 +616,7 @@ uint32_t Park::CalculateGuestGenerationProbability() const } // Penalty for overpriced entrance fee relative to total ride value - money16 entranceFee = park_get_entrance_fee(); + money16 entranceFee = ParkGetEntranceFee(); if (entranceFee > gTotalRideValueForMoney) { probability /= 4; @@ -704,10 +704,10 @@ Guest* Park::GenerateGuestFromCampaign(int32_t campaign) Guest* Park::GenerateGuest() { Guest* peep = nullptr; - const auto spawn = get_random_peep_spawn(); + const auto spawn = GetRandomPeepSpawn(); if (spawn != nullptr) { - auto direction = direction_reverse(spawn->direction); + auto direction = DirectionReverse(spawn->direction); peep = Guest::Generate({ spawn->x, spawn->y, spawn->z }); if (peep != nullptr) { @@ -773,17 +773,17 @@ void Park::UpdateHistories() // Invalidate relevant windows auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); - context_broadcast_intent(&intent); + ContextBroadcastIntent(&intent); window_invalidate_by_class(WindowClass::ParkInformation); window_invalidate_by_class(WindowClass::Finances); } -int32_t park_is_open() +int32_t ParkIsOpen() { return GetContext()->GetGameState()->GetPark().IsOpen(); } -uint32_t park_calculate_size() +uint32_t ParkCalculateSize() { auto tiles = GetContext()->GetGameState()->GetPark().CalculateParkSize(); if (tiles != gParkSize) @@ -794,7 +794,7 @@ uint32_t park_calculate_size() return tiles; } -uint8_t calculate_guest_initial_happiness(uint8_t percentage) +uint8_t CalculateGuestInitialHappiness(uint8_t percentage) { return Park::CalculateGuestInitialHappiness(percentage); } diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index e2130c9bd2..b1cf23dd24 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -109,20 +109,20 @@ extern uint32_t gGuestsInParkHistory[32]; extern int32_t _guestGenerationProbability; extern uint32_t _suggestedGuestMaximum; -void set_forced_park_rating(int32_t rating); -int32_t get_forced_park_rating(); +void ParkSetForcedRating(int32_t rating); +int32_t ParkGetForcedRating(); -int32_t park_is_open(); -uint32_t park_calculate_size(); +int32_t ParkIsOpen(); +uint32_t ParkCalculateSize(); -void update_park_fences(const CoordsXY& coords); -void update_park_fences_around_tile(const CoordsXY& coords); +void ParkUpdateFences(const CoordsXY& coords); +void ParkUpdateFencesAroundTile(const CoordsXY& coords); -uint8_t calculate_guest_initial_happiness(uint8_t percentage); +uint8_t CalculateGuestInitialHappiness(uint8_t percentage); -void park_set_open(bool open); -int32_t park_entrance_get_index(const CoordsXYZ& entrancePos); -money16 park_get_entrance_fee(); +void ParkSetOpen(bool open); +int32_t ParkEntranceGetIndex(const CoordsXYZ& entrancePos); +money16 ParkGetEntranceFee(); -bool park_ride_prices_unlocked(); -bool park_entry_price_unlocked(); +bool ParkRidePricesUnlocked(); +bool ParkEntranceFeeUnlocked(); diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 7fa8756dcc..6af904f3b7 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -120,11 +120,11 @@ int32_t LargeSceneryText::MeasureHeight(std::string_view text) const return result; } -void scenery_update_tile(const CoordsXY& sceneryPos) +void SceneryUpdateTile(const CoordsXY& sceneryPos) { TileElement* tileElement; - tileElement = map_get_first_element_at(sceneryPos); + tileElement = MapGetFirstElementAt(sceneryPos); if (tileElement == nullptr) return; do @@ -202,7 +202,7 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos) case TileElementType::LargeScenery: case TileElementType::Entrance: case TileElementType::Path: - map_invalidate_tile_zoom1({ sceneryPos, tileElementAbove->GetBaseZ(), tileElementAbove->GetClearanceZ() }); + MapInvalidateTileZoom1({ sceneryPos, tileElementAbove->GetBaseZ(), tileElementAbove->GetClearanceZ() }); IncreaseAge(sceneryPos); return; case TileElementType::SmallScenery: @@ -220,14 +220,14 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos) // Reset age / water plant SetAge(0); - map_invalidate_tile_zoom1({ sceneryPos, GetBaseZ(), GetClearanceZ() }); + MapInvalidateTileZoom1({ sceneryPos, GetBaseZ(), GetClearanceZ() }); } /** * * rct2: 0x006E2712 */ -void scenery_remove_ghost_tool_placement() +void SceneryRemoveGhostToolPlacement() { if (gSceneryGhostType & SCENERY_GHOST_FLAG_0) { @@ -243,7 +243,7 @@ void scenery_remove_ghost_tool_placement() if (gSceneryGhostType & SCENERY_GHOST_FLAG_1) { gSceneryGhostType &= ~SCENERY_GHOST_FLAG_1; - TileElement* tileElement = map_get_first_element_at(gSceneryGhostPosition); + TileElement* tileElement = MapGetFirstElementAt(gSceneryGhostPosition); do { @@ -295,7 +295,7 @@ void scenery_remove_ghost_tool_placement() } } -WallSceneryEntry* get_wall_entry(ObjectEntryIndex entryIndex) +WallSceneryEntry* GetWallEntry(ObjectEntryIndex entryIndex) { WallSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -307,7 +307,7 @@ WallSceneryEntry* get_wall_entry(ObjectEntryIndex entryIndex) return result; } -BannerSceneryEntry* get_banner_entry(ObjectEntryIndex entryIndex) +BannerSceneryEntry* GetBannerEntry(ObjectEntryIndex entryIndex) { BannerSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -319,7 +319,7 @@ BannerSceneryEntry* get_banner_entry(ObjectEntryIndex entryIndex) return result; } -PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex) +PathBitEntry* GetFootpathItemEntry(ObjectEntryIndex entryIndex) { PathBitEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -331,7 +331,7 @@ PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex) return result; } -rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex) +rct_scenery_group_entry* GetSceneryGroupEntry(ObjectEntryIndex entryIndex) { rct_scenery_group_entry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); @@ -343,7 +343,7 @@ rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex) return result; } -int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry) +int32_t WallEntryGetDoorSound(const WallSceneryEntry* wallEntry) { return (wallEntry->flags2 & WALL_SCENERY_2_DOOR_SOUND_MASK) >> WALL_SCENERY_2_DOOR_SOUND_SHIFT; } @@ -399,15 +399,15 @@ static SceneryEntryBase* GetSceneryEntry(const ScenerySelection& item) switch (item.SceneryType) { case SCENERY_TYPE_SMALL: - return get_small_scenery_entry(item.EntryIndex); + return GetSmallSceneryEntry(item.EntryIndex); case SCENERY_TYPE_PATH_ITEM: - return get_footpath_item_entry(item.EntryIndex); + return GetFootpathItemEntry(item.EntryIndex); case SCENERY_TYPE_WALL: - return get_wall_entry(item.EntryIndex); + return GetWallEntry(item.EntryIndex); case SCENERY_TYPE_LARGE: - return get_large_scenery_entry(item.EntryIndex); + return GetLargeSceneryEntry(item.EntryIndex); case SCENERY_TYPE_BANNER: - return get_banner_entry(item.EntryIndex); + return GetBannerEntry(item.EntryIndex); default: return nullptr; } @@ -434,7 +434,7 @@ static std::vector GetAllMiscScenery() std::vector nonMiscScenery; for (ObjectEntryIndex i = 0; i < MAX_SCENERY_GROUP_OBJECTS; i++) { - const auto* sgEntry = get_scenery_group_entry(i); + const auto* sgEntry = GetSceneryGroupEntry(i); if (sgEntry != nullptr) { nonMiscScenery.insert(nonMiscScenery.end(), sgEntry->SceneryEntries.begin(), sgEntry->SceneryEntries.end()); diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index 6ff0fc59ce..93e4072e21 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -273,17 +273,17 @@ extern const CoordsXY SceneryQuadrantOffsets[]; extern money64 gClearSceneryCost; -void init_scenery(); -void scenery_update_tile(const CoordsXY& sceneryPos); -void scenery_set_default_placement_configuration(); -void scenery_remove_ghost_tool_placement(); +void SceneryInit(); +void SceneryUpdateTile(const CoordsXY& sceneryPos); +void ScenerySetDefaultPlacementConfiguration(); +void SceneryRemoveGhostToolPlacement(); -WallSceneryEntry* get_wall_entry(ObjectEntryIndex entryIndex); -BannerSceneryEntry* get_banner_entry(ObjectEntryIndex entryIndex); -PathBitEntry* get_footpath_item_entry(ObjectEntryIndex entryIndex); -rct_scenery_group_entry* get_scenery_group_entry(ObjectEntryIndex entryIndex); +WallSceneryEntry* GetWallEntry(ObjectEntryIndex entryIndex); +BannerSceneryEntry* GetBannerEntry(ObjectEntryIndex entryIndex); +PathBitEntry* GetFootpathItemEntry(ObjectEntryIndex entryIndex); +rct_scenery_group_entry* GetSceneryGroupEntry(ObjectEntryIndex entryIndex); -int32_t wall_entry_get_door_sound(const WallSceneryEntry* wallEntry); +int32_t WallEntryGetDoorSound(const WallSceneryEntry* wallEntry); bool IsSceneryAvailableToBuild(const ScenerySelection& item); diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index fe6e6678c0..123bfe91e0 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -71,7 +71,7 @@ void SmallSceneryElement::IncreaseAge(const CoordsXY& sceneryPos) if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_WITHER)) { - map_invalidate_tile_zoom1({ sceneryPos, GetBaseZ(), GetClearanceZ() }); + MapInvalidateTileZoom1({ sceneryPos, GetBaseZ(), GetClearanceZ() }); } } } @@ -125,10 +125,10 @@ void SmallSceneryElement::SetNeedsSupports() SmallSceneryEntry* SmallSceneryElement::GetEntry() const { - return get_small_scenery_entry(entryIndex); + return GetSmallSceneryEntry(entryIndex); } -SmallSceneryEntry* get_small_scenery_entry(ObjectEntryIndex entryIndex) +SmallSceneryEntry* GetSmallSceneryEntry(ObjectEntryIndex entryIndex) { SmallSceneryEntry* result = nullptr; auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); diff --git a/src/openrct2/world/SmallScenery.h b/src/openrct2/world/SmallScenery.h index 89e0010aac..938f53d8d2 100644 --- a/src/openrct2/world/SmallScenery.h +++ b/src/openrct2/world/SmallScenery.h @@ -55,4 +55,4 @@ enum MAP_ELEM_SMALL_SCENERY_COLOUR_FLAG_NEEDS_SUPPORTS = (1 << 5), }; -SmallSceneryEntry* get_small_scenery_entry(ObjectEntryIndex entryIndex); +SmallSceneryEntry* GetSmallSceneryEntry(ObjectEntryIndex entryIndex); diff --git a/src/openrct2/world/Surface.cpp b/src/openrct2/world/Surface.cpp index 139564b993..90fd261bfb 100644 --- a/src/openrct2/world/Surface.cpp +++ b/src/openrct2/world/Surface.cpp @@ -106,7 +106,7 @@ void SurfaceElement::SetGrassLengthAndInvalidate(uint8_t length, const CoordsXY& } int32_t z = GetBaseZ(); - map_invalidate_tile({ coords, z, z + 16 }); + MapInvalidateTile({ coords, z, z + 16 }); } /** @@ -122,7 +122,7 @@ void SurfaceElement::UpdateGrassLength(const CoordsXY& coords) uint8_t grassLengthTmp = GrassLength & 7; // Check if grass is underwater or outside park - if (GetWaterHeight() > GetBaseZ() || !map_is_location_in_park(coords)) + if (GetWaterHeight() > GetBaseZ() || !MapIsLocationInPark(coords)) { if (grassLengthTmp != GRASS_LENGTH_CLEAR_0) SetGrassLengthAndInvalidate(GRASS_LENGTH_CLEAR_0, coords); diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 118970623b..b18f61748b 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -18,7 +18,7 @@ #include "Location.hpp" #include "Scenery.h" -bool tile_element_is_underground(TileElement* tileElement) +bool TileElementIsUnderground(TileElement* tileElement) { do { diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 17b628e830..b4e73e66ef 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -708,4 +708,4 @@ enum LANDSCAPE_DOOR_OPEN = 3, }; -bool tile_element_is_underground(TileElement* tileElement); +bool TileElementIsUnderground(TileElement* tileElement); diff --git a/src/openrct2/world/TileElementBase.cpp b/src/openrct2/world/TileElementBase.cpp index 50066035e1..d5ea3f84ed 100644 --- a/src/openrct2/world/TileElementBase.cpp +++ b/src/openrct2/world/TileElementBase.cpp @@ -82,7 +82,7 @@ void TileElementBase::SetGhost(bool isGhost) void TileElementBase::Remove() { - tile_element_remove(static_cast(this)); + TileElementRemove(static_cast(this)); } uint8_t TileElementBase::GetOccupiedQuadrants() const diff --git a/src/openrct2/world/TileElementsView.h b/src/openrct2/world/TileElementsView.h index 08c44ee8bc..7fa0c49f74 100644 --- a/src/openrct2/world/TileElementsView.h +++ b/src/openrct2/world/TileElementsView.h @@ -111,7 +111,7 @@ namespace OpenRCT2 Iterator begin() noexcept { - T* element = reinterpret_cast(map_get_first_element_at(_loc)); + T* element = reinterpret_cast(MapGetFirstElementAt(_loc)); if constexpr (!std::is_same_v) { diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 5cc80faa66..7184a78308 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -43,8 +43,8 @@ namespace OpenRCT2::TileInspector { static bool SwapTileElements(const CoordsXY& loc, int16_t first, int16_t second) { - TileElement* const firstElement = map_get_nth_element_at(loc, first); - TileElement* const secondElement = map_get_nth_element_at(loc, second); + TileElement* const firstElement = MapGetNthElementAt(loc, first); + TileElement* const secondElement = MapGetNthElementAt(loc, second); if (firstElement == nullptr) { @@ -86,7 +86,7 @@ namespace OpenRCT2::TileInspector return nullptr; } - static int32_t numLargeScenerySequences(const CoordsXY& loc, const LargeSceneryElement* const largeScenery) + static int32_t NumLargeScenerySequences(const CoordsXY& loc, const LargeSceneryElement* const largeScenery) { const auto* const largeEntry = largeScenery->GetEntry(); const auto direction = largeScenery->GetDirection(); @@ -107,7 +107,7 @@ namespace OpenRCT2::TileInspector const auto currentTile = firstTile + rotatedCurrentTile; - const TileElement* tileElement = map_get_first_element_at(currentTile); + const TileElement* tileElement = MapGetFirstElementAt(currentTile); if (tileElement != nullptr) { do @@ -140,7 +140,7 @@ namespace OpenRCT2::TileInspector */ GameActions::Result RemoveElementAt(const CoordsXY& loc, int16_t elementIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -151,7 +151,7 @@ namespace OpenRCT2::TileInspector 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) + if (NumLargeScenerySequences(loc, largeScenery) == 1) { tileElement->RemoveBannerEntry(); } @@ -162,8 +162,8 @@ namespace OpenRCT2::TileInspector tileElement->RemoveBannerEntry(); } - tile_element_remove(tileElement); - map_invalidate_tile_full(loc); + TileElementRemove(tileElement); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -194,7 +194,7 @@ namespace OpenRCT2::TileInspector { return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); } - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -213,7 +213,7 @@ namespace OpenRCT2::TileInspector GameActions::Result RotateElementAt(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -285,7 +285,7 @@ namespace OpenRCT2::TileInspector break; } - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -298,7 +298,7 @@ namespace OpenRCT2::TileInspector GameActions::Result ToggleInvisibilityOfElementAt(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -310,7 +310,7 @@ namespace OpenRCT2::TileInspector bool currentlyInvisible = tileElement->IsInvisible(); tileElement->SetInvisible(!currentlyInvisible); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (loc == windowTileInspectorTile.ToCoordsXY()) { window_invalidate_by_class(WindowClass::TileInspector); @@ -353,21 +353,20 @@ namespace OpenRCT2::TileInspector // The occupiedQuadrants will be automatically set when the element is copied over, so it's not necessary to set // them correctly _here_. - TileElement* const pastedElement = tile_element_insert( - { loc, element.GetBaseZ() }, 0b0000, TileElementType::Surface); + TileElement* const pastedElement = TileElementInsert({ loc, element.GetBaseZ() }, 0b0000, TileElementType::Surface); bool lastForTile = pastedElement->IsLastForTile(); *pastedElement = element; pastedElement->SetLastForTile(lastForTile); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { windowTileInspectorElementCount++; // Select new element if there was none selected already - int16_t newIndex = static_cast((pastedElement - map_get_first_element_at(loc))); + int16_t newIndex = static_cast((pastedElement - MapGetFirstElementAt(loc))); if (windowTileInspectorSelectedIndex == -1) windowTileInspectorSelectedIndex = newIndex; else if (windowTileInspectorSelectedIndex >= newIndex) @@ -384,7 +383,7 @@ namespace OpenRCT2::TileInspector { if (isExecuting) { - const TileElement* const firstElement = map_get_first_element_at(loc); + const TileElement* const firstElement = MapGetFirstElementAt(loc); if (firstElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -424,7 +423,7 @@ namespace OpenRCT2::TileInspector } } - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -463,7 +462,7 @@ namespace OpenRCT2::TileInspector GameActions::Result AnyBaseHeightOffset(const CoordsXY& loc, int16_t elementIndex, int8_t heightOffset, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -500,7 +499,7 @@ namespace OpenRCT2::TileInspector tileElement->base_height += heightOffset; tileElement->clearance_height += heightOffset; - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -513,7 +512,7 @@ namespace OpenRCT2::TileInspector GameActions::Result SurfaceShowParkFences(const CoordsXY& loc, bool showFences, bool isExecuting) { - auto* const surfaceelement = map_get_surface_element_at(loc); + auto* const surfaceelement = MapGetSurfaceElementAt(loc); // No surface element on tile if (surfaceelement == nullptr) @@ -524,9 +523,9 @@ namespace OpenRCT2::TileInspector if (!showFences) surfaceelement->SetParkFences(0); else - update_park_fences(loc); + ParkUpdateFences(loc); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -539,7 +538,7 @@ namespace OpenRCT2::TileInspector GameActions::Result SurfaceToggleCorner(const CoordsXY& loc, int32_t cornerIndex, bool isExecuting) { - auto* const surfaceElement = map_get_surface_element_at(loc); + auto* const surfaceElement = MapGetSurfaceElementAt(loc); // No surface element on tile if (surfaceElement == nullptr) @@ -579,7 +578,7 @@ namespace OpenRCT2::TileInspector surfaceElement->SetSlope(newSlope); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -592,7 +591,7 @@ namespace OpenRCT2::TileInspector GameActions::Result SurfaceToggleDiagonal(const CoordsXY& loc, bool isExecuting) { - auto* const surfaceElement = map_get_surface_element_at(loc); + auto* const surfaceElement = MapGetSurfaceElementAt(loc); // No surface element on tile if (surfaceElement == nullptr) @@ -603,7 +602,7 @@ namespace OpenRCT2::TileInspector uint8_t newSlope = surfaceElement->GetSlope() ^ TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT; surfaceElement->SetSlope(newSlope); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -616,7 +615,7 @@ namespace OpenRCT2::TileInspector GameActions::Result PathSetSloped(const CoordsXY& loc, int32_t elementIndex, bool sloped, bool isExecuting) { - TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -624,7 +623,7 @@ namespace OpenRCT2::TileInspector { pathElement->AsPath()->SetSloped(sloped); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -637,7 +636,7 @@ namespace OpenRCT2::TileInspector GameActions::Result PathSetBroken(const CoordsXY& loc, int32_t elementIndex, bool broken, bool isExecuting) { - TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -645,7 +644,7 @@ namespace OpenRCT2::TileInspector { pathElement->AsPath()->SetIsBroken(broken); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -658,7 +657,7 @@ namespace OpenRCT2::TileInspector GameActions::Result PathToggleEdge(const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) { - TileElement* const pathElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const pathElement = MapGetNthElementAt(loc, elementIndex); if (pathElement == nullptr || pathElement->GetType() != TileElementType::Path) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -667,7 +666,7 @@ namespace OpenRCT2::TileInspector uint8_t newEdges = pathElement->AsPath()->GetEdgesAndCorners() ^ (1 << edgeIndex); pathElement->AsPath()->SetEdgesAndCorners(newEdges); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -680,7 +679,7 @@ namespace OpenRCT2::TileInspector GameActions::Result EntranceMakeUsable(const CoordsXY& loc, int32_t elementIndex, bool isExecuting) { - TileElement* const entranceElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const entranceElement = MapGetNthElementAt(loc, elementIndex); if (entranceElement == nullptr || entranceElement->GetType() != TileElementType::Entrance) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -714,7 +713,7 @@ namespace OpenRCT2::TileInspector GameActions::Result WallSetSlope(const CoordsXY& loc, int32_t elementIndex, int32_t slopeValue, bool isExecuting) { - TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -723,7 +722,7 @@ namespace OpenRCT2::TileInspector // Set new slope value wallElement->AsWall()->SetSlope(slopeValue); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -737,7 +736,7 @@ namespace OpenRCT2::TileInspector GameActions::Result WallAnimationFrameOffset( const CoordsXY& loc, int16_t elementIndex, int8_t animationFrameOffset, bool isExecuting) { - TileElement* const wallElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const wallElement = MapGetNthElementAt(loc, elementIndex); if (wallElement == nullptr || wallElement->GetType() != TileElementType::Wall) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -746,7 +745,7 @@ namespace OpenRCT2::TileInspector uint8_t animationFrame = wallElement->AsWall()->GetAnimationFrame(); wallElement->AsWall()->SetAnimationFrame(animationFrame + animationFrameOffset); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -764,7 +763,7 @@ namespace OpenRCT2::TileInspector if (offset == 0) return GameActions::Result(); - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -781,13 +780,14 @@ namespace OpenRCT2::TileInspector return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); const auto& ted = GetTrackElementDescriptor(type); - const auto* trackBlock = ted.Block; - trackBlock += trackElement->AsTrack()->GetSequenceIndex(); + const auto* trackBlock = ted.GetBlockForSequence(trackElement->AsTrack()->GetSequenceIndex()); + if (trackBlock == nullptr) + return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); uint8_t originDirection = trackElement->GetDirection(); CoordsXY offsets = { trackBlock->x, trackBlock->y }; CoordsXY coords = { originX, originY }; - coords += offsets.Rotate(direction_reverse(originDirection)); + coords += offsets.Rotate(DirectionReverse(originDirection)); originX = static_cast(coords.x); originY = static_cast(coords.y); @@ -801,7 +801,7 @@ namespace OpenRCT2::TileInspector offsets.y = trackBlock->y; elem += offsets.Rotate(originDirection); - TrackElement* tileElement = map_get_track_element_at_of_type_seq(elem, type, trackBlock->index); + TrackElement* tileElement = MapGetTrackElementAtOfTypeSeq(elem, type, trackBlock->index); if (tileElement == nullptr) { log_error("Track map element part not found!"); @@ -810,9 +810,9 @@ namespace OpenRCT2::TileInspector // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is // for when you decrease the map size. - openrct2_assert(map_get_surface_element_at(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); + openrct2_assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); - map_invalidate_tile_full(elem); + MapInvalidateTileFull(elem); // Keep? // invalidate_test_results(ride); @@ -836,7 +836,7 @@ namespace OpenRCT2::TileInspector GameActions::Result TrackSetChain( const CoordsXY& loc, int32_t elementIndex, bool entireTrackBlock, bool setChain, bool isExecuting) { - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -864,13 +864,14 @@ namespace OpenRCT2::TileInspector return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); const auto& ted = GetTrackElementDescriptor(type); - auto trackBlock = ted.Block; - trackBlock += trackElement->AsTrack()->GetSequenceIndex(); + auto trackBlock = ted.GetBlockForSequence(trackElement->AsTrack()->GetSequenceIndex()); + if (trackBlock == nullptr) + return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); uint8_t originDirection = trackElement->GetDirection(); CoordsXY offsets = { trackBlock->x, trackBlock->y }; CoordsXY coords = { originX, originY }; - coords += offsets.Rotate(direction_reverse(originDirection)); + coords += offsets.Rotate(DirectionReverse(originDirection)); originX = static_cast(coords.x); originY = static_cast(coords.y); @@ -884,7 +885,7 @@ namespace OpenRCT2::TileInspector offsets.y = trackBlock->y; elem += offsets.Rotate(originDirection); - TrackElement* tileElement = map_get_track_element_at_of_type_seq(elem, type, trackBlock->index); + TrackElement* tileElement = MapGetTrackElementAtOfTypeSeq(elem, type, trackBlock->index); if (tileElement == nullptr) { log_error("Track map element part not found!"); @@ -893,9 +894,9 @@ namespace OpenRCT2::TileInspector // track_remove returns here on failure, not sure when this would ever be hit. Only thing I can think of is // for when you decrease the map size. - openrct2_assert(map_get_surface_element_at(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); + openrct2_assert(MapGetSurfaceElementAt(elem) != nullptr, "No surface at %d,%d", elem.x >> 5, elem.y >> 5); - map_invalidate_tile_full(elem); + MapInvalidateTileFull(elem); // Keep? // invalidate_test_results(ride); @@ -917,7 +918,7 @@ namespace OpenRCT2::TileInspector GameActions::Result TrackSetBlockBrake(const CoordsXY& loc, int32_t elementIndex, bool blockBrake, bool isExecuting) { - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -925,7 +926,7 @@ namespace OpenRCT2::TileInspector { trackElement->AsTrack()->SetBlockBrakeClosed(blockBrake); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -939,7 +940,7 @@ namespace OpenRCT2::TileInspector GameActions::Result TrackSetIndestructible( const CoordsXY& loc, int32_t elementIndex, bool isIndestructible, bool isExecuting) { - TileElement* const trackElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const trackElement = MapGetNthElementAt(loc, elementIndex); if (trackElement == nullptr || trackElement->GetType() != TileElementType::Track) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -947,7 +948,7 @@ namespace OpenRCT2::TileInspector { trackElement->AsTrack()->SetIsIndestructible(isIndestructible); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -961,7 +962,7 @@ namespace OpenRCT2::TileInspector GameActions::Result ScenerySetQuarterLocation( const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TileElementType::SmallScenery) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -973,7 +974,7 @@ namespace OpenRCT2::TileInspector // Update collision tileElement->SetOccupiedQuadrants(1 << ((quarterIndex + 2) & 3)); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -987,7 +988,7 @@ namespace OpenRCT2::TileInspector GameActions::Result ScenerySetQuarterCollision( const CoordsXY& loc, int32_t elementIndex, int32_t quarterIndex, bool isExecuting) { - TileElement* const tileElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const tileElement = MapGetNthElementAt(loc, elementIndex); if (tileElement == nullptr || tileElement->GetType() != TileElementType::SmallScenery) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); @@ -997,7 +998,7 @@ namespace OpenRCT2::TileInspector occupiedQuadrants ^= 1 << quarterIndex; tileElement->SetOccupiedQuadrants(occupiedQuadrants); - map_invalidate_tile_full(loc); + MapInvalidateTileFull(loc); if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr) { @@ -1010,7 +1011,7 @@ namespace OpenRCT2::TileInspector GameActions::Result BannerToggleBlockingEdge(const CoordsXY& loc, int32_t elementIndex, int32_t edgeIndex, bool isExecuting) { - TileElement* const bannerElement = map_get_nth_element_at(loc, elementIndex); + TileElement* const bannerElement = MapGetNthElementAt(loc, elementIndex); if (bannerElement == nullptr || bannerElement->GetType() != TileElementType::Banner) return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index b3629977d1..6ed5ef83d3 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -32,14 +32,13 @@ * * rct2: 0x006E588E */ -void wall_remove_at(const CoordsXYRangedZ& wallPos) +void WallRemoveAt(const CoordsXYRangedZ& wallPos) { - for (auto wallElement = map_get_wall_element_at(wallPos); wallElement != nullptr; - wallElement = map_get_wall_element_at(wallPos)) + for (auto wallElement = MapGetWallElementAt(wallPos); wallElement != nullptr; wallElement = MapGetWallElementAt(wallPos)) { reinterpret_cast(wallElement)->RemoveBannerEntry(); - map_invalidate_tile_zoom1({ wallPos, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 }); - tile_element_remove(reinterpret_cast(wallElement)); + MapInvalidateTileZoom1({ wallPos, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 }); + TileElementRemove(reinterpret_cast(wallElement)); } } @@ -47,20 +46,20 @@ void wall_remove_at(const CoordsXYRangedZ& wallPos) * * rct2: 0x006E57E6 */ -void wall_remove_at_z(const CoordsXYZ& wallPos) +void WallRemoveAtZ(const CoordsXYZ& wallPos) { - wall_remove_at({ wallPos, wallPos.z, wallPos.z + 48 }); + WallRemoveAt({ wallPos, wallPos.z, wallPos.z + 48 }); } /** * * rct2: 0x006E5935 */ -void wall_remove_intersecting_walls(const CoordsXYRangedZ& wallPos, Direction direction) +void WallRemoveIntersectingWalls(const CoordsXYRangedZ& wallPos, Direction direction) { TileElement* tileElement; - tileElement = map_get_first_element_at(wallPos); + tileElement = MapGetFirstElementAt(wallPos); if (tileElement == nullptr) return; do @@ -75,8 +74,8 @@ void wall_remove_intersecting_walls(const CoordsXYRangedZ& wallPos, Direction di continue; tileElement->RemoveBannerEntry(); - map_invalidate_tile_zoom1({ wallPos, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 72 }); - tile_element_remove(tileElement); + MapInvalidateTileZoom1({ wallPos, tileElement->GetBaseZ(), tileElement->GetBaseZ() + 72 }); + TileElementRemove(tileElement); tileElement--; } while (!(tileElement++)->IsLastForTile()); } @@ -140,7 +139,7 @@ uint16_t WallElement::GetEntryIndex() const WallSceneryEntry* WallElement::GetEntry() const { - return get_wall_entry(entryIndex); + return GetWallEntry(entryIndex); } void WallElement::SetEntryIndex(uint16_t newIndex) diff --git a/src/thirdparty/duktape/README.md b/src/thirdparty/duktape/README.md index 1253f03a04..1eb700e796 100644 --- a/src/thirdparty/duktape/README.md +++ b/src/thirdparty/duktape/README.md @@ -4,17 +4,20 @@ [#14853](https://github.com/OpenRCT2/OpenRCT2/issues/14853) is the primary issue that was solved by embedding our own copy of duktape. -This directory contains a pre-configured copy of duktape v2.6.0 with the following switches enabled: +This directory contains a pre-configured copy of duktape v2.7.0 with the following switches enabled: * `DUK_USE_CPP_EXCEPTIONS` for C++ exception handling. * `DUK_USE_DATE_NOW_WINDOWS` for Windows Vista compatibility. * `DUK_USE_INTERRUPT_COUNTER` for aborting long or non-terminating scripts. duktape is configured with a command such as: ``` -python2 duktape-2.6.0/tools/configure.py --output-directory src/thirdparty/duktape \ - -DUK_USE_CPP_EXCEPTIONS - -DUK_USE_DATE_NOW_WINDOWS - -DUK_USE_INTERRUPT_COUNTER +python2 duktape-2.7.0/tools/configure.py --output-directory src/thirdparty/duktape \ + -DDUK_USE_CPP_EXCEPTIONS \ + -DDUK_USE_DATE_NOW_WINDOWS \ + -DDUK_USE_INTERRUPT_COUNTER \ + -DDUK_USE_EXEC_TIMEOUT_CHECK=duk_exec_timeout_check ``` +Then manually apply configuration fixup for `duk_exec_timeout_check` (e.g. compare repo version of `duk_config.h` with the one freshly generated) and rename resulting `duktape.c` file to `duktape.cpp` + See [Configuring Duktape for build](https://wiki.duktape.org/configuring) for more information. diff --git a/src/thirdparty/duktape/duk_source_meta.json b/src/thirdparty/duktape/duk_source_meta.json index 78ab9d8649..8ab44ca3b9 100644 --- a/src/thirdparty/duktape/duk_source_meta.json +++ b/src/thirdparty/duktape/duk_source_meta.json @@ -1,1911 +1,1911 @@ { - "comment": "Metadata for Duktape sources", - "duk_version_string": "2.6.0", - "type": "duk_source_meta", + "comment": "Metadata for Duktape sources", + "duk_version_string": "2.7.0", + "type": "duk_source_meta", "line_map": [ { - "original_line": 1, - "combined_line": 155, + "original_line": 1, + "combined_line": 161, "original_file": "duk_replacements.c" - }, + }, { - "original_line": 1, - "combined_line": 164, + "original_line": 1, + "combined_line": 170, "original_file": "duk_internal.h" - }, + }, { - "original_line": 1, - "combined_line": 201, + "original_line": 1, + "combined_line": 207, "original_file": "duk_dblunion.h" - }, + }, { - "original_line": 1, - "combined_line": 626, + "original_line": 1, + "combined_line": 627, "original_file": "duk_fltunion.h" - }, + }, { - "original_line": 1, - "combined_line": 666, + "original_line": 1, + "combined_line": 667, "original_file": "duk_replacements.h" - }, + }, { - "original_line": 1, - "combined_line": 696, + "original_line": 1, + "combined_line": 697, "original_file": "duk_jmpbuf.h" - }, + }, { - "original_line": 1, - "combined_line": 721, + "original_line": 1, + "combined_line": 722, "original_file": "duk_exception.h" - }, + }, { - "original_line": 1, - "combined_line": 752, + "original_line": 1, + "combined_line": 754, "original_file": "duk_forwdecl.h" - }, + }, { - "original_line": 1, - "combined_line": 887, + "original_line": 1, + "combined_line": 889, "original_file": "duk_tval.h" - }, + }, { - "original_line": 1, - "combined_line": 1527, + "original_line": 1, + "combined_line": 1567, "original_file": "duk_builtins.h" - }, + }, { - "original_line": 45, - "combined_line": 2318, + "original_line": 45, + "combined_line": 2358, "original_file": "duk_internal.h" - }, + }, { - "original_line": 1, - "combined_line": 2320, + "original_line": 1, + "combined_line": 2360, "original_file": "duk_util.h" - }, + }, { - "original_line": 1, - "combined_line": 3052, + "original_line": 1, + "combined_line": 3156, "original_file": "duk_strings.h" - }, + }, { - "original_line": 1, - "combined_line": 3222, + "original_line": 1, + "combined_line": 3326, "original_file": "duk_js_bytecode.h" - }, + }, { - "original_line": 1, - "combined_line": 3705, + "original_line": 1, + "combined_line": 3800, "original_file": "duk_lexer.h" - }, + }, { - "original_line": 1, - "combined_line": 4144, + "original_line": 1, + "combined_line": 4236, "original_file": "duk_js_compiler.h" - }, + }, { - "original_line": 1, - "combined_line": 4372, + "original_line": 1, + "combined_line": 4469, "original_file": "duk_regexp.h" - }, + }, { - "original_line": 1, - "combined_line": 4457, + "original_line": 1, + "combined_line": 4554, "original_file": "duk_heaphdr.h" - }, + }, { - "original_line": 1, - "combined_line": 4755, + "original_line": 1, + "combined_line": 4871, "original_file": "duk_refcount.h" - }, + }, { - "original_line": 1, - "combined_line": 5481, + "original_line": 1, + "combined_line": 5888, "original_file": "duk_api_internal.h" - }, + }, { - "original_line": 1, - "combined_line": 5868, + "original_line": 1, + "combined_line": 6282, "original_file": "duk_hstring.h" - }, + }, { - "original_line": 1, - "combined_line": 6122, + "original_line": 1, + "combined_line": 6548, "original_file": "duk_hobject.h" - }, + }, { - "original_line": 1, - "combined_line": 7104, + "original_line": 1, + "combined_line": 7538, "original_file": "duk_hcompfunc.h" - }, + }, { - "original_line": 1, - "combined_line": 7378, + "original_line": 1, + "combined_line": 7798, "original_file": "duk_hnatfunc.h" - }, + }, { - "original_line": 1, - "combined_line": 7418, + "original_line": 1, + "combined_line": 7843, "original_file": "duk_hboundfunc.h" - }, + }, { - "original_line": 1, - "combined_line": 7456, + "original_line": 1, + "combined_line": 7886, "original_file": "duk_hbufobj.h" - }, + }, { - "original_line": 1, - "combined_line": 7584, + "original_line": 1, + "combined_line": 8024, "original_file": "duk_hthread.h" - }, + }, { - "original_line": 1, - "combined_line": 7993, + "original_line": 1, + "combined_line": 8446, "original_file": "duk_harray.h" - }, + }, { - "original_line": 1, - "combined_line": 8042, + "original_line": 1, + "combined_line": 8506, "original_file": "duk_henv.h" - }, + }, { - "original_line": 1, - "combined_line": 8088, + "original_line": 1, + "combined_line": 8562, "original_file": "duk_hbuffer.h" - }, + }, { - "original_line": 1, - "combined_line": 8425, + "original_line": 1, + "combined_line": 8910, "original_file": "duk_hproxy.h" - }, + }, { - "original_line": 1, - "combined_line": 8452, + "original_line": 1, + "combined_line": 8942, "original_file": "duk_heap.h" - }, + }, { - "original_line": 1, - "combined_line": 9176, + "original_line": 1, + "combined_line": 9689, "original_file": "duk_debugger.h" - }, + }, { - "original_line": 1, - "combined_line": 9328, + "original_line": 1, + "combined_line": 9841, "original_file": "duk_debug.h" - }, + }, { - "original_line": 1, - "combined_line": 9513, + "original_line": 1, + "combined_line": 10038, "original_file": "duk_error.h" - }, + }, { - "original_line": 1, - "combined_line": 10039, + "original_line": 1, + "combined_line": 10728, "original_file": "duk_unicode.h" - }, + }, { - "original_line": 1, - "combined_line": 10330, + "original_line": 1, + "combined_line": 11028, "original_file": "duk_json.h" - }, + }, { - "original_line": 1, - "combined_line": 10399, + "original_line": 1, + "combined_line": 11097, "original_file": "duk_js.h" - }, + }, { - "original_line": 1, - "combined_line": 10516, + "original_line": 1, + "combined_line": 11231, "original_file": "duk_numconv.h" - }, + }, { - "original_line": 1, - "combined_line": 10621, + "original_line": 1, + "combined_line": 11339, "original_file": "duk_bi_protos.h" - }, + }, { - "original_line": 1, - "combined_line": 10703, + "original_line": 1, + "combined_line": 11421, "original_file": "duk_selftest.h" - }, + }, { - "original_line": 76, - "combined_line": 10718, + "original_line": 76, + "combined_line": 11436, "original_file": "duk_internal.h" - }, + }, { - "original_line": 10, - "combined_line": 10720, + "original_line": 10, + "combined_line": 11438, "original_file": "duk_replacements.c" - }, + }, { - "original_line": 1, - "combined_line": 10793, + "original_line": 1, + "combined_line": 11511, "original_file": "duk_debug_macros.c" - }, + }, { - "original_line": 1, - "combined_line": 10884, + "original_line": 1, + "combined_line": 11602, "original_file": "duk_builtins.c" - }, + }, { - "original_line": 1, - "combined_line": 11748, + "original_line": 1, + "combined_line": 12466, "original_file": "duk_error_macros.c" - }, + }, { - "original_line": 1, - "combined_line": 11903, + "original_line": 1, + "combined_line": 12653, "original_file": "duk_unicode_support.c" - }, + }, { - "original_line": 1, - "combined_line": 13168, + "original_line": 1, + "combined_line": 13878, "original_file": "duk_util_memrw.c" - }, + }, { - "original_line": 1, - "combined_line": 13316, + "original_line": 1, + "combined_line": 14026, "original_file": "duk_util_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 13499, + "original_line": 1, + "combined_line": 14191, "original_file": "duk_hobject_class.c" - }, + }, { - "original_line": 1, - "combined_line": 13628, + "original_line": 1, + "combined_line": 14320, "original_file": "duk_alloc_default.c" - }, + }, { - "original_line": 1, - "combined_line": 13662, + "original_line": 1, + "combined_line": 14352, "original_file": "duk_api_buffer.c" - }, + }, { - "original_line": 1, - "combined_line": 13735, + "original_line": 1, + "combined_line": 14425, "original_file": "duk_api_bytecode.c" - }, + }, { - "original_line": 1, - "combined_line": 14503, + "original_line": 1, + "combined_line": 15204, "original_file": "duk_api_call.c" - }, + }, { - "original_line": 1, - "combined_line": 15019, + "original_line": 1, + "combined_line": 15722, "original_file": "duk_api_codec.c" - }, + }, { - "original_line": 1, - "combined_line": 15945, + "original_line": 1, + "combined_line": 16653, "original_file": "duk_api_compile.c" - }, + }, { - "original_line": 1, - "combined_line": 16117, + "original_line": 1, + "combined_line": 16827, "original_file": "duk_api_debug.c" - }, + }, { - "original_line": 1, - "combined_line": 16378, + "original_line": 1, + "combined_line": 17088, "original_file": "duk_api_heap.c" - }, + }, { - "original_line": 1, - "combined_line": 16589, + "original_line": 1, + "combined_line": 17297, "original_file": "duk_api_inspect.c" - }, + }, { - "original_line": 1, - "combined_line": 16834, + "original_line": 1, + "combined_line": 17568, "original_file": "duk_api_memory.c" - }, + }, { - "original_line": 1, - "combined_line": 16914, + "original_line": 1, + "combined_line": 17648, "original_file": "duk_api_object.c" - }, + }, { - "original_line": 1, - "combined_line": 17964, + "original_line": 1, + "combined_line": 18686, "original_file": "duk_api_random.c" - }, + }, { - "original_line": 1, - "combined_line": 17973, + "original_line": 1, + "combined_line": 18695, "original_file": "duk_api_stack.c" - }, + }, { - "original_line": 1, - "combined_line": 24851, + "original_line": 1, + "combined_line": 25603, "original_file": "duk_api_string.c" - }, + }, { - "original_line": 1, - "combined_line": 25229, + "original_line": 1, + "combined_line": 25982, "original_file": "duk_api_time.c" - }, + }, { - "original_line": 1, - "combined_line": 25339, + "original_line": 1, + "combined_line": 26092, "original_file": "duk_bi_array.c" - }, + }, { - "original_line": 1, - "combined_line": 26994, + "original_line": 1, + "combined_line": 27746, "original_file": "duk_bi_boolean.c" - }, + }, { - "original_line": 1, - "combined_line": 27063, + "original_line": 1, + "combined_line": 27815, "original_file": "duk_bi_buffer.c" - }, + }, { - "original_line": 1, - "combined_line": 29999, + "original_line": 1, + "combined_line": 30744, "original_file": "duk_bi_cbor.c" - }, + }, { - "original_line": 1, - "combined_line": 31739, + "original_line": 1, + "combined_line": 32667, "original_file": "duk_bi_date.c" - }, + }, { - "original_line": 1, - "combined_line": 33557, + "original_line": 1, + "combined_line": 34566, "original_file": "duk_bi_date_unix.c" - }, + }, { - "original_line": 1, - "combined_line": 33886, + "original_line": 1, + "combined_line": 34914, "original_file": "duk_bi_date_windows.c" - }, + }, { - "original_line": 1, - "combined_line": 34079, + "original_line": 1, + "combined_line": 35109, "original_file": "duk_bi_duktape.c" - }, + }, { - "original_line": 1, - "combined_line": 34237, + "original_line": 1, + "combined_line": 35259, "original_file": "duk_bi_encoding.c" - }, + }, { - "original_line": 1, - "combined_line": 34775, + "original_line": 1, + "combined_line": 35796, "original_file": "duk_bi_error.c" - }, + }, { - "original_line": 1, - "combined_line": 35167, + "original_line": 1, + "combined_line": 36196, "original_file": "duk_bi_function.c" - }, + }, { - "original_line": 1, - "combined_line": 35620, + "original_line": 1, + "combined_line": 36649, "original_file": "duk_bi_global.c" - }, + }, { - "original_line": 1, - "combined_line": 36351, + "original_line": 1, + "combined_line": 37369, "original_file": "duk_bi_json.c" - }, + }, { - "original_line": 1, - "combined_line": 39631, + "original_line": 1, + "combined_line": 40612, "original_file": "duk_bi_math.c" - }, + }, { - "original_line": 1, - "combined_line": 40150, + "original_line": 1, + "combined_line": 41103, "original_file": "duk_bi_number.c" - }, + }, { - "original_line": 1, - "combined_line": 40430, + "original_line": 1, + "combined_line": 41368, "original_file": "duk_bi_object.c" - }, + }, { - "original_line": 1, - "combined_line": 41233, + "original_line": 1, + "combined_line": 42122, "original_file": "duk_bi_performance.c" - }, + }, { - "original_line": 1, - "combined_line": 41264, + "original_line": 1, + "combined_line": 42153, "original_file": "duk_bi_pointer.c" - }, + }, { - "original_line": 1, - "combined_line": 41339, + "original_line": 1, + "combined_line": 42227, "original_file": "duk_bi_promise.c" - }, + }, { - "original_line": 1, - "combined_line": 41383, + "original_line": 1, + "combined_line": 42271, "original_file": "duk_bi_proxy.c" - }, + }, { - "original_line": 1, - "combined_line": 41481, + "original_line": 1, + "combined_line": 42369, "original_file": "duk_bi_reflect.c" - }, + }, { - "original_line": 1, - "combined_line": 41580, + "original_line": 1, + "combined_line": 42468, "original_file": "duk_bi_regexp.c" - }, + }, { - "original_line": 1, - "combined_line": 41806, + "original_line": 1, + "combined_line": 42692, "original_file": "duk_bi_string.c" - }, + }, { - "original_line": 1, - "combined_line": 43416, + "original_line": 1, + "combined_line": 44307, "original_file": "duk_bi_symbol.c" - }, + }, { - "original_line": 1, - "combined_line": 43586, + "original_line": 1, + "combined_line": 44479, "original_file": "duk_bi_thread.c" - }, + }, { - "original_line": 1, - "combined_line": 43912, + "original_line": 1, + "combined_line": 44803, "original_file": "duk_bi_thrower.c" - }, + }, { - "original_line": 1, - "combined_line": 43921, + "original_line": 1, + "combined_line": 44812, "original_file": "duk_debug_fixedbuffer.c" - }, + }, { - "original_line": 1, - "combined_line": 43990, + "original_line": 1, + "combined_line": 44881, "original_file": "duk_debug_vsnprintf.c" - }, + }, { - "original_line": 1, - "combined_line": 45090, + "original_line": 1, + "combined_line": 46085, "original_file": "duk_debugger.c" - }, + }, { - "original_line": 1, - "combined_line": 48004, + "original_line": 1, + "combined_line": 48984, "original_file": "duk_error_augment.c" - }, + }, { - "original_line": 1, - "combined_line": 48592, + "original_line": 1, + "combined_line": 49586, "original_file": "duk_error_longjmp.c" - }, + }, { - "original_line": 1, - "combined_line": 48695, + "original_line": 1, + "combined_line": 49693, "original_file": "duk_error_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 48869, + "original_line": 1, + "combined_line": 49866, "original_file": "duk_error_throw.c" - }, + }, { - "original_line": 1, - "combined_line": 49031, + "original_line": 1, + "combined_line": 50025, "original_file": "duk_hbuffer_alloc.c" - }, + }, { - "original_line": 1, - "combined_line": 49163, + "original_line": 1, + "combined_line": 50156, "original_file": "duk_hbuffer_assert.c" - }, + }, { - "original_line": 1, - "combined_line": 49176, + "original_line": 1, + "combined_line": 50169, "original_file": "duk_hbuffer_ops.c" - }, + }, { - "original_line": 2, - "combined_line": 49255, + "original_line": 2, + "combined_line": 50247, "original_file": "duk_hbufobj_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 49274, + "original_line": 1, + "combined_line": 50266, "original_file": "duk_heap_alloc.c" - }, + }, { - "original_line": 1, - "combined_line": 50499, + "original_line": 1, + "combined_line": 51493, "original_file": "duk_heap_finalize.c" - }, + }, { - "original_line": 1, - "combined_line": 50944, + "original_line": 1, + "combined_line": 51942, "original_file": "duk_heap_hashstring.c" - }, + }, { - "original_line": 1, - "combined_line": 51065, + "original_line": 1, + "combined_line": 52063, "original_file": "duk_heap_markandsweep.c" - }, + }, { - "original_line": 1, - "combined_line": 52551, + "original_line": 1, + "combined_line": 53571, "original_file": "duk_heap_memory.c" - }, + }, { - "original_line": 1, - "combined_line": 52963, + "original_line": 1, + "combined_line": 53983, "original_file": "duk_heap_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 53150, + "original_line": 1, + "combined_line": 54170, "original_file": "duk_heap_refcount.c" - }, + }, { - "original_line": 1, - "combined_line": 53996, + "original_line": 1, + "combined_line": 55029, "original_file": "duk_heap_stringcache.c" - }, + }, { - "original_line": 1, - "combined_line": 54305, + "original_line": 1, + "combined_line": 55349, "original_file": "duk_heap_stringtable.c" - }, + }, { - "original_line": 1, - "combined_line": 55354, + "original_line": 1, + "combined_line": 56419, "original_file": "duk_heaphdr_assert.c" - }, + }, { - "original_line": 1, - "combined_line": 55432, + "original_line": 1, + "combined_line": 56497, "original_file": "duk_hobject_alloc.c" - }, + }, { - "original_line": 1, - "combined_line": 55703, + "original_line": 1, + "combined_line": 56768, "original_file": "duk_hobject_assert.c" - }, + }, { - "original_line": 1, - "combined_line": 55830, + "original_line": 1, + "combined_line": 56892, "original_file": "duk_hobject_enum.c" - }, + }, { - "original_line": 1, - "combined_line": 56546, + "original_line": 1, + "combined_line": 57612, "original_file": "duk_hobject_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 56599, + "original_line": 1, + "combined_line": 57668, "original_file": "duk_hobject_pc2line.c" - }, + }, { - "original_line": 1, - "combined_line": 56843, + "original_line": 1, + "combined_line": 57914, "original_file": "duk_hobject_props.c" - }, + }, { - "original_line": 1, - "combined_line": 63058, + "original_line": 1, + "combined_line": 64276, "original_file": "duk_hstring_assert.c" - }, + }, { - "original_line": 1, - "combined_line": 63071, + "original_line": 1, + "combined_line": 64289, "original_file": "duk_hstring_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 63267, + "original_line": 1, + "combined_line": 64485, "original_file": "duk_hthread_alloc.c" - }, + }, { - "original_line": 1, - "combined_line": 63326, + "original_line": 1, + "combined_line": 64544, "original_file": "duk_hthread_builtins.c" - }, + }, { - "original_line": 1, - "combined_line": 64212, + "original_line": 1, + "combined_line": 65445, "original_file": "duk_hthread_misc.c" - }, + }, { - "original_line": 1, - "combined_line": 64309, + "original_line": 1, + "combined_line": 65542, "original_file": "duk_hthread_stacks.c" - }, + }, { - "original_line": 1, - "combined_line": 64716, + "original_line": 1, + "combined_line": 65947, "original_file": "duk_js_arith.c" - }, + }, { - "original_line": 1, - "combined_line": 64853, + "original_line": 1, + "combined_line": 66088, "original_file": "duk_js_call.c" - }, + }, { - "original_line": 1, - "combined_line": 67790, + "original_line": 1, + "combined_line": 69036, "original_file": "duk_js_compiler.c" - }, + }, { - "original_line": 1, - "combined_line": 75900, + "original_line": 1, + "combined_line": 77176, "original_file": "duk_js_executor.c" - }, + }, { - "original_line": 1, - "combined_line": 81165, + "original_line": 1, + "combined_line": 82498, "original_file": "duk_js_ops.c" - }, + }, { - "original_line": 1, - "combined_line": 82643, + "original_line": 1, + "combined_line": 83954, "original_file": "duk_js_var.c" - }, + }, { - "original_line": 1, - "combined_line": 84440, + "original_line": 1, + "combined_line": 85745, "original_file": "duk_lexer.c" - }, + }, { - "original_line": 1, - "combined_line": 86901, + "original_line": 1, + "combined_line": 88196, "original_file": "duk_numconv.c" - }, + }, { - "original_line": 1, - "combined_line": 89194, + "original_line": 1, + "combined_line": 90538, "original_file": "duk_regexp_compiler.c" - }, + }, { - "original_line": 1, - "combined_line": 90485, + "original_line": 1, + "combined_line": 91841, "original_file": "duk_regexp_executor.c" - }, + }, { - "original_line": 1, - "combined_line": 91514, + "original_line": 1, + "combined_line": 92896, "original_file": "duk_selftest.c" - }, + }, { - "original_line": 2, - "combined_line": 92201, + "original_line": 2, + "combined_line": 93643, "original_file": "duk_tval.c" - }, + }, { - "original_line": 1, - "combined_line": 92352, + "original_line": 1, + "combined_line": 93794, "original_file": "duk_unicode_tables.c" - }, + }, { - "original_line": 1, - "combined_line": 98527, + "original_line": 1, + "combined_line": 99969, "original_file": "duk_util_bitdecoder.c" - }, + }, { - "original_line": 1, - "combined_line": 98693, + "original_line": 1, + "combined_line": 100133, "original_file": "duk_util_bitencoder.c" - }, + }, { - "original_line": 1, - "combined_line": 98736, + "original_line": 1, + "combined_line": 100176, "original_file": "duk_util_bufwriter.c" - }, + }, { - "original_line": 1, - "combined_line": 99022, + "original_line": 1, + "combined_line": 100462, "original_file": "duk_util_cast.c" - }, + }, { - "original_line": 1, - "combined_line": 99190, + "original_line": 1, + "combined_line": 100634, "original_file": "duk_util_double.c" - }, + }, { - "original_line": 1, - "combined_line": 99533, + "original_line": 1, + "combined_line": 100977, "original_file": "duk_util_hashbytes.c" - }, + }, { - "original_line": 1, - "combined_line": 99594, + "original_line": 1, + "combined_line": 101039, "original_file": "duk_util_memory.c" - }, + }, { - "original_line": 1, - "combined_line": 99630, + "original_line": 1, + "combined_line": 101075, "original_file": "duk_util_tinyrandom.c" } - ], - "duk_version": 20600, - "git_branch": "external", - "git_commit": "external", + ], + "duk_version": 20700, + "git_branch": "external", + "git_commit": "external", "builtin_strings_info": [ { - "plain": "Undefined", - "base64": "VW5kZWZpbmVk", + "plain": "Undefined", + "base64": "VW5kZWZpbmVk", "define": "DUK_STRIDX_UC_UNDEFINED" - }, + }, { - "plain": "Null", - "base64": "TnVsbA==", + "plain": "Null", + "base64": "TnVsbA==", "define": "DUK_STRIDX_UC_NULL" - }, + }, { - "plain": "Symbol", - "base64": "U3ltYm9s", + "plain": "Symbol", + "base64": "U3ltYm9s", "define": "DUK_STRIDX_UC_SYMBOL" - }, + }, { - "plain": "Arguments", - "base64": "QXJndW1lbnRz", + "plain": "Arguments", + "base64": "QXJndW1lbnRz", "define": "DUK_STRIDX_UC_ARGUMENTS" - }, + }, { - "plain": "Object", - "base64": "T2JqZWN0", + "plain": "Object", + "base64": "T2JqZWN0", "define": "DUK_STRIDX_UC_OBJECT" - }, + }, { - "plain": "Function", - "base64": "RnVuY3Rpb24=", + "plain": "Function", + "base64": "RnVuY3Rpb24=", "define": "DUK_STRIDX_UC_FUNCTION" - }, + }, { - "plain": "Array", - "base64": "QXJyYXk=", + "plain": "Array", + "base64": "QXJyYXk=", "define": "DUK_STRIDX_UC_ARRAY" - }, + }, { - "plain": "String", - "base64": "U3RyaW5n", + "plain": "String", + "base64": "U3RyaW5n", "define": "DUK_STRIDX_UC_STRING" - }, + }, { - "plain": "Boolean", - "base64": "Qm9vbGVhbg==", + "plain": "Boolean", + "base64": "Qm9vbGVhbg==", "define": "DUK_STRIDX_UC_BOOLEAN" - }, + }, { - "plain": "Number", - "base64": "TnVtYmVy", + "plain": "Number", + "base64": "TnVtYmVy", "define": "DUK_STRIDX_UC_NUMBER" - }, + }, { - "plain": "Date", - "base64": "RGF0ZQ==", + "plain": "Date", + "base64": "RGF0ZQ==", "define": "DUK_STRIDX_UC_DATE" - }, + }, { - "plain": "RegExp", - "base64": "UmVnRXhw", + "plain": "RegExp", + "base64": "UmVnRXhw", "define": "DUK_STRIDX_REG_EXP" - }, + }, { - "plain": "Error", - "base64": "RXJyb3I=", + "plain": "Error", + "base64": "RXJyb3I=", "define": "DUK_STRIDX_UC_ERROR" - }, + }, { - "plain": "Math", - "base64": "TWF0aA==", + "plain": "Math", + "base64": "TWF0aA==", "define": "DUK_STRIDX_MATH" - }, + }, { - "plain": "JSON", - "base64": "SlNPTg==", + "plain": "JSON", + "base64": "SlNPTg==", "define": "DUK_STRIDX_JSON" - }, + }, { - "plain": "", - "base64": "", + "plain": "", + "base64": "", "define": "DUK_STRIDX_EMPTY_STRING" - }, + }, { - "plain": "ArrayBuffer", - "base64": "QXJyYXlCdWZmZXI=", + "plain": "ArrayBuffer", + "base64": "QXJyYXlCdWZmZXI=", "define": "DUK_STRIDX_ARRAY_BUFFER" - }, + }, { - "plain": "DataView", - "base64": "RGF0YVZpZXc=", + "plain": "DataView", + "base64": "RGF0YVZpZXc=", "define": "DUK_STRIDX_DATA_VIEW" - }, + }, { - "plain": "Int8Array", - "base64": "SW50OEFycmF5", + "plain": "Int8Array", + "base64": "SW50OEFycmF5", "define": "DUK_STRIDX_INT8_ARRAY" - }, + }, { - "plain": "Uint8Array", - "base64": "VWludDhBcnJheQ==", + "plain": "Uint8Array", + "base64": "VWludDhBcnJheQ==", "define": "DUK_STRIDX_UINT8_ARRAY" - }, + }, { - "plain": "Uint8ClampedArray", - "base64": "VWludDhDbGFtcGVkQXJyYXk=", + "plain": "Uint8ClampedArray", + "base64": "VWludDhDbGFtcGVkQXJyYXk=", "define": "DUK_STRIDX_UINT8_CLAMPED_ARRAY" - }, + }, { - "plain": "Int16Array", - "base64": "SW50MTZBcnJheQ==", + "plain": "Int16Array", + "base64": "SW50MTZBcnJheQ==", "define": "DUK_STRIDX_INT16_ARRAY" - }, + }, { - "plain": "Uint16Array", - "base64": "VWludDE2QXJyYXk=", + "plain": "Uint16Array", + "base64": "VWludDE2QXJyYXk=", "define": "DUK_STRIDX_UINT16_ARRAY" - }, + }, { - "plain": "Int32Array", - "base64": "SW50MzJBcnJheQ==", + "plain": "Int32Array", + "base64": "SW50MzJBcnJheQ==", "define": "DUK_STRIDX_INT32_ARRAY" - }, + }, { - "plain": "Uint32Array", - "base64": "VWludDMyQXJyYXk=", + "plain": "Uint32Array", + "base64": "VWludDMyQXJyYXk=", "define": "DUK_STRIDX_UINT32_ARRAY" - }, + }, { - "plain": "Float32Array", - "base64": "RmxvYXQzMkFycmF5", + "plain": "Float32Array", + "base64": "RmxvYXQzMkFycmF5", "define": "DUK_STRIDX_FLOAT32_ARRAY" - }, + }, { - "plain": "Float64Array", - "base64": "RmxvYXQ2NEFycmF5", + "plain": "Float64Array", + "base64": "RmxvYXQ2NEFycmF5", "define": "DUK_STRIDX_FLOAT64_ARRAY" - }, + }, { - "plain": "global", - "base64": "Z2xvYmFs", + "plain": "global", + "base64": "Z2xvYmFs", "define": "DUK_STRIDX_GLOBAL" - }, + }, { - "plain": "ObjEnv", - "base64": "T2JqRW52", + "plain": "ObjEnv", + "base64": "T2JqRW52", "define": "DUK_STRIDX_OBJ_ENV" - }, + }, { - "plain": "DecEnv", - "base64": "RGVjRW52", + "plain": "DecEnv", + "base64": "RGVjRW52", "define": "DUK_STRIDX_DEC_ENV" - }, + }, { - "plain": "Buffer", - "base64": "QnVmZmVy", + "plain": "Buffer", + "base64": "QnVmZmVy", "define": "DUK_STRIDX_UC_BUFFER" - }, + }, { - "plain": "Pointer", - "base64": "UG9pbnRlcg==", + "plain": "Pointer", + "base64": "UG9pbnRlcg==", "define": "DUK_STRIDX_UC_POINTER" - }, + }, { - "plain": "Thread", - "base64": "VGhyZWFk", + "plain": "Thread", + "base64": "VGhyZWFk", "define": "DUK_STRIDX_UC_THREAD" - }, + }, { - "plain": "eval", - "base64": "ZXZhbA==", + "plain": "eval", + "base64": "ZXZhbA==", "define": "DUK_STRIDX_EVAL" - }, + }, { - "plain": "value", - "base64": "dmFsdWU=", + "plain": "value", + "base64": "dmFsdWU=", "define": "DUK_STRIDX_VALUE" - }, + }, { - "plain": "writable", - "base64": "d3JpdGFibGU=", + "plain": "writable", + "base64": "d3JpdGFibGU=", "define": "DUK_STRIDX_WRITABLE" - }, + }, { - "plain": "configurable", - "base64": "Y29uZmlndXJhYmxl", + "plain": "configurable", + "base64": "Y29uZmlndXJhYmxl", "define": "DUK_STRIDX_CONFIGURABLE" - }, + }, { - "plain": "enumerable", - "base64": "ZW51bWVyYWJsZQ==", + "plain": "enumerable", + "base64": "ZW51bWVyYWJsZQ==", "define": "DUK_STRIDX_ENUMERABLE" - }, + }, { - "plain": "join", - "base64": "am9pbg==", + "plain": "join", + "base64": "am9pbg==", "define": "DUK_STRIDX_JOIN" - }, + }, { - "plain": "toLocaleString", - "base64": "dG9Mb2NhbGVTdHJpbmc=", + "plain": "toLocaleString", + "base64": "dG9Mb2NhbGVTdHJpbmc=", "define": "DUK_STRIDX_TO_LOCALE_STRING" - }, + }, { - "plain": "valueOf", - "base64": "dmFsdWVPZg==", + "plain": "valueOf", + "base64": "dmFsdWVPZg==", "define": "DUK_STRIDX_VALUE_OF" - }, + }, { - "plain": "toUTCString", - "base64": "dG9VVENTdHJpbmc=", + "plain": "toUTCString", + "base64": "dG9VVENTdHJpbmc=", "define": "DUK_STRIDX_TO_UTC_STRING" - }, + }, { - "plain": "toISOString", - "base64": "dG9JU09TdHJpbmc=", + "plain": "toISOString", + "base64": "dG9JU09TdHJpbmc=", "define": "DUK_STRIDX_TO_ISO_STRING" - }, + }, { - "plain": "toGMTString", - "base64": "dG9HTVRTdHJpbmc=", + "plain": "toGMTString", + "base64": "dG9HTVRTdHJpbmc=", "define": "DUK_STRIDX_TO_GMT_STRING" - }, + }, { - "plain": "source", - "base64": "c291cmNl", + "plain": "source", + "base64": "c291cmNl", "define": "DUK_STRIDX_SOURCE" - }, + }, { - "plain": "ignoreCase", - "base64": "aWdub3JlQ2FzZQ==", + "plain": "ignoreCase", + "base64": "aWdub3JlQ2FzZQ==", "define": "DUK_STRIDX_IGNORE_CASE" - }, + }, { - "plain": "multiline", - "base64": "bXVsdGlsaW5l", + "plain": "multiline", + "base64": "bXVsdGlsaW5l", "define": "DUK_STRIDX_MULTILINE" - }, + }, { - "plain": "lastIndex", - "base64": "bGFzdEluZGV4", + "plain": "lastIndex", + "base64": "bGFzdEluZGV4", "define": "DUK_STRIDX_LAST_INDEX" - }, + }, { - "plain": "flags", - "base64": "ZmxhZ3M=", + "plain": "flags", + "base64": "ZmxhZ3M=", "define": "DUK_STRIDX_FLAGS" - }, + }, { - "plain": "index", - "base64": "aW5kZXg=", + "plain": "index", + "base64": "aW5kZXg=", "define": "DUK_STRIDX_INDEX" - }, + }, { - "plain": "prototype", - "base64": "cHJvdG90eXBl", + "plain": "prototype", + "base64": "cHJvdG90eXBl", "define": "DUK_STRIDX_PROTOTYPE" - }, + }, { - "plain": "constructor", - "base64": "Y29uc3RydWN0b3I=", + "plain": "constructor", + "base64": "Y29uc3RydWN0b3I=", "define": "DUK_STRIDX_CONSTRUCTOR" - }, + }, { - "plain": "message", - "base64": "bWVzc2FnZQ==", + "plain": "message", + "base64": "bWVzc2FnZQ==", "define": "DUK_STRIDX_MESSAGE" - }, + }, { - "plain": "boolean", - "base64": "Ym9vbGVhbg==", + "plain": "boolean", + "base64": "Ym9vbGVhbg==", "define": "DUK_STRIDX_LC_BOOLEAN" - }, + }, { - "plain": "number", - "base64": "bnVtYmVy", + "plain": "number", + "base64": "bnVtYmVy", "define": "DUK_STRIDX_LC_NUMBER" - }, + }, { - "plain": "string", - "base64": "c3RyaW5n", + "plain": "string", + "base64": "c3RyaW5n", "define": "DUK_STRIDX_LC_STRING" - }, + }, { - "plain": "symbol", - "base64": "c3ltYm9s", + "plain": "symbol", + "base64": "c3ltYm9s", "define": "DUK_STRIDX_LC_SYMBOL" - }, + }, { - "plain": "object", - "base64": "b2JqZWN0", + "plain": "object", + "base64": "b2JqZWN0", "define": "DUK_STRIDX_LC_OBJECT" - }, + }, { - "plain": "undefined", - "base64": "dW5kZWZpbmVk", + "plain": "undefined", + "base64": "dW5kZWZpbmVk", "define": "DUK_STRIDX_LC_UNDEFINED" - }, + }, { - "plain": "NaN", - "base64": "TmFO", + "plain": "NaN", + "base64": "TmFO", "define": "DUK_STRIDX_NAN" - }, + }, { - "plain": "Infinity", - "base64": "SW5maW5pdHk=", + "plain": "Infinity", + "base64": "SW5maW5pdHk=", "define": "DUK_STRIDX_INFINITY" - }, + }, { - "plain": "-Infinity", - "base64": "LUluZmluaXR5", + "plain": "-Infinity", + "base64": "LUluZmluaXR5", "define": "DUK_STRIDX_MINUS_INFINITY" - }, + }, { - "plain": "-0", - "base64": "LTA=", + "plain": "-0", + "base64": "LTA=", "define": "DUK_STRIDX_MINUS_ZERO" - }, + }, { - "plain": ",", - "base64": "LA==", + "plain": ",", + "base64": "LA==", "define": "DUK_STRIDX_COMMA" - }, + }, { - "plain": "\n ", - "base64": "CiAgICA=", + "plain": "\n ", + "base64": "CiAgICA=", "define": "DUK_STRIDX_NEWLINE_4SPACE" - }, + }, { - "plain": "[...]", - "base64": "Wy4uLl0=", + "plain": "[...]", + "base64": "Wy4uLl0=", "define": "DUK_STRIDX_BRACKETED_ELLIPSIS" - }, + }, { - "plain": "Invalid Date", - "base64": "SW52YWxpZCBEYXRl", + "plain": "Invalid Date", + "base64": "SW52YWxpZCBEYXRl", "define": "DUK_STRIDX_INVALID_DATE" - }, + }, { - "plain": "arguments", - "base64": "YXJndW1lbnRz", + "plain": "arguments", + "base64": "YXJndW1lbnRz", "define": "DUK_STRIDX_LC_ARGUMENTS" - }, + }, { - "plain": "callee", - "base64": "Y2FsbGVl", + "plain": "callee", + "base64": "Y2FsbGVl", "define": "DUK_STRIDX_CALLEE" - }, + }, { - "plain": "caller", - "base64": "Y2FsbGVy", + "plain": "caller", + "base64": "Y2FsbGVy", "define": "DUK_STRIDX_CALLER" - }, + }, { - "plain": "apply", - "base64": "YXBwbHk=", + "plain": "apply", + "base64": "YXBwbHk=", "define": "DUK_STRIDX_APPLY" - }, + }, { - "plain": "construct", - "base64": "Y29uc3RydWN0", + "plain": "construct", + "base64": "Y29uc3RydWN0", "define": "DUK_STRIDX_CONSTRUCT" - }, + }, { - "plain": "deleteProperty", - "base64": "ZGVsZXRlUHJvcGVydHk=", + "plain": "deleteProperty", + "base64": "ZGVsZXRlUHJvcGVydHk=", "define": "DUK_STRIDX_DELETE_PROPERTY" - }, + }, { - "plain": "get", - "base64": "Z2V0", + "plain": "get", + "base64": "Z2V0", "define": "DUK_STRIDX_GET" - }, + }, { - "plain": "has", - "base64": "aGFz", + "plain": "has", + "base64": "aGFz", "define": "DUK_STRIDX_HAS" - }, + }, { - "plain": "ownKeys", - "base64": "b3duS2V5cw==", + "plain": "ownKeys", + "base64": "b3duS2V5cw==", "define": "DUK_STRIDX_OWN_KEYS" - }, + }, { - "plain": "\u0081Symbol.toPrimitive\u00ff", - "base64": "gVN5bWJvbC50b1ByaW1pdGl2Zf8=", + "plain": "\u0081Symbol.toPrimitive\u00ff", + "base64": "gVN5bWJvbC50b1ByaW1pdGl2Zf8=", "define": "DUK_STRIDX_WELLKNOWN_SYMBOL_TO_PRIMITIVE" - }, + }, { - "plain": "\u0081Symbol.hasInstance\u00ff", - "base64": "gVN5bWJvbC5oYXNJbnN0YW5jZf8=", + "plain": "\u0081Symbol.hasInstance\u00ff", + "base64": "gVN5bWJvbC5oYXNJbnN0YW5jZf8=", "define": "DUK_STRIDX_WELLKNOWN_SYMBOL_HAS_INSTANCE" - }, + }, { - "plain": "\u0081Symbol.toStringTag\u00ff", - "base64": "gVN5bWJvbC50b1N0cmluZ1RhZ/8=", + "plain": "\u0081Symbol.toStringTag\u00ff", + "base64": "gVN5bWJvbC50b1N0cmluZ1RhZ/8=", "define": "DUK_STRIDX_WELLKNOWN_SYMBOL_TO_STRING_TAG" - }, + }, { - "plain": "\u0081Symbol.isConcatSpreadable\u00ff", - "base64": "gVN5bWJvbC5pc0NvbmNhdFNwcmVhZGFibGX/", + "plain": "\u0081Symbol.isConcatSpreadable\u00ff", + "base64": "gVN5bWJvbC5pc0NvbmNhdFNwcmVhZGFibGX/", "define": "DUK_STRIDX_WELLKNOWN_SYMBOL_IS_CONCAT_SPREADABLE" - }, + }, { - "plain": "setPrototypeOf", - "base64": "c2V0UHJvdG90eXBlT2Y=", + "plain": "setPrototypeOf", + "base64": "c2V0UHJvdG90eXBlT2Y=", "define": "DUK_STRIDX_SET_PROTOTYPE_OF" - }, + }, { - "plain": "__proto__", - "base64": "X19wcm90b19f", + "plain": "__proto__", + "base64": "X19wcm90b19f", "define": "DUK_STRIDX___PROTO__" - }, + }, { - "plain": "toString", - "base64": "dG9TdHJpbmc=", + "plain": "toString", + "base64": "dG9TdHJpbmc=", "define": "DUK_STRIDX_TO_STRING" - }, + }, { - "plain": "toJSON", - "base64": "dG9KU09O", + "plain": "toJSON", + "base64": "dG9KU09O", "define": "DUK_STRIDX_TO_JSON" - }, + }, { - "plain": "type", - "base64": "dHlwZQ==", + "plain": "type", + "base64": "dHlwZQ==", "define": "DUK_STRIDX_TYPE" - }, + }, { - "plain": "data", - "base64": "ZGF0YQ==", + "plain": "data", + "base64": "ZGF0YQ==", "define": "DUK_STRIDX_DATA" - }, + }, { - "plain": "buffer", - "base64": "YnVmZmVy", + "plain": "buffer", + "base64": "YnVmZmVy", "define": "DUK_STRIDX_LC_BUFFER" - }, + }, { - "plain": "length", - "base64": "bGVuZ3Ro", + "plain": "length", + "base64": "bGVuZ3Ro", "define": "DUK_STRIDX_LENGTH" - }, + }, { - "plain": "set", - "base64": "c2V0", + "plain": "set", + "base64": "c2V0", "define": "DUK_STRIDX_SET" - }, + }, { - "plain": "stack", - "base64": "c3RhY2s=", + "plain": "stack", + "base64": "c3RhY2s=", "define": "DUK_STRIDX_STACK" - }, + }, { - "plain": "pc", - "base64": "cGM=", + "plain": "pc", + "base64": "cGM=", "define": "DUK_STRIDX_PC" - }, + }, { - "plain": "lineNumber", - "base64": "bGluZU51bWJlcg==", + "plain": "lineNumber", + "base64": "bGluZU51bWJlcg==", "define": "DUK_STRIDX_LINE_NUMBER" - }, + }, { - "plain": "\u0082Tracedata", - "base64": "glRyYWNlZGF0YQ==", + "plain": "\u0082Tracedata", + "base64": "glRyYWNlZGF0YQ==", "define": "DUK_STRIDX_INT_TRACEDATA" - }, + }, { - "plain": "name", - "base64": "bmFtZQ==", + "plain": "name", + "base64": "bmFtZQ==", "define": "DUK_STRIDX_NAME" - }, + }, { - "plain": "fileName", - "base64": "ZmlsZU5hbWU=", + "plain": "fileName", + "base64": "ZmlsZU5hbWU=", "define": "DUK_STRIDX_FILE_NAME" - }, + }, { - "plain": "pointer", - "base64": "cG9pbnRlcg==", + "plain": "pointer", + "base64": "cG9pbnRlcg==", "define": "DUK_STRIDX_LC_POINTER" - }, + }, { - "plain": "\u0082Target", - "base64": "glRhcmdldA==", + "plain": "\u0082Target", + "base64": "glRhcmdldA==", "define": "DUK_STRIDX_INT_TARGET" - }, + }, { - "plain": "\u0082Next", - "base64": "gk5leHQ=", + "plain": "\u0082Next", + "base64": "gk5leHQ=", "define": "DUK_STRIDX_INT_NEXT" - }, + }, { - "plain": "\u0082Bytecode", - "base64": "gkJ5dGVjb2Rl", + "plain": "\u0082Bytecode", + "base64": "gkJ5dGVjb2Rl", "define": "DUK_STRIDX_INT_BYTECODE" - }, + }, { - "plain": "\u0082Formals", - "base64": "gkZvcm1hbHM=", + "plain": "\u0082Formals", + "base64": "gkZvcm1hbHM=", "define": "DUK_STRIDX_INT_FORMALS" - }, + }, { - "plain": "\u0082Varmap", - "base64": "glZhcm1hcA==", + "plain": "\u0082Varmap", + "base64": "glZhcm1hcA==", "define": "DUK_STRIDX_INT_VARMAP" - }, + }, { - "plain": "\u0082Source", - "base64": "glNvdXJjZQ==", + "plain": "\u0082Source", + "base64": "glNvdXJjZQ==", "define": "DUK_STRIDX_INT_SOURCE" - }, + }, { - "plain": "\u0082Pc2line", - "base64": "glBjMmxpbmU=", + "plain": "\u0082Pc2line", + "base64": "glBjMmxpbmU=", "define": "DUK_STRIDX_INT_PC2LINE" - }, + }, { - "plain": "\u0082Map", - "base64": "gk1hcA==", + "plain": "\u0082Map", + "base64": "gk1hcA==", "define": "DUK_STRIDX_INT_MAP" - }, + }, { - "plain": "\u0082Varenv", - "base64": "glZhcmVudg==", + "plain": "\u0082Varenv", + "base64": "glZhcmVudg==", "define": "DUK_STRIDX_INT_VARENV" - }, + }, { - "plain": "\u0082Finalizer", - "base64": "gkZpbmFsaXplcg==", + "plain": "\u0082Finalizer", + "base64": "gkZpbmFsaXplcg==", "define": "DUK_STRIDX_INT_FINALIZER" - }, + }, { - "plain": "\u0082Value", - "base64": "glZhbHVl", + "plain": "\u0082Value", + "base64": "glZhbHVl", "define": "DUK_STRIDX_INT_VALUE" - }, + }, { - "plain": "compile", - "base64": "Y29tcGlsZQ==", + "plain": "compile", + "base64": "Y29tcGlsZQ==", "define": "DUK_STRIDX_COMPILE" - }, + }, { - "plain": "input", - "base64": "aW5wdXQ=", + "plain": "input", + "base64": "aW5wdXQ=", "define": "DUK_STRIDX_INPUT" - }, + }, { - "plain": "errCreate", - "base64": "ZXJyQ3JlYXRl", + "plain": "errCreate", + "base64": "ZXJyQ3JlYXRl", "define": "DUK_STRIDX_ERR_CREATE" - }, + }, { - "plain": "errThrow", - "base64": "ZXJyVGhyb3c=", + "plain": "errThrow", + "base64": "ZXJyVGhyb3c=", "define": "DUK_STRIDX_ERR_THROW" - }, + }, { - "plain": "env", - "base64": "ZW52", + "plain": "env", + "base64": "ZW52", "define": "DUK_STRIDX_ENV" - }, + }, { - "plain": "hex", - "base64": "aGV4", + "plain": "hex", + "base64": "aGV4", "define": "DUK_STRIDX_HEX" - }, + }, { - "plain": "base64", - "base64": "YmFzZTY0", + "plain": "base64", + "base64": "YmFzZTY0", "define": "DUK_STRIDX_BASE64" - }, + }, { - "plain": "jx", - "base64": "ang=", + "plain": "jx", + "base64": "ang=", "define": "DUK_STRIDX_JX" - }, + }, { - "plain": "jc", - "base64": "amM=", + "plain": "jc", + "base64": "amM=", "define": "DUK_STRIDX_JC" - }, + }, { - "plain": "{\"_undef\":true}", - "base64": "eyJfdW5kZWYiOnRydWV9", + "plain": "{\"_undef\":true}", + "base64": "eyJfdW5kZWYiOnRydWV9", "define": "DUK_STRIDX_JSON_EXT_UNDEFINED" - }, + }, { - "plain": "{\"_nan\":true}", - "base64": "eyJfbmFuIjp0cnVlfQ==", + "plain": "{\"_nan\":true}", + "base64": "eyJfbmFuIjp0cnVlfQ==", "define": "DUK_STRIDX_JSON_EXT_NAN" - }, + }, { - "plain": "{\"_inf\":true}", - "base64": "eyJfaW5mIjp0cnVlfQ==", + "plain": "{\"_inf\":true}", + "base64": "eyJfaW5mIjp0cnVlfQ==", "define": "DUK_STRIDX_JSON_EXT_POSINF" - }, + }, { - "plain": "{\"_ninf\":true}", - "base64": "eyJfbmluZiI6dHJ1ZX0=", + "plain": "{\"_ninf\":true}", + "base64": "eyJfbmluZiI6dHJ1ZX0=", "define": "DUK_STRIDX_JSON_EXT_NEGINF" - }, + }, { - "plain": "{\"_func\":true}", - "base64": "eyJfZnVuYyI6dHJ1ZX0=", + "plain": "{\"_func\":true}", + "base64": "eyJfZnVuYyI6dHJ1ZX0=", "define": "DUK_STRIDX_JSON_EXT_FUNCTION1" - }, + }, { - "plain": "{_func:true}", - "base64": "e19mdW5jOnRydWV9", + "plain": "{_func:true}", + "base64": "e19mdW5jOnRydWV9", "define": "DUK_STRIDX_JSON_EXT_FUNCTION2" - }, + }, { - "plain": "break", - "base64": "YnJlYWs=", + "plain": "break", + "base64": "YnJlYWs=", "define": "DUK_STRIDX_BREAK" - }, + }, { - "plain": "case", - "base64": "Y2FzZQ==", + "plain": "case", + "base64": "Y2FzZQ==", "define": "DUK_STRIDX_CASE" - }, + }, { - "plain": "catch", - "base64": "Y2F0Y2g=", + "plain": "catch", + "base64": "Y2F0Y2g=", "define": "DUK_STRIDX_CATCH" - }, + }, { - "plain": "continue", - "base64": "Y29udGludWU=", + "plain": "continue", + "base64": "Y29udGludWU=", "define": "DUK_STRIDX_CONTINUE" - }, + }, { - "plain": "debugger", - "base64": "ZGVidWdnZXI=", + "plain": "debugger", + "base64": "ZGVidWdnZXI=", "define": "DUK_STRIDX_DEBUGGER" - }, + }, { - "plain": "default", - "base64": "ZGVmYXVsdA==", + "plain": "default", + "base64": "ZGVmYXVsdA==", "define": "DUK_STRIDX_DEFAULT" - }, + }, { - "plain": "delete", - "base64": "ZGVsZXRl", + "plain": "delete", + "base64": "ZGVsZXRl", "define": "DUK_STRIDX_DELETE" - }, + }, { - "plain": "do", - "base64": "ZG8=", + "plain": "do", + "base64": "ZG8=", "define": "DUK_STRIDX_DO" - }, + }, { - "plain": "else", - "base64": "ZWxzZQ==", + "plain": "else", + "base64": "ZWxzZQ==", "define": "DUK_STRIDX_ELSE" - }, + }, { - "plain": "finally", - "base64": "ZmluYWxseQ==", + "plain": "finally", + "base64": "ZmluYWxseQ==", "define": "DUK_STRIDX_FINALLY" - }, + }, { - "plain": "for", - "base64": "Zm9y", + "plain": "for", + "base64": "Zm9y", "define": "DUK_STRIDX_FOR" - }, + }, { - "plain": "function", - "base64": "ZnVuY3Rpb24=", + "plain": "function", + "base64": "ZnVuY3Rpb24=", "define": "DUK_STRIDX_LC_FUNCTION" - }, + }, { - "plain": "if", - "base64": "aWY=", + "plain": "if", + "base64": "aWY=", "define": "DUK_STRIDX_IF" - }, + }, { - "plain": "in", - "base64": "aW4=", + "plain": "in", + "base64": "aW4=", "define": "DUK_STRIDX_IN" - }, + }, { - "plain": "instanceof", - "base64": "aW5zdGFuY2VvZg==", + "plain": "instanceof", + "base64": "aW5zdGFuY2VvZg==", "define": "DUK_STRIDX_INSTANCEOF" - }, + }, { - "plain": "new", - "base64": "bmV3", + "plain": "new", + "base64": "bmV3", "define": "DUK_STRIDX_NEW" - }, + }, { - "plain": "return", - "base64": "cmV0dXJu", + "plain": "return", + "base64": "cmV0dXJu", "define": "DUK_STRIDX_RETURN" - }, + }, { - "plain": "switch", - "base64": "c3dpdGNo", + "plain": "switch", + "base64": "c3dpdGNo", "define": "DUK_STRIDX_SWITCH" - }, + }, { - "plain": "this", - "base64": "dGhpcw==", + "plain": "this", + "base64": "dGhpcw==", "define": "DUK_STRIDX_THIS" - }, + }, { - "plain": "throw", - "base64": "dGhyb3c=", + "plain": "throw", + "base64": "dGhyb3c=", "define": "DUK_STRIDX_THROW" - }, + }, { - "plain": "try", - "base64": "dHJ5", + "plain": "try", + "base64": "dHJ5", "define": "DUK_STRIDX_TRY" - }, + }, { - "plain": "typeof", - "base64": "dHlwZW9m", + "plain": "typeof", + "base64": "dHlwZW9m", "define": "DUK_STRIDX_TYPEOF" - }, + }, { - "plain": "var", - "base64": "dmFy", + "plain": "var", + "base64": "dmFy", "define": "DUK_STRIDX_VAR" - }, + }, { - "plain": "const", - "base64": "Y29uc3Q=", + "plain": "const", + "base64": "Y29uc3Q=", "define": "DUK_STRIDX_CONST" - }, + }, { - "plain": "void", - "base64": "dm9pZA==", + "plain": "void", + "base64": "dm9pZA==", "define": "DUK_STRIDX_VOID" - }, + }, { - "plain": "while", - "base64": "d2hpbGU=", + "plain": "while", + "base64": "d2hpbGU=", "define": "DUK_STRIDX_WHILE" - }, + }, { - "plain": "with", - "base64": "d2l0aA==", + "plain": "with", + "base64": "d2l0aA==", "define": "DUK_STRIDX_WITH" - }, + }, { - "plain": "class", - "base64": "Y2xhc3M=", + "plain": "class", + "base64": "Y2xhc3M=", "define": "DUK_STRIDX_CLASS" - }, + }, { - "plain": "enum", - "base64": "ZW51bQ==", + "plain": "enum", + "base64": "ZW51bQ==", "define": "DUK_STRIDX_ENUM" - }, + }, { - "plain": "export", - "base64": "ZXhwb3J0", + "plain": "export", + "base64": "ZXhwb3J0", "define": "DUK_STRIDX_EXPORT" - }, + }, { - "plain": "extends", - "base64": "ZXh0ZW5kcw==", + "plain": "extends", + "base64": "ZXh0ZW5kcw==", "define": "DUK_STRIDX_EXTENDS" - }, + }, { - "plain": "import", - "base64": "aW1wb3J0", + "plain": "import", + "base64": "aW1wb3J0", "define": "DUK_STRIDX_IMPORT" - }, + }, { - "plain": "super", - "base64": "c3VwZXI=", + "plain": "super", + "base64": "c3VwZXI=", "define": "DUK_STRIDX_SUPER" - }, + }, { - "plain": "null", - "base64": "bnVsbA==", + "plain": "null", + "base64": "bnVsbA==", "define": "DUK_STRIDX_LC_NULL" - }, + }, { - "plain": "true", - "base64": "dHJ1ZQ==", + "plain": "true", + "base64": "dHJ1ZQ==", "define": "DUK_STRIDX_TRUE" - }, + }, { - "plain": "false", - "base64": "ZmFsc2U=", + "plain": "false", + "base64": "ZmFsc2U=", "define": "DUK_STRIDX_FALSE" - }, + }, { - "plain": "implements", - "base64": "aW1wbGVtZW50cw==", + "plain": "implements", + "base64": "aW1wbGVtZW50cw==", "define": "DUK_STRIDX_IMPLEMENTS" - }, + }, { - "plain": "interface", - "base64": "aW50ZXJmYWNl", + "plain": "interface", + "base64": "aW50ZXJmYWNl", "define": "DUK_STRIDX_INTERFACE" - }, + }, { - "plain": "let", - "base64": "bGV0", + "plain": "let", + "base64": "bGV0", "define": "DUK_STRIDX_LET" - }, + }, { - "plain": "package", - "base64": "cGFja2FnZQ==", + "plain": "package", + "base64": "cGFja2FnZQ==", "define": "DUK_STRIDX_PACKAGE" - }, + }, { - "plain": "private", - "base64": "cHJpdmF0ZQ==", + "plain": "private", + "base64": "cHJpdmF0ZQ==", "define": "DUK_STRIDX_PRIVATE" - }, + }, { - "plain": "protected", - "base64": "cHJvdGVjdGVk", + "plain": "protected", + "base64": "cHJvdGVjdGVk", "define": "DUK_STRIDX_PROTECTED" - }, + }, { - "plain": "public", - "base64": "cHVibGlj", + "plain": "public", + "base64": "cHVibGlj", "define": "DUK_STRIDX_PUBLIC" - }, + }, { - "plain": "static", - "base64": "c3RhdGlj", + "plain": "static", + "base64": "c3RhdGlj", "define": "DUK_STRIDX_STATIC" - }, + }, { - "plain": "yield", - "base64": "eWllbGQ=", + "plain": "yield", + "base64": "eWllbGQ=", "define": "DUK_STRIDX_YIELD" } - ], + ], "builtin_strings_base64": [ - "VW5kZWZpbmVk", - "TnVsbA==", - "U3ltYm9s", - "QXJndW1lbnRz", - "T2JqZWN0", - "RnVuY3Rpb24=", - "QXJyYXk=", - "U3RyaW5n", - "Qm9vbGVhbg==", - "TnVtYmVy", - "RGF0ZQ==", - "UmVnRXhw", - "RXJyb3I=", - "TWF0aA==", - "SlNPTg==", - "", - "QXJyYXlCdWZmZXI=", - "RGF0YVZpZXc=", - "SW50OEFycmF5", - "VWludDhBcnJheQ==", - "VWludDhDbGFtcGVkQXJyYXk=", - "SW50MTZBcnJheQ==", - "VWludDE2QXJyYXk=", - "SW50MzJBcnJheQ==", - "VWludDMyQXJyYXk=", - "RmxvYXQzMkFycmF5", - "RmxvYXQ2NEFycmF5", - "Z2xvYmFs", - "T2JqRW52", - "RGVjRW52", - "QnVmZmVy", - "UG9pbnRlcg==", - "VGhyZWFk", - "ZXZhbA==", - "dmFsdWU=", - "d3JpdGFibGU=", - "Y29uZmlndXJhYmxl", - "ZW51bWVyYWJsZQ==", - "am9pbg==", - "dG9Mb2NhbGVTdHJpbmc=", - "dmFsdWVPZg==", - "dG9VVENTdHJpbmc=", - "dG9JU09TdHJpbmc=", - "dG9HTVRTdHJpbmc=", - "c291cmNl", - "aWdub3JlQ2FzZQ==", - "bXVsdGlsaW5l", - "bGFzdEluZGV4", - "ZmxhZ3M=", - "aW5kZXg=", - "cHJvdG90eXBl", - "Y29uc3RydWN0b3I=", - "bWVzc2FnZQ==", - "Ym9vbGVhbg==", - "bnVtYmVy", - "c3RyaW5n", - "c3ltYm9s", - "b2JqZWN0", - "dW5kZWZpbmVk", - "TmFO", - "SW5maW5pdHk=", - "LUluZmluaXR5", - "LTA=", - "LA==", - "CiAgICA=", - "Wy4uLl0=", - "SW52YWxpZCBEYXRl", - "YXJndW1lbnRz", - "Y2FsbGVl", - "Y2FsbGVy", - "YXBwbHk=", - "Y29uc3RydWN0", - "ZGVsZXRlUHJvcGVydHk=", - "Z2V0", - "aGFz", - "b3duS2V5cw==", - "gVN5bWJvbC50b1ByaW1pdGl2Zf8=", - "gVN5bWJvbC5oYXNJbnN0YW5jZf8=", - "gVN5bWJvbC50b1N0cmluZ1RhZ/8=", - "gVN5bWJvbC5pc0NvbmNhdFNwcmVhZGFibGX/", - "c2V0UHJvdG90eXBlT2Y=", - "X19wcm90b19f", - "dG9TdHJpbmc=", - "dG9KU09O", - "dHlwZQ==", - "ZGF0YQ==", - "YnVmZmVy", - "bGVuZ3Ro", - "c2V0", - "c3RhY2s=", - "cGM=", - "bGluZU51bWJlcg==", - "glRyYWNlZGF0YQ==", - "bmFtZQ==", - "ZmlsZU5hbWU=", - "cG9pbnRlcg==", - "glRhcmdldA==", - "gk5leHQ=", - "gkJ5dGVjb2Rl", - "gkZvcm1hbHM=", - "glZhcm1hcA==", - "glNvdXJjZQ==", - "glBjMmxpbmU=", - "gk1hcA==", - "glZhcmVudg==", - "gkZpbmFsaXplcg==", - "glZhbHVl", - "Y29tcGlsZQ==", - "aW5wdXQ=", - "ZXJyQ3JlYXRl", - "ZXJyVGhyb3c=", - "ZW52", - "aGV4", - "YmFzZTY0", - "ang=", - "amM=", - "eyJfdW5kZWYiOnRydWV9", - "eyJfbmFuIjp0cnVlfQ==", - "eyJfaW5mIjp0cnVlfQ==", - "eyJfbmluZiI6dHJ1ZX0=", - "eyJfZnVuYyI6dHJ1ZX0=", - "e19mdW5jOnRydWV9", - "YnJlYWs=", - "Y2FzZQ==", - "Y2F0Y2g=", - "Y29udGludWU=", - "ZGVidWdnZXI=", - "ZGVmYXVsdA==", - "ZGVsZXRl", - "ZG8=", - "ZWxzZQ==", - "ZmluYWxseQ==", - "Zm9y", - "ZnVuY3Rpb24=", - "aWY=", - "aW4=", - "aW5zdGFuY2VvZg==", - "bmV3", - "cmV0dXJu", - "c3dpdGNo", - "dGhpcw==", - "dGhyb3c=", - "dHJ5", - "dHlwZW9m", - "dmFy", - "Y29uc3Q=", - "dm9pZA==", - "d2hpbGU=", - "d2l0aA==", - "Y2xhc3M=", - "ZW51bQ==", - "ZXhwb3J0", - "ZXh0ZW5kcw==", - "aW1wb3J0", - "c3VwZXI=", - "bnVsbA==", - "dHJ1ZQ==", - "ZmFsc2U=", - "aW1wbGVtZW50cw==", - "aW50ZXJmYWNl", - "bGV0", - "cGFja2FnZQ==", - "cHJpdmF0ZQ==", - "cHJvdGVjdGVk", - "cHVibGlj", - "c3RhdGlj", + "VW5kZWZpbmVk", + "TnVsbA==", + "U3ltYm9s", + "QXJndW1lbnRz", + "T2JqZWN0", + "RnVuY3Rpb24=", + "QXJyYXk=", + "U3RyaW5n", + "Qm9vbGVhbg==", + "TnVtYmVy", + "RGF0ZQ==", + "UmVnRXhw", + "RXJyb3I=", + "TWF0aA==", + "SlNPTg==", + "", + "QXJyYXlCdWZmZXI=", + "RGF0YVZpZXc=", + "SW50OEFycmF5", + "VWludDhBcnJheQ==", + "VWludDhDbGFtcGVkQXJyYXk=", + "SW50MTZBcnJheQ==", + "VWludDE2QXJyYXk=", + "SW50MzJBcnJheQ==", + "VWludDMyQXJyYXk=", + "RmxvYXQzMkFycmF5", + "RmxvYXQ2NEFycmF5", + "Z2xvYmFs", + "T2JqRW52", + "RGVjRW52", + "QnVmZmVy", + "UG9pbnRlcg==", + "VGhyZWFk", + "ZXZhbA==", + "dmFsdWU=", + "d3JpdGFibGU=", + "Y29uZmlndXJhYmxl", + "ZW51bWVyYWJsZQ==", + "am9pbg==", + "dG9Mb2NhbGVTdHJpbmc=", + "dmFsdWVPZg==", + "dG9VVENTdHJpbmc=", + "dG9JU09TdHJpbmc=", + "dG9HTVRTdHJpbmc=", + "c291cmNl", + "aWdub3JlQ2FzZQ==", + "bXVsdGlsaW5l", + "bGFzdEluZGV4", + "ZmxhZ3M=", + "aW5kZXg=", + "cHJvdG90eXBl", + "Y29uc3RydWN0b3I=", + "bWVzc2FnZQ==", + "Ym9vbGVhbg==", + "bnVtYmVy", + "c3RyaW5n", + "c3ltYm9s", + "b2JqZWN0", + "dW5kZWZpbmVk", + "TmFO", + "SW5maW5pdHk=", + "LUluZmluaXR5", + "LTA=", + "LA==", + "CiAgICA=", + "Wy4uLl0=", + "SW52YWxpZCBEYXRl", + "YXJndW1lbnRz", + "Y2FsbGVl", + "Y2FsbGVy", + "YXBwbHk=", + "Y29uc3RydWN0", + "ZGVsZXRlUHJvcGVydHk=", + "Z2V0", + "aGFz", + "b3duS2V5cw==", + "gVN5bWJvbC50b1ByaW1pdGl2Zf8=", + "gVN5bWJvbC5oYXNJbnN0YW5jZf8=", + "gVN5bWJvbC50b1N0cmluZ1RhZ/8=", + "gVN5bWJvbC5pc0NvbmNhdFNwcmVhZGFibGX/", + "c2V0UHJvdG90eXBlT2Y=", + "X19wcm90b19f", + "dG9TdHJpbmc=", + "dG9KU09O", + "dHlwZQ==", + "ZGF0YQ==", + "YnVmZmVy", + "bGVuZ3Ro", + "c2V0", + "c3RhY2s=", + "cGM=", + "bGluZU51bWJlcg==", + "glRyYWNlZGF0YQ==", + "bmFtZQ==", + "ZmlsZU5hbWU=", + "cG9pbnRlcg==", + "glRhcmdldA==", + "gk5leHQ=", + "gkJ5dGVjb2Rl", + "gkZvcm1hbHM=", + "glZhcm1hcA==", + "glNvdXJjZQ==", + "glBjMmxpbmU=", + "gk1hcA==", + "glZhcmVudg==", + "gkZpbmFsaXplcg==", + "glZhbHVl", + "Y29tcGlsZQ==", + "aW5wdXQ=", + "ZXJyQ3JlYXRl", + "ZXJyVGhyb3c=", + "ZW52", + "aGV4", + "YmFzZTY0", + "ang=", + "amM=", + "eyJfdW5kZWYiOnRydWV9", + "eyJfbmFuIjp0cnVlfQ==", + "eyJfaW5mIjp0cnVlfQ==", + "eyJfbmluZiI6dHJ1ZX0=", + "eyJfZnVuYyI6dHJ1ZX0=", + "e19mdW5jOnRydWV9", + "YnJlYWs=", + "Y2FzZQ==", + "Y2F0Y2g=", + "Y29udGludWU=", + "ZGVidWdnZXI=", + "ZGVmYXVsdA==", + "ZGVsZXRl", + "ZG8=", + "ZWxzZQ==", + "ZmluYWxseQ==", + "Zm9y", + "ZnVuY3Rpb24=", + "aWY=", + "aW4=", + "aW5zdGFuY2VvZg==", + "bmV3", + "cmV0dXJu", + "c3dpdGNo", + "dGhpcw==", + "dGhyb3c=", + "dHJ5", + "dHlwZW9m", + "dmFy", + "Y29uc3Q=", + "dm9pZA==", + "d2hpbGU=", + "d2l0aA==", + "Y2xhc3M=", + "ZW51bQ==", + "ZXhwb3J0", + "ZXh0ZW5kcw==", + "aW1wb3J0", + "c3VwZXI=", + "bnVsbA==", + "dHJ1ZQ==", + "ZmFsc2U=", + "aW1wbGVtZW50cw==", + "aW50ZXJmYWNl", + "bGV0", + "cGFja2FnZQ==", + "cHJpdmF0ZQ==", + "cHJvdGVjdGVk", + "cHVibGlj", + "c3RhdGlj", "eWllbGQ=" - ], - "git_describe": "external", + ], + "git_describe": "external", "builtin_strings": [ - "Undefined", - "Null", - "Symbol", - "Arguments", - "Object", - "Function", - "Array", - "String", - "Boolean", - "Number", - "Date", - "RegExp", - "Error", - "Math", - "JSON", - "", - "ArrayBuffer", - "DataView", - "Int8Array", - "Uint8Array", - "Uint8ClampedArray", - "Int16Array", - "Uint16Array", - "Int32Array", - "Uint32Array", - "Float32Array", - "Float64Array", - "global", - "ObjEnv", - "DecEnv", - "Buffer", - "Pointer", - "Thread", - "eval", - "value", - "writable", - "configurable", - "enumerable", - "join", - "toLocaleString", - "valueOf", - "toUTCString", - "toISOString", - "toGMTString", - "source", - "ignoreCase", - "multiline", - "lastIndex", - "flags", - "index", - "prototype", - "constructor", - "message", - "boolean", - "number", - "string", - "symbol", - "object", - "undefined", - "NaN", - "Infinity", - "-Infinity", - "-0", - ",", - "\n ", - "[...]", - "Invalid Date", - "arguments", - "callee", - "caller", - "apply", - "construct", - "deleteProperty", - "get", - "has", - "ownKeys", - "\u0081Symbol.toPrimitive\u00ff", - "\u0081Symbol.hasInstance\u00ff", - "\u0081Symbol.toStringTag\u00ff", - "\u0081Symbol.isConcatSpreadable\u00ff", - "setPrototypeOf", - "__proto__", - "toString", - "toJSON", - "type", - "data", - "buffer", - "length", - "set", - "stack", - "pc", - "lineNumber", - "\u0082Tracedata", - "name", - "fileName", - "pointer", - "\u0082Target", - "\u0082Next", - "\u0082Bytecode", - "\u0082Formals", - "\u0082Varmap", - "\u0082Source", - "\u0082Pc2line", - "\u0082Map", - "\u0082Varenv", - "\u0082Finalizer", - "\u0082Value", - "compile", - "input", - "errCreate", - "errThrow", - "env", - "hex", - "base64", - "jx", - "jc", - "{\"_undef\":true}", - "{\"_nan\":true}", - "{\"_inf\":true}", - "{\"_ninf\":true}", - "{\"_func\":true}", - "{_func:true}", - "break", - "case", - "catch", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "finally", - "for", - "function", - "if", - "in", - "instanceof", - "new", - "return", - "switch", - "this", - "throw", - "try", - "typeof", - "var", - "const", - "void", - "while", - "with", - "class", - "enum", - "export", - "extends", - "import", - "super", - "null", - "true", - "false", - "implements", - "interface", - "let", - "package", - "private", - "protected", - "public", - "static", + "Undefined", + "Null", + "Symbol", + "Arguments", + "Object", + "Function", + "Array", + "String", + "Boolean", + "Number", + "Date", + "RegExp", + "Error", + "Math", + "JSON", + "", + "ArrayBuffer", + "DataView", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "global", + "ObjEnv", + "DecEnv", + "Buffer", + "Pointer", + "Thread", + "eval", + "value", + "writable", + "configurable", + "enumerable", + "join", + "toLocaleString", + "valueOf", + "toUTCString", + "toISOString", + "toGMTString", + "source", + "ignoreCase", + "multiline", + "lastIndex", + "flags", + "index", + "prototype", + "constructor", + "message", + "boolean", + "number", + "string", + "symbol", + "object", + "undefined", + "NaN", + "Infinity", + "-Infinity", + "-0", + ",", + "\n ", + "[...]", + "Invalid Date", + "arguments", + "callee", + "caller", + "apply", + "construct", + "deleteProperty", + "get", + "has", + "ownKeys", + "\u0081Symbol.toPrimitive\u00ff", + "\u0081Symbol.hasInstance\u00ff", + "\u0081Symbol.toStringTag\u00ff", + "\u0081Symbol.isConcatSpreadable\u00ff", + "setPrototypeOf", + "__proto__", + "toString", + "toJSON", + "type", + "data", + "buffer", + "length", + "set", + "stack", + "pc", + "lineNumber", + "\u0082Tracedata", + "name", + "fileName", + "pointer", + "\u0082Target", + "\u0082Next", + "\u0082Bytecode", + "\u0082Formals", + "\u0082Varmap", + "\u0082Source", + "\u0082Pc2line", + "\u0082Map", + "\u0082Varenv", + "\u0082Finalizer", + "\u0082Value", + "compile", + "input", + "errCreate", + "errThrow", + "env", + "hex", + "base64", + "jx", + "jc", + "{\"_undef\":true}", + "{\"_nan\":true}", + "{\"_inf\":true}", + "{\"_ninf\":true}", + "{\"_func\":true}", + "{_func:true}", + "break", + "case", + "catch", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "finally", + "for", + "function", + "if", + "in", + "instanceof", + "new", + "return", + "switch", + "this", + "throw", + "try", + "typeof", + "var", + "const", + "void", + "while", + "with", + "class", + "enum", + "export", + "extends", + "import", + "super", + "null", + "true", + "false", + "implements", + "interface", + "let", + "package", + "private", + "protected", + "public", + "static", "yield" ] -} +} \ No newline at end of file diff --git a/src/thirdparty/duktape/duktape.cpp b/src/thirdparty/duktape/duktape.cpp index 5987fd03df..1a27b650a8 100644 --- a/src/thirdparty/duktape/duktape.cpp +++ b/src/thirdparty/duktape/duktape.cpp @@ -1,5 +1,5 @@ /* - * Single source autogenerated distributable for Duktape 2.6.0. + * Single source autogenerated distributable for Duktape 2.7.0. * * Git commit external (external). * Git branch external. @@ -16,7 +16,7 @@ * * (http://opensource.org/licenses/MIT) * -* Copyright (c) 2013-2019 by Duktape authors (see AUTHORS.rst) +* Copyright (c) 2013-present by Duktape authors (see AUTHORS.rst) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -105,6 +105,12 @@ * * Luis de Bethencourt (https://github.com/luisbg) * * Ian Whyman (https://github.com/v00d00) * * Rick Sayre (https://github.com/whorfin) +* * Craig Leres (https://github.com/leres) +* * Maurici Abad (https://github.com/mauriciabad) +* * Nancy Li (https://github.com/NancyLi1013) +* * William Parks (https://github.com/WilliamParks) +* * Sam Hellawell (https://github.com/samhellawell) +* * Vladislavs Sokurenko (https://github.com/sokurenko) * * Other contributions * =================== @@ -266,7 +272,7 @@ union duk_double_union { duk_uint16_t us[4]; duk_uint8_t uc[8]; #if defined(DUK_USE_PACKED_TVAL) - void *vp[2]; /* used by packed duk_tval, assumes sizeof(void *) == 4 */ + void *vp[2]; /* used by packed duk_tval, assumes sizeof(void *) == 4 */ #endif }; @@ -278,64 +284,64 @@ typedef union duk_double_union duk_double_union; #if defined(DUK_USE_DOUBLE_LE) #if defined(DUK_USE_64BIT_OPS) -#define DUK_DBL_IDX_ULL0 0 +#define DUK_DBL_IDX_ULL0 0 #endif -#define DUK_DBL_IDX_UI0 1 -#define DUK_DBL_IDX_UI1 0 -#define DUK_DBL_IDX_US0 3 -#define DUK_DBL_IDX_US1 2 -#define DUK_DBL_IDX_US2 1 -#define DUK_DBL_IDX_US3 0 -#define DUK_DBL_IDX_UC0 7 -#define DUK_DBL_IDX_UC1 6 -#define DUK_DBL_IDX_UC2 5 -#define DUK_DBL_IDX_UC3 4 -#define DUK_DBL_IDX_UC4 3 -#define DUK_DBL_IDX_UC5 2 -#define DUK_DBL_IDX_UC6 1 -#define DUK_DBL_IDX_UC7 0 -#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */ -#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */ +#define DUK_DBL_IDX_UI0 1 +#define DUK_DBL_IDX_UI1 0 +#define DUK_DBL_IDX_US0 3 +#define DUK_DBL_IDX_US1 2 +#define DUK_DBL_IDX_US2 1 +#define DUK_DBL_IDX_US3 0 +#define DUK_DBL_IDX_UC0 7 +#define DUK_DBL_IDX_UC1 6 +#define DUK_DBL_IDX_UC2 5 +#define DUK_DBL_IDX_UC3 4 +#define DUK_DBL_IDX_UC4 3 +#define DUK_DBL_IDX_UC5 2 +#define DUK_DBL_IDX_UC6 1 +#define DUK_DBL_IDX_UC7 0 +#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */ +#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */ #elif defined(DUK_USE_DOUBLE_BE) #if defined(DUK_USE_64BIT_OPS) -#define DUK_DBL_IDX_ULL0 0 +#define DUK_DBL_IDX_ULL0 0 #endif -#define DUK_DBL_IDX_UI0 0 -#define DUK_DBL_IDX_UI1 1 -#define DUK_DBL_IDX_US0 0 -#define DUK_DBL_IDX_US1 1 -#define DUK_DBL_IDX_US2 2 -#define DUK_DBL_IDX_US3 3 -#define DUK_DBL_IDX_UC0 0 -#define DUK_DBL_IDX_UC1 1 -#define DUK_DBL_IDX_UC2 2 -#define DUK_DBL_IDX_UC3 3 -#define DUK_DBL_IDX_UC4 4 -#define DUK_DBL_IDX_UC5 5 -#define DUK_DBL_IDX_UC6 6 -#define DUK_DBL_IDX_UC7 7 -#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */ -#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */ +#define DUK_DBL_IDX_UI0 0 +#define DUK_DBL_IDX_UI1 1 +#define DUK_DBL_IDX_US0 0 +#define DUK_DBL_IDX_US1 1 +#define DUK_DBL_IDX_US2 2 +#define DUK_DBL_IDX_US3 3 +#define DUK_DBL_IDX_UC0 0 +#define DUK_DBL_IDX_UC1 1 +#define DUK_DBL_IDX_UC2 2 +#define DUK_DBL_IDX_UC3 3 +#define DUK_DBL_IDX_UC4 4 +#define DUK_DBL_IDX_UC5 5 +#define DUK_DBL_IDX_UC6 6 +#define DUK_DBL_IDX_UC7 7 +#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */ +#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */ #elif defined(DUK_USE_DOUBLE_ME) #if defined(DUK_USE_64BIT_OPS) -#define DUK_DBL_IDX_ULL0 0 /* not directly applicable, byte order differs from a double */ +#define DUK_DBL_IDX_ULL0 0 /* not directly applicable, byte order differs from a double */ #endif -#define DUK_DBL_IDX_UI0 0 -#define DUK_DBL_IDX_UI1 1 -#define DUK_DBL_IDX_US0 1 -#define DUK_DBL_IDX_US1 0 -#define DUK_DBL_IDX_US2 3 -#define DUK_DBL_IDX_US3 2 -#define DUK_DBL_IDX_UC0 3 -#define DUK_DBL_IDX_UC1 2 -#define DUK_DBL_IDX_UC2 1 -#define DUK_DBL_IDX_UC3 0 -#define DUK_DBL_IDX_UC4 7 -#define DUK_DBL_IDX_UC5 6 -#define DUK_DBL_IDX_UC6 5 -#define DUK_DBL_IDX_UC7 4 -#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */ -#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */ +#define DUK_DBL_IDX_UI0 0 +#define DUK_DBL_IDX_UI1 1 +#define DUK_DBL_IDX_US0 1 +#define DUK_DBL_IDX_US1 0 +#define DUK_DBL_IDX_US2 3 +#define DUK_DBL_IDX_US3 2 +#define DUK_DBL_IDX_UC0 3 +#define DUK_DBL_IDX_UC1 2 +#define DUK_DBL_IDX_UC2 1 +#define DUK_DBL_IDX_UC3 0 +#define DUK_DBL_IDX_UC4 7 +#define DUK_DBL_IDX_UC5 6 +#define DUK_DBL_IDX_UC6 5 +#define DUK_DBL_IDX_UC7 4 +#define DUK_DBL_IDX_VP0 DUK_DBL_IDX_UI0 /* packed tval */ +#define DUK_DBL_IDX_VP1 DUK_DBL_IDX_UI1 /* packed tval */ #else #error internal error #endif @@ -345,57 +351,63 @@ typedef union duk_double_union duk_double_union; * by duk_numconv.c and duk_tval.h. */ -#define DUK_DBLUNION_SET_DOUBLE(u,v) do { \ +#define DUK_DBLUNION_SET_DOUBLE(u, v) \ + do { \ (u)->d = (v); \ } while (0) -#define DUK_DBLUNION_SET_HIGH32(u,v) do { \ +#define DUK_DBLUNION_SET_HIGH32(u, v) \ + do { \ (u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) (v); \ } while (0) #if defined(DUK_USE_64BIT_OPS) #if defined(DUK_USE_DOUBLE_ME) -#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u,v) do { \ +#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u, v) \ + do { \ (u)->ull[DUK_DBL_IDX_ULL0] = (duk_uint64_t) (v); \ } while (0) #else -#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u,v) do { \ +#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u, v) \ + do { \ (u)->ull[DUK_DBL_IDX_ULL0] = ((duk_uint64_t) (v)) << 32; \ } while (0) #endif -#else /* DUK_USE_64BIT_OPS */ -#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u,v) do { \ +#else /* DUK_USE_64BIT_OPS */ +#define DUK_DBLUNION_SET_HIGH32_ZERO_LOW32(u, v) \ + do { \ (u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) (v); \ (u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) 0; \ } while (0) -#endif /* DUK_USE_64BIT_OPS */ +#endif /* DUK_USE_64BIT_OPS */ -#define DUK_DBLUNION_SET_LOW32(u,v) do { \ +#define DUK_DBLUNION_SET_LOW32(u, v) \ + do { \ (u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (v); \ } while (0) -#define DUK_DBLUNION_GET_DOUBLE(u) ((u)->d) -#define DUK_DBLUNION_GET_HIGH32(u) ((u)->ui[DUK_DBL_IDX_UI0]) -#define DUK_DBLUNION_GET_LOW32(u) ((u)->ui[DUK_DBL_IDX_UI1]) +#define DUK_DBLUNION_GET_DOUBLE(u) ((u)->d) +#define DUK_DBLUNION_GET_HIGH32(u) ((u)->ui[DUK_DBL_IDX_UI0]) +#define DUK_DBLUNION_GET_LOW32(u) ((u)->ui[DUK_DBL_IDX_UI1]) #if defined(DUK_USE_64BIT_OPS) #if defined(DUK_USE_DOUBLE_ME) -#define DUK_DBLUNION_SET_UINT64(u,v) do { \ +#define DUK_DBLUNION_SET_UINT64(u, v) \ + do { \ (u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) ((v) >> 32); \ (u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (v); \ } while (0) -#define DUK_DBLUNION_GET_UINT64(u) \ - ((((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI0]) << 32) | \ - ((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI1])) +#define DUK_DBLUNION_GET_UINT64(u) ((((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI0]) << 32) | ((duk_uint64_t) (u)->ui[DUK_DBL_IDX_UI1])) #else -#define DUK_DBLUNION_SET_UINT64(u,v) do { \ +#define DUK_DBLUNION_SET_UINT64(u, v) \ + do { \ (u)->ull[DUK_DBL_IDX_ULL0] = (duk_uint64_t) (v); \ } while (0) -#define DUK_DBLUNION_GET_UINT64(u) ((u)->ull[DUK_DBL_IDX_ULL0]) +#define DUK_DBLUNION_GET_UINT64(u) ((u)->ull[DUK_DBL_IDX_ULL0]) #endif -#define DUK_DBLUNION_SET_INT64(u,v) DUK_DBLUNION_SET_UINT64((u), (duk_uint64_t) (v)) -#define DUK_DBLUNION_GET_INT64(u) ((duk_int64_t) DUK_DBLUNION_GET_UINT64((u))) -#endif /* DUK_USE_64BIT_OPS */ +#define DUK_DBLUNION_SET_INT64(u, v) DUK_DBLUNION_SET_UINT64((u), (duk_uint64_t) (v)) +#define DUK_DBLUNION_GET_INT64(u) ((duk_int64_t) DUK_DBLUNION_GET_UINT64((u))) +#endif /* DUK_USE_64BIT_OPS */ /* * Double NaN manipulation macros related to NaN normalization needed when @@ -426,102 +438,85 @@ typedef union duk_double_union duk_double_union; #if defined(DUK_USE_64BIT_OPS) #if defined(DUK_USE_DOUBLE_ME) /* Macros for 64-bit ops + mixed endian doubles. */ -#define DUK__DBLUNION_SET_NAN_FULL(u) do { \ +#define DUK__DBLUNION_SET_NAN_FULL(u) \ + do { \ (u)->ull[DUK_DBL_IDX_ULL0] = DUK_U64_CONSTANT(0x000000007ff80000); \ } while (0) #define DUK__DBLUNION_IS_NAN_FULL(u) \ ((((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x000000007ff00000)) == DUK_U64_CONSTANT(0x000000007ff00000)) && \ ((((u)->ull[DUK_DBL_IDX_ULL0]) & DUK_U64_CONSTANT(0xffffffff000fffff)) != 0)) -#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff80000)) +#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff80000)) #define DUK__DBLUNION_IS_ANYINF(u) \ (((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0xffffffff7fffffff)) == DUK_U64_CONSTANT(0x000000007ff00000)) -#define DUK__DBLUNION_IS_POSINF(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff00000)) -#define DUK__DBLUNION_IS_NEGINF(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x00000000fff00000)) +#define DUK__DBLUNION_IS_POSINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x000000007ff00000)) +#define DUK__DBLUNION_IS_NEGINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x00000000fff00000)) #define DUK__DBLUNION_IS_ANYZERO(u) \ (((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0xffffffff7fffffff)) == DUK_U64_CONSTANT(0x0000000000000000)) -#define DUK__DBLUNION_IS_POSZERO(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000)) -#define DUK__DBLUNION_IS_NEGZERO(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000080000000)) +#define DUK__DBLUNION_IS_POSZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000)) +#define DUK__DBLUNION_IS_NEGZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000080000000)) #else /* Macros for 64-bit ops + big/little endian doubles. */ -#define DUK__DBLUNION_SET_NAN_FULL(u) do { \ +#define DUK__DBLUNION_SET_NAN_FULL(u) \ + do { \ (u)->ull[DUK_DBL_IDX_ULL0] = DUK_U64_CONSTANT(0x7ff8000000000000); \ } while (0) #define DUK__DBLUNION_IS_NAN_FULL(u) \ ((((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x7ff0000000000000)) == DUK_U64_CONSTANT(0x7ff0000000000000)) && \ ((((u)->ull[DUK_DBL_IDX_ULL0]) & DUK_U64_CONSTANT(0x000fffffffffffff)) != 0)) -#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff8000000000000)) +#define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff8000000000000)) #define DUK__DBLUNION_IS_ANYINF(u) \ (((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x7fffffffffffffff)) == DUK_U64_CONSTANT(0x7ff0000000000000)) -#define DUK__DBLUNION_IS_POSINF(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff0000000000000)) -#define DUK__DBLUNION_IS_NEGINF(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0xfff0000000000000)) +#define DUK__DBLUNION_IS_POSINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x7ff0000000000000)) +#define DUK__DBLUNION_IS_NEGINF(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0xfff0000000000000)) #define DUK__DBLUNION_IS_ANYZERO(u) \ (((u)->ull[DUK_DBL_IDX_ULL0] & DUK_U64_CONSTANT(0x7fffffffffffffff)) == DUK_U64_CONSTANT(0x0000000000000000)) -#define DUK__DBLUNION_IS_POSZERO(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000)) -#define DUK__DBLUNION_IS_NEGZERO(u) \ - ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x8000000000000000)) +#define DUK__DBLUNION_IS_POSZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x0000000000000000)) +#define DUK__DBLUNION_IS_NEGZERO(u) ((u)->ull[DUK_DBL_IDX_ULL0] == DUK_U64_CONSTANT(0x8000000000000000)) #endif -#else /* DUK_USE_64BIT_OPS */ +#else /* DUK_USE_64BIT_OPS */ /* Macros for no 64-bit ops, any endianness. */ -#define DUK__DBLUNION_SET_NAN_FULL(u) do { \ +#define DUK__DBLUNION_SET_NAN_FULL(u) \ + do { \ (u)->ui[DUK_DBL_IDX_UI0] = (duk_uint32_t) 0x7ff80000UL; \ (u)->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) 0x00000000UL; \ } while (0) #define DUK__DBLUNION_IS_NAN_FULL(u) \ ((((u)->ui[DUK_DBL_IDX_UI0] & 0x7ff00000UL) == 0x7ff00000UL) && \ - (((u)->ui[DUK_DBL_IDX_UI0] & 0x000fffffUL) != 0 || \ - (u)->ui[DUK_DBL_IDX_UI1] != 0)) + (((u)->ui[DUK_DBL_IDX_UI0] & 0x000fffffUL) != 0 || (u)->ui[DUK_DBL_IDX_UI1] != 0)) #define DUK__DBLUNION_IS_NORMALIZED_NAN_FULL(u) \ - (((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff80000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) + (((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff80000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) #define DUK__DBLUNION_IS_ANYINF(u) \ - ((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x7ff00000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) -#define DUK__DBLUNION_IS_POSINF(u) \ - (((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff00000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) -#define DUK__DBLUNION_IS_NEGINF(u) \ - (((u)->ui[DUK_DBL_IDX_UI0] == 0xfff00000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) + ((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x7ff00000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) +#define DUK__DBLUNION_IS_POSINF(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0x7ff00000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) +#define DUK__DBLUNION_IS_NEGINF(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0xfff00000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) #define DUK__DBLUNION_IS_ANYZERO(u) \ - ((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x00000000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) -#define DUK__DBLUNION_IS_POSZERO(u) \ - (((u)->ui[DUK_DBL_IDX_UI0] == 0x00000000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) -#define DUK__DBLUNION_IS_NEGZERO(u) \ - (((u)->ui[DUK_DBL_IDX_UI0] == 0x80000000UL) && \ - ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) -#endif /* DUK_USE_64BIT_OPS */ + ((((u)->ui[DUK_DBL_IDX_UI0] & 0x7fffffffUL) == 0x00000000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) +#define DUK__DBLUNION_IS_POSZERO(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0x00000000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) +#define DUK__DBLUNION_IS_NEGZERO(u) (((u)->ui[DUK_DBL_IDX_UI0] == 0x80000000UL) && ((u)->ui[DUK_DBL_IDX_UI1] == 0x00000000UL)) +#endif /* DUK_USE_64BIT_OPS */ -#define DUK__DBLUNION_SET_NAN_NOTFULL(u) do { \ +#define DUK__DBLUNION_SET_NAN_NOTFULL(u) \ + do { \ (u)->us[DUK_DBL_IDX_US0] = 0x7ff8UL; \ } while (0) #define DUK__DBLUNION_IS_NAN_NOTFULL(u) \ /* E == 0x7ff, topmost four bits of F != 0 => assume NaN */ \ - ((((u)->us[DUK_DBL_IDX_US0] & 0x7ff0UL) == 0x7ff0UL) && \ - (((u)->us[DUK_DBL_IDX_US0] & 0x000fUL) != 0x0000UL)) + ((((u)->us[DUK_DBL_IDX_US0] & 0x7ff0UL) == 0x7ff0UL) && (((u)->us[DUK_DBL_IDX_US0] & 0x000fUL) != 0x0000UL)) #define DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL(u) \ /* E == 0x7ff, F == 8 => normalized NaN */ \ ((u)->us[DUK_DBL_IDX_US0] == 0x7ff8UL) -#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL(u) do { \ +#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL(u) \ + do { \ if (DUK__DBLUNION_IS_NAN_FULL((u))) { \ DUK__DBLUNION_SET_NAN_FULL((u)); \ } \ } while (0) -#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL(u) do { \ +#define DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL(u) \ + do { \ /* Check must be full. */ \ if (DUK__DBLUNION_IS_NAN_FULL((u))) { \ DUK__DBLUNION_SET_NAN_NOTFULL((u)); \ @@ -535,29 +530,30 @@ typedef union duk_double_union duk_double_union; */ #if defined(DUK_USE_PACKED_TVAL) -#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL((u)) -#define DUK_DBLUNION_IS_NAN(u) DUK__DBLUNION_IS_NAN_FULL((u)) -#define DUK_DBLUNION_IS_NORMALIZED_NAN(u) DUK__DBLUNION_IS_NORMALIZED_NAN_FULL((u)) -#define DUK_DBLUNION_SET_NAN(d) DUK__DBLUNION_SET_NAN_FULL((d)) +#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL((u)) +#define DUK_DBLUNION_IS_NAN(u) DUK__DBLUNION_IS_NAN_FULL((u)) +#define DUK_DBLUNION_IS_NORMALIZED_NAN(u) DUK__DBLUNION_IS_NORMALIZED_NAN_FULL((u)) +#define DUK_DBLUNION_SET_NAN(d) DUK__DBLUNION_SET_NAN_FULL((d)) #if 0 -#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL((u)) -#define DUK_DBLUNION_IS_NAN(u) DUK__DBLUNION_IS_NAN_NOTFULL((u)) -#define DUK_DBLUNION_IS_NORMALIZED_NAN(u) DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL((u)) -#define DUK_DBLUNION_SET_NAN(d) DUK__DBLUNION_SET_NAN_NOTFULL((d)) +#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL((u)) +#define DUK_DBLUNION_IS_NAN(u) DUK__DBLUNION_IS_NAN_NOTFULL((u)) +#define DUK_DBLUNION_IS_NORMALIZED_NAN(u) DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL((u)) +#define DUK_DBLUNION_SET_NAN(d) DUK__DBLUNION_SET_NAN_NOTFULL((d)) #endif #define DUK_DBLUNION_IS_NORMALIZED(u) \ - (!DUK_DBLUNION_IS_NAN((u)) || /* either not a NaN */ \ - DUK_DBLUNION_IS_NORMALIZED_NAN((u))) /* or is a normalized NaN */ -#else /* DUK_USE_PACKED_TVAL */ -#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) /* nop: no need to normalize */ -#define DUK_DBLUNION_IS_NAN(u) DUK__DBLUNION_IS_NAN_FULL((u)) /* (DUK_ISNAN((u)->d)) */ -#define DUK_DBLUNION_IS_NORMALIZED_NAN(u) DUK__DBLUNION_IS_NAN_FULL((u)) /* (DUK_ISNAN((u)->d)) */ -#define DUK_DBLUNION_IS_NORMALIZED(u) 1 /* all doubles are considered normalized */ -#define DUK_DBLUNION_SET_NAN(u) do { \ + (!DUK_DBLUNION_IS_NAN((u)) || /* either not a NaN */ \ + DUK_DBLUNION_IS_NORMALIZED_NAN((u))) /* or is a normalized NaN */ +#else /* DUK_USE_PACKED_TVAL */ +#define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u) /* nop: no need to normalize */ +#define DUK_DBLUNION_IS_NAN(u) DUK__DBLUNION_IS_NAN_FULL((u)) /* (DUK_ISNAN((u)->d)) */ +#define DUK_DBLUNION_IS_NORMALIZED_NAN(u) DUK__DBLUNION_IS_NAN_FULL((u)) /* (DUK_ISNAN((u)->d)) */ +#define DUK_DBLUNION_IS_NORMALIZED(u) 1 /* all doubles are considered normalized */ +#define DUK_DBLUNION_SET_NAN(u) \ + do { \ /* in non-packed representation we don't care about which NaN is used */ \ (u)->d = DUK_DOUBLE_NAN; \ } while (0) -#endif /* DUK_USE_PACKED_TVAL */ +#endif /* DUK_USE_PACKED_TVAL */ #define DUK_DBLUNION_IS_ANYINF(u) DUK__DBLUNION_IS_ANYINF((u)) #define DUK_DBLUNION_IS_POSINF(u) DUK__DBLUNION_IS_POSINF((u)) @@ -570,7 +566,8 @@ typedef union duk_double_union duk_double_union; /* XXX: native 64-bit byteswaps when available */ /* 64-bit byteswap, same operation independent of target endianness. */ -#define DUK_DBLUNION_BSWAP64(u) do { \ +#define DUK_DBLUNION_BSWAP64(u) \ + do { \ duk_uint32_t duk__bswaptmp1, duk__bswaptmp2; \ duk__bswaptmp1 = (u)->ui[0]; \ duk__bswaptmp2 = (u)->ui[1]; \ @@ -584,7 +581,8 @@ typedef union duk_double_union duk_double_union; * order. For a big endian target this is a no-op. */ #if defined(DUK_USE_DOUBLE_LE) -#define DUK_DBLUNION_DOUBLE_HTON(u) do { \ +#define DUK_DBLUNION_DOUBLE_HTON(u) \ + do { \ duk_uint32_t duk__bswaptmp1, duk__bswaptmp2; \ duk__bswaptmp1 = (u)->ui[0]; \ duk__bswaptmp2 = (u)->ui[1]; \ @@ -594,7 +592,8 @@ typedef union duk_double_union duk_double_union; (u)->ui[1] = duk__bswaptmp1; \ } while (0) #elif defined(DUK_USE_DOUBLE_ME) -#define DUK_DBLUNION_DOUBLE_HTON(u) do { \ +#define DUK_DBLUNION_DOUBLE_HTON(u) \ + do { \ duk_uint32_t duk__bswaptmp1, duk__bswaptmp2; \ duk__bswaptmp1 = (u)->ui[0]; \ duk__bswaptmp2 = (u)->ui[1]; \ @@ -604,7 +603,9 @@ typedef union duk_double_union duk_double_union; (u)->ui[1] = duk__bswaptmp2; \ } while (0) #elif defined(DUK_USE_DOUBLE_BE) -#define DUK_DBLUNION_DOUBLE_HTON(u) do { } while (0) +#define DUK_DBLUNION_DOUBLE_HTON(u) \ + do { \ + } while (0) #else #error internal error, double endianness insane #endif @@ -621,7 +622,7 @@ typedef union duk_double_union duk_double_union; #define DUK_DBLUNION_GET_SIGNBIT(u) (((u)->ui[DUK_DBL_IDX_UI0] >> 31U)) #endif -#endif /* DUK_DBLUNION_H_INCLUDED */ +#endif /* DUK_DBLUNION_H_INCLUDED */ /* #include duk_fltunion.h */ /* * Union to access IEEE float memory representation. @@ -642,26 +643,26 @@ union duk_float_union { typedef union duk_float_union duk_float_union; #if defined(DUK_USE_DOUBLE_LE) || defined(DUK_USE_DOUBLE_ME) -#define DUK_FLT_IDX_UI0 0 -#define DUK_FLT_IDX_US0 1 -#define DUK_FLT_IDX_US1 0 -#define DUK_FLT_IDX_UC0 3 -#define DUK_FLT_IDX_UC1 2 -#define DUK_FLT_IDX_UC2 1 -#define DUK_FLT_IDX_UC3 0 +#define DUK_FLT_IDX_UI0 0 +#define DUK_FLT_IDX_US0 1 +#define DUK_FLT_IDX_US1 0 +#define DUK_FLT_IDX_UC0 3 +#define DUK_FLT_IDX_UC1 2 +#define DUK_FLT_IDX_UC2 1 +#define DUK_FLT_IDX_UC3 0 #elif defined(DUK_USE_DOUBLE_BE) -#define DUK_FLT_IDX_UI0 0 -#define DUK_FLT_IDX_US0 0 -#define DUK_FLT_IDX_US1 1 -#define DUK_FLT_IDX_UC0 0 -#define DUK_FLT_IDX_UC1 1 -#define DUK_FLT_IDX_UC2 2 -#define DUK_FLT_IDX_UC3 3 +#define DUK_FLT_IDX_UI0 0 +#define DUK_FLT_IDX_US0 0 +#define DUK_FLT_IDX_US1 1 +#define DUK_FLT_IDX_UC0 0 +#define DUK_FLT_IDX_UC1 1 +#define DUK_FLT_IDX_UC2 2 +#define DUK_FLT_IDX_UC3 3 #else #error internal error #endif -#endif /* DUK_FLTUNION_H_INCLUDED */ +#endif /* DUK_FLTUNION_H_INCLUDED */ /* #include duk_replacements.h */ #if !defined(DUK_REPLACEMENTS_H_INCLUDED) #define DUK_REPLACEMENTS_H_INCLUDED @@ -673,7 +674,7 @@ DUK_INTERNAL_DECL double duk_computed_infinity; #if defined(DUK_USE_COMPUTED_NAN) DUK_INTERNAL_DECL double duk_computed_nan; #endif -#endif /* !DUK_SINGLE_FILE */ +#endif /* !DUK_SINGLE_FILE */ #if defined(DUK_USE_REPL_FPCLASSIFY) DUK_INTERNAL_DECL int duk_repl_fpclassify(double x); @@ -691,7 +692,7 @@ DUK_INTERNAL_DECL int duk_repl_isnan(double x); DUK_INTERNAL_DECL int duk_repl_isinf(double x); #endif -#endif /* DUK_REPLACEMENTS_H_INCLUDED */ +#endif /* DUK_REPLACEMENTS_H_INCLUDED */ /* #include duk_jmpbuf.h */ /* * Wrapper for jmp_buf. @@ -708,7 +709,7 @@ DUK_INTERNAL_DECL int duk_repl_isinf(double x); #if defined(DUK_USE_CPP_EXCEPTIONS) struct duk_jmpbuf { - duk_small_int_t dummy; /* unused */ + duk_small_int_t dummy; /* unused */ }; #else struct duk_jmpbuf { @@ -716,7 +717,7 @@ struct duk_jmpbuf { }; #endif -#endif /* DUK_JMPBUF_H_INCLUDED */ +#endif /* DUK_JMPBUF_H_INCLUDED */ /* #include duk_exception.h */ /* * Exceptions for Duktape internal throws when C++ exceptions are used @@ -742,12 +743,13 @@ class duk_internal_exception { * aware of the "unsafe to continue" semantics. */ class duk_fatal_exception : public virtual std::runtime_error { - public: - duk_fatal_exception(const char *message) : std::runtime_error(message) {} + public: + duk_fatal_exception(const char *message) : std::runtime_error(message) { + } }; #endif -#endif /* DUK_EXCEPTION_H_INCLUDED */ +#endif /* DUK_EXCEPTION_H_INCLUDED */ /* #include duk_forwdecl.h */ /* * Forward declarations for all Duktape structures. @@ -882,7 +884,7 @@ typedef struct duk_compiler_ctx duk_compiler_ctx; typedef struct duk_re_matcher_ctx duk_re_matcher_ctx; typedef struct duk_re_compiler_ctx duk_re_compiler_ctx; -#endif /* DUK_FORWDECL_H_INCLUDED */ +#endif /* DUK_FORWDECL_H_INCLUDED */ /* #include duk_tval.h */ /* * Tagged type definition (duk_tval) and accessor macros. @@ -927,30 +929,29 @@ typedef struct { } duk_tval_unused; /* tags */ -#define DUK_TAG_NORMALIZED_NAN 0x7ff8UL /* the NaN variant we use */ +#define DUK_TAG_NORMALIZED_NAN 0x7ff8UL /* the NaN variant we use */ /* avoid tag 0xfff0, no risk of confusion with negative infinity */ -#define DUK_TAG_MIN 0xfff1UL +#define DUK_TAG_MIN 0xfff1UL #if defined(DUK_USE_FASTINT) -#define DUK_TAG_FASTINT 0xfff1UL /* embed: integer value */ +#define DUK_TAG_FASTINT 0xfff1UL /* embed: integer value */ #endif -#define DUK_TAG_UNUSED 0xfff2UL /* marker; not actual tagged value */ -#define DUK_TAG_UNDEFINED 0xfff3UL /* embed: nothing */ -#define DUK_TAG_NULL 0xfff4UL /* embed: nothing */ -#define DUK_TAG_BOOLEAN 0xfff5UL /* embed: 0 or 1 (false or true) */ +#define DUK_TAG_UNUSED 0xfff2UL /* marker; not actual tagged value */ +#define DUK_TAG_UNDEFINED 0xfff3UL /* embed: nothing */ +#define DUK_TAG_NULL 0xfff4UL /* embed: nothing */ +#define DUK_TAG_BOOLEAN 0xfff5UL /* embed: 0 or 1 (false or true) */ /* DUK_TAG_NUMBER would logically go here, but it has multiple 'tags' */ -#define DUK_TAG_POINTER 0xfff6UL /* embed: void ptr */ -#define DUK_TAG_LIGHTFUNC 0xfff7UL /* embed: func ptr */ -#define DUK_TAG_STRING 0xfff8UL /* embed: duk_hstring ptr */ -#define DUK_TAG_OBJECT 0xfff9UL /* embed: duk_hobject ptr */ -#define DUK_TAG_BUFFER 0xfffaUL /* embed: duk_hbuffer ptr */ -#define DUK_TAG_MAX 0xfffaUL +#define DUK_TAG_POINTER 0xfff6UL /* embed: void ptr */ +#define DUK_TAG_LIGHTFUNC 0xfff7UL /* embed: func ptr */ +#define DUK_TAG_STRING 0xfff8UL /* embed: duk_hstring ptr */ +#define DUK_TAG_OBJECT 0xfff9UL /* embed: duk_hobject ptr */ +#define DUK_TAG_BUFFER 0xfffaUL /* embed: duk_hbuffer ptr */ +#define DUK_TAG_MAX 0xfffaUL /* for convenience */ -#define DUK_XTAG_BOOLEAN_FALSE 0xfff50000UL -#define DUK_XTAG_BOOLEAN_TRUE 0xfff50001UL +#define DUK_XTAG_BOOLEAN_FALSE 0xfff50000UL +#define DUK_XTAG_BOOLEAN_TRUE 0xfff50001UL -#define DUK_TVAL_IS_VALID_TAG(tv) \ - (DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN) +#define DUK_TVAL_IS_VALID_TAG(tv) (DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN) /* DUK_TVAL_UNUSED initializer for duk_tval_unused, works for any endianness. */ #define DUK_TVAL_UNUSED_INITIALIZER() \ @@ -959,116 +960,136 @@ typedef struct { /* two casts to avoid gcc warning: "warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]" */ #if defined(DUK_USE_64BIT_OPS) #if defined(DUK_USE_DOUBLE_ME) -#define DUK__TVAL_SET_TAGGEDPOINTER(tv,h,tag) do { \ +#define DUK__TVAL_SET_TAGGEDPOINTER(tv, h, tag) \ + do { \ (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) (tag)) << 16) | (((duk_uint64_t) (duk_uint32_t) (h)) << 32); \ } while (0) #else -#define DUK__TVAL_SET_TAGGEDPOINTER(tv,h,tag) do { \ +#define DUK__TVAL_SET_TAGGEDPOINTER(tv, h, tag) \ + do { \ (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) (tag)) << 48) | ((duk_uint64_t) (duk_uint32_t) (h)); \ } while (0) #endif -#else /* DUK_USE_64BIT_OPS */ -#define DUK__TVAL_SET_TAGGEDPOINTER(tv,h,tag) do { \ +#else /* DUK_USE_64BIT_OPS */ +#define DUK__TVAL_SET_TAGGEDPOINTER(tv, h, tag) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->ui[DUK_DBL_IDX_UI0] = ((duk_uint32_t) (tag)) << 16; \ duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (h); \ } while (0) -#endif /* DUK_USE_64BIT_OPS */ +#endif /* DUK_USE_64BIT_OPS */ #if defined(DUK_USE_64BIT_OPS) /* Double casting for pointer to avoid gcc warning (cast from pointer to integer of different size) */ #if defined(DUK_USE_DOUBLE_ME) -#define DUK__TVAL_SET_LIGHTFUNC(tv,fp,flags) do { \ - (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 16) | \ - ((duk_uint64_t) (flags)) | \ +#define DUK__TVAL_SET_LIGHTFUNC(tv, fp, flags) \ + do { \ + (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 16) | ((duk_uint64_t) (flags)) | \ (((duk_uint64_t) (duk_uint32_t) (fp)) << 32); \ } while (0) #else -#define DUK__TVAL_SET_LIGHTFUNC(tv,fp,flags) do { \ - (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 48) | \ - (((duk_uint64_t) (flags)) << 32) | \ +#define DUK__TVAL_SET_LIGHTFUNC(tv, fp, flags) \ + do { \ + (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_LIGHTFUNC) << 48) | (((duk_uint64_t) (flags)) << 32) | \ ((duk_uint64_t) (duk_uint32_t) (fp)); \ } while (0) #endif -#else /* DUK_USE_64BIT_OPS */ -#define DUK__TVAL_SET_LIGHTFUNC(tv,fp,flags) do { \ +#else /* DUK_USE_64BIT_OPS */ +#define DUK__TVAL_SET_LIGHTFUNC(tv, fp, flags) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->ui[DUK_DBL_IDX_UI0] = (((duk_uint32_t) DUK_TAG_LIGHTFUNC) << 16) | ((duk_uint32_t) (flags)); \ duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (fp); \ } while (0) -#endif /* DUK_USE_64BIT_OPS */ +#endif /* DUK_USE_64BIT_OPS */ #if defined(DUK_USE_FASTINT) /* Note: masking is done for 'i' to deal with negative numbers correctly */ #if defined(DUK_USE_DOUBLE_ME) -#define DUK__TVAL_SET_I48(tv,i) do { \ +#define DUK__TVAL_SET_I48(tv, i) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ - duk__tv->ui[DUK_DBL_IDX_UI0] = ((duk_uint32_t) DUK_TAG_FASTINT) << 16 | (((duk_uint32_t) ((i) >> 32)) & 0x0000ffffUL); \ + duk__tv->ui[DUK_DBL_IDX_UI0] = \ + ((duk_uint32_t) DUK_TAG_FASTINT) << 16 | (((duk_uint32_t) ((i) >> 32)) & 0x0000ffffUL); \ duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (i); \ } while (0) -#define DUK__TVAL_SET_U32(tv,i) do { \ +#define DUK__TVAL_SET_U32(tv, i) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->ui[DUK_DBL_IDX_UI0] = ((duk_uint32_t) DUK_TAG_FASTINT) << 16; \ duk__tv->ui[DUK_DBL_IDX_UI1] = (duk_uint32_t) (i); \ } while (0) #else -#define DUK__TVAL_SET_I48(tv,i) do { \ - (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_FASTINT) << 48) | (((duk_uint64_t) (i)) & DUK_U64_CONSTANT(0x0000ffffffffffff)); \ +#define DUK__TVAL_SET_I48(tv, i) \ + do { \ + (tv)->ull[DUK_DBL_IDX_ULL0] = \ + (((duk_uint64_t) DUK_TAG_FASTINT) << 48) | (((duk_uint64_t) (i)) & DUK_U64_CONSTANT(0x0000ffffffffffff)); \ } while (0) -#define DUK__TVAL_SET_U32(tv,i) do { \ +#define DUK__TVAL_SET_U32(tv, i) \ + do { \ (tv)->ull[DUK_DBL_IDX_ULL0] = (((duk_uint64_t) DUK_TAG_FASTINT) << 48) | (duk_uint64_t) (i); \ } while (0) #endif /* This needs to go through a cast because sign extension is needed. */ -#define DUK__TVAL_SET_I32(tv,i) do { \ +#define DUK__TVAL_SET_I32(tv, i) \ + do { \ duk_int64_t duk__tmp = (duk_int64_t) (i); \ DUK_TVAL_SET_I48((tv), duk__tmp); \ } while (0) /* XXX: Clumsy sign extend and masking of 16 topmost bits. */ #if defined(DUK_USE_DOUBLE_ME) -#define DUK__TVAL_GET_FASTINT(tv) (((duk_int64_t) ((((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI0]) << 32) | ((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI1]))) << 16 >> 16) +#define DUK__TVAL_GET_FASTINT(tv) \ + (((duk_int64_t) ((((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI0]) << 32) | ((duk_uint64_t) (tv)->ui[DUK_DBL_IDX_UI1]))) \ + << 16 >> \ + 16) #else -#define DUK__TVAL_GET_FASTINT(tv) ((((duk_int64_t) (tv)->ull[DUK_DBL_IDX_ULL0]) << 16) >> 16) +#define DUK__TVAL_GET_FASTINT(tv) ((((duk_int64_t) (tv)->ull[DUK_DBL_IDX_ULL0]) << 16) >> 16) #endif -#define DUK__TVAL_GET_FASTINT_U32(tv) ((tv)->ui[DUK_DBL_IDX_UI1]) -#define DUK__TVAL_GET_FASTINT_I32(tv) ((duk_int32_t) (tv)->ui[DUK_DBL_IDX_UI1]) -#endif /* DUK_USE_FASTINT */ +#define DUK__TVAL_GET_FASTINT_U32(tv) ((tv)->ui[DUK_DBL_IDX_UI1]) +#define DUK__TVAL_GET_FASTINT_I32(tv) ((duk_int32_t) (tv)->ui[DUK_DBL_IDX_UI1]) +#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_UNDEFINED(tv) do { \ +#define DUK_TVAL_SET_UNDEFINED(tv) \ + do { \ (tv)->us[DUK_DBL_IDX_US0] = (duk_uint16_t) DUK_TAG_UNDEFINED; \ } while (0) -#define DUK_TVAL_SET_UNUSED(tv) do { \ +#define DUK_TVAL_SET_UNUSED(tv) \ + do { \ (tv)->us[DUK_DBL_IDX_US0] = (duk_uint16_t) DUK_TAG_UNUSED; \ } while (0) -#define DUK_TVAL_SET_NULL(tv) do { \ +#define DUK_TVAL_SET_NULL(tv) \ + do { \ (tv)->us[DUK_DBL_IDX_US0] = (duk_uint16_t) DUK_TAG_NULL; \ } while (0) -#define DUK_TVAL_SET_BOOLEAN(tv,val) DUK_DBLUNION_SET_HIGH32((tv), (((duk_uint32_t) DUK_TAG_BOOLEAN) << 16) | ((duk_uint32_t) (val))) +#define DUK_TVAL_SET_BOOLEAN(tv, val) \ + DUK_DBLUNION_SET_HIGH32((tv), (((duk_uint32_t) DUK_TAG_BOOLEAN) << 16) | ((duk_uint32_t) (val))) -#define DUK_TVAL_SET_NAN(tv) DUK_DBLUNION_SET_NAN_FULL((tv)) +#define DUK_TVAL_SET_NAN(tv) DUK_DBLUNION_SET_NAN_FULL((tv)) /* Assumes that caller has normalized NaNs, otherwise trouble ahead. */ #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_SET_DOUBLE(tv,d) do { \ +#define DUK_TVAL_SET_DOUBLE(tv, d) \ + do { \ duk_double_t duk__dblval; \ duk__dblval = (d); \ DUK_ASSERT_DOUBLE_IS_NORMALIZED(duk__dblval); \ DUK_DBLUNION_SET_DOUBLE((tv), duk__dblval); \ } while (0) -#define DUK_TVAL_SET_I48(tv,i) DUK__TVAL_SET_I48((tv), (i)) -#define DUK_TVAL_SET_I32(tv,i) DUK__TVAL_SET_I32((tv), (i)) -#define DUK_TVAL_SET_U32(tv,i) DUK__TVAL_SET_U32((tv), (i)) -#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d) duk_tval_set_number_chkfast_fast((tv), (d)) -#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d) duk_tval_set_number_chkfast_slow((tv), (d)) -#define DUK_TVAL_SET_NUMBER(tv,d) DUK_TVAL_SET_DOUBLE((tv), (d)) -#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) do { \ +#define DUK_TVAL_SET_I48(tv, i) DUK__TVAL_SET_I48((tv), (i)) +#define DUK_TVAL_SET_I32(tv, i) DUK__TVAL_SET_I32((tv), (i)) +#define DUK_TVAL_SET_U32(tv, i) DUK__TVAL_SET_U32((tv), (i)) +#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) duk_tval_set_number_chkfast_fast((tv), (d)) +#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) duk_tval_set_number_chkfast_slow((tv), (d)) +#define DUK_TVAL_SET_NUMBER(tv, d) DUK_TVAL_SET_DOUBLE((tv), (d)) +#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \ + do { \ duk_tval *duk__tv; \ duk_double_t duk__d; \ duk__tv = (tv); \ @@ -1077,7 +1098,8 @@ typedef struct { DUK_TVAL_SET_NUMBER_CHKFAST_FAST(duk__tv, duk__d); \ } \ } while (0) -#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) do { \ +#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \ + do { \ duk_tval *duk__tv; \ duk_double_t duk__d; \ duk__tv = (tv); \ @@ -1086,89 +1108,98 @@ typedef struct { DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(duk__tv, duk__d); \ } \ } while (0) -#else /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_DOUBLE(tv,d) do { \ +#else /* DUK_USE_FASTINT */ +#define DUK_TVAL_SET_DOUBLE(tv, d) \ + do { \ duk_double_t duk__dblval; \ duk__dblval = (d); \ DUK_ASSERT_DOUBLE_IS_NORMALIZED(duk__dblval); \ DUK_DBLUNION_SET_DOUBLE((tv), duk__dblval); \ } while (0) -#define DUK_TVAL_SET_I48(tv,i) DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) /* XXX: fast int-to-double */ -#define DUK_TVAL_SET_I32(tv,i) DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) -#define DUK_TVAL_SET_U32(tv,i) DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) -#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d) DUK_TVAL_SET_DOUBLE((tv), (d)) -#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d) DUK_TVAL_SET_DOUBLE((tv), (d)) -#define DUK_TVAL_SET_NUMBER(tv,d) DUK_TVAL_SET_DOUBLE((tv), (d)) -#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) do { } while (0) -#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) do { } while (0) -#endif /* DUK_USE_FASTINT */ +#define DUK_TVAL_SET_I48(tv, i) DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) /* XXX: fast int-to-double */ +#define DUK_TVAL_SET_I32(tv, i) DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) +#define DUK_TVAL_SET_U32(tv, i) DUK_TVAL_SET_DOUBLE((tv), (duk_double_t) (i)) +#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) DUK_TVAL_SET_DOUBLE((tv), (d)) +#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) DUK_TVAL_SET_DOUBLE((tv), (d)) +#define DUK_TVAL_SET_NUMBER(tv, d) DUK_TVAL_SET_DOUBLE((tv), (d)) +#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \ + do { \ + } while (0) +#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \ + do { \ + } while (0) +#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_FASTINT(tv,i) DUK_TVAL_SET_I48((tv), (i)) /* alias */ +#define DUK_TVAL_SET_FASTINT(tv, i) DUK_TVAL_SET_I48((tv), (i)) /* alias */ -#define DUK_TVAL_SET_LIGHTFUNC(tv,fp,flags) DUK__TVAL_SET_LIGHTFUNC((tv), (fp), (flags)) -#define DUK_TVAL_SET_STRING(tv,h) DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_STRING) -#define DUK_TVAL_SET_OBJECT(tv,h) DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_OBJECT) -#define DUK_TVAL_SET_BUFFER(tv,h) DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_BUFFER) -#define DUK_TVAL_SET_POINTER(tv,p) DUK__TVAL_SET_TAGGEDPOINTER((tv), (p), DUK_TAG_POINTER) +#define DUK_TVAL_SET_LIGHTFUNC(tv, fp, flags) DUK__TVAL_SET_LIGHTFUNC((tv), (fp), (flags)) +#define DUK_TVAL_SET_STRING(tv, h) DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_STRING) +#define DUK_TVAL_SET_OBJECT(tv, h) DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_OBJECT) +#define DUK_TVAL_SET_BUFFER(tv, h) DUK__TVAL_SET_TAGGEDPOINTER((tv), (h), DUK_TAG_BUFFER) +#define DUK_TVAL_SET_POINTER(tv, p) DUK__TVAL_SET_TAGGEDPOINTER((tv), (p), DUK_TAG_POINTER) -#define DUK_TVAL_SET_TVAL(tv,x) do { *(tv) = *(x); } while (0) +#define DUK_TVAL_SET_TVAL(tv, x) \ + do { \ + *(tv) = *(x); \ + } while (0) /* getters */ -#define DUK_TVAL_GET_BOOLEAN(tv) ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US1]) +#define DUK_TVAL_GET_BOOLEAN(tv) ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US1]) #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->d) -#define DUK_TVAL_GET_FASTINT(tv) DUK__TVAL_GET_FASTINT((tv)) -#define DUK_TVAL_GET_FASTINT_U32(tv) DUK__TVAL_GET_FASTINT_U32((tv)) -#define DUK_TVAL_GET_FASTINT_I32(tv) DUK__TVAL_GET_FASTINT_I32((tv)) -#define DUK_TVAL_GET_NUMBER(tv) duk_tval_get_number_packed((tv)) +#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->d) +#define DUK_TVAL_GET_FASTINT(tv) DUK__TVAL_GET_FASTINT((tv)) +#define DUK_TVAL_GET_FASTINT_U32(tv) DUK__TVAL_GET_FASTINT_U32((tv)) +#define DUK_TVAL_GET_FASTINT_I32(tv) DUK__TVAL_GET_FASTINT_I32((tv)) +#define DUK_TVAL_GET_NUMBER(tv) duk_tval_get_number_packed((tv)) #else -#define DUK_TVAL_GET_NUMBER(tv) ((tv)->d) -#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->d) +#define DUK_TVAL_GET_NUMBER(tv) ((tv)->d) +#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->d) #endif -#define DUK_TVAL_GET_LIGHTFUNC(tv,out_fp,out_flags) do { \ +#define DUK_TVAL_GET_LIGHTFUNC(tv, out_fp, out_flags) \ + do { \ (out_flags) = (tv)->ui[DUK_DBL_IDX_UI0] & 0xffffUL; \ (out_fp) = (duk_c_function) (tv)->ui[DUK_DBL_IDX_UI1]; \ } while (0) -#define DUK_TVAL_GET_LIGHTFUNC_FUNCPTR(tv) ((duk_c_function) ((tv)->ui[DUK_DBL_IDX_UI1])) -#define DUK_TVAL_GET_LIGHTFUNC_FLAGS(tv) (((duk_small_uint_t) (tv)->ui[DUK_DBL_IDX_UI0]) & 0xffffUL) -#define DUK_TVAL_GET_STRING(tv) ((duk_hstring *) (tv)->vp[DUK_DBL_IDX_VP1]) -#define DUK_TVAL_GET_OBJECT(tv) ((duk_hobject *) (tv)->vp[DUK_DBL_IDX_VP1]) -#define DUK_TVAL_GET_BUFFER(tv) ((duk_hbuffer *) (tv)->vp[DUK_DBL_IDX_VP1]) -#define DUK_TVAL_GET_POINTER(tv) ((void *) (tv)->vp[DUK_DBL_IDX_VP1]) -#define DUK_TVAL_GET_HEAPHDR(tv) ((duk_heaphdr *) (tv)->vp[DUK_DBL_IDX_VP1]) +#define DUK_TVAL_GET_LIGHTFUNC_FUNCPTR(tv) ((duk_c_function) ((tv)->ui[DUK_DBL_IDX_UI1])) +#define DUK_TVAL_GET_LIGHTFUNC_FLAGS(tv) (((duk_small_uint_t) (tv)->ui[DUK_DBL_IDX_UI0]) & 0xffffUL) +#define DUK_TVAL_GET_STRING(tv) ((duk_hstring *) (tv)->vp[DUK_DBL_IDX_VP1]) +#define DUK_TVAL_GET_OBJECT(tv) ((duk_hobject *) (tv)->vp[DUK_DBL_IDX_VP1]) +#define DUK_TVAL_GET_BUFFER(tv) ((duk_hbuffer *) (tv)->vp[DUK_DBL_IDX_VP1]) +#define DUK_TVAL_GET_POINTER(tv) ((void *) (tv)->vp[DUK_DBL_IDX_VP1]) +#define DUK_TVAL_GET_HEAPHDR(tv) ((duk_heaphdr *) (tv)->vp[DUK_DBL_IDX_VP1]) /* decoding */ -#define DUK_TVAL_GET_TAG(tv) ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US0]) +#define DUK_TVAL_GET_TAG(tv) ((duk_small_uint_t) (tv)->us[DUK_DBL_IDX_US0]) -#define DUK_TVAL_IS_UNDEFINED(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNDEFINED) -#define DUK_TVAL_IS_UNUSED(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNUSED) -#define DUK_TVAL_IS_NULL(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_NULL) -#define DUK_TVAL_IS_BOOLEAN(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BOOLEAN) -#define DUK_TVAL_IS_BOOLEAN_TRUE(tv) ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_TRUE) -#define DUK_TVAL_IS_BOOLEAN_FALSE(tv) ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_FALSE) -#define DUK_TVAL_IS_LIGHTFUNC(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_LIGHTFUNC) -#define DUK_TVAL_IS_STRING(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_STRING) -#define DUK_TVAL_IS_OBJECT(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_OBJECT) -#define DUK_TVAL_IS_BUFFER(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BUFFER) -#define DUK_TVAL_IS_POINTER(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_POINTER) +#define DUK_TVAL_IS_UNDEFINED(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNDEFINED) +#define DUK_TVAL_IS_UNUSED(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_UNUSED) +#define DUK_TVAL_IS_NULL(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_NULL) +#define DUK_TVAL_IS_BOOLEAN(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BOOLEAN) +#define DUK_TVAL_IS_BOOLEAN_TRUE(tv) ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_TRUE) +#define DUK_TVAL_IS_BOOLEAN_FALSE(tv) ((tv)->ui[DUK_DBL_IDX_UI0] == DUK_XTAG_BOOLEAN_FALSE) +#define DUK_TVAL_IS_LIGHTFUNC(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_LIGHTFUNC) +#define DUK_TVAL_IS_STRING(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_STRING) +#define DUK_TVAL_IS_OBJECT(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_OBJECT) +#define DUK_TVAL_IS_BUFFER(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_BUFFER) +#define DUK_TVAL_IS_POINTER(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_POINTER) #if defined(DUK_USE_FASTINT) /* 0xfff0 is -Infinity */ -#define DUK_TVAL_IS_DOUBLE(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL) -#define DUK_TVAL_IS_FASTINT(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_FASTINT) -#define DUK_TVAL_IS_NUMBER(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff1UL) +#define DUK_TVAL_IS_DOUBLE(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL) +#define DUK_TVAL_IS_FASTINT(tv) (DUK_TVAL_GET_TAG((tv)) == DUK_TAG_FASTINT) +#define DUK_TVAL_IS_NUMBER(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff1UL) #else -#define DUK_TVAL_IS_NUMBER(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL) -#define DUK_TVAL_IS_DOUBLE(tv) DUK_TVAL_IS_NUMBER((tv)) +#define DUK_TVAL_IS_NUMBER(tv) (DUK_TVAL_GET_TAG((tv)) <= 0xfff0UL) +#define DUK_TVAL_IS_DOUBLE(tv) DUK_TVAL_IS_NUMBER((tv)) #endif /* This is performance critical because it appears in every DECREF. */ -#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) (DUK_TVAL_GET_TAG((tv)) >= DUK_TAG_STRING) +#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) (DUK_TVAL_GET_TAG((tv)) >= DUK_TAG_STRING) #if defined(DUK_USE_FASTINT) DUK_INTERNAL_DECL duk_double_t duk_tval_get_number_packed(duk_tval *tv); #endif -#else /* DUK_USE_PACKED_TVAL */ +#else /* DUK_USE_PACKED_TVAL */ /* ======================================================================== */ /* @@ -1192,7 +1223,7 @@ struct duk_tval_struct { duk_double_t d; duk_small_int_t i; #if defined(DUK_USE_FASTINT) - duk_int64_t fi; /* if present, forces 16-byte duk_tval */ + duk_int64_t fi; /* if present, forces 16-byte duk_tval */ #endif void *voidptr; duk_hstring *hstring; @@ -1220,24 +1251,23 @@ typedef struct { #define DUK_TVAL_UNUSED_INITIALIZER() \ { DUK_TAG_UNUSED, 0, 0.0 } -#define DUK_TAG_MIN 0 -#define DUK_TAG_NUMBER 0 /* DUK_TAG_NUMBER only defined for non-packed duk_tval */ +#define DUK_TAG_MIN 0 +#define DUK_TAG_NUMBER 0 /* DUK_TAG_NUMBER only defined for non-packed duk_tval */ #if defined(DUK_USE_FASTINT) -#define DUK_TAG_FASTINT 1 +#define DUK_TAG_FASTINT 1 #endif -#define DUK_TAG_UNDEFINED 2 -#define DUK_TAG_NULL 3 -#define DUK_TAG_BOOLEAN 4 -#define DUK_TAG_POINTER 5 -#define DUK_TAG_LIGHTFUNC 6 -#define DUK_TAG_UNUSED 7 /* marker; not actual tagged type */ -#define DUK_TAG_STRING 8 /* first heap allocated, match bit boundary */ -#define DUK_TAG_OBJECT 9 -#define DUK_TAG_BUFFER 10 -#define DUK_TAG_MAX 10 +#define DUK_TAG_UNDEFINED 2 +#define DUK_TAG_NULL 3 +#define DUK_TAG_BOOLEAN 4 +#define DUK_TAG_POINTER 5 +#define DUK_TAG_LIGHTFUNC 6 +#define DUK_TAG_UNUSED 7 /* marker; not actual tagged type */ +#define DUK_TAG_STRING 8 /* first heap allocated, match bit boundary */ +#define DUK_TAG_OBJECT 9 +#define DUK_TAG_BUFFER 10 +#define DUK_TAG_MAX 10 -#define DUK_TVAL_IS_VALID_TAG(tv) \ - (DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN) +#define DUK_TVAL_IS_VALID_TAG(tv) (DUK_TVAL_GET_TAG((tv)) - DUK_TAG_MIN <= DUK_TAG_MAX - DUK_TAG_MIN) /* DUK_TAG_NUMBER is intentionally first, as it is the default clause in code * to support the 8-byte representation. Further, it is a non-heap-allocated @@ -1246,25 +1276,29 @@ typedef struct { */ /* setters */ -#define DUK_TVAL_SET_UNDEFINED(tv) do { \ +#define DUK_TVAL_SET_UNDEFINED(tv) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_UNDEFINED; \ } while (0) -#define DUK_TVAL_SET_UNUSED(tv) do { \ +#define DUK_TVAL_SET_UNUSED(tv) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_UNUSED; \ } while (0) -#define DUK_TVAL_SET_NULL(tv) do { \ +#define DUK_TVAL_SET_NULL(tv) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_NULL; \ } while (0) -#define DUK_TVAL_SET_BOOLEAN(tv,val) do { \ +#define DUK_TVAL_SET_BOOLEAN(tv, val) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_BOOLEAN; \ @@ -1272,7 +1306,8 @@ typedef struct { } while (0) #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_SET_DOUBLE(tv,val) do { \ +#define DUK_TVAL_SET_DOUBLE(tv, val) \ + do { \ duk_tval *duk__tv; \ duk_double_t duk__dblval; \ duk__dblval = (val); \ @@ -1281,31 +1316,32 @@ typedef struct { duk__tv->t = DUK_TAG_NUMBER; \ duk__tv->v.d = duk__dblval; \ } while (0) -#define DUK_TVAL_SET_I48(tv,val) do { \ +#define DUK_TVAL_SET_I48(tv, val) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_FASTINT; \ duk__tv->v.fi = (val); \ } while (0) -#define DUK_TVAL_SET_U32(tv,val) do { \ +#define DUK_TVAL_SET_U32(tv, val) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_FASTINT; \ duk__tv->v.fi = (duk_int64_t) (val); \ } while (0) -#define DUK_TVAL_SET_I32(tv,val) do { \ +#define DUK_TVAL_SET_I32(tv, val) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_FASTINT; \ duk__tv->v.fi = (duk_int64_t) (val); \ } while (0) -#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d) \ - duk_tval_set_number_chkfast_fast((tv), (d)) -#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d) \ - duk_tval_set_number_chkfast_slow((tv), (d)) -#define DUK_TVAL_SET_NUMBER(tv,val) \ - DUK_TVAL_SET_DOUBLE((tv), (val)) -#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) do { \ +#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) duk_tval_set_number_chkfast_fast((tv), (d)) +#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) duk_tval_set_number_chkfast_slow((tv), (d)) +#define DUK_TVAL_SET_NUMBER(tv, val) DUK_TVAL_SET_DOUBLE((tv), (val)) +#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \ + do { \ duk_tval *duk__tv; \ duk_double_t duk__d; \ duk__tv = (tv); \ @@ -1314,7 +1350,8 @@ typedef struct { DUK_TVAL_SET_NUMBER_CHKFAST_FAST(duk__tv, duk__d); \ } \ } while (0) -#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) do { \ +#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \ + do { \ duk_tval *duk__tv; \ duk_double_t duk__d; \ duk__tv = (tv); \ @@ -1323,16 +1360,13 @@ typedef struct { DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(duk__tv, duk__d); \ } \ } while (0) -#else /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_DOUBLE(tv,d) \ - DUK_TVAL_SET_NUMBER((tv), (d)) -#define DUK_TVAL_SET_I48(tv,val) \ - DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) /* XXX: fast int-to-double */ -#define DUK_TVAL_SET_U32(tv,val) \ - DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) -#define DUK_TVAL_SET_I32(tv,val) \ - DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) -#define DUK_TVAL_SET_NUMBER(tv,val) do { \ +#else /* DUK_USE_FASTINT */ +#define DUK_TVAL_SET_DOUBLE(tv, d) DUK_TVAL_SET_NUMBER((tv), (d)) +#define DUK_TVAL_SET_I48(tv, val) DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) /* XXX: fast int-to-double */ +#define DUK_TVAL_SET_U32(tv, val) DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) +#define DUK_TVAL_SET_I32(tv, val) DUK_TVAL_SET_NUMBER((tv), (duk_double_t) (val)) +#define DUK_TVAL_SET_NUMBER(tv, val) \ + do { \ duk_tval *duk__tv; \ duk_double_t duk__dblval; \ duk__dblval = (val); \ @@ -1341,25 +1375,28 @@ typedef struct { duk__tv->t = DUK_TAG_NUMBER; \ duk__tv->v.d = duk__dblval; \ } while (0) -#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv,d) \ - DUK_TVAL_SET_NUMBER((tv), (d)) -#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv,d) \ - DUK_TVAL_SET_NUMBER((tv), (d)) -#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) do { } while (0) -#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) do { } while (0) -#endif /* DUK_USE_FASTINT */ +#define DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv, d) DUK_TVAL_SET_NUMBER((tv), (d)) +#define DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, d) DUK_TVAL_SET_NUMBER((tv), (d)) +#define DUK_TVAL_CHKFAST_INPLACE_FAST(tv) \ + do { \ + } while (0) +#define DUK_TVAL_CHKFAST_INPLACE_SLOW(tv) \ + do { \ + } while (0) +#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_FASTINT(tv,i) \ - DUK_TVAL_SET_I48((tv), (i)) /* alias */ +#define DUK_TVAL_SET_FASTINT(tv, i) DUK_TVAL_SET_I48((tv), (i)) /* alias */ -#define DUK_TVAL_SET_POINTER(tv,hptr) do { \ +#define DUK_TVAL_SET_POINTER(tv, hptr) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_POINTER; \ duk__tv->v.voidptr = (hptr); \ } while (0) -#define DUK_TVAL_SET_LIGHTFUNC(tv,fp,flags) do { \ +#define DUK_TVAL_SET_LIGHTFUNC(tv, fp, flags) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_LIGHTFUNC; \ @@ -1367,28 +1404,32 @@ typedef struct { duk__tv->v.lightfunc = (duk_c_function) (fp); \ } while (0) -#define DUK_TVAL_SET_STRING(tv,hptr) do { \ +#define DUK_TVAL_SET_STRING(tv, hptr) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_STRING; \ duk__tv->v.hstring = (hptr); \ } while (0) -#define DUK_TVAL_SET_OBJECT(tv,hptr) do { \ +#define DUK_TVAL_SET_OBJECT(tv, hptr) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_OBJECT; \ duk__tv->v.hobject = (hptr); \ } while (0) -#define DUK_TVAL_SET_BUFFER(tv,hptr) do { \ +#define DUK_TVAL_SET_BUFFER(tv, hptr) \ + do { \ duk_tval *duk__tv; \ duk__tv = (tv); \ duk__tv->t = DUK_TAG_BUFFER; \ duk__tv->v.hbuffer = (hptr); \ } while (0) -#define DUK_TVAL_SET_NAN(tv) do { \ +#define DUK_TVAL_SET_NAN(tv) \ + do { \ /* in non-packed representation we don't care about which NaN is used */ \ duk_tval *duk__tv; \ duk__tv = (tv); \ @@ -1396,32 +1437,32 @@ typedef struct { duk__tv->v.d = DUK_DOUBLE_NAN; \ } while (0) -#define DUK_TVAL_SET_TVAL(tv,x) do { *(tv) = *(x); } while (0) +#define DUK_TVAL_SET_TVAL(tv, x) \ + do { \ + *(tv) = *(x); \ + } while (0) /* getters */ -#define DUK_TVAL_GET_BOOLEAN(tv) ((duk_small_uint_t) (tv)->v.i) +#define DUK_TVAL_GET_BOOLEAN(tv) ((duk_small_uint_t) (tv)->v.i) #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->v.d) -#define DUK_TVAL_GET_FASTINT(tv) ((tv)->v.fi) -#define DUK_TVAL_GET_FASTINT_U32(tv) ((duk_uint32_t) ((tv)->v.fi)) -#define DUK_TVAL_GET_FASTINT_I32(tv) ((duk_int32_t) ((tv)->v.fi)) +#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->v.d) +#define DUK_TVAL_GET_FASTINT(tv) ((tv)->v.fi) +#define DUK_TVAL_GET_FASTINT_U32(tv) ((duk_uint32_t) ((tv)->v.fi)) +#define DUK_TVAL_GET_FASTINT_I32(tv) ((duk_int32_t) ((tv)->v.fi)) #if 0 -#define DUK_TVAL_GET_NUMBER(tv) (DUK_TVAL_IS_FASTINT((tv)) ? \ - (duk_double_t) DUK_TVAL_GET_FASTINT((tv)) : \ - DUK_TVAL_GET_DOUBLE((tv))) -#define DUK_TVAL_GET_NUMBER(tv) duk_tval_get_number_unpacked((tv)) +#define DUK_TVAL_GET_NUMBER(tv) (DUK_TVAL_IS_FASTINT((tv)) ? (duk_double_t) DUK_TVAL_GET_FASTINT((tv)) : DUK_TVAL_GET_DOUBLE((tv))) +#define DUK_TVAL_GET_NUMBER(tv) duk_tval_get_number_unpacked((tv)) #else /* This seems reasonable overall. */ -#define DUK_TVAL_GET_NUMBER(tv) (DUK_TVAL_IS_FASTINT((tv)) ? \ - duk_tval_get_number_unpacked_fastint((tv)) : \ - DUK_TVAL_GET_DOUBLE((tv))) +#define DUK_TVAL_GET_NUMBER(tv) (DUK_TVAL_IS_FASTINT((tv)) ? duk_tval_get_number_unpacked_fastint((tv)) : DUK_TVAL_GET_DOUBLE((tv))) #endif #else -#define DUK_TVAL_GET_NUMBER(tv) ((tv)->v.d) -#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->v.d) -#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_GET_POINTER(tv) ((tv)->v.voidptr) -#define DUK_TVAL_GET_LIGHTFUNC(tv,out_fp,out_flags) do { \ +#define DUK_TVAL_GET_NUMBER(tv) ((tv)->v.d) +#define DUK_TVAL_GET_DOUBLE(tv) ((tv)->v.d) +#endif /* DUK_USE_FASTINT */ +#define DUK_TVAL_GET_POINTER(tv) ((tv)->v.voidptr) +#define DUK_TVAL_GET_LIGHTFUNC(tv, out_fp, out_flags) \ + do { \ (out_flags) = (duk_uint32_t) (tv)->v_extra; \ (out_fp) = (tv)->v.lightfunc; \ } while (0) @@ -1441,19 +1482,18 @@ typedef struct { #define DUK_TVAL_IS_BOOLEAN_TRUE(tv) (((tv)->t == DUK_TAG_BOOLEAN) && ((tv)->v.i != 0)) #define DUK_TVAL_IS_BOOLEAN_FALSE(tv) (((tv)->t == DUK_TAG_BOOLEAN) && ((tv)->v.i == 0)) #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_IS_DOUBLE(tv) ((tv)->t == DUK_TAG_NUMBER) -#define DUK_TVAL_IS_FASTINT(tv) ((tv)->t == DUK_TAG_FASTINT) -#define DUK_TVAL_IS_NUMBER(tv) ((tv)->t == DUK_TAG_NUMBER || \ - (tv)->t == DUK_TAG_FASTINT) +#define DUK_TVAL_IS_DOUBLE(tv) ((tv)->t == DUK_TAG_NUMBER) +#define DUK_TVAL_IS_FASTINT(tv) ((tv)->t == DUK_TAG_FASTINT) +#define DUK_TVAL_IS_NUMBER(tv) ((tv)->t == DUK_TAG_NUMBER || (tv)->t == DUK_TAG_FASTINT) #else -#define DUK_TVAL_IS_NUMBER(tv) ((tv)->t == DUK_TAG_NUMBER) -#define DUK_TVAL_IS_DOUBLE(tv) DUK_TVAL_IS_NUMBER((tv)) -#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_IS_POINTER(tv) ((tv)->t == DUK_TAG_POINTER) -#define DUK_TVAL_IS_LIGHTFUNC(tv) ((tv)->t == DUK_TAG_LIGHTFUNC) -#define DUK_TVAL_IS_STRING(tv) ((tv)->t == DUK_TAG_STRING) -#define DUK_TVAL_IS_OBJECT(tv) ((tv)->t == DUK_TAG_OBJECT) -#define DUK_TVAL_IS_BUFFER(tv) ((tv)->t == DUK_TAG_BUFFER) +#define DUK_TVAL_IS_NUMBER(tv) ((tv)->t == DUK_TAG_NUMBER) +#define DUK_TVAL_IS_DOUBLE(tv) DUK_TVAL_IS_NUMBER((tv)) +#endif /* DUK_USE_FASTINT */ +#define DUK_TVAL_IS_POINTER(tv) ((tv)->t == DUK_TAG_POINTER) +#define DUK_TVAL_IS_LIGHTFUNC(tv) ((tv)->t == DUK_TAG_LIGHTFUNC) +#define DUK_TVAL_IS_STRING(tv) ((tv)->t == DUK_TAG_STRING) +#define DUK_TVAL_IS_OBJECT(tv) ((tv)->t == DUK_TAG_OBJECT) +#define DUK_TVAL_IS_BUFFER(tv) ((tv)->t == DUK_TAG_BUFFER) /* This is performance critical because it's needed for every DECREF. * Take advantage of the fact that the first heap allocated tag is 8, @@ -1461,9 +1501,9 @@ typedef struct { * non-heap-allocated tags). */ #if 0 -#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) ((tv)->t >= DUK_TAG_STRING) +#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) ((tv)->t >= DUK_TAG_STRING) #endif -#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) ((tv)->t & 0x08) +#define DUK_TVAL_IS_HEAP_ALLOCATED(tv) ((tv)->t & 0x08) #if defined(DUK_USE_FASTINT) #if 0 @@ -1472,44 +1512,39 @@ DUK_INTERNAL_DECL duk_double_t duk_tval_get_number_unpacked(duk_tval *tv); DUK_INTERNAL_DECL duk_double_t duk_tval_get_number_unpacked_fastint(duk_tval *tv); #endif -#endif /* DUK_USE_PACKED_TVAL */ +#endif /* DUK_USE_PACKED_TVAL */ /* * Convenience (independent of representation) */ -#define DUK_TVAL_SET_BOOLEAN_TRUE(tv) DUK_TVAL_SET_BOOLEAN((tv), 1) -#define DUK_TVAL_SET_BOOLEAN_FALSE(tv) DUK_TVAL_SET_BOOLEAN((tv), 0) +#define DUK_TVAL_SET_BOOLEAN_TRUE(tv) DUK_TVAL_SET_BOOLEAN((tv), 1) +#define DUK_TVAL_SET_BOOLEAN_FALSE(tv) DUK_TVAL_SET_BOOLEAN((tv), 0) -#define DUK_TVAL_STRING_IS_SYMBOL(tv) \ - DUK_HSTRING_HAS_SYMBOL(DUK_TVAL_GET_STRING((tv))) +#define DUK_TVAL_STRING_IS_SYMBOL(tv) DUK_HSTRING_HAS_SYMBOL(DUK_TVAL_GET_STRING((tv))) /* Lightfunc flags packing and unpacking. */ /* Sign extend: 0x0000##00 -> 0x##000000 -> sign extend to 0xssssss##. * Avoid signed shifts due to portability limitations. */ -#define DUK_LFUNC_FLAGS_GET_MAGIC(lf_flags) \ - ((duk_int32_t) (duk_int8_t) (((duk_uint16_t) (lf_flags)) >> 8)) -#define DUK_LFUNC_FLAGS_GET_LENGTH(lf_flags) \ - (((lf_flags) >> 4) & 0x0fU) -#define DUK_LFUNC_FLAGS_GET_NARGS(lf_flags) \ - ((lf_flags) & 0x0fU) -#define DUK_LFUNC_FLAGS_PACK(magic,length,nargs) \ - ((((duk_small_uint_t) (magic)) & 0xffU) << 8) | ((length) << 4) | (nargs) +#define DUK_LFUNC_FLAGS_GET_MAGIC(lf_flags) ((duk_int32_t) (duk_int8_t) (((duk_uint16_t) (lf_flags)) >> 8)) +#define DUK_LFUNC_FLAGS_GET_LENGTH(lf_flags) (((lf_flags) >> 4) & 0x0fU) +#define DUK_LFUNC_FLAGS_GET_NARGS(lf_flags) ((lf_flags) &0x0fU) +#define DUK_LFUNC_FLAGS_PACK(magic, length, nargs) ((((duk_small_uint_t) (magic)) & 0xffU) << 8) | ((length) << 4) | (nargs) -#define DUK_LFUNC_NARGS_VARARGS 0x0f /* varargs marker */ -#define DUK_LFUNC_NARGS_MIN 0x00 -#define DUK_LFUNC_NARGS_MAX 0x0e /* max, excl. varargs marker */ -#define DUK_LFUNC_LENGTH_MIN 0x00 -#define DUK_LFUNC_LENGTH_MAX 0x0f -#define DUK_LFUNC_MAGIC_MIN (-0x80) -#define DUK_LFUNC_MAGIC_MAX 0x7f +#define DUK_LFUNC_NARGS_VARARGS 0x0f /* varargs marker */ +#define DUK_LFUNC_NARGS_MIN 0x00 +#define DUK_LFUNC_NARGS_MAX 0x0e /* max, excl. varargs marker */ +#define DUK_LFUNC_LENGTH_MIN 0x00 +#define DUK_LFUNC_LENGTH_MAX 0x0f +#define DUK_LFUNC_MAGIC_MIN (-0x80) +#define DUK_LFUNC_MAGIC_MAX 0x7f /* fastint constants etc */ #if defined(DUK_USE_FASTINT) -#define DUK_FASTINT_MIN (DUK_I64_CONSTANT(-0x800000000000)) -#define DUK_FASTINT_MAX (DUK_I64_CONSTANT(0x7fffffffffff)) -#define DUK_FASTINT_BITS 48 +#define DUK_FASTINT_MIN (DUK_I64_CONSTANT(-0x800000000000)) +#define DUK_FASTINT_MAX (DUK_I64_CONSTANT(0x7fffffffffff)) +#define DUK_FASTINT_BITS 48 DUK_INTERNAL_DECL void duk_tval_set_number_chkfast_fast(duk_tval *tv, duk_double_t x); DUK_INTERNAL_DECL void duk_tval_set_number_chkfast_slow(duk_tval *tv, duk_double_t x); @@ -1517,12 +1552,17 @@ DUK_INTERNAL_DECL void duk_tval_set_number_chkfast_slow(duk_tval *tv, duk_double #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_tval_assert_valid(duk_tval *tv); -#define DUK_TVAL_ASSERT_VALID(tv) do { duk_tval_assert_valid((tv)); } while (0) +#define DUK_TVAL_ASSERT_VALID(tv) \ + do { \ + duk_tval_assert_valid((tv)); \ + } while (0) #else -#define DUK_TVAL_ASSERT_VALID(tv) do {} while (0) +#define DUK_TVAL_ASSERT_VALID(tv) \ + do { \ + } while (0) #endif -#endif /* DUK_TVAL_H_INCLUDED */ +#endif /* DUK_TVAL_H_INCLUDED */ /* #include duk_builtins.h */ /* * Automatically generated by genbuiltins.py, do not edit! @@ -2324,20 +2364,14 @@ DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4281]; #if !defined(DUK_UTIL_H_INCLUDED) #define DUK_UTIL_H_INCLUDED -#if defined(DUK_USE_GET_RANDOM_DOUBLE) -#define DUK_UTIL_GET_RANDOM_DOUBLE(thr) DUK_USE_GET_RANDOM_DOUBLE((thr)->heap_udata) -#else -#define DUK_UTIL_GET_RANDOM_DOUBLE(thr) duk_util_tinyrandom_get_double(thr) -#endif - /* * Some useful constants */ -#define DUK_DOUBLE_2TO32 4294967296.0 -#define DUK_DOUBLE_2TO31 2147483648.0 -#define DUK_DOUBLE_LOG2E 1.4426950408889634 -#define DUK_DOUBLE_LOG10E 0.4342944819032518 +#define DUK_DOUBLE_2TO32 4294967296.0 +#define DUK_DOUBLE_2TO31 2147483648.0 +#define DUK_DOUBLE_LOG2E 1.4426950408889634 +#define DUK_DOUBLE_LOG10E 0.4342944819032518 /* * Endian conversion @@ -2390,33 +2424,35 @@ struct duk_bitencoder_ctx { * update the pointer argument automatically. */ -#define DUK_RAW_WRITE_U8(ptr,val) do { \ +#define DUK_RAW_WRITE_U8(ptr, val) \ + do { \ *(ptr) = (duk_uint8_t) (val); \ } while (0) -#define DUK_RAW_WRITE_U16_BE(ptr,val) duk_raw_write_u16_be((ptr), (duk_uint16_t) (val)) -#define DUK_RAW_WRITE_U32_BE(ptr,val) duk_raw_write_u32_be((ptr), (duk_uint32_t) (val)) -#define DUK_RAW_WRITE_FLOAT_BE(ptr,val) duk_raw_write_float_be((ptr), (duk_float_t) (val)) -#define DUK_RAW_WRITE_DOUBLE_BE(ptr,val) duk_raw_write_double_be((ptr), (duk_double_t) (val)) -#define DUK_RAW_WRITE_XUTF8(ptr,val) duk_raw_write_xutf8((ptr), (duk_ucodepoint_t) (val)) +#define DUK_RAW_WRITE_U16_BE(ptr, val) duk_raw_write_u16_be((ptr), (duk_uint16_t) (val)) +#define DUK_RAW_WRITE_U32_BE(ptr, val) duk_raw_write_u32_be((ptr), (duk_uint32_t) (val)) +#define DUK_RAW_WRITE_FLOAT_BE(ptr, val) duk_raw_write_float_be((ptr), (duk_float_t) (val)) +#define DUK_RAW_WRITE_DOUBLE_BE(ptr, val) duk_raw_write_double_be((ptr), (duk_double_t) (val)) +#define DUK_RAW_WRITE_XUTF8(ptr, val) duk_raw_write_xutf8((ptr), (duk_ucodepoint_t) (val)) -#define DUK_RAW_WRITEINC_U8(ptr,val) do { \ +#define DUK_RAW_WRITEINC_U8(ptr, val) \ + do { \ *(ptr)++ = (duk_uint8_t) (val); \ } while (0) -#define DUK_RAW_WRITEINC_U16_BE(ptr,val) duk_raw_writeinc_u16_be(&(ptr), (duk_uint16_t) (val)) -#define DUK_RAW_WRITEINC_U32_BE(ptr,val) duk_raw_writeinc_u32_be(&(ptr), (duk_uint32_t) (val)) -#define DUK_RAW_WRITEINC_FLOAT_BE(ptr,val) duk_raw_writeinc_float_be(&(ptr), (duk_float_t) (val)) -#define DUK_RAW_WRITEINC_DOUBLE_BE(ptr,val) duk_raw_writeinc_double_be(&(ptr), (duk_double_t) (val)) -#define DUK_RAW_WRITEINC_XUTF8(ptr,val) duk_raw_writeinc_xutf8(&(ptr), (duk_ucodepoint_t) (val)) -#define DUK_RAW_WRITEINC_CESU8(ptr,val) duk_raw_writeinc_cesu8(&(ptr), (duk_ucodepoint_t) (val)) +#define DUK_RAW_WRITEINC_U16_BE(ptr, val) duk_raw_writeinc_u16_be(&(ptr), (duk_uint16_t) (val)) +#define DUK_RAW_WRITEINC_U32_BE(ptr, val) duk_raw_writeinc_u32_be(&(ptr), (duk_uint32_t) (val)) +#define DUK_RAW_WRITEINC_FLOAT_BE(ptr, val) duk_raw_writeinc_float_be(&(ptr), (duk_float_t) (val)) +#define DUK_RAW_WRITEINC_DOUBLE_BE(ptr, val) duk_raw_writeinc_double_be(&(ptr), (duk_double_t) (val)) +#define DUK_RAW_WRITEINC_XUTF8(ptr, val) duk_raw_writeinc_xutf8(&(ptr), (duk_ucodepoint_t) (val)) +#define DUK_RAW_WRITEINC_CESU8(ptr, val) duk_raw_writeinc_cesu8(&(ptr), (duk_ucodepoint_t) (val)) -#define DUK_RAW_READ_U8(ptr) ((duk_uint8_t) (*(ptr))) -#define DUK_RAW_READ_U16_BE(ptr) duk_raw_read_u16_be((ptr)); -#define DUK_RAW_READ_U32_BE(ptr) duk_raw_read_u32_be((ptr)); +#define DUK_RAW_READ_U8(ptr) ((duk_uint8_t) (*(ptr))) +#define DUK_RAW_READ_U16_BE(ptr) duk_raw_read_u16_be((ptr)); +#define DUK_RAW_READ_U32_BE(ptr) duk_raw_read_u32_be((ptr)); #define DUK_RAW_READ_DOUBLE_BE(ptr) duk_raw_read_double_be((ptr)); -#define DUK_RAW_READINC_U8(ptr) ((duk_uint8_t) (*(ptr)++)) -#define DUK_RAW_READINC_U16_BE(ptr) duk_raw_readinc_u16_be(&(ptr)); -#define DUK_RAW_READINC_U32_BE(ptr) duk_raw_readinc_u32_be(&(ptr)); +#define DUK_RAW_READINC_U8(ptr) ((duk_uint8_t) (*(ptr)++)) +#define DUK_RAW_READINC_U16_BE(ptr) duk_raw_readinc_u16_be(&(ptr)); +#define DUK_RAW_READINC_U32_BE(ptr) duk_raw_readinc_u32_be(&(ptr)); #define DUK_RAW_READINC_DOUBLE_BE(ptr) duk_raw_readinc_double_be(&(ptr)); /* @@ -2463,29 +2499,31 @@ struct duk_bufwriter_ctx { }; #if defined(DUK_USE_PREFER_SIZE) -#define DUK_BW_SLACK_ADD 64 -#define DUK_BW_SLACK_SHIFT 4 /* 2^4 -> 1/16 = 6.25% slack */ +#define DUK_BW_SLACK_ADD 64 +#define DUK_BW_SLACK_SHIFT 4 /* 2^4 -> 1/16 = 6.25% slack */ #else -#define DUK_BW_SLACK_ADD 64 -#define DUK_BW_SLACK_SHIFT 2 /* 2^2 -> 1/4 = 25% slack */ +#define DUK_BW_SLACK_ADD 64 +#define DUK_BW_SLACK_SHIFT 2 /* 2^2 -> 1/4 = 25% slack */ #endif /* Initialization and finalization (compaction), converting to other types. */ -#define DUK_BW_INIT_PUSHBUF(thr,bw_ctx,sz) do { \ +#define DUK_BW_INIT_PUSHBUF(thr, bw_ctx, sz) \ + do { \ duk_bw_init_pushbuf((thr), (bw_ctx), (sz)); \ } while (0) -#define DUK_BW_INIT_WITHBUF(thr,bw_ctx,buf) do { \ +#define DUK_BW_INIT_WITHBUF(thr, bw_ctx, buf) \ + do { \ duk_bw_init((thr), (bw_ctx), (buf)); \ } while (0) -#define DUK_BW_COMPACT(thr,bw_ctx) do { \ +#define DUK_BW_COMPACT(thr, bw_ctx) \ + do { \ /* Make underlying buffer compact to match DUK_BW_GET_SIZE(). */ \ duk_bw_compact((thr), (bw_ctx)); \ } while (0) -#define DUK_BW_PUSH_AS_STRING(thr,bw_ctx) do { \ - duk_push_lstring((thr), \ - (const char *) (bw_ctx)->p_base, \ - (duk_size_t) ((bw_ctx)->p - (bw_ctx)->p_base)); \ +#define DUK_BW_PUSH_AS_STRING(thr, bw_ctx) \ + do { \ + duk_push_lstring((thr), (const char *) (bw_ctx)->p_base, (duk_size_t) ((bw_ctx)->p - (bw_ctx)->p_base)); \ } while (0) /* Pointers may be NULL for a while when 'buf' size is zero and before any @@ -2495,43 +2533,48 @@ struct duk_bufwriter_ctx { */ #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx *bw_ctx); -#define DUK_BW_ASSERT_VALID_EXPR(thr,bw_ctx) (duk_bw_assert_valid((thr), (bw_ctx))) -#define DUK_BW_ASSERT_VALID(thr,bw_ctx) do { duk_bw_assert_valid((thr), (bw_ctx)); } while (0) +#define DUK_BW_ASSERT_VALID_EXPR(thr, bw_ctx) (duk_bw_assert_valid((thr), (bw_ctx))) +#define DUK_BW_ASSERT_VALID(thr, bw_ctx) \ + do { \ + duk_bw_assert_valid((thr), (bw_ctx)); \ + } while (0) #else -#define DUK_BW_ASSERT_VALID_EXPR(thr,bw_ctx) DUK_ASSERT_EXPR(1) -#define DUK_BW_ASSERT_VALID(thr,bw_ctx) do {} while (0) +#define DUK_BW_ASSERT_VALID_EXPR(thr, bw_ctx) DUK_ASSERT_EXPR(1) +#define DUK_BW_ASSERT_VALID(thr, bw_ctx) \ + do { \ + } while (0) #endif /* Working with the pointer and current size. */ -#define DUK_BW_GET_PTR(thr,bw_ctx) \ - ((bw_ctx)->p) -#define DUK_BW_SET_PTR(thr,bw_ctx,ptr) do { \ +#define DUK_BW_GET_PTR(thr, bw_ctx) ((bw_ctx)->p) +#define DUK_BW_SET_PTR(thr, bw_ctx, ptr) \ + do { \ (bw_ctx)->p = (ptr); \ } while (0) -#define DUK_BW_ADD_PTR(thr,bw_ctx,delta) do { \ +#define DUK_BW_ADD_PTR(thr, bw_ctx, delta) \ + do { \ (bw_ctx)->p += (delta); \ } while (0) -#define DUK_BW_GET_BASEPTR(thr,bw_ctx) \ - ((bw_ctx)->p_base) -#define DUK_BW_GET_LIMITPTR(thr,bw_ctx) \ - ((bw_ctx)->p_limit) -#define DUK_BW_GET_SIZE(thr,bw_ctx) \ - ((duk_size_t) ((bw_ctx)->p - (bw_ctx)->p_base)) -#define DUK_BW_SET_SIZE(thr,bw_ctx,sz) do { \ +#define DUK_BW_GET_BASEPTR(thr, bw_ctx) ((bw_ctx)->p_base) +#define DUK_BW_GET_LIMITPTR(thr, bw_ctx) ((bw_ctx)->p_limit) +#define DUK_BW_GET_SIZE(thr, bw_ctx) ((duk_size_t) ((bw_ctx)->p - (bw_ctx)->p_base)) +#define DUK_BW_SET_SIZE(thr, bw_ctx, sz) \ + do { \ DUK_ASSERT((duk_size_t) (sz) <= (duk_size_t) ((bw_ctx)->p - (bw_ctx)->p_base)); \ (bw_ctx)->p = (bw_ctx)->p_base + (sz); \ } while (0) -#define DUK_BW_RESET_SIZE(thr,bw_ctx) do { \ +#define DUK_BW_RESET_SIZE(thr, bw_ctx) \ + do { \ /* Reset to zero size, keep current limit. */ \ (bw_ctx)->p = (bw_ctx)->p_base; \ } while (0) -#define DUK_BW_GET_BUFFER(thr,bw_ctx) \ - ((bw_ctx)->buf) +#define DUK_BW_GET_BUFFER(thr, bw_ctx) ((bw_ctx)->buf) /* Ensuring (reserving) space. */ -#define DUK_BW_ENSURE(thr,bw_ctx,sz) do { \ +#define DUK_BW_ENSURE(thr, bw_ctx, sz) \ + do { \ duk_size_t duk__sz, duk__space; \ DUK_BW_ASSERT_VALID((thr), (bw_ctx)); \ duk__sz = (sz); \ @@ -2542,22 +2585,21 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * } while (0) /* NOTE: Multiple evaluation of 'ptr' in this macro. */ /* XXX: Rework to use an always-inline function? */ -#define DUK_BW_ENSURE_RAW(thr,bw_ctx,sz,ptr) \ - (((duk_size_t) ((bw_ctx)->p_limit - (ptr)) >= (sz)) ? \ - (ptr) : \ - ((bw_ctx)->p = (ptr), duk_bw_resize((thr),(bw_ctx),(sz)))) -#define DUK_BW_ENSURE_GETPTR(thr,bw_ctx,sz) \ - DUK_BW_ENSURE_RAW((thr), (bw_ctx), (sz), (bw_ctx)->p) -#define DUK_BW_ASSERT_SPACE_EXPR(thr,bw_ctx,sz) \ +#define DUK_BW_ENSURE_RAW(thr, bw_ctx, sz, ptr) \ + (((duk_size_t) ((bw_ctx)->p_limit - (ptr)) >= (sz)) ? (ptr) : ((bw_ctx)->p = (ptr), duk_bw_resize((thr), (bw_ctx), (sz)))) +#define DUK_BW_ENSURE_GETPTR(thr, bw_ctx, sz) DUK_BW_ENSURE_RAW((thr), (bw_ctx), (sz), (bw_ctx)->p) +#define DUK_BW_ASSERT_SPACE_EXPR(thr, bw_ctx, sz) \ (DUK_BW_ASSERT_VALID_EXPR((thr), (bw_ctx)), \ DUK_ASSERT_EXPR((duk_size_t) ((bw_ctx)->p_limit - (bw_ctx)->p) >= (duk_size_t) (sz))) -#define DUK_BW_ASSERT_SPACE(thr,bw_ctx,sz) do { \ +#define DUK_BW_ASSERT_SPACE(thr, bw_ctx, sz) \ + do { \ DUK_BW_ASSERT_SPACE_EXPR((thr), (bw_ctx), (sz)); \ } while (0) /* Miscellaneous. */ -#define DUK_BW_SETPTR_AND_COMPACT(thr,bw_ctx,ptr) do { \ +#define DUK_BW_SETPTR_AND_COMPACT(thr, bw_ctx, ptr) \ + do { \ (bw_ctx)->p = (ptr); \ duk_bw_compact((thr), (bw_ctx)); \ } while (0) @@ -2568,11 +2610,13 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * * explicit pointer load/stores get generated (e.g. gcc -Os). */ -#define DUK_BW_WRITE_RAW_U8(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_RAW_U8(thr, bw_ctx, val) \ + do { \ DUK_BW_ASSERT_SPACE((thr), (bw_ctx), 1); \ *(bw_ctx)->p++ = (duk_uint8_t) (val); \ } while (0) -#define DUK_BW_WRITE_RAW_U8_2(thr,bw_ctx,val1,val2) do { \ +#define DUK_BW_WRITE_RAW_U8_2(thr, bw_ctx, val1, val2) \ + do { \ duk_uint8_t *duk__p; \ DUK_BW_ASSERT_SPACE((thr), (bw_ctx), 2); \ duk__p = (bw_ctx)->p; \ @@ -2580,7 +2624,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * *duk__p++ = (duk_uint8_t) (val2); \ (bw_ctx)->p = duk__p; \ } while (0) -#define DUK_BW_WRITE_RAW_U8_3(thr,bw_ctx,val1,val2,val3) do { \ +#define DUK_BW_WRITE_RAW_U8_3(thr, bw_ctx, val1, val2, val3) \ + do { \ duk_uint8_t *duk__p; \ DUK_BW_ASSERT_SPACE((thr), (bw_ctx), 3); \ duk__p = (bw_ctx)->p; \ @@ -2589,7 +2634,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * *duk__p++ = (duk_uint8_t) (val3); \ (bw_ctx)->p = duk__p; \ } while (0) -#define DUK_BW_WRITE_RAW_U8_4(thr,bw_ctx,val1,val2,val3,val4) do { \ +#define DUK_BW_WRITE_RAW_U8_4(thr, bw_ctx, val1, val2, val3, val4) \ + do { \ duk_uint8_t *duk__p; \ DUK_BW_ASSERT_SPACE((thr), (bw_ctx), 4); \ duk__p = (bw_ctx)->p; \ @@ -2599,7 +2645,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * *duk__p++ = (duk_uint8_t) (val4); \ (bw_ctx)->p = duk__p; \ } while (0) -#define DUK_BW_WRITE_RAW_U8_5(thr,bw_ctx,val1,val2,val3,val4,val5) do { \ +#define DUK_BW_WRITE_RAW_U8_5(thr, bw_ctx, val1, val2, val3, val4, val5) \ + do { \ duk_uint8_t *duk__p; \ DUK_BW_ASSERT_SPACE((thr), (bw_ctx), 5); \ duk__p = (bw_ctx)->p; \ @@ -2610,7 +2657,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * *duk__p++ = (duk_uint8_t) (val5); \ (bw_ctx)->p = duk__p; \ } while (0) -#define DUK_BW_WRITE_RAW_U8_6(thr,bw_ctx,val1,val2,val3,val4,val5,val6) do { \ +#define DUK_BW_WRITE_RAW_U8_6(thr, bw_ctx, val1, val2, val3, val4, val5, val6) \ + do { \ duk_uint8_t *duk__p; \ DUK_BW_ASSERT_SPACE((thr), (bw_ctx), 6); \ duk__p = (bw_ctx)->p; \ @@ -2622,7 +2670,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * *duk__p++ = (duk_uint8_t) (val6); \ (bw_ctx)->p = duk__p; \ } while (0) -#define DUK_BW_WRITE_RAW_XUTF8(thr,bw_ctx,cp) do { \ +#define DUK_BW_WRITE_RAW_XUTF8(thr, bw_ctx, cp) \ + do { \ duk_ucodepoint_t duk__cp; \ duk_small_int_t duk__enc_len; \ duk__cp = (duk_ucodepoint_t) (cp); \ @@ -2630,7 +2679,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * duk__enc_len = duk_unicode_encode_xutf8(duk__cp, (bw_ctx)->p); \ (bw_ctx)->p += duk__enc_len; \ } while (0) -#define DUK_BW_WRITE_RAW_CESU8(thr,bw_ctx,cp) do { \ +#define DUK_BW_WRITE_RAW_CESU8(thr, bw_ctx, cp) \ + do { \ duk_ucodepoint_t duk__cp; \ duk_small_int_t duk__enc_len; \ duk__cp = (duk_ucodepoint_t) (cp); \ @@ -2640,7 +2690,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * } while (0) /* XXX: add temporary duk__p pointer here too; sharing */ /* XXX: avoid unsafe variants */ -#define DUK_BW_WRITE_RAW_BYTES(thr,bw_ctx,valptr,valsz) do { \ +#define DUK_BW_WRITE_RAW_BYTES(thr, bw_ctx, valptr, valsz) \ + do { \ const void *duk__valptr; \ duk_size_t duk__valsz; \ duk__valptr = (const void *) (valptr); \ @@ -2648,7 +2699,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * duk_memcpy_unsafe((void *) ((bw_ctx)->p), duk__valptr, duk__valsz); \ (bw_ctx)->p += duk__valsz; \ } while (0) -#define DUK_BW_WRITE_RAW_CSTRING(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_RAW_CSTRING(thr, bw_ctx, val) \ + do { \ const duk_uint8_t *duk__val; \ duk_size_t duk__val_len; \ duk__val = (const duk_uint8_t *) (val); \ @@ -2656,93 +2708,107 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) duk__val, duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_RAW_HSTRING(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_RAW_HSTRING(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HSTRING_GET_BYTELEN((val)); \ duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HSTRING_GET_DATA((val)), duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_RAW_HBUFFER(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_RAW_HBUFFER(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HBUFFER_GET_SIZE((val)); \ - duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HBUFFER_GET_DATA_PTR((thr)->heap, (val)), duk__val_len); \ + duk_memcpy_unsafe((void *) ((bw_ctx)->p), \ + (const void *) DUK_HBUFFER_GET_DATA_PTR((thr)->heap, (val)), \ + duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_RAW_HBUFFER_FIXED(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_RAW_HBUFFER_FIXED(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HBUFFER_FIXED_GET_SIZE((val)); \ - duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HBUFFER_FIXED_GET_DATA_PTR((thr)->heap, (val)), duk__val_len); \ + duk_memcpy_unsafe((void *) ((bw_ctx)->p), \ + (const void *) DUK_HBUFFER_FIXED_GET_DATA_PTR((thr)->heap, (val)), \ + duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_RAW_HBUFFER_DYNAMIC(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_RAW_HBUFFER_DYNAMIC(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HBUFFER_DYNAMIC_GET_SIZE((val)); \ - duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((thr)->heap, (val)), duk__val_len); \ + duk_memcpy_unsafe((void *) ((bw_ctx)->p), \ + (const void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((thr)->heap, (val)), \ + duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) /* Append bytes from a slice already in the buffer. */ -#define DUK_BW_WRITE_RAW_SLICE(thr,bw,dst_off,dst_len) \ - duk_bw_write_raw_slice((thr), (bw), (dst_off), (dst_len)) +#define DUK_BW_WRITE_RAW_SLICE(thr, bw, dst_off, dst_len) duk_bw_write_raw_slice((thr), (bw), (dst_off), (dst_len)) /* Insert bytes in the middle of the buffer from an external buffer. */ -#define DUK_BW_INSERT_RAW_BYTES(thr,bw,dst_off,buf,len) \ - duk_bw_insert_raw_bytes((thr), (bw), (dst_off), (buf), (len)) +#define DUK_BW_INSERT_RAW_BYTES(thr, bw, dst_off, buf, len) duk_bw_insert_raw_bytes((thr), (bw), (dst_off), (buf), (len)) /* Insert bytes in the middle of the buffer from a slice already * in the buffer. Source offset is interpreted "before" the operation. */ -#define DUK_BW_INSERT_RAW_SLICE(thr,bw,dst_off,src_off,len) \ - duk_bw_insert_raw_slice((thr), (bw), (dst_off), (src_off), (len)) +#define DUK_BW_INSERT_RAW_SLICE(thr, bw, dst_off, src_off, len) duk_bw_insert_raw_slice((thr), (bw), (dst_off), (src_off), (len)) /* Insert a reserved area somewhere in the buffer; caller fills it. * Evaluates to a (duk_uint_t *) pointing to the start of the reserved * area for convenience. */ -#define DUK_BW_INSERT_RAW_AREA(thr,bw,off,len) \ - duk_bw_insert_raw_area((thr), (bw), (off), (len)) +#define DUK_BW_INSERT_RAW_AREA(thr, bw, off, len) duk_bw_insert_raw_area((thr), (bw), (off), (len)) /* Remove a slice from inside buffer. */ -#define DUK_BW_REMOVE_RAW_SLICE(thr,bw,off,len) \ - duk_bw_remove_raw_slice((thr), (bw), (off), (len)) +#define DUK_BW_REMOVE_RAW_SLICE(thr, bw, off, len) duk_bw_remove_raw_slice((thr), (bw), (off), (len)) /* Safe write calls which will ensure space first. */ -#define DUK_BW_WRITE_ENSURE_U8(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_ENSURE_U8(thr, bw_ctx, val) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), 1); \ DUK_BW_WRITE_RAW_U8((thr), (bw_ctx), (val)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_U8_2(thr,bw_ctx,val1,val2) do { \ +#define DUK_BW_WRITE_ENSURE_U8_2(thr, bw_ctx, val1, val2) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), 2); \ DUK_BW_WRITE_RAW_U8_2((thr), (bw_ctx), (val1), (val2)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_U8_3(thr,bw_ctx,val1,val2,val3) do { \ +#define DUK_BW_WRITE_ENSURE_U8_3(thr, bw_ctx, val1, val2, val3) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), 3); \ DUK_BW_WRITE_RAW_U8_3((thr), (bw_ctx), (val1), (val2), (val3)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_U8_4(thr,bw_ctx,val1,val2,val3,val4) do { \ +#define DUK_BW_WRITE_ENSURE_U8_4(thr, bw_ctx, val1, val2, val3, val4) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), 4); \ DUK_BW_WRITE_RAW_U8_4((thr), (bw_ctx), (val1), (val2), (val3), (val4)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_U8_5(thr,bw_ctx,val1,val2,val3,val4,val5) do { \ +#define DUK_BW_WRITE_ENSURE_U8_5(thr, bw_ctx, val1, val2, val3, val4, val5) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), 5); \ DUK_BW_WRITE_RAW_U8_5((thr), (bw_ctx), (val1), (val2), (val3), (val4), (val5)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_U8_6(thr,bw_ctx,val1,val2,val3,val4,val5,val6) do { \ +#define DUK_BW_WRITE_ENSURE_U8_6(thr, bw_ctx, val1, val2, val3, val4, val5, val6) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), 6); \ DUK_BW_WRITE_RAW_U8_6((thr), (bw_ctx), (val1), (val2), (val3), (val4), (val5), (val6)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_XUTF8(thr,bw_ctx,cp) do { \ +#define DUK_BW_WRITE_ENSURE_XUTF8(thr, bw_ctx, cp) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), DUK_UNICODE_MAX_XUTF8_LENGTH); \ DUK_BW_WRITE_RAW_XUTF8((thr), (bw_ctx), (cp)); \ } while (0) -#define DUK_BW_WRITE_ENSURE_CESU8(thr,bw_ctx,cp) do { \ +#define DUK_BW_WRITE_ENSURE_CESU8(thr, bw_ctx, cp) \ + do { \ DUK_BW_ENSURE((thr), (bw_ctx), DUK_UNICODE_MAX_CESU8_LENGTH); \ DUK_BW_WRITE_RAW_CESU8((thr), (bw_ctx), (cp)); \ } while (0) /* XXX: add temporary duk__p pointer here too; sharing */ /* XXX: avoid unsafe */ -#define DUK_BW_WRITE_ENSURE_BYTES(thr,bw_ctx,valptr,valsz) do { \ +#define DUK_BW_WRITE_ENSURE_BYTES(thr, bw_ctx, valptr, valsz) \ + do { \ const void *duk__valptr; \ duk_size_t duk__valsz; \ duk__valptr = (const void *) (valptr); \ @@ -2751,7 +2817,8 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * duk_memcpy_unsafe((void *) ((bw_ctx)->p), duk__valptr, duk__valsz); \ (bw_ctx)->p += duk__valsz; \ } while (0) -#define DUK_BW_WRITE_ENSURE_CSTRING(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_ENSURE_CSTRING(thr, bw_ctx, val) \ + do { \ const duk_uint8_t *duk__val; \ duk_size_t duk__val_len; \ duk__val = (const duk_uint8_t *) (val); \ @@ -2760,45 +2827,53 @@ DUK_INTERNAL_DECL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx * duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) duk__val, duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_ENSURE_HSTRING(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_ENSURE_HSTRING(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HSTRING_GET_BYTELEN((val)); \ DUK_BW_ENSURE((thr), (bw_ctx), duk__val_len); \ duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HSTRING_GET_DATA((val)), duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_ENSURE_HBUFFER(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_ENSURE_HBUFFER(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HBUFFER_GET_SIZE((val)); \ DUK_BW_ENSURE((thr), (bw_ctx), duk__val_len); \ - duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HBUFFER_GET_DATA_PTR((thr)->heap, (val)), duk__val_len); \ + duk_memcpy_unsafe((void *) ((bw_ctx)->p), \ + (const void *) DUK_HBUFFER_GET_DATA_PTR((thr)->heap, (val)), \ + duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_ENSURE_HBUFFER_FIXED(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_ENSURE_HBUFFER_FIXED(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HBUFFER_FIXED_GET_SIZE((val)); \ DUK_BW_ENSURE((thr), (bw_ctx), duk__val_len); \ - duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HBUFFER_FIXED_GET_DATA_PTR((thr)->heap, (val)), duk__val_len); \ + duk_memcpy_unsafe((void *) ((bw_ctx)->p), \ + (const void *) DUK_HBUFFER_FIXED_GET_DATA_PTR((thr)->heap, (val)), \ + duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_ENSURE_HBUFFER_DYNAMIC(thr,bw_ctx,val) do { \ +#define DUK_BW_WRITE_ENSURE_HBUFFER_DYNAMIC(thr, bw_ctx, val) \ + do { \ duk_size_t duk__val_len; \ duk__val_len = DUK_HBUFFER_DYNAMIC_GET_SIZE((val)); \ DUK_BW_ENSURE((thr), (bw_ctx), duk__val_len); \ - duk_memcpy_unsafe((void *) ((bw_ctx)->p), (const void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((thr)->heap, (val)), duk__val_len); \ + duk_memcpy_unsafe((void *) ((bw_ctx)->p), \ + (const void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((thr)->heap, (val)), \ + duk__val_len); \ (bw_ctx)->p += duk__val_len; \ } while (0) -#define DUK_BW_WRITE_ENSURE_SLICE(thr,bw,dst_off,dst_len) \ - duk_bw_write_ensure_slice((thr), (bw), (dst_off), (dst_len)) -#define DUK_BW_INSERT_ENSURE_BYTES(thr,bw,dst_off,buf,len) \ - duk_bw_insert_ensure_bytes((thr), (bw), (dst_off), (buf), (len)) -#define DUK_BW_INSERT_ENSURE_SLICE(thr,bw,dst_off,src_off,len) \ +#define DUK_BW_WRITE_ENSURE_SLICE(thr, bw, dst_off, dst_len) duk_bw_write_ensure_slice((thr), (bw), (dst_off), (dst_len)) +#define DUK_BW_INSERT_ENSURE_BYTES(thr, bw, dst_off, buf, len) duk_bw_insert_ensure_bytes((thr), (bw), (dst_off), (buf), (len)) +#define DUK_BW_INSERT_ENSURE_SLICE(thr, bw, dst_off, src_off, len) \ duk_bw_insert_ensure_slice((thr), (bw), (dst_off), (src_off), (len)) -#define DUK_BW_INSERT_ENSURE_AREA(thr,bw,off,len) \ +#define DUK_BW_INSERT_ENSURE_AREA(thr, bw, off, len) \ /* Evaluates to (duk_uint8_t *) pointing to start of area. */ \ duk_bw_insert_ensure_area((thr), (bw), (off), (len)) -#define DUK_BW_REMOVE_ENSURE_SLICE(thr,bw,off,len) \ +#define DUK_BW_REMOVE_ENSURE_SLICE(thr, bw, off, len) \ /* No difference between raw/ensure because the buffer shrinks. */ \ DUK_BW_REMOVE_RAW_SLICE((thr), (bw), (off), (len)) @@ -2814,13 +2889,13 @@ DUK_INTERNAL_DECL const duk_int8_t duk_hex_dectab[256]; DUK_INTERNAL_DECL const duk_int16_t duk_hex_dectab_shift4[256]; DUK_INTERNAL_DECL const duk_uint16_t duk_hex_enctab[256]; #endif -#endif /* !DUK_SINGLE_FILE */ +#endif /* !DUK_SINGLE_FILE */ /* Note: assumes that duk_util_probe_steps size is 32 */ #if defined(DUK_USE_HOBJECT_HASH_PART) #if !defined(DUK_SINGLE_FILE) DUK_INTERNAL_DECL duk_uint8_t duk_util_probe_steps[32]; -#endif /* !DUK_SINGLE_FILE */ +#endif /* !DUK_SINGLE_FILE */ #endif #if defined(DUK_USE_STRHASH_DENSE) @@ -2848,10 +2923,26 @@ DUK_INTERNAL_DECL duk_uint8_t *duk_bw_resize(duk_hthread *thr, duk_bufwriter_ctx DUK_INTERNAL_DECL void duk_bw_compact(duk_hthread *thr, duk_bufwriter_ctx *bw_ctx); DUK_INTERNAL_DECL void duk_bw_write_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t src_off, duk_size_t len); DUK_INTERNAL_DECL void duk_bw_write_ensure_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t src_off, duk_size_t len); -DUK_INTERNAL_DECL void duk_bw_insert_raw_bytes(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, const duk_uint8_t *buf, duk_size_t len); -DUK_INTERNAL_DECL void duk_bw_insert_ensure_bytes(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, const duk_uint8_t *buf, duk_size_t len); -DUK_INTERNAL_DECL void duk_bw_insert_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, duk_size_t src_off, duk_size_t len); -DUK_INTERNAL_DECL void duk_bw_insert_ensure_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, duk_size_t src_off, duk_size_t len); +DUK_INTERNAL_DECL void duk_bw_insert_raw_bytes(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + const duk_uint8_t *buf, + duk_size_t len); +DUK_INTERNAL_DECL void duk_bw_insert_ensure_bytes(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + const duk_uint8_t *buf, + duk_size_t len); +DUK_INTERNAL_DECL void duk_bw_insert_raw_slice(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + duk_size_t src_off, + duk_size_t len); +DUK_INTERNAL_DECL void duk_bw_insert_ensure_slice(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + duk_size_t src_off, + duk_size_t len); DUK_INTERNAL_DECL duk_uint8_t *duk_bw_insert_raw_area(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t off, duk_size_t len); DUK_INTERNAL_DECL duk_uint8_t *duk_bw_insert_ensure_area(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t off, duk_size_t len); DUK_INTERNAL_DECL void duk_bw_remove_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t off, duk_size_t len); @@ -2878,10 +2969,12 @@ DUK_INTERNAL_DECL void duk_raw_writeinc_double_be(duk_uint8_t **p, duk_double_t DUK_INTERNAL_DECL void duk_raw_writeinc_xutf8(duk_uint8_t **p, duk_ucodepoint_t val); DUK_INTERNAL_DECL void duk_raw_writeinc_cesu8(duk_uint8_t **p, duk_ucodepoint_t val); -#if defined(DUK_USE_DEBUGGER_SUPPORT) /* For now only needed by the debugger. */ +#if defined(DUK_USE_DEBUGGER_SUPPORT) /* For now only needed by the debugger. */ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); #endif +DUK_INTERNAL_DECL duk_double_t duk_util_get_random_double(duk_hthread *thr); + /* memcpy(), memmove() etc wrappers. The plain variants like duk_memcpy() * assume C99+ and 'src' and 'dst' pointers must be non-NULL even when the * operation size is zero. The unsafe variants like duk_memcpy_safe() deal @@ -2892,7 +2985,8 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); * few extra bytes per call site adds up to ~1kB footprint. */ #if defined(DUK_USE_ALLOW_UNDEFINED_BEHAVIOR) -#define duk_memcpy(dst,src,len) do { \ +#define duk_memcpy(dst, src, len) \ + do { \ void *duk__dst = (dst); \ const void *duk__src = (src); \ duk_size_t duk__len = (len); \ @@ -2900,8 +2994,9 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); DUK_ASSERT(duk__src != NULL || duk__len == 0U); \ (void) DUK_MEMCPY(duk__dst, duk__src, (size_t) duk__len); \ } while (0) -#define duk_memcpy_unsafe(dst,src,len) duk_memcpy((dst), (src), (len)) -#define duk_memmove(dst,src,len) do { \ +#define duk_memcpy_unsafe(dst, src, len) duk_memcpy((dst), (src), (len)) +#define duk_memmove(dst, src, len) \ + do { \ void *duk__dst = (dst); \ const void *duk__src = (src); \ duk_size_t duk__len = (len); \ @@ -2909,24 +3004,27 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); DUK_ASSERT(duk__src != NULL || duk__len == 0U); \ (void) DUK_MEMMOVE(duk__dst, duk__src, (size_t) duk__len); \ } while (0) -#define duk_memmove_unsafe(dst,src,len) duk_memmove((dst), (src), (len)) -#define duk_memset(dst,val,len) do { \ +#define duk_memmove_unsafe(dst, src, len) duk_memmove((dst), (src), (len)) +#define duk_memset(dst, val, len) \ + do { \ void *duk__dst = (dst); \ duk_small_int_t duk__val = (val); \ duk_size_t duk__len = (len); \ DUK_ASSERT(duk__dst != NULL || duk__len == 0U); \ (void) DUK_MEMSET(duk__dst, duk__val, (size_t) duk__len); \ } while (0) -#define duk_memset_unsafe(dst,val,len) duk_memset((dst), (val), (len)) -#define duk_memzero(dst,len) do { \ +#define duk_memset_unsafe(dst, val, len) duk_memset((dst), (val), (len)) +#define duk_memzero(dst, len) \ + do { \ void *duk__dst = (dst); \ duk_size_t duk__len = (len); \ DUK_ASSERT(duk__dst != NULL || duk__len == 0U); \ (void) DUK_MEMZERO(duk__dst, (size_t) duk__len); \ } while (0) -#define duk_memzero_unsafe(dst,len) duk_memzero((dst), (len)) -#else /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ -#define duk_memcpy(dst,src,len) do { \ +#define duk_memzero_unsafe(dst, len) duk_memzero((dst), (len)) +#else /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ +#define duk_memcpy(dst, src, len) \ + do { \ void *duk__dst = (dst); \ const void *duk__src = (src); \ duk_size_t duk__len = (len); \ @@ -2934,7 +3032,8 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); DUK_ASSERT(duk__src != NULL); \ (void) DUK_MEMCPY(duk__dst, duk__src, (size_t) duk__len); \ } while (0) -#define duk_memcpy_unsafe(dst,src,len) do { \ +#define duk_memcpy_unsafe(dst, src, len) \ + do { \ void *duk__dst = (dst); \ const void *duk__src = (src); \ duk_size_t duk__len = (len); \ @@ -2946,7 +3045,8 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); (void) DUK_MEMCPY(duk__dst, duk__src, (size_t) duk__len); \ } \ } while (0) -#define duk_memmove(dst,src,len) do { \ +#define duk_memmove(dst, src, len) \ + do { \ void *duk__dst = (dst); \ const void *duk__src = (src); \ duk_size_t duk__len = (len); \ @@ -2954,7 +3054,8 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); DUK_ASSERT(duk__src != NULL); \ (void) DUK_MEMMOVE(duk__dst, duk__src, (size_t) duk__len); \ } while (0) -#define duk_memmove_unsafe(dst,src,len) do { \ +#define duk_memmove_unsafe(dst, src, len) \ + do { \ void *duk__dst = (dst); \ const void *duk__src = (src); \ duk_size_t duk__len = (len); \ @@ -2966,14 +3067,16 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); (void) DUK_MEMMOVE(duk__dst, duk__src, (size_t) duk__len); \ } \ } while (0) -#define duk_memset(dst,val,len) do { \ +#define duk_memset(dst, val, len) \ + do { \ void *duk__dst = (dst); \ duk_small_int_t duk__val = (val); \ duk_size_t duk__len = (len); \ DUK_ASSERT(duk__dst != NULL); \ (void) DUK_MEMSET(duk__dst, duk__val, (size_t) duk__len); \ } while (0) -#define duk_memset_unsafe(dst,val,len) do { \ +#define duk_memset_unsafe(dst, val, len) \ + do { \ void *duk__dst = (dst); \ duk_small_int_t duk__val = (val); \ duk_size_t duk__len = (len); \ @@ -2983,13 +3086,15 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); (void) DUK_MEMSET(duk__dst, duk__val, (size_t) duk__len); \ } \ } while (0) -#define duk_memzero(dst,len) do { \ +#define duk_memzero(dst, len) \ + do { \ void *duk__dst = (dst); \ duk_size_t duk__len = (len); \ DUK_ASSERT(duk__dst != NULL); \ (void) DUK_MEMZERO(duk__dst, (size_t) duk__len); \ } while (0) -#define duk_memzero_unsafe(dst,len) do { \ +#define duk_memzero_unsafe(dst, len) \ + do { \ void *duk__dst = (dst); \ duk_size_t duk__len = (len); \ DUK_ASSERT(duk__dst != NULL || duk__len == 0U); \ @@ -2998,7 +3103,7 @@ DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len); (void) DUK_MEMZERO(duk__dst, (size_t) duk__len); \ } \ } while (0) -#endif /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ +#endif /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ DUK_INTERNAL_DECL duk_small_int_t duk_memcmp(const void *s1, const void *s2, duk_size_t len); DUK_INTERNAL_DECL duk_small_int_t duk_memcmp_unsafe(const void *s1, const void *s2, duk_size_t len); @@ -3044,10 +3149,9 @@ DUK_INTERNAL_DECL duk_bool_t duk_float_equals(duk_float_t x, duk_float_t y); * * However, incorrectly true for x == 0 so check for that explicitly. */ -#define DUK_IS_POWER_OF_TWO(x) \ - ((x) != 0U && ((x) & ((x) - 1U)) == 0U) +#define DUK_IS_POWER_OF_TWO(x) ((x) != 0U && ((x) & ((x) -1U)) == 0U) -#endif /* DUK_UTIL_H_INCLUDED */ +#endif /* DUK_UTIL_H_INCLUDED */ /* #include duk_strings.h */ /* * Shared string macros. @@ -3073,151 +3177,151 @@ DUK_INTERNAL_DECL duk_bool_t duk_float_equals(duk_float_t x, duk_float_t y); #define DUK_ERRMSG_H_INCLUDED /* Mostly API and built-in method related */ -#define DUK_STR_INTERNAL_ERROR "internal error" -#define DUK_STR_UNSUPPORTED "unsupported" -#define DUK_STR_INVALID_COUNT "invalid count" -#define DUK_STR_INVALID_ARGS "invalid args" -#define DUK_STR_INVALID_STATE "invalid state" -#define DUK_STR_INVALID_INPUT "invalid input" -#define DUK_STR_INVALID_LENGTH "invalid length" -#define DUK_STR_NOT_CONSTRUCTABLE "not constructable" -#define DUK_STR_CONSTRUCT_ONLY "constructor requires 'new'" -#define DUK_STR_NOT_CALLABLE "not callable" -#define DUK_STR_NOT_EXTENSIBLE "not extensible" -#define DUK_STR_NOT_WRITABLE "not writable" -#define DUK_STR_NOT_CONFIGURABLE "not configurable" -#define DUK_STR_INVALID_CONTEXT "invalid context" -#define DUK_STR_INVALID_INDEX "invalid args" -#define DUK_STR_PUSH_BEYOND_ALLOC_STACK "cannot push beyond allocated stack" -#define DUK_STR_NOT_UNDEFINED "unexpected type" -#define DUK_STR_NOT_NULL "unexpected type" -#define DUK_STR_NOT_BOOLEAN "unexpected type" -#define DUK_STR_NOT_NUMBER "unexpected type" -#define DUK_STR_NOT_STRING "unexpected type" -#define DUK_STR_NOT_OBJECT "unexpected type" -#define DUK_STR_NOT_POINTER "unexpected type" -#define DUK_STR_NOT_BUFFER "not buffer" /* still in use with verbose messages */ -#define DUK_STR_UNEXPECTED_TYPE "unexpected type" -#define DUK_STR_NOT_THREAD "unexpected type" -#define DUK_STR_NOT_COMPFUNC "unexpected type" -#define DUK_STR_NOT_NATFUNC "unexpected type" -#define DUK_STR_NOT_C_FUNCTION "unexpected type" -#define DUK_STR_NOT_FUNCTION "unexpected type" -#define DUK_STR_NOT_REGEXP "unexpected type" -#define DUK_STR_TOPRIMITIVE_FAILED "coercion to primitive failed" -#define DUK_STR_NUMBER_OUTSIDE_RANGE "number outside range" -#define DUK_STR_NOT_OBJECT_COERCIBLE "not object coercible" -#define DUK_STR_CANNOT_NUMBER_COERCE_SYMBOL "cannot number coerce Symbol" -#define DUK_STR_CANNOT_STRING_COERCE_SYMBOL "cannot string coerce Symbol" -#define DUK_STR_STRING_TOO_LONG "string too long" -#define DUK_STR_BUFFER_TOO_LONG "buffer too long" -#define DUK_STR_ALLOC_FAILED "alloc failed" -#define DUK_STR_WRONG_BUFFER_TYPE "wrong buffer type" -#define DUK_STR_BASE64_ENCODE_FAILED "base64 encode failed" -#define DUK_STR_SOURCE_DECODE_FAILED "source decode failed" -#define DUK_STR_UTF8_DECODE_FAILED "utf-8 decode failed" -#define DUK_STR_BASE64_DECODE_FAILED "base64 decode failed" -#define DUK_STR_HEX_DECODE_FAILED "hex decode failed" -#define DUK_STR_INVALID_BYTECODE "invalid bytecode" -#define DUK_STR_NO_SOURCECODE "no sourcecode" -#define DUK_STR_RESULT_TOO_LONG "result too long" -#define DUK_STR_INVALID_CFUNC_RC "invalid C function rc" -#define DUK_STR_INVALID_INSTANCEOF_RVAL "invalid instanceof rval" -#define DUK_STR_INVALID_INSTANCEOF_RVAL_NOPROTO "instanceof rval has no .prototype" +#define DUK_STR_INTERNAL_ERROR "internal error" +#define DUK_STR_UNSUPPORTED "unsupported" +#define DUK_STR_INVALID_COUNT "invalid count" +#define DUK_STR_INVALID_ARGS "invalid args" +#define DUK_STR_INVALID_STATE "invalid state" +#define DUK_STR_INVALID_INPUT "invalid input" +#define DUK_STR_INVALID_LENGTH "invalid length" +#define DUK_STR_NOT_CONSTRUCTABLE "not constructable" +#define DUK_STR_CONSTRUCT_ONLY "constructor requires 'new'" +#define DUK_STR_NOT_CALLABLE "not callable" +#define DUK_STR_NOT_EXTENSIBLE "not extensible" +#define DUK_STR_NOT_WRITABLE "not writable" +#define DUK_STR_NOT_CONFIGURABLE "not configurable" +#define DUK_STR_INVALID_CONTEXT "invalid context" +#define DUK_STR_INVALID_INDEX "invalid args" +#define DUK_STR_PUSH_BEYOND_ALLOC_STACK "cannot push beyond allocated stack" +#define DUK_STR_NOT_UNDEFINED "unexpected type" +#define DUK_STR_NOT_NULL "unexpected type" +#define DUK_STR_NOT_BOOLEAN "unexpected type" +#define DUK_STR_NOT_NUMBER "unexpected type" +#define DUK_STR_NOT_STRING "unexpected type" +#define DUK_STR_NOT_OBJECT "unexpected type" +#define DUK_STR_NOT_POINTER "unexpected type" +#define DUK_STR_NOT_BUFFER "not buffer" /* still in use with verbose messages */ +#define DUK_STR_UNEXPECTED_TYPE "unexpected type" +#define DUK_STR_NOT_THREAD "unexpected type" +#define DUK_STR_NOT_COMPFUNC "unexpected type" +#define DUK_STR_NOT_NATFUNC "unexpected type" +#define DUK_STR_NOT_C_FUNCTION "unexpected type" +#define DUK_STR_NOT_FUNCTION "unexpected type" +#define DUK_STR_NOT_REGEXP "unexpected type" +#define DUK_STR_TOPRIMITIVE_FAILED "coercion to primitive failed" +#define DUK_STR_NUMBER_OUTSIDE_RANGE "number outside range" +#define DUK_STR_NOT_OBJECT_COERCIBLE "not object coercible" +#define DUK_STR_CANNOT_NUMBER_COERCE_SYMBOL "cannot number coerce Symbol" +#define DUK_STR_CANNOT_STRING_COERCE_SYMBOL "cannot string coerce Symbol" +#define DUK_STR_STRING_TOO_LONG "string too long" +#define DUK_STR_BUFFER_TOO_LONG "buffer too long" +#define DUK_STR_ALLOC_FAILED "alloc failed" +#define DUK_STR_WRONG_BUFFER_TYPE "wrong buffer type" +#define DUK_STR_BASE64_ENCODE_FAILED "base64 encode failed" +#define DUK_STR_SOURCE_DECODE_FAILED "source decode failed" +#define DUK_STR_UTF8_DECODE_FAILED "utf-8 decode failed" +#define DUK_STR_BASE64_DECODE_FAILED "base64 decode failed" +#define DUK_STR_HEX_DECODE_FAILED "hex decode failed" +#define DUK_STR_INVALID_BYTECODE "invalid bytecode" +#define DUK_STR_NO_SOURCECODE "no sourcecode" +#define DUK_STR_RESULT_TOO_LONG "result too long" +#define DUK_STR_INVALID_CFUNC_RC "invalid C function rc" +#define DUK_STR_INVALID_INSTANCEOF_RVAL "invalid instanceof rval" +#define DUK_STR_INVALID_INSTANCEOF_RVAL_NOPROTO "instanceof rval has no .prototype" /* JSON */ -#define DUK_STR_FMT_PTR "%p" -#define DUK_STR_FMT_INVALID_JSON "invalid json (at offset %ld)" -#define DUK_STR_CYCLIC_INPUT "cyclic input" +#define DUK_STR_FMT_PTR "%p" +#define DUK_STR_FMT_INVALID_JSON "invalid json (at offset %ld)" +#define DUK_STR_CYCLIC_INPUT "cyclic input" /* Generic codec */ -#define DUK_STR_DEC_RECLIMIT "decode recursion limit" -#define DUK_STR_ENC_RECLIMIT "encode recursion limit" +#define DUK_STR_DEC_RECLIMIT "decode recursion limit" +#define DUK_STR_ENC_RECLIMIT "encode recursion limit" /* Object property access */ -#define DUK_STR_INVALID_BASE "invalid base value" -#define DUK_STR_STRICT_CALLER_READ "cannot read strict 'caller'" -#define DUK_STR_PROXY_REJECTED "proxy rejected" -#define DUK_STR_INVALID_ARRAY_LENGTH "invalid array length" -#define DUK_STR_SETTER_UNDEFINED "setter undefined" -#define DUK_STR_INVALID_DESCRIPTOR "invalid descriptor" +#define DUK_STR_INVALID_BASE "invalid base value" +#define DUK_STR_STRICT_CALLER_READ "cannot read strict 'caller'" +#define DUK_STR_PROXY_REJECTED "proxy rejected" +#define DUK_STR_INVALID_ARRAY_LENGTH "invalid array length" +#define DUK_STR_SETTER_UNDEFINED "setter undefined" +#define DUK_STR_INVALID_DESCRIPTOR "invalid descriptor" /* Proxy */ -#define DUK_STR_PROXY_REVOKED "proxy revoked" -#define DUK_STR_INVALID_TRAP_RESULT "invalid trap result" +#define DUK_STR_PROXY_REVOKED "proxy revoked" +#define DUK_STR_INVALID_TRAP_RESULT "invalid trap result" /* Variables */ /* Lexer */ -#define DUK_STR_INVALID_ESCAPE "invalid escape" -#define DUK_STR_UNTERMINATED_STRING "unterminated string" -#define DUK_STR_UNTERMINATED_COMMENT "unterminated comment" -#define DUK_STR_UNTERMINATED_REGEXP "unterminated regexp" -#define DUK_STR_TOKEN_LIMIT "token limit" -#define DUK_STR_REGEXP_SUPPORT_DISABLED "regexp support disabled" -#define DUK_STR_INVALID_NUMBER_LITERAL "invalid number literal" -#define DUK_STR_INVALID_TOKEN "invalid token" +#define DUK_STR_INVALID_ESCAPE "invalid escape" +#define DUK_STR_UNTERMINATED_STRING "unterminated string" +#define DUK_STR_UNTERMINATED_COMMENT "unterminated comment" +#define DUK_STR_UNTERMINATED_REGEXP "unterminated regexp" +#define DUK_STR_TOKEN_LIMIT "token limit" +#define DUK_STR_REGEXP_SUPPORT_DISABLED "regexp support disabled" +#define DUK_STR_INVALID_NUMBER_LITERAL "invalid number literal" +#define DUK_STR_INVALID_TOKEN "invalid token" /* Compiler */ -#define DUK_STR_PARSE_ERROR "parse error" -#define DUK_STR_DUPLICATE_LABEL "duplicate label" -#define DUK_STR_INVALID_LABEL "invalid label" -#define DUK_STR_INVALID_ARRAY_LITERAL "invalid array literal" -#define DUK_STR_INVALID_OBJECT_LITERAL "invalid object literal" -#define DUK_STR_INVALID_VAR_DECLARATION "invalid variable declaration" -#define DUK_STR_CANNOT_DELETE_IDENTIFIER "cannot delete identifier" -#define DUK_STR_INVALID_EXPRESSION "invalid expression" -#define DUK_STR_INVALID_LVALUE "invalid lvalue" -#define DUK_STR_INVALID_NEWTARGET "invalid new.target" -#define DUK_STR_EXPECTED_IDENTIFIER "expected identifier" -#define DUK_STR_EMPTY_EXPR_NOT_ALLOWED "empty expression not allowed" -#define DUK_STR_INVALID_FOR "invalid for statement" -#define DUK_STR_INVALID_SWITCH "invalid switch statement" -#define DUK_STR_INVALID_BREAK_CONT_LABEL "invalid break/continue label" -#define DUK_STR_INVALID_RETURN "invalid return" -#define DUK_STR_INVALID_TRY "invalid try" -#define DUK_STR_INVALID_THROW "invalid throw" -#define DUK_STR_WITH_IN_STRICT_MODE "with in strict mode" -#define DUK_STR_FUNC_STMT_NOT_ALLOWED "function statement not allowed" -#define DUK_STR_UNTERMINATED_STMT "unterminated statement" -#define DUK_STR_INVALID_ARG_NAME "invalid argument name" -#define DUK_STR_INVALID_FUNC_NAME "invalid function name" -#define DUK_STR_INVALID_GETSET_NAME "invalid getter/setter name" -#define DUK_STR_FUNC_NAME_REQUIRED "function name required" +#define DUK_STR_PARSE_ERROR "parse error" +#define DUK_STR_DUPLICATE_LABEL "duplicate label" +#define DUK_STR_INVALID_LABEL "invalid label" +#define DUK_STR_INVALID_ARRAY_LITERAL "invalid array literal" +#define DUK_STR_INVALID_OBJECT_LITERAL "invalid object literal" +#define DUK_STR_INVALID_VAR_DECLARATION "invalid variable declaration" +#define DUK_STR_CANNOT_DELETE_IDENTIFIER "cannot delete identifier" +#define DUK_STR_INVALID_EXPRESSION "invalid expression" +#define DUK_STR_INVALID_LVALUE "invalid lvalue" +#define DUK_STR_INVALID_NEWTARGET "invalid new.target" +#define DUK_STR_EXPECTED_IDENTIFIER "expected identifier" +#define DUK_STR_EMPTY_EXPR_NOT_ALLOWED "empty expression not allowed" +#define DUK_STR_INVALID_FOR "invalid for statement" +#define DUK_STR_INVALID_SWITCH "invalid switch statement" +#define DUK_STR_INVALID_BREAK_CONT_LABEL "invalid break/continue label" +#define DUK_STR_INVALID_RETURN "invalid return" +#define DUK_STR_INVALID_TRY "invalid try" +#define DUK_STR_INVALID_THROW "invalid throw" +#define DUK_STR_WITH_IN_STRICT_MODE "with in strict mode" +#define DUK_STR_FUNC_STMT_NOT_ALLOWED "function statement not allowed" +#define DUK_STR_UNTERMINATED_STMT "unterminated statement" +#define DUK_STR_INVALID_ARG_NAME "invalid argument name" +#define DUK_STR_INVALID_FUNC_NAME "invalid function name" +#define DUK_STR_INVALID_GETSET_NAME "invalid getter/setter name" +#define DUK_STR_FUNC_NAME_REQUIRED "function name required" /* RegExp */ -#define DUK_STR_INVALID_QUANTIFIER "invalid regexp quantifier" -#define DUK_STR_INVALID_QUANTIFIER_NO_ATOM "quantifier without preceding atom" -#define DUK_STR_INVALID_QUANTIFIER_VALUES "quantifier values invalid (qmin > qmax)" -#define DUK_STR_QUANTIFIER_TOO_MANY_COPIES "quantifier requires too many atom copies" -#define DUK_STR_UNEXPECTED_CLOSING_PAREN "unexpected closing parenthesis" -#define DUK_STR_UNEXPECTED_END_OF_PATTERN "unexpected end of pattern" -#define DUK_STR_UNEXPECTED_REGEXP_TOKEN "unexpected token in regexp" -#define DUK_STR_INVALID_REGEXP_FLAGS "invalid regexp flags" -#define DUK_STR_INVALID_REGEXP_ESCAPE "invalid regexp escape" -#define DUK_STR_INVALID_BACKREFS "invalid backreference(s)" -#define DUK_STR_INVALID_REGEXP_CHARACTER "invalid regexp character" -#define DUK_STR_INVALID_REGEXP_GROUP "invalid regexp group" -#define DUK_STR_UNTERMINATED_CHARCLASS "unterminated character class" -#define DUK_STR_INVALID_RANGE "invalid range" +#define DUK_STR_INVALID_QUANTIFIER "invalid regexp quantifier" +#define DUK_STR_INVALID_QUANTIFIER_NO_ATOM "quantifier without preceding atom" +#define DUK_STR_INVALID_QUANTIFIER_VALUES "quantifier values invalid (qmin > qmax)" +#define DUK_STR_QUANTIFIER_TOO_MANY_COPIES "quantifier requires too many atom copies" +#define DUK_STR_UNEXPECTED_CLOSING_PAREN "unexpected closing parenthesis" +#define DUK_STR_UNEXPECTED_END_OF_PATTERN "unexpected end of pattern" +#define DUK_STR_UNEXPECTED_REGEXP_TOKEN "unexpected token in regexp" +#define DUK_STR_INVALID_REGEXP_FLAGS "invalid regexp flags" +#define DUK_STR_INVALID_REGEXP_ESCAPE "invalid regexp escape" +#define DUK_STR_INVALID_BACKREFS "invalid backreference(s)" +#define DUK_STR_INVALID_REGEXP_CHARACTER "invalid regexp character" +#define DUK_STR_INVALID_REGEXP_GROUP "invalid regexp group" +#define DUK_STR_UNTERMINATED_CHARCLASS "unterminated character class" +#define DUK_STR_INVALID_RANGE "invalid range" /* Limits */ -#define DUK_STR_VALSTACK_LIMIT "valstack limit" -#define DUK_STR_CALLSTACK_LIMIT "callstack limit" -#define DUK_STR_PROTOTYPE_CHAIN_LIMIT "prototype chain limit" -#define DUK_STR_BOUND_CHAIN_LIMIT "function call bound chain limit" -#define DUK_STR_NATIVE_STACK_LIMIT "C stack depth limit" -#define DUK_STR_COMPILER_RECURSION_LIMIT "compiler recursion limit" -#define DUK_STR_BYTECODE_LIMIT "bytecode limit" -#define DUK_STR_REG_LIMIT "register limit" -#define DUK_STR_TEMP_LIMIT "temp limit" -#define DUK_STR_CONST_LIMIT "const limit" -#define DUK_STR_FUNC_LIMIT "function limit" -#define DUK_STR_REGEXP_COMPILER_RECURSION_LIMIT "regexp compiler recursion limit" -#define DUK_STR_REGEXP_EXECUTOR_RECURSION_LIMIT "regexp executor recursion limit" -#define DUK_STR_REGEXP_EXECUTOR_STEP_LIMIT "regexp step limit" +#define DUK_STR_VALSTACK_LIMIT "valstack limit" +#define DUK_STR_CALLSTACK_LIMIT "callstack limit" +#define DUK_STR_PROTOTYPE_CHAIN_LIMIT "prototype chain limit" +#define DUK_STR_BOUND_CHAIN_LIMIT "function call bound chain limit" +#define DUK_STR_NATIVE_STACK_LIMIT "C stack depth limit" +#define DUK_STR_COMPILER_RECURSION_LIMIT "compiler recursion limit" +#define DUK_STR_BYTECODE_LIMIT "bytecode limit" +#define DUK_STR_REG_LIMIT "register limit" +#define DUK_STR_TEMP_LIMIT "temp limit" +#define DUK_STR_CONST_LIMIT "const limit" +#define DUK_STR_FUNC_LIMIT "function limit" +#define DUK_STR_REGEXP_COMPILER_RECURSION_LIMIT "regexp compiler recursion limit" +#define DUK_STR_REGEXP_EXECUTOR_RECURSION_LIMIT "regexp executor recursion limit" +#define DUK_STR_REGEXP_EXECUTOR_STEP_LIMIT "regexp step limit" -#endif /* DUK_ERRMSG_H_INCLUDED */ +#endif /* DUK_ERRMSG_H_INCLUDED */ /* #include duk_js_bytecode.h */ /* * ECMAScript bytecode @@ -3304,403 +3408,394 @@ DUK_INTERNAL_DECL duk_bool_t duk_float_equals(duk_float_t x, duk_float_t y); typedef duk_uint32_t duk_instr_t; -#define DUK_BC_SHIFT_OP 0 -#define DUK_BC_SHIFT_A 8 -#define DUK_BC_SHIFT_B 16 -#define DUK_BC_SHIFT_C 24 -#define DUK_BC_SHIFT_BC DUK_BC_SHIFT_B -#define DUK_BC_SHIFT_ABC DUK_BC_SHIFT_A +#define DUK_BC_SHIFT_OP 0 +#define DUK_BC_SHIFT_A 8 +#define DUK_BC_SHIFT_B 16 +#define DUK_BC_SHIFT_C 24 +#define DUK_BC_SHIFT_BC DUK_BC_SHIFT_B +#define DUK_BC_SHIFT_ABC DUK_BC_SHIFT_A -#define DUK_BC_UNSHIFTED_MASK_OP 0xffUL -#define DUK_BC_UNSHIFTED_MASK_A 0xffUL -#define DUK_BC_UNSHIFTED_MASK_B 0xffUL -#define DUK_BC_UNSHIFTED_MASK_C 0xffUL -#define DUK_BC_UNSHIFTED_MASK_BC 0xffffUL -#define DUK_BC_UNSHIFTED_MASK_ABC 0xffffffUL +#define DUK_BC_UNSHIFTED_MASK_OP 0xffUL +#define DUK_BC_UNSHIFTED_MASK_A 0xffUL +#define DUK_BC_UNSHIFTED_MASK_B 0xffUL +#define DUK_BC_UNSHIFTED_MASK_C 0xffUL +#define DUK_BC_UNSHIFTED_MASK_BC 0xffffUL +#define DUK_BC_UNSHIFTED_MASK_ABC 0xffffffUL -#define DUK_BC_SHIFTED_MASK_OP (DUK_BC_UNSHIFTED_MASK_OP << DUK_BC_SHIFT_OP) -#define DUK_BC_SHIFTED_MASK_A (DUK_BC_UNSHIFTED_MASK_A << DUK_BC_SHIFT_A) -#define DUK_BC_SHIFTED_MASK_B (DUK_BC_UNSHIFTED_MASK_B << DUK_BC_SHIFT_B) -#define DUK_BC_SHIFTED_MASK_C (DUK_BC_UNSHIFTED_MASK_C << DUK_BC_SHIFT_C) -#define DUK_BC_SHIFTED_MASK_BC (DUK_BC_UNSHIFTED_MASK_BC << DUK_BC_SHIFT_BC) -#define DUK_BC_SHIFTED_MASK_ABC (DUK_BC_UNSHIFTED_MASK_ABC << DUK_BC_SHIFT_ABC) +#define DUK_BC_SHIFTED_MASK_OP (DUK_BC_UNSHIFTED_MASK_OP << DUK_BC_SHIFT_OP) +#define DUK_BC_SHIFTED_MASK_A (DUK_BC_UNSHIFTED_MASK_A << DUK_BC_SHIFT_A) +#define DUK_BC_SHIFTED_MASK_B (DUK_BC_UNSHIFTED_MASK_B << DUK_BC_SHIFT_B) +#define DUK_BC_SHIFTED_MASK_C (DUK_BC_UNSHIFTED_MASK_C << DUK_BC_SHIFT_C) +#define DUK_BC_SHIFTED_MASK_BC (DUK_BC_UNSHIFTED_MASK_BC << DUK_BC_SHIFT_BC) +#define DUK_BC_SHIFTED_MASK_ABC (DUK_BC_UNSHIFTED_MASK_ABC << DUK_BC_SHIFT_ABC) -#define DUK_DEC_OP(x) ((x) & 0xffUL) -#define DUK_DEC_A(x) (((x) >> 8) & 0xffUL) -#define DUK_DEC_B(x) (((x) >> 16) & 0xffUL) -#define DUK_DEC_C(x) (((x) >> 24) & 0xffUL) -#define DUK_DEC_BC(x) (((x) >> 16) & 0xffffUL) -#define DUK_DEC_ABC(x) (((x) >> 8) & 0xffffffUL) +#define DUK_DEC_OP(x) ((x) &0xffUL) +#define DUK_DEC_A(x) (((x) >> 8) & 0xffUL) +#define DUK_DEC_B(x) (((x) >> 16) & 0xffUL) +#define DUK_DEC_C(x) (((x) >> 24) & 0xffUL) +#define DUK_DEC_BC(x) (((x) >> 16) & 0xffffUL) +#define DUK_DEC_ABC(x) (((x) >> 8) & 0xffffffUL) -#define DUK_ENC_OP(op) ((duk_instr_t) (op)) -#define DUK_ENC_OP_ABC(op,abc) ((duk_instr_t) ( \ - (((duk_instr_t) (abc)) << 8) | \ - ((duk_instr_t) (op)) \ - )) -#define DUK_ENC_OP_A_BC(op,a,bc) ((duk_instr_t) ( \ - (((duk_instr_t) (bc)) << 16) | \ - (((duk_instr_t) (a)) << 8) | \ - ((duk_instr_t) (op)) \ - )) -#define DUK_ENC_OP_A_B_C(op,a,b,c) ((duk_instr_t) ( \ - (((duk_instr_t) (c)) << 24) | \ - (((duk_instr_t) (b)) << 16) | \ - (((duk_instr_t) (a)) << 8) | \ - ((duk_instr_t) (op)) \ - )) -#define DUK_ENC_OP_A_B(op,a,b) DUK_ENC_OP_A_B_C((op),(a),(b),0) -#define DUK_ENC_OP_A(op,a) DUK_ENC_OP_A_B_C((op),(a),0,0) -#define DUK_ENC_OP_BC(op,bc) DUK_ENC_OP_A_BC((op),0,(bc)) +#define DUK_ENC_OP(op) ((duk_instr_t) (op)) +#define DUK_ENC_OP_ABC(op, abc) ((duk_instr_t) ((((duk_instr_t) (abc)) << 8) | ((duk_instr_t) (op)))) +#define DUK_ENC_OP_A_BC(op, a, bc) \ + ((duk_instr_t) ((((duk_instr_t) (bc)) << 16) | (((duk_instr_t) (a)) << 8) | ((duk_instr_t) (op)))) +#define DUK_ENC_OP_A_B_C(op, a, b, c) \ + ((duk_instr_t) ((((duk_instr_t) (c)) << 24) | (((duk_instr_t) (b)) << 16) | (((duk_instr_t) (a)) << 8) | \ + ((duk_instr_t) (op)))) +#define DUK_ENC_OP_A_B(op, a, b) DUK_ENC_OP_A_B_C((op), (a), (b), 0) +#define DUK_ENC_OP_A(op, a) DUK_ENC_OP_A_B_C((op), (a), 0, 0) +#define DUK_ENC_OP_BC(op, bc) DUK_ENC_OP_A_BC((op), 0, (bc)) /* Get opcode base value with B/C reg/const flags cleared. */ -#define DUK_BC_NOREGCONST_OP(op) ((op) & 0xfc) +#define DUK_BC_NOREGCONST_OP(op) ((op) &0xfc) /* Constants should be signed so that signed arithmetic involving them * won't cause values to be coerced accidentally to unsigned. */ -#define DUK_BC_OP_MIN 0 -#define DUK_BC_OP_MAX 0xffL -#define DUK_BC_A_MIN 0 -#define DUK_BC_A_MAX 0xffL -#define DUK_BC_B_MIN 0 -#define DUK_BC_B_MAX 0xffL -#define DUK_BC_C_MIN 0 -#define DUK_BC_C_MAX 0xffL -#define DUK_BC_BC_MIN 0 -#define DUK_BC_BC_MAX 0xffffL -#define DUK_BC_ABC_MIN 0 -#define DUK_BC_ABC_MAX 0xffffffL +#define DUK_BC_OP_MIN 0 +#define DUK_BC_OP_MAX 0xffL +#define DUK_BC_A_MIN 0 +#define DUK_BC_A_MAX 0xffL +#define DUK_BC_B_MIN 0 +#define DUK_BC_B_MAX 0xffL +#define DUK_BC_C_MIN 0 +#define DUK_BC_C_MAX 0xffL +#define DUK_BC_BC_MIN 0 +#define DUK_BC_BC_MAX 0xffffL +#define DUK_BC_ABC_MIN 0 +#define DUK_BC_ABC_MAX 0xffffffL /* Masks for B/C reg/const indicator in opcode field. */ -#define DUK_BC_REGCONST_B (0x01UL) -#define DUK_BC_REGCONST_C (0x02UL) +#define DUK_BC_REGCONST_B (0x01UL) +#define DUK_BC_REGCONST_C (0x02UL) /* Misc. masks for opcode field. */ -#define DUK_BC_INCDECP_FLAG_DEC (0x04UL) -#define DUK_BC_INCDECP_FLAG_POST (0x08UL) +#define DUK_BC_INCDECP_FLAG_DEC (0x04UL) +#define DUK_BC_INCDECP_FLAG_POST (0x08UL) /* Opcodes. */ -#define DUK_OP_LDREG 0 -#define DUK_OP_STREG 1 -#define DUK_OP_JUMP 2 -#define DUK_OP_LDCONST 3 -#define DUK_OP_LDINT 4 -#define DUK_OP_LDINTX 5 -#define DUK_OP_LDTHIS 6 -#define DUK_OP_LDUNDEF 7 -#define DUK_OP_LDNULL 8 -#define DUK_OP_LDTRUE 9 -#define DUK_OP_LDFALSE 10 -#define DUK_OP_GETVAR 11 -#define DUK_OP_BNOT 12 -#define DUK_OP_LNOT 13 -#define DUK_OP_UNM 14 -#define DUK_OP_UNP 15 -#define DUK_OP_EQ 16 -#define DUK_OP_EQ_RR 16 -#define DUK_OP_EQ_CR 17 -#define DUK_OP_EQ_RC 18 -#define DUK_OP_EQ_CC 19 -#define DUK_OP_NEQ 20 -#define DUK_OP_NEQ_RR 20 -#define DUK_OP_NEQ_CR 21 -#define DUK_OP_NEQ_RC 22 -#define DUK_OP_NEQ_CC 23 -#define DUK_OP_SEQ 24 -#define DUK_OP_SEQ_RR 24 -#define DUK_OP_SEQ_CR 25 -#define DUK_OP_SEQ_RC 26 -#define DUK_OP_SEQ_CC 27 -#define DUK_OP_SNEQ 28 -#define DUK_OP_SNEQ_RR 28 -#define DUK_OP_SNEQ_CR 29 -#define DUK_OP_SNEQ_RC 30 -#define DUK_OP_SNEQ_CC 31 -#define DUK_OP_GT 32 -#define DUK_OP_GT_RR 32 -#define DUK_OP_GT_CR 33 -#define DUK_OP_GT_RC 34 -#define DUK_OP_GT_CC 35 -#define DUK_OP_GE 36 -#define DUK_OP_GE_RR 36 -#define DUK_OP_GE_CR 37 -#define DUK_OP_GE_RC 38 -#define DUK_OP_GE_CC 39 -#define DUK_OP_LT 40 -#define DUK_OP_LT_RR 40 -#define DUK_OP_LT_CR 41 -#define DUK_OP_LT_RC 42 -#define DUK_OP_LT_CC 43 -#define DUK_OP_LE 44 -#define DUK_OP_LE_RR 44 -#define DUK_OP_LE_CR 45 -#define DUK_OP_LE_RC 46 -#define DUK_OP_LE_CC 47 -#define DUK_OP_IFTRUE 48 -#define DUK_OP_IFTRUE_R 48 -#define DUK_OP_IFTRUE_C 49 -#define DUK_OP_IFFALSE 50 -#define DUK_OP_IFFALSE_R 50 -#define DUK_OP_IFFALSE_C 51 -#define DUK_OP_ADD 52 -#define DUK_OP_ADD_RR 52 -#define DUK_OP_ADD_CR 53 -#define DUK_OP_ADD_RC 54 -#define DUK_OP_ADD_CC 55 -#define DUK_OP_SUB 56 -#define DUK_OP_SUB_RR 56 -#define DUK_OP_SUB_CR 57 -#define DUK_OP_SUB_RC 58 -#define DUK_OP_SUB_CC 59 -#define DUK_OP_MUL 60 -#define DUK_OP_MUL_RR 60 -#define DUK_OP_MUL_CR 61 -#define DUK_OP_MUL_RC 62 -#define DUK_OP_MUL_CC 63 -#define DUK_OP_DIV 64 -#define DUK_OP_DIV_RR 64 -#define DUK_OP_DIV_CR 65 -#define DUK_OP_DIV_RC 66 -#define DUK_OP_DIV_CC 67 -#define DUK_OP_MOD 68 -#define DUK_OP_MOD_RR 68 -#define DUK_OP_MOD_CR 69 -#define DUK_OP_MOD_RC 70 -#define DUK_OP_MOD_CC 71 -#define DUK_OP_EXP 72 -#define DUK_OP_EXP_RR 72 -#define DUK_OP_EXP_CR 73 -#define DUK_OP_EXP_RC 74 -#define DUK_OP_EXP_CC 75 -#define DUK_OP_BAND 76 -#define DUK_OP_BAND_RR 76 -#define DUK_OP_BAND_CR 77 -#define DUK_OP_BAND_RC 78 -#define DUK_OP_BAND_CC 79 -#define DUK_OP_BOR 80 -#define DUK_OP_BOR_RR 80 -#define DUK_OP_BOR_CR 81 -#define DUK_OP_BOR_RC 82 -#define DUK_OP_BOR_CC 83 -#define DUK_OP_BXOR 84 -#define DUK_OP_BXOR_RR 84 -#define DUK_OP_BXOR_CR 85 -#define DUK_OP_BXOR_RC 86 -#define DUK_OP_BXOR_CC 87 -#define DUK_OP_BASL 88 -#define DUK_OP_BASL_RR 88 -#define DUK_OP_BASL_CR 89 -#define DUK_OP_BASL_RC 90 -#define DUK_OP_BASL_CC 91 -#define DUK_OP_BLSR 92 -#define DUK_OP_BLSR_RR 92 -#define DUK_OP_BLSR_CR 93 -#define DUK_OP_BLSR_RC 94 -#define DUK_OP_BLSR_CC 95 -#define DUK_OP_BASR 96 -#define DUK_OP_BASR_RR 96 -#define DUK_OP_BASR_CR 97 -#define DUK_OP_BASR_RC 98 -#define DUK_OP_BASR_CC 99 -#define DUK_OP_INSTOF 100 -#define DUK_OP_INSTOF_RR 100 -#define DUK_OP_INSTOF_CR 101 -#define DUK_OP_INSTOF_RC 102 -#define DUK_OP_INSTOF_CC 103 -#define DUK_OP_IN 104 -#define DUK_OP_IN_RR 104 -#define DUK_OP_IN_CR 105 -#define DUK_OP_IN_RC 106 -#define DUK_OP_IN_CC 107 -#define DUK_OP_GETPROP 108 -#define DUK_OP_GETPROP_RR 108 -#define DUK_OP_GETPROP_CR 109 -#define DUK_OP_GETPROP_RC 110 -#define DUK_OP_GETPROP_CC 111 -#define DUK_OP_PUTPROP 112 -#define DUK_OP_PUTPROP_RR 112 -#define DUK_OP_PUTPROP_CR 113 -#define DUK_OP_PUTPROP_RC 114 -#define DUK_OP_PUTPROP_CC 115 -#define DUK_OP_DELPROP 116 -#define DUK_OP_DELPROP_RR 116 -#define DUK_OP_DELPROP_CR_UNUSED 117 /* unused now */ -#define DUK_OP_DELPROP_RC 118 -#define DUK_OP_DELPROP_CC_UNUSED 119 /* unused now */ -#define DUK_OP_PREINCR 120 /* pre/post opcode values have constraints, */ -#define DUK_OP_PREDECR 121 /* see duk_js_executor.c and duk_js_compiler.c. */ -#define DUK_OP_POSTINCR 122 -#define DUK_OP_POSTDECR 123 -#define DUK_OP_PREINCV 124 -#define DUK_OP_PREDECV 125 -#define DUK_OP_POSTINCV 126 -#define DUK_OP_POSTDECV 127 -#define DUK_OP_PREINCP 128 /* pre/post inc/dec prop opcodes have constraints */ -#define DUK_OP_PREINCP_RR 128 -#define DUK_OP_PREINCP_CR 129 -#define DUK_OP_PREINCP_RC 130 -#define DUK_OP_PREINCP_CC 131 -#define DUK_OP_PREDECP 132 -#define DUK_OP_PREDECP_RR 132 -#define DUK_OP_PREDECP_CR 133 -#define DUK_OP_PREDECP_RC 134 -#define DUK_OP_PREDECP_CC 135 -#define DUK_OP_POSTINCP 136 -#define DUK_OP_POSTINCP_RR 136 -#define DUK_OP_POSTINCP_CR 137 -#define DUK_OP_POSTINCP_RC 138 -#define DUK_OP_POSTINCP_CC 139 -#define DUK_OP_POSTDECP 140 -#define DUK_OP_POSTDECP_RR 140 -#define DUK_OP_POSTDECP_CR 141 -#define DUK_OP_POSTDECP_RC 142 -#define DUK_OP_POSTDECP_CC 143 -#define DUK_OP_DECLVAR 144 -#define DUK_OP_DECLVAR_RR 144 -#define DUK_OP_DECLVAR_CR 145 -#define DUK_OP_DECLVAR_RC 146 -#define DUK_OP_DECLVAR_CC 147 -#define DUK_OP_REGEXP 148 -#define DUK_OP_REGEXP_RR 148 -#define DUK_OP_REGEXP_CR 149 -#define DUK_OP_REGEXP_RC 150 -#define DUK_OP_REGEXP_CC 151 -#define DUK_OP_CLOSURE 152 -#define DUK_OP_TYPEOF 153 -#define DUK_OP_TYPEOFID 154 -#define DUK_OP_PUTVAR 155 -#define DUK_OP_DELVAR 156 -#define DUK_OP_RETREG 157 -#define DUK_OP_RETUNDEF 158 -#define DUK_OP_RETCONST 159 -#define DUK_OP_RETCONSTN 160 /* return const without incref (e.g. number) */ -#define DUK_OP_LABEL 161 -#define DUK_OP_ENDLABEL 162 -#define DUK_OP_BREAK 163 -#define DUK_OP_CONTINUE 164 -#define DUK_OP_TRYCATCH 165 -#define DUK_OP_ENDTRY 166 -#define DUK_OP_ENDCATCH 167 -#define DUK_OP_ENDFIN 168 -#define DUK_OP_THROW 169 -#define DUK_OP_INVLHS 170 -#define DUK_OP_CSREG 171 -#define DUK_OP_CSVAR 172 -#define DUK_OP_CSVAR_RR 172 -#define DUK_OP_CSVAR_CR 173 -#define DUK_OP_CSVAR_RC 174 -#define DUK_OP_CSVAR_CC 175 -#define DUK_OP_CALL0 176 /* DUK_OP_CALL0 & 0x0F must be zero. */ -#define DUK_OP_CALL1 177 -#define DUK_OP_CALL2 178 -#define DUK_OP_CALL3 179 -#define DUK_OP_CALL4 180 -#define DUK_OP_CALL5 181 -#define DUK_OP_CALL6 182 -#define DUK_OP_CALL7 183 -#define DUK_OP_CALL8 184 -#define DUK_OP_CALL9 185 -#define DUK_OP_CALL10 186 -#define DUK_OP_CALL11 187 -#define DUK_OP_CALL12 188 -#define DUK_OP_CALL13 189 -#define DUK_OP_CALL14 190 -#define DUK_OP_CALL15 191 -#define DUK_OP_NEWOBJ 192 -#define DUK_OP_NEWARR 193 -#define DUK_OP_MPUTOBJ 194 -#define DUK_OP_MPUTOBJI 195 -#define DUK_OP_INITSET 196 -#define DUK_OP_INITGET 197 -#define DUK_OP_MPUTARR 198 -#define DUK_OP_MPUTARRI 199 -#define DUK_OP_SETALEN 200 -#define DUK_OP_INITENUM 201 -#define DUK_OP_NEXTENUM 202 -#define DUK_OP_NEWTARGET 203 -#define DUK_OP_DEBUGGER 204 -#define DUK_OP_NOP 205 -#define DUK_OP_INVALID 206 -#define DUK_OP_UNUSED207 207 -#define DUK_OP_GETPROPC 208 -#define DUK_OP_GETPROPC_RR 208 -#define DUK_OP_GETPROPC_CR 209 -#define DUK_OP_GETPROPC_RC 210 -#define DUK_OP_GETPROPC_CC 211 -#define DUK_OP_UNUSED212 212 -#define DUK_OP_UNUSED213 213 -#define DUK_OP_UNUSED214 214 -#define DUK_OP_UNUSED215 215 -#define DUK_OP_UNUSED216 216 -#define DUK_OP_UNUSED217 217 -#define DUK_OP_UNUSED218 218 -#define DUK_OP_UNUSED219 219 -#define DUK_OP_UNUSED220 220 -#define DUK_OP_UNUSED221 221 -#define DUK_OP_UNUSED222 222 -#define DUK_OP_UNUSED223 223 -#define DUK_OP_UNUSED224 224 -#define DUK_OP_UNUSED225 225 -#define DUK_OP_UNUSED226 226 -#define DUK_OP_UNUSED227 227 -#define DUK_OP_UNUSED228 228 -#define DUK_OP_UNUSED229 229 -#define DUK_OP_UNUSED230 230 -#define DUK_OP_UNUSED231 231 -#define DUK_OP_UNUSED232 232 -#define DUK_OP_UNUSED233 233 -#define DUK_OP_UNUSED234 234 -#define DUK_OP_UNUSED235 235 -#define DUK_OP_UNUSED236 236 -#define DUK_OP_UNUSED237 237 -#define DUK_OP_UNUSED238 238 -#define DUK_OP_UNUSED239 239 -#define DUK_OP_UNUSED240 240 -#define DUK_OP_UNUSED241 241 -#define DUK_OP_UNUSED242 242 -#define DUK_OP_UNUSED243 243 -#define DUK_OP_UNUSED244 244 -#define DUK_OP_UNUSED245 245 -#define DUK_OP_UNUSED246 246 -#define DUK_OP_UNUSED247 247 -#define DUK_OP_UNUSED248 248 -#define DUK_OP_UNUSED249 249 -#define DUK_OP_UNUSED250 250 -#define DUK_OP_UNUSED251 251 -#define DUK_OP_UNUSED252 252 -#define DUK_OP_UNUSED253 253 -#define DUK_OP_UNUSED254 254 -#define DUK_OP_UNUSED255 255 -#define DUK_OP_NONE 256 /* dummy value used as marker (doesn't fit in 8-bit field) */ +#define DUK_OP_LDREG 0 +#define DUK_OP_STREG 1 +#define DUK_OP_JUMP 2 +#define DUK_OP_LDCONST 3 +#define DUK_OP_LDINT 4 +#define DUK_OP_LDINTX 5 +#define DUK_OP_LDTHIS 6 +#define DUK_OP_LDUNDEF 7 +#define DUK_OP_LDNULL 8 +#define DUK_OP_LDTRUE 9 +#define DUK_OP_LDFALSE 10 +#define DUK_OP_GETVAR 11 +#define DUK_OP_BNOT 12 +#define DUK_OP_LNOT 13 +#define DUK_OP_UNM 14 +#define DUK_OP_UNP 15 +#define DUK_OP_EQ 16 +#define DUK_OP_EQ_RR 16 +#define DUK_OP_EQ_CR 17 +#define DUK_OP_EQ_RC 18 +#define DUK_OP_EQ_CC 19 +#define DUK_OP_NEQ 20 +#define DUK_OP_NEQ_RR 20 +#define DUK_OP_NEQ_CR 21 +#define DUK_OP_NEQ_RC 22 +#define DUK_OP_NEQ_CC 23 +#define DUK_OP_SEQ 24 +#define DUK_OP_SEQ_RR 24 +#define DUK_OP_SEQ_CR 25 +#define DUK_OP_SEQ_RC 26 +#define DUK_OP_SEQ_CC 27 +#define DUK_OP_SNEQ 28 +#define DUK_OP_SNEQ_RR 28 +#define DUK_OP_SNEQ_CR 29 +#define DUK_OP_SNEQ_RC 30 +#define DUK_OP_SNEQ_CC 31 +#define DUK_OP_GT 32 +#define DUK_OP_GT_RR 32 +#define DUK_OP_GT_CR 33 +#define DUK_OP_GT_RC 34 +#define DUK_OP_GT_CC 35 +#define DUK_OP_GE 36 +#define DUK_OP_GE_RR 36 +#define DUK_OP_GE_CR 37 +#define DUK_OP_GE_RC 38 +#define DUK_OP_GE_CC 39 +#define DUK_OP_LT 40 +#define DUK_OP_LT_RR 40 +#define DUK_OP_LT_CR 41 +#define DUK_OP_LT_RC 42 +#define DUK_OP_LT_CC 43 +#define DUK_OP_LE 44 +#define DUK_OP_LE_RR 44 +#define DUK_OP_LE_CR 45 +#define DUK_OP_LE_RC 46 +#define DUK_OP_LE_CC 47 +#define DUK_OP_IFTRUE 48 +#define DUK_OP_IFTRUE_R 48 +#define DUK_OP_IFTRUE_C 49 +#define DUK_OP_IFFALSE 50 +#define DUK_OP_IFFALSE_R 50 +#define DUK_OP_IFFALSE_C 51 +#define DUK_OP_ADD 52 +#define DUK_OP_ADD_RR 52 +#define DUK_OP_ADD_CR 53 +#define DUK_OP_ADD_RC 54 +#define DUK_OP_ADD_CC 55 +#define DUK_OP_SUB 56 +#define DUK_OP_SUB_RR 56 +#define DUK_OP_SUB_CR 57 +#define DUK_OP_SUB_RC 58 +#define DUK_OP_SUB_CC 59 +#define DUK_OP_MUL 60 +#define DUK_OP_MUL_RR 60 +#define DUK_OP_MUL_CR 61 +#define DUK_OP_MUL_RC 62 +#define DUK_OP_MUL_CC 63 +#define DUK_OP_DIV 64 +#define DUK_OP_DIV_RR 64 +#define DUK_OP_DIV_CR 65 +#define DUK_OP_DIV_RC 66 +#define DUK_OP_DIV_CC 67 +#define DUK_OP_MOD 68 +#define DUK_OP_MOD_RR 68 +#define DUK_OP_MOD_CR 69 +#define DUK_OP_MOD_RC 70 +#define DUK_OP_MOD_CC 71 +#define DUK_OP_EXP 72 +#define DUK_OP_EXP_RR 72 +#define DUK_OP_EXP_CR 73 +#define DUK_OP_EXP_RC 74 +#define DUK_OP_EXP_CC 75 +#define DUK_OP_BAND 76 +#define DUK_OP_BAND_RR 76 +#define DUK_OP_BAND_CR 77 +#define DUK_OP_BAND_RC 78 +#define DUK_OP_BAND_CC 79 +#define DUK_OP_BOR 80 +#define DUK_OP_BOR_RR 80 +#define DUK_OP_BOR_CR 81 +#define DUK_OP_BOR_RC 82 +#define DUK_OP_BOR_CC 83 +#define DUK_OP_BXOR 84 +#define DUK_OP_BXOR_RR 84 +#define DUK_OP_BXOR_CR 85 +#define DUK_OP_BXOR_RC 86 +#define DUK_OP_BXOR_CC 87 +#define DUK_OP_BASL 88 +#define DUK_OP_BASL_RR 88 +#define DUK_OP_BASL_CR 89 +#define DUK_OP_BASL_RC 90 +#define DUK_OP_BASL_CC 91 +#define DUK_OP_BLSR 92 +#define DUK_OP_BLSR_RR 92 +#define DUK_OP_BLSR_CR 93 +#define DUK_OP_BLSR_RC 94 +#define DUK_OP_BLSR_CC 95 +#define DUK_OP_BASR 96 +#define DUK_OP_BASR_RR 96 +#define DUK_OP_BASR_CR 97 +#define DUK_OP_BASR_RC 98 +#define DUK_OP_BASR_CC 99 +#define DUK_OP_INSTOF 100 +#define DUK_OP_INSTOF_RR 100 +#define DUK_OP_INSTOF_CR 101 +#define DUK_OP_INSTOF_RC 102 +#define DUK_OP_INSTOF_CC 103 +#define DUK_OP_IN 104 +#define DUK_OP_IN_RR 104 +#define DUK_OP_IN_CR 105 +#define DUK_OP_IN_RC 106 +#define DUK_OP_IN_CC 107 +#define DUK_OP_GETPROP 108 +#define DUK_OP_GETPROP_RR 108 +#define DUK_OP_GETPROP_CR 109 +#define DUK_OP_GETPROP_RC 110 +#define DUK_OP_GETPROP_CC 111 +#define DUK_OP_PUTPROP 112 +#define DUK_OP_PUTPROP_RR 112 +#define DUK_OP_PUTPROP_CR 113 +#define DUK_OP_PUTPROP_RC 114 +#define DUK_OP_PUTPROP_CC 115 +#define DUK_OP_DELPROP 116 +#define DUK_OP_DELPROP_RR 116 +#define DUK_OP_DELPROP_CR_UNUSED 117 /* unused now */ +#define DUK_OP_DELPROP_RC 118 +#define DUK_OP_DELPROP_CC_UNUSED 119 /* unused now */ +#define DUK_OP_PREINCR 120 /* pre/post opcode values have constraints, */ +#define DUK_OP_PREDECR 121 /* see duk_js_executor.c and duk_js_compiler.c. */ +#define DUK_OP_POSTINCR 122 +#define DUK_OP_POSTDECR 123 +#define DUK_OP_PREINCV 124 +#define DUK_OP_PREDECV 125 +#define DUK_OP_POSTINCV 126 +#define DUK_OP_POSTDECV 127 +#define DUK_OP_PREINCP 128 /* pre/post inc/dec prop opcodes have constraints */ +#define DUK_OP_PREINCP_RR 128 +#define DUK_OP_PREINCP_CR 129 +#define DUK_OP_PREINCP_RC 130 +#define DUK_OP_PREINCP_CC 131 +#define DUK_OP_PREDECP 132 +#define DUK_OP_PREDECP_RR 132 +#define DUK_OP_PREDECP_CR 133 +#define DUK_OP_PREDECP_RC 134 +#define DUK_OP_PREDECP_CC 135 +#define DUK_OP_POSTINCP 136 +#define DUK_OP_POSTINCP_RR 136 +#define DUK_OP_POSTINCP_CR 137 +#define DUK_OP_POSTINCP_RC 138 +#define DUK_OP_POSTINCP_CC 139 +#define DUK_OP_POSTDECP 140 +#define DUK_OP_POSTDECP_RR 140 +#define DUK_OP_POSTDECP_CR 141 +#define DUK_OP_POSTDECP_RC 142 +#define DUK_OP_POSTDECP_CC 143 +#define DUK_OP_DECLVAR 144 +#define DUK_OP_DECLVAR_RR 144 +#define DUK_OP_DECLVAR_CR 145 +#define DUK_OP_DECLVAR_RC 146 +#define DUK_OP_DECLVAR_CC 147 +#define DUK_OP_REGEXP 148 +#define DUK_OP_REGEXP_RR 148 +#define DUK_OP_REGEXP_CR 149 +#define DUK_OP_REGEXP_RC 150 +#define DUK_OP_REGEXP_CC 151 +#define DUK_OP_CLOSURE 152 +#define DUK_OP_TYPEOF 153 +#define DUK_OP_TYPEOFID 154 +#define DUK_OP_PUTVAR 155 +#define DUK_OP_DELVAR 156 +#define DUK_OP_RETREG 157 +#define DUK_OP_RETUNDEF 158 +#define DUK_OP_RETCONST 159 +#define DUK_OP_RETCONSTN 160 /* return const without incref (e.g. number) */ +#define DUK_OP_LABEL 161 +#define DUK_OP_ENDLABEL 162 +#define DUK_OP_BREAK 163 +#define DUK_OP_CONTINUE 164 +#define DUK_OP_TRYCATCH 165 +#define DUK_OP_ENDTRY 166 +#define DUK_OP_ENDCATCH 167 +#define DUK_OP_ENDFIN 168 +#define DUK_OP_THROW 169 +#define DUK_OP_INVLHS 170 +#define DUK_OP_CSREG 171 +#define DUK_OP_CSVAR 172 +#define DUK_OP_CSVAR_RR 172 +#define DUK_OP_CSVAR_CR 173 +#define DUK_OP_CSVAR_RC 174 +#define DUK_OP_CSVAR_CC 175 +#define DUK_OP_CALL0 176 /* DUK_OP_CALL0 & 0x0F must be zero. */ +#define DUK_OP_CALL1 177 +#define DUK_OP_CALL2 178 +#define DUK_OP_CALL3 179 +#define DUK_OP_CALL4 180 +#define DUK_OP_CALL5 181 +#define DUK_OP_CALL6 182 +#define DUK_OP_CALL7 183 +#define DUK_OP_CALL8 184 +#define DUK_OP_CALL9 185 +#define DUK_OP_CALL10 186 +#define DUK_OP_CALL11 187 +#define DUK_OP_CALL12 188 +#define DUK_OP_CALL13 189 +#define DUK_OP_CALL14 190 +#define DUK_OP_CALL15 191 +#define DUK_OP_NEWOBJ 192 +#define DUK_OP_NEWARR 193 +#define DUK_OP_MPUTOBJ 194 +#define DUK_OP_MPUTOBJI 195 +#define DUK_OP_INITSET 196 +#define DUK_OP_INITGET 197 +#define DUK_OP_MPUTARR 198 +#define DUK_OP_MPUTARRI 199 +#define DUK_OP_SETALEN 200 +#define DUK_OP_INITENUM 201 +#define DUK_OP_NEXTENUM 202 +#define DUK_OP_NEWTARGET 203 +#define DUK_OP_DEBUGGER 204 +#define DUK_OP_NOP 205 +#define DUK_OP_INVALID 206 +#define DUK_OP_UNUSED207 207 +#define DUK_OP_GETPROPC 208 +#define DUK_OP_GETPROPC_RR 208 +#define DUK_OP_GETPROPC_CR 209 +#define DUK_OP_GETPROPC_RC 210 +#define DUK_OP_GETPROPC_CC 211 +#define DUK_OP_UNUSED212 212 +#define DUK_OP_UNUSED213 213 +#define DUK_OP_UNUSED214 214 +#define DUK_OP_UNUSED215 215 +#define DUK_OP_UNUSED216 216 +#define DUK_OP_UNUSED217 217 +#define DUK_OP_UNUSED218 218 +#define DUK_OP_UNUSED219 219 +#define DUK_OP_UNUSED220 220 +#define DUK_OP_UNUSED221 221 +#define DUK_OP_UNUSED222 222 +#define DUK_OP_UNUSED223 223 +#define DUK_OP_UNUSED224 224 +#define DUK_OP_UNUSED225 225 +#define DUK_OP_UNUSED226 226 +#define DUK_OP_UNUSED227 227 +#define DUK_OP_UNUSED228 228 +#define DUK_OP_UNUSED229 229 +#define DUK_OP_UNUSED230 230 +#define DUK_OP_UNUSED231 231 +#define DUK_OP_UNUSED232 232 +#define DUK_OP_UNUSED233 233 +#define DUK_OP_UNUSED234 234 +#define DUK_OP_UNUSED235 235 +#define DUK_OP_UNUSED236 236 +#define DUK_OP_UNUSED237 237 +#define DUK_OP_UNUSED238 238 +#define DUK_OP_UNUSED239 239 +#define DUK_OP_UNUSED240 240 +#define DUK_OP_UNUSED241 241 +#define DUK_OP_UNUSED242 242 +#define DUK_OP_UNUSED243 243 +#define DUK_OP_UNUSED244 244 +#define DUK_OP_UNUSED245 245 +#define DUK_OP_UNUSED246 246 +#define DUK_OP_UNUSED247 247 +#define DUK_OP_UNUSED248 248 +#define DUK_OP_UNUSED249 249 +#define DUK_OP_UNUSED250 250 +#define DUK_OP_UNUSED251 251 +#define DUK_OP_UNUSED252 252 +#define DUK_OP_UNUSED253 253 +#define DUK_OP_UNUSED254 254 +#define DUK_OP_UNUSED255 255 +#define DUK_OP_NONE 256 /* dummy value used as marker (doesn't fit in 8-bit field) */ /* XXX: Allocate flags from opcode field? Would take 16 opcode slots * but avoids shuffling in more cases. Maybe not worth it. */ /* DUK_OP_TRYCATCH flags in A. */ -#define DUK_BC_TRYCATCH_FLAG_HAVE_CATCH (1U << 0) -#define DUK_BC_TRYCATCH_FLAG_HAVE_FINALLY (1U << 1) -#define DUK_BC_TRYCATCH_FLAG_CATCH_BINDING (1U << 2) -#define DUK_BC_TRYCATCH_FLAG_WITH_BINDING (1U << 3) +#define DUK_BC_TRYCATCH_FLAG_HAVE_CATCH (1U << 0) +#define DUK_BC_TRYCATCH_FLAG_HAVE_FINALLY (1U << 1) +#define DUK_BC_TRYCATCH_FLAG_CATCH_BINDING (1U << 2) +#define DUK_BC_TRYCATCH_FLAG_WITH_BINDING (1U << 3) /* DUK_OP_DECLVAR flags in A; bottom bits are reserved for propdesc flags * (DUK_PROPDESC_FLAG_XXX). */ -#define DUK_BC_DECLVAR_FLAG_FUNC_DECL (1U << 4) /* function declaration */ +#define DUK_BC_DECLVAR_FLAG_FUNC_DECL (1U << 4) /* function declaration */ /* DUK_OP_CALLn flags, part of opcode field. Three lowest bits must match * DUK_CALL_FLAG_xxx directly. */ -#define DUK_BC_CALL_FLAG_TAILCALL (1U << 0) -#define DUK_BC_CALL_FLAG_CONSTRUCT (1U << 1) -#define DUK_BC_CALL_FLAG_CALLED_AS_EVAL (1U << 2) -#define DUK_BC_CALL_FLAG_INDIRECT (1U << 3) +#define DUK_BC_CALL_FLAG_TAILCALL (1U << 0) +#define DUK_BC_CALL_FLAG_CONSTRUCT (1U << 1) +#define DUK_BC_CALL_FLAG_CALLED_AS_EVAL (1U << 2) +#define DUK_BC_CALL_FLAG_INDIRECT (1U << 3) /* Misc constants and helper macros. */ -#define DUK_BC_LDINT_BIAS (1L << 15) -#define DUK_BC_LDINTX_SHIFT 16 -#define DUK_BC_JUMP_BIAS (1L << 23) +#define DUK_BC_LDINT_BIAS (1L << 15) +#define DUK_BC_LDINTX_SHIFT 16 +#define DUK_BC_JUMP_BIAS (1L << 23) -#endif /* DUK_JS_BYTECODE_H_INCLUDED */ +#endif /* DUK_JS_BYTECODE_H_INCLUDED */ /* #include duk_lexer.h */ /* * Lexer defines. @@ -3730,156 +3825,156 @@ typedef void (*duk_re_range_callback)(void *user, duk_codepoint_t r1, duk_codepo * in a continuous range and in a particular order. See genstrings.py. */ -#define DUK_LEXER_INITCTX(ctx) duk_lexer_initctx((ctx)) +#define DUK_LEXER_INITCTX(ctx) duk_lexer_initctx((ctx)) -#define DUK_LEXER_SETPOINT(ctx,pt) duk_lexer_setpoint((ctx), (pt)) +#define DUK_LEXER_SETPOINT(ctx, pt) duk_lexer_setpoint((ctx), (pt)) -#define DUK_LEXER_GETPOINT(ctx,pt) duk_lexer_getpoint((ctx), (pt)) +#define DUK_LEXER_GETPOINT(ctx, pt) duk_lexer_getpoint((ctx), (pt)) /* Currently 6 characters of lookup are actually needed (duk_lexer.c). */ -#define DUK_LEXER_WINDOW_SIZE 6 +#define DUK_LEXER_WINDOW_SIZE 6 #if defined(DUK_USE_LEXER_SLIDING_WINDOW) -#define DUK_LEXER_BUFFER_SIZE 64 +#define DUK_LEXER_BUFFER_SIZE 64 #endif -#define DUK_TOK_MINVAL 0 +#define DUK_TOK_MINVAL 0 /* returned after EOF (infinite amount) */ -#define DUK_TOK_EOF 0 +#define DUK_TOK_EOF 0 /* identifier names (E5 Section 7.6) */ -#define DUK_TOK_IDENTIFIER 1 +#define DUK_TOK_IDENTIFIER 1 /* reserved words: keywords */ -#define DUK_TOK_START_RESERVED 2 -#define DUK_TOK_BREAK 2 -#define DUK_TOK_CASE 3 -#define DUK_TOK_CATCH 4 -#define DUK_TOK_CONTINUE 5 -#define DUK_TOK_DEBUGGER 6 -#define DUK_TOK_DEFAULT 7 -#define DUK_TOK_DELETE 8 -#define DUK_TOK_DO 9 -#define DUK_TOK_ELSE 10 -#define DUK_TOK_FINALLY 11 -#define DUK_TOK_FOR 12 -#define DUK_TOK_FUNCTION 13 -#define DUK_TOK_IF 14 -#define DUK_TOK_IN 15 -#define DUK_TOK_INSTANCEOF 16 -#define DUK_TOK_NEW 17 -#define DUK_TOK_RETURN 18 -#define DUK_TOK_SWITCH 19 -#define DUK_TOK_THIS 20 -#define DUK_TOK_THROW 21 -#define DUK_TOK_TRY 22 -#define DUK_TOK_TYPEOF 23 -#define DUK_TOK_VAR 24 -#define DUK_TOK_CONST 25 -#define DUK_TOK_VOID 26 -#define DUK_TOK_WHILE 27 -#define DUK_TOK_WITH 28 +#define DUK_TOK_START_RESERVED 2 +#define DUK_TOK_BREAK 2 +#define DUK_TOK_CASE 3 +#define DUK_TOK_CATCH 4 +#define DUK_TOK_CONTINUE 5 +#define DUK_TOK_DEBUGGER 6 +#define DUK_TOK_DEFAULT 7 +#define DUK_TOK_DELETE 8 +#define DUK_TOK_DO 9 +#define DUK_TOK_ELSE 10 +#define DUK_TOK_FINALLY 11 +#define DUK_TOK_FOR 12 +#define DUK_TOK_FUNCTION 13 +#define DUK_TOK_IF 14 +#define DUK_TOK_IN 15 +#define DUK_TOK_INSTANCEOF 16 +#define DUK_TOK_NEW 17 +#define DUK_TOK_RETURN 18 +#define DUK_TOK_SWITCH 19 +#define DUK_TOK_THIS 20 +#define DUK_TOK_THROW 21 +#define DUK_TOK_TRY 22 +#define DUK_TOK_TYPEOF 23 +#define DUK_TOK_VAR 24 +#define DUK_TOK_CONST 25 +#define DUK_TOK_VOID 26 +#define DUK_TOK_WHILE 27 +#define DUK_TOK_WITH 28 /* reserved words: future reserved words */ -#define DUK_TOK_CLASS 29 -#define DUK_TOK_ENUM 30 -#define DUK_TOK_EXPORT 31 -#define DUK_TOK_EXTENDS 32 -#define DUK_TOK_IMPORT 33 -#define DUK_TOK_SUPER 34 +#define DUK_TOK_CLASS 29 +#define DUK_TOK_ENUM 30 +#define DUK_TOK_EXPORT 31 +#define DUK_TOK_EXTENDS 32 +#define DUK_TOK_IMPORT 33 +#define DUK_TOK_SUPER 34 /* "null", "true", and "false" are always reserved words. * Note that "get" and "set" are not! */ -#define DUK_TOK_NULL 35 -#define DUK_TOK_TRUE 36 -#define DUK_TOK_FALSE 37 +#define DUK_TOK_NULL 35 +#define DUK_TOK_TRUE 36 +#define DUK_TOK_FALSE 37 /* reserved words: additional future reserved words in strict mode */ -#define DUK_TOK_START_STRICT_RESERVED 38 /* inclusive */ -#define DUK_TOK_IMPLEMENTS 38 -#define DUK_TOK_INTERFACE 39 -#define DUK_TOK_LET 40 -#define DUK_TOK_PACKAGE 41 -#define DUK_TOK_PRIVATE 42 -#define DUK_TOK_PROTECTED 43 -#define DUK_TOK_PUBLIC 44 -#define DUK_TOK_STATIC 45 -#define DUK_TOK_YIELD 46 +#define DUK_TOK_START_STRICT_RESERVED 38 /* inclusive */ +#define DUK_TOK_IMPLEMENTS 38 +#define DUK_TOK_INTERFACE 39 +#define DUK_TOK_LET 40 +#define DUK_TOK_PACKAGE 41 +#define DUK_TOK_PRIVATE 42 +#define DUK_TOK_PROTECTED 43 +#define DUK_TOK_PUBLIC 44 +#define DUK_TOK_STATIC 45 +#define DUK_TOK_YIELD 46 -#define DUK_TOK_END_RESERVED 47 /* exclusive */ +#define DUK_TOK_END_RESERVED 47 /* exclusive */ /* "get" and "set" are tokens but NOT ReservedWords. They are currently * parsed and identifiers and these defines are actually now unused. */ -#define DUK_TOK_GET 47 -#define DUK_TOK_SET 48 +#define DUK_TOK_GET 47 +#define DUK_TOK_SET 48 /* punctuators (unlike the spec, also includes "/" and "/=") */ -#define DUK_TOK_LCURLY 49 -#define DUK_TOK_RCURLY 50 -#define DUK_TOK_LBRACKET 51 -#define DUK_TOK_RBRACKET 52 -#define DUK_TOK_LPAREN 53 -#define DUK_TOK_RPAREN 54 -#define DUK_TOK_PERIOD 55 -#define DUK_TOK_SEMICOLON 56 -#define DUK_TOK_COMMA 57 -#define DUK_TOK_LT 58 -#define DUK_TOK_GT 59 -#define DUK_TOK_LE 60 -#define DUK_TOK_GE 61 -#define DUK_TOK_EQ 62 -#define DUK_TOK_NEQ 63 -#define DUK_TOK_SEQ 64 -#define DUK_TOK_SNEQ 65 -#define DUK_TOK_ADD 66 -#define DUK_TOK_SUB 67 -#define DUK_TOK_MUL 68 -#define DUK_TOK_DIV 69 -#define DUK_TOK_MOD 70 -#define DUK_TOK_EXP 71 -#define DUK_TOK_INCREMENT 72 -#define DUK_TOK_DECREMENT 73 -#define DUK_TOK_ALSHIFT 74 /* named "arithmetic" because result is signed */ -#define DUK_TOK_ARSHIFT 75 -#define DUK_TOK_RSHIFT 76 -#define DUK_TOK_BAND 77 -#define DUK_TOK_BOR 78 -#define DUK_TOK_BXOR 79 -#define DUK_TOK_LNOT 80 -#define DUK_TOK_BNOT 81 -#define DUK_TOK_LAND 82 -#define DUK_TOK_LOR 83 -#define DUK_TOK_QUESTION 84 -#define DUK_TOK_COLON 85 -#define DUK_TOK_EQUALSIGN 86 -#define DUK_TOK_ADD_EQ 87 -#define DUK_TOK_SUB_EQ 88 -#define DUK_TOK_MUL_EQ 89 -#define DUK_TOK_DIV_EQ 90 -#define DUK_TOK_MOD_EQ 91 -#define DUK_TOK_EXP_EQ 92 -#define DUK_TOK_ALSHIFT_EQ 93 -#define DUK_TOK_ARSHIFT_EQ 94 -#define DUK_TOK_RSHIFT_EQ 95 -#define DUK_TOK_BAND_EQ 96 -#define DUK_TOK_BOR_EQ 97 -#define DUK_TOK_BXOR_EQ 98 +#define DUK_TOK_LCURLY 49 +#define DUK_TOK_RCURLY 50 +#define DUK_TOK_LBRACKET 51 +#define DUK_TOK_RBRACKET 52 +#define DUK_TOK_LPAREN 53 +#define DUK_TOK_RPAREN 54 +#define DUK_TOK_PERIOD 55 +#define DUK_TOK_SEMICOLON 56 +#define DUK_TOK_COMMA 57 +#define DUK_TOK_LT 58 +#define DUK_TOK_GT 59 +#define DUK_TOK_LE 60 +#define DUK_TOK_GE 61 +#define DUK_TOK_EQ 62 +#define DUK_TOK_NEQ 63 +#define DUK_TOK_SEQ 64 +#define DUK_TOK_SNEQ 65 +#define DUK_TOK_ADD 66 +#define DUK_TOK_SUB 67 +#define DUK_TOK_MUL 68 +#define DUK_TOK_DIV 69 +#define DUK_TOK_MOD 70 +#define DUK_TOK_EXP 71 +#define DUK_TOK_INCREMENT 72 +#define DUK_TOK_DECREMENT 73 +#define DUK_TOK_ALSHIFT 74 /* named "arithmetic" because result is signed */ +#define DUK_TOK_ARSHIFT 75 +#define DUK_TOK_RSHIFT 76 +#define DUK_TOK_BAND 77 +#define DUK_TOK_BOR 78 +#define DUK_TOK_BXOR 79 +#define DUK_TOK_LNOT 80 +#define DUK_TOK_BNOT 81 +#define DUK_TOK_LAND 82 +#define DUK_TOK_LOR 83 +#define DUK_TOK_QUESTION 84 +#define DUK_TOK_COLON 85 +#define DUK_TOK_EQUALSIGN 86 +#define DUK_TOK_ADD_EQ 87 +#define DUK_TOK_SUB_EQ 88 +#define DUK_TOK_MUL_EQ 89 +#define DUK_TOK_DIV_EQ 90 +#define DUK_TOK_MOD_EQ 91 +#define DUK_TOK_EXP_EQ 92 +#define DUK_TOK_ALSHIFT_EQ 93 +#define DUK_TOK_ARSHIFT_EQ 94 +#define DUK_TOK_RSHIFT_EQ 95 +#define DUK_TOK_BAND_EQ 96 +#define DUK_TOK_BOR_EQ 97 +#define DUK_TOK_BXOR_EQ 98 /* literals (E5 Section 7.8), except null, true, false, which are treated * like reserved words (above). */ -#define DUK_TOK_NUMBER 99 -#define DUK_TOK_STRING 100 -#define DUK_TOK_REGEXP 101 +#define DUK_TOK_NUMBER 99 +#define DUK_TOK_STRING 100 +#define DUK_TOK_REGEXP 101 -#define DUK_TOK_MAXVAL 101 /* inclusive */ +#define DUK_TOK_MAXVAL 101 /* inclusive */ -#define DUK_TOK_INVALID DUK_SMALL_UINT_MAX +#define DUK_TOK_INVALID DUK_SMALL_UINT_MAX /* Convert heap string index to a token (reserved words) */ -#define DUK_STRIDX_TO_TOK(x) ((x) - DUK_STRIDX_START_RESERVED + DUK_TOK_START_RESERVED) +#define DUK_STRIDX_TO_TOK(x) ((x) -DUK_STRIDX_START_RESERVED + DUK_TOK_START_RESERVED) /* Sanity check */ #if (DUK_TOK_MAXVAL > 255) @@ -4024,57 +4119,57 @@ typedef void (*duk_re_range_callback)(void *user, duk_codepoint_t r1, duk_codepo #endif /* Regexp tokens */ -#define DUK_RETOK_EOF 0 -#define DUK_RETOK_DISJUNCTION 1 -#define DUK_RETOK_QUANTIFIER 2 -#define DUK_RETOK_ASSERT_START 3 -#define DUK_RETOK_ASSERT_END 4 -#define DUK_RETOK_ASSERT_WORD_BOUNDARY 5 -#define DUK_RETOK_ASSERT_NOT_WORD_BOUNDARY 6 -#define DUK_RETOK_ASSERT_START_POS_LOOKAHEAD 7 -#define DUK_RETOK_ASSERT_START_NEG_LOOKAHEAD 8 -#define DUK_RETOK_ATOM_PERIOD 9 -#define DUK_RETOK_ATOM_CHAR 10 -#define DUK_RETOK_ATOM_DIGIT 11 /* assumptions in regexp compiler */ -#define DUK_RETOK_ATOM_NOT_DIGIT 12 /* -""- */ -#define DUK_RETOK_ATOM_WHITE 13 /* -""- */ -#define DUK_RETOK_ATOM_NOT_WHITE 14 /* -""- */ -#define DUK_RETOK_ATOM_WORD_CHAR 15 /* -""- */ -#define DUK_RETOK_ATOM_NOT_WORD_CHAR 16 /* -""- */ -#define DUK_RETOK_ATOM_BACKREFERENCE 17 -#define DUK_RETOK_ATOM_START_CAPTURE_GROUP 18 -#define DUK_RETOK_ATOM_START_NONCAPTURE_GROUP 19 -#define DUK_RETOK_ATOM_START_CHARCLASS 20 -#define DUK_RETOK_ATOM_START_CHARCLASS_INVERTED 21 -#define DUK_RETOK_ATOM_END_GROUP 22 +#define DUK_RETOK_EOF 0 +#define DUK_RETOK_DISJUNCTION 1 +#define DUK_RETOK_QUANTIFIER 2 +#define DUK_RETOK_ASSERT_START 3 +#define DUK_RETOK_ASSERT_END 4 +#define DUK_RETOK_ASSERT_WORD_BOUNDARY 5 +#define DUK_RETOK_ASSERT_NOT_WORD_BOUNDARY 6 +#define DUK_RETOK_ASSERT_START_POS_LOOKAHEAD 7 +#define DUK_RETOK_ASSERT_START_NEG_LOOKAHEAD 8 +#define DUK_RETOK_ATOM_PERIOD 9 +#define DUK_RETOK_ATOM_CHAR 10 +#define DUK_RETOK_ATOM_DIGIT 11 /* assumptions in regexp compiler */ +#define DUK_RETOK_ATOM_NOT_DIGIT 12 /* -""- */ +#define DUK_RETOK_ATOM_WHITE 13 /* -""- */ +#define DUK_RETOK_ATOM_NOT_WHITE 14 /* -""- */ +#define DUK_RETOK_ATOM_WORD_CHAR 15 /* -""- */ +#define DUK_RETOK_ATOM_NOT_WORD_CHAR 16 /* -""- */ +#define DUK_RETOK_ATOM_BACKREFERENCE 17 +#define DUK_RETOK_ATOM_START_CAPTURE_GROUP 18 +#define DUK_RETOK_ATOM_START_NONCAPTURE_GROUP 19 +#define DUK_RETOK_ATOM_START_CHARCLASS 20 +#define DUK_RETOK_ATOM_START_CHARCLASS_INVERTED 21 +#define DUK_RETOK_ATOM_END_GROUP 22 /* Constants for duk_lexer_ctx.buf. */ -#define DUK_LEXER_TEMP_BUF_LIMIT 256 +#define DUK_LEXER_TEMP_BUF_LIMIT 256 /* A token value. Can be memcpy()'d, but note that slot1/slot2 values are on the valstack. * Some fields (like num, str1, str2) are only valid for specific token types and may have * stale values otherwise. */ struct duk_token { - duk_small_uint_t t; /* token type (with reserved word identification) */ - duk_small_uint_t t_nores; /* token type (with reserved words as DUK_TOK_IDENTIFER) */ - duk_double_t num; /* numeric value of token */ - duk_hstring *str1; /* string 1 of token (borrowed, stored to ctx->slot1_idx) */ - duk_hstring *str2; /* string 2 of token (borrowed, stored to ctx->slot2_idx) */ - duk_size_t start_offset; /* start byte offset of token in lexer input */ - duk_int_t start_line; /* start line of token (first char) */ - duk_int_t num_escapes; /* number of escapes and line continuations (for directive prologue) */ - duk_bool_t lineterm; /* token was preceded by a lineterm */ - duk_bool_t allow_auto_semi; /* token allows automatic semicolon insertion (eof or preceded by newline) */ + duk_small_uint_t t; /* token type (with reserved word identification) */ + duk_small_uint_t t_nores; /* token type (with reserved words as DUK_TOK_IDENTIFER) */ + duk_double_t num; /* numeric value of token */ + duk_hstring *str1; /* string 1 of token (borrowed, stored to ctx->slot1_idx) */ + duk_hstring *str2; /* string 2 of token (borrowed, stored to ctx->slot2_idx) */ + duk_size_t start_offset; /* start byte offset of token in lexer input */ + duk_int_t start_line; /* start line of token (first char) */ + duk_int_t num_escapes; /* number of escapes and line continuations (for directive prologue) */ + duk_bool_t lineterm; /* token was preceded by a lineterm */ + duk_bool_t allow_auto_semi; /* token allows automatic semicolon insertion (eof or preceded by newline) */ }; -#define DUK_RE_QUANTIFIER_INFINITE ((duk_uint32_t) 0xffffffffUL) +#define DUK_RE_QUANTIFIER_INFINITE ((duk_uint32_t) 0xffffffffUL) /* A regexp token value. */ struct duk_re_token { - duk_small_uint_t t; /* token type */ + duk_small_uint_t t; /* token type */ duk_small_uint_t greedy; - duk_uint32_t num; /* numeric value (character, count) */ + duk_uint32_t num; /* numeric value (character, count) */ duk_uint32_t qmin; duk_uint32_t qmax; }; @@ -4101,23 +4196,23 @@ struct duk_lexer_ctx { duk_lexer_codepoint window[DUK_LEXER_WINDOW_SIZE]; /* unicode code points, window[0] is always next */ #endif - duk_hthread *thr; /* thread; minimizes argument passing */ + duk_hthread *thr; /* thread; minimizes argument passing */ - const duk_uint8_t *input; /* input string (may be a user pointer) */ - duk_size_t input_length; /* input byte length */ - duk_size_t input_offset; /* input offset for window leading edge (not window[0]) */ - duk_int_t input_line; /* input linenumber at input_offset (not window[0]), init to 1 */ + const duk_uint8_t *input; /* input string (may be a user pointer) */ + duk_size_t input_length; /* input byte length */ + duk_size_t input_offset; /* input offset for window leading edge (not window[0]) */ + duk_int_t input_line; /* input linenumber at input_offset (not window[0]), init to 1 */ - duk_idx_t slot1_idx; /* valstack slot for 1st token value */ - duk_idx_t slot2_idx; /* valstack slot for 2nd token value */ - duk_idx_t buf_idx; /* valstack slot for temp buffer */ - duk_hbuffer_dynamic *buf; /* temp accumulation buffer */ - duk_bufwriter_ctx bw; /* bufwriter for temp accumulation */ + duk_idx_t slot1_idx; /* valstack slot for 1st token value */ + duk_idx_t slot2_idx; /* valstack slot for 2nd token value */ + duk_idx_t buf_idx; /* valstack slot for temp buffer */ + duk_hbuffer_dynamic *buf; /* temp accumulation buffer */ + duk_bufwriter_ctx bw; /* bufwriter for temp accumulation */ - duk_int_t token_count; /* number of tokens parsed */ - duk_int_t token_limit; /* maximum token count before error (sanity backstop) */ + duk_int_t token_count; /* number of tokens parsed */ + duk_int_t token_limit; /* maximum token count before error (sanity backstop) */ - duk_small_uint_t flags; /* lexer flags, use compiler flag defines for now */ + duk_small_uint_t flags; /* lexer flags, use compiler flag defines for now */ }; /* @@ -4130,16 +4225,13 @@ DUK_INTERNAL_DECL void duk_lexer_getpoint(duk_lexer_ctx *lex_ctx, duk_lexer_poin DUK_INTERNAL_DECL void duk_lexer_setpoint(duk_lexer_ctx *lex_ctx, duk_lexer_point *pt); DUK_INTERNAL_DECL -void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, - duk_token *out_token, - duk_bool_t strict_mode, - duk_bool_t regexp_mode); +void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, duk_token *out_token, duk_bool_t strict_mode, duk_bool_t regexp_mode); #if defined(DUK_USE_REGEXP_SUPPORT) DUK_INTERNAL_DECL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token *out_token); DUK_INTERNAL_DECL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range_callback gen_range, void *userdata); -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ -#endif /* DUK_LEXER_H_INCLUDED */ +#endif /* DUK_LEXER_H_INCLUDED */ /* #include duk_js_compiler.h */ /* * ECMAScript compiler. @@ -4149,13 +4241,13 @@ DUK_INTERNAL_DECL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_ #define DUK_JS_COMPILER_H_INCLUDED /* ECMAScript compiler limits */ -#define DUK_COMPILER_TOKEN_LIMIT 100000000L /* 1e8: protects against deeply nested inner functions */ +#define DUK_COMPILER_TOKEN_LIMIT 100000000L /* 1e8: protects against deeply nested inner functions */ /* maximum loopcount for peephole optimization */ -#define DUK_COMPILER_PEEPHOLE_MAXITER 3 +#define DUK_COMPILER_PEEPHOLE_MAXITER 3 /* maximum bytecode length in instructions */ -#define DUK_COMPILER_MAX_BYTECODE_LENGTH (256L * 1024L * 1024L) /* 1 GB */ +#define DUK_COMPILER_MAX_BYTECODE_LENGTH (256L * 1024L * 1024L) /* 1 GB */ /* * Compiler intermediate values @@ -4165,21 +4257,21 @@ DUK_INTERNAL_DECL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_ * either a left-hand-side or right-hand-side role (e.g. object property). */ -#define DUK_IVAL_NONE 0 /* no value */ -#define DUK_IVAL_PLAIN 1 /* register, constant, or value */ -#define DUK_IVAL_ARITH 2 /* binary arithmetic; DUK_OP_ADD, DUK_OP_EQ, other binary ops */ -#define DUK_IVAL_PROP 3 /* property access */ -#define DUK_IVAL_VAR 4 /* variable access */ +#define DUK_IVAL_NONE 0 /* no value */ +#define DUK_IVAL_PLAIN 1 /* register, constant, or value */ +#define DUK_IVAL_ARITH 2 /* binary arithmetic; DUK_OP_ADD, DUK_OP_EQ, other binary ops */ +#define DUK_IVAL_PROP 3 /* property access */ +#define DUK_IVAL_VAR 4 /* variable access */ -#define DUK_ISPEC_NONE 0 /* no value */ -#define DUK_ISPEC_VALUE 1 /* value resides in 'valstack_idx' */ -#define DUK_ISPEC_REGCONST 2 /* value resides in a register or constant */ +#define DUK_ISPEC_NONE 0 /* no value */ +#define DUK_ISPEC_VALUE 1 /* value resides in 'valstack_idx' */ +#define DUK_ISPEC_REGCONST 2 /* value resides in a register or constant */ /* Bit mask which indicates that a regconst is a constant instead of a register. * Chosen so that when a regconst is cast to duk_int32_t, all consts are * negative values. */ -#define DUK_REGCONST_CONST_MARKER DUK_INT32_MIN /* = -0x80000000 */ +#define DUK_REGCONST_CONST_MARKER DUK_INT32_MIN /* = -0x80000000 */ /* Type to represent a reg/const reference during compilation, with <0 * indicating a constant. Some call sites also use -1 to indicate 'none'. @@ -4187,9 +4279,9 @@ DUK_INTERNAL_DECL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_ typedef duk_int32_t duk_regconst_t; typedef struct { - duk_small_uint_t t; /* DUK_ISPEC_XXX */ + duk_small_uint_t t; /* DUK_ISPEC_XXX */ duk_regconst_t regconst; - duk_idx_t valstack_idx; /* always set; points to a reserved valstack slot */ + duk_idx_t valstack_idx; /* always set; points to a reserved valstack slot */ } duk_ispec; typedef struct { @@ -4201,8 +4293,8 @@ typedef struct { */ /* XXX: can be optimized for smaller footprint esp. on 32-bit environments */ - duk_small_uint_t t; /* DUK_IVAL_XXX */ - duk_small_uint_t op; /* bytecode opcode for binary ops */ + duk_small_uint_t t; /* DUK_IVAL_XXX */ + duk_small_uint_t op; /* bytecode opcode for binary ops */ duk_ispec x1; duk_ispec x2; } duk_ivalue; @@ -4224,22 +4316,22 @@ struct duk_compiler_instr { * Compiler state */ -#define DUK_LABEL_FLAG_ALLOW_BREAK (1U << 0) -#define DUK_LABEL_FLAG_ALLOW_CONTINUE (1U << 1) +#define DUK_LABEL_FLAG_ALLOW_BREAK (1U << 0) +#define DUK_LABEL_FLAG_ALLOW_CONTINUE (1U << 1) -#define DUK_DECL_TYPE_VAR 0 -#define DUK_DECL_TYPE_FUNC 1 +#define DUK_DECL_TYPE_VAR 0 +#define DUK_DECL_TYPE_FUNC 1 /* XXX: optimize to 16 bytes */ typedef struct { duk_small_uint_t flags; - duk_int_t label_id; /* numeric label_id (-1 reserved as marker) */ - duk_hstring *h_label; /* borrowed label name */ - duk_int_t catch_depth; /* catch depth at point of definition */ - duk_int_t pc_label; /* pc of label statement: - * pc+1: break jump site - * pc+2: continue jump site - */ + duk_int_t label_id; /* numeric label_id (-1 reserved as marker) */ + duk_hstring *h_label; /* borrowed label name */ + duk_int_t catch_depth; /* catch depth at point of definition */ + duk_int_t pc_label; /* pc of label statement: + * pc+1: break jump site + * pc+2: continue jump site + */ /* Fast jumps (which avoid longjmp) jump directly to the jump sites * which are always known even while the iteration/switch statement @@ -4255,22 +4347,22 @@ struct duk_compiler_func { * platforms (e.g. if int is 32 bits and pointers are 64 bits). */ - duk_bufwriter_ctx bw_code; /* bufwriter for code */ + duk_bufwriter_ctx bw_code; /* bufwriter for code */ - duk_hstring *h_name; /* function name (borrowed reference), ends up in _name */ + duk_hstring *h_name; /* function name (borrowed reference), ends up in _name */ /* h_code: held in bw_code */ - duk_hobject *h_consts; /* array */ - duk_hobject *h_funcs; /* array of function templates: [func1, offset1, line1, func2, offset2, line2] - * offset/line points to closing brace to allow skipping on pass 2 - */ - duk_hobject *h_decls; /* array of declarations: [ name1, val1, name2, val2, ... ] - * valN = (typeN) | (fnum << 8), where fnum is inner func number (0 for vars) - * record function and variable declarations in pass 1 - */ - duk_hobject *h_labelnames; /* array of active label names */ - duk_hbuffer_dynamic *h_labelinfos; /* C array of duk_labelinfo */ - duk_hobject *h_argnames; /* array of formal argument names (-> _Formals) */ - duk_hobject *h_varmap; /* variable map for pass 2 (identifier -> register number or null (unmapped)) */ + duk_hobject *h_consts; /* array */ + duk_hobject *h_funcs; /* array of function templates: [func1, offset1, line1, func2, offset2, line2] + * offset/line points to closing brace to allow skipping on pass 2 + */ + duk_hobject *h_decls; /* array of declarations: [ name1, val1, name2, val2, ... ] + * valN = (typeN) | (fnum << 8), where fnum is inner func number (0 for vars) + * record function and variable declarations in pass 1 + */ + duk_hobject *h_labelnames; /* array of active label names */ + duk_hbuffer_dynamic *h_labelinfos; /* C array of duk_labelinfo */ + duk_hobject *h_argnames; /* array of formal argument names (-> _Formals) */ + duk_hobject *h_varmap; /* variable map for pass 2 (identifier -> register number or null (unmapped)) */ /* Value stack indices for tracking objects. */ /* code_idx: not needed */ @@ -4283,9 +4375,9 @@ struct duk_compiler_func { duk_idx_t varmap_idx; /* Temp reg handling. */ - duk_regconst_t temp_first; /* first register that is a temporary (below: variables) */ - duk_regconst_t temp_next; /* next temporary register to allocate */ - duk_regconst_t temp_max; /* highest value of temp_reg (temp_max - 1 is highest used reg) */ + duk_regconst_t temp_first; /* first register that is a temporary (below: variables) */ + duk_regconst_t temp_next; /* next temporary register to allocate */ + duk_regconst_t temp_max; /* highest value of temp_reg (temp_max - 1 is highest used reg) */ /* Shuffle registers if large number of regs/consts. */ duk_regconst_t shuffle1; @@ -4295,49 +4387,51 @@ struct duk_compiler_func { /* Stats for current expression being parsed. */ duk_int_t nud_count; duk_int_t led_count; - duk_int_t paren_level; /* parenthesis count, 0 = top level */ - duk_bool_t expr_lhs; /* expression is left-hand-side compatible */ - duk_bool_t allow_in; /* current paren level allows 'in' token */ + duk_int_t paren_level; /* parenthesis count, 0 = top level */ + duk_bool_t expr_lhs; /* expression is left-hand-side compatible */ + duk_bool_t allow_in; /* current paren level allows 'in' token */ /* Misc. */ - duk_int_t stmt_next; /* statement id allocation (running counter) */ - duk_int_t label_next; /* label id allocation (running counter) */ - duk_int_t catch_depth; /* catch stack depth */ - duk_int_t with_depth; /* with stack depth (affects identifier lookups) */ - duk_int_t fnum_next; /* inner function numbering */ - duk_int_t num_formals; /* number of formal arguments */ - duk_regconst_t reg_stmt_value; /* register for writing value of 'non-empty' statements (global or eval code), -1 is marker */ + duk_int_t stmt_next; /* statement id allocation (running counter) */ + duk_int_t label_next; /* label id allocation (running counter) */ + duk_int_t catch_depth; /* catch stack depth */ + duk_int_t with_depth; /* with stack depth (affects identifier lookups) */ + duk_int_t fnum_next; /* inner function numbering */ + duk_int_t num_formals; /* number of formal arguments */ + duk_regconst_t + reg_stmt_value; /* register for writing value of 'non-empty' statements (global or eval code), -1 is marker */ #if defined(DUK_USE_DEBUGGER_SUPPORT) - duk_int_t min_line; /* XXX: typing (duk_hcompfunc has duk_uint32_t) */ + duk_int_t min_line; /* XXX: typing (duk_hcompfunc has duk_uint32_t) */ duk_int_t max_line; #endif /* Status booleans. */ - duk_uint8_t is_function; /* is an actual function (not global/eval code) */ - duk_uint8_t is_eval; /* is eval code */ - duk_uint8_t is_global; /* is global code */ - duk_uint8_t is_namebinding; /* needs a name binding */ - duk_uint8_t is_constructable; /* result is constructable */ - duk_uint8_t is_setget; /* is a setter/getter */ - duk_uint8_t is_strict; /* function is strict */ - duk_uint8_t is_notail; /* function must not be tail called */ - duk_uint8_t in_directive_prologue; /* parsing in "directive prologue", recognize directives */ - duk_uint8_t in_scanning; /* parsing in "scanning" phase (first pass) */ - duk_uint8_t may_direct_eval; /* function may call direct eval */ - duk_uint8_t id_access_arguments; /* function refers to 'arguments' identifier */ - duk_uint8_t id_access_slow; /* function makes one or more slow path accesses that won't match own static variables */ - duk_uint8_t id_access_slow_own; /* function makes one or more slow path accesses that may match own static variables */ - duk_uint8_t is_arguments_shadowed; /* argument/function declaration shadows 'arguments' */ - duk_uint8_t needs_shuffle; /* function needs shuffle registers */ - duk_uint8_t reject_regexp_in_adv; /* reject RegExp literal on next advance() call; needed for handling IdentifierName productions */ - duk_uint8_t allow_regexp_in_adv; /* allow RegExp literal on next advance() call */ + duk_uint8_t is_function; /* is an actual function (not global/eval code) */ + duk_uint8_t is_eval; /* is eval code */ + duk_uint8_t is_global; /* is global code */ + duk_uint8_t is_namebinding; /* needs a name binding */ + duk_uint8_t is_constructable; /* result is constructable */ + duk_uint8_t is_setget; /* is a setter/getter */ + duk_uint8_t is_strict; /* function is strict */ + duk_uint8_t is_notail; /* function must not be tail called */ + duk_uint8_t in_directive_prologue; /* parsing in "directive prologue", recognize directives */ + duk_uint8_t in_scanning; /* parsing in "scanning" phase (first pass) */ + duk_uint8_t may_direct_eval; /* function may call direct eval */ + duk_uint8_t id_access_arguments; /* function refers to 'arguments' identifier */ + duk_uint8_t id_access_slow; /* function makes one or more slow path accesses that won't match own static variables */ + duk_uint8_t id_access_slow_own; /* function makes one or more slow path accesses that may match own static variables */ + duk_uint8_t is_arguments_shadowed; /* argument/function declaration shadows 'arguments' */ + duk_uint8_t needs_shuffle; /* function needs shuffle registers */ + duk_uint8_t + reject_regexp_in_adv; /* reject RegExp literal on next advance() call; needed for handling IdentifierName productions */ + duk_uint8_t allow_regexp_in_adv; /* allow RegExp literal on next advance() call */ }; struct duk_compiler_ctx { duk_hthread *thr; /* filename being compiled (ends up in functions' '_filename' property) */ - duk_hstring *h_filename; /* borrowed reference */ + duk_hstring *h_filename; /* borrowed reference */ /* lexing (tokenization) state (contains two valstack slot indices) */ duk_lexer_ctx lex; @@ -4345,10 +4439,10 @@ struct duk_compiler_ctx { /* current and previous token for parsing */ duk_token prev_token; duk_token curr_token; - duk_idx_t tok11_idx; /* curr_token slot1 (matches 'lex' slot1_idx) */ - duk_idx_t tok12_idx; /* curr_token slot2 (matches 'lex' slot2_idx) */ - duk_idx_t tok21_idx; /* prev_token slot1 */ - duk_idx_t tok22_idx; /* prev_token slot2 */ + duk_idx_t tok11_idx; /* curr_token slot1 (matches 'lex' slot1_idx) */ + duk_idx_t tok12_idx; /* curr_token slot2 (matches 'lex' slot2_idx) */ + duk_idx_t tok21_idx; /* prev_token slot1 */ + duk_idx_t tok22_idx; /* prev_token slot2 */ /* recursion limit */ duk_int_t recursion_depth; @@ -4365,9 +4459,12 @@ struct duk_compiler_ctx { * Prototypes */ -DUK_INTERNAL_DECL void duk_js_compile(duk_hthread *thr, const duk_uint8_t *src_buffer, duk_size_t src_length, duk_small_uint_t flags); +DUK_INTERNAL_DECL void duk_js_compile(duk_hthread *thr, + const duk_uint8_t *src_buffer, + duk_size_t src_length, + duk_small_uint_t flags); -#endif /* DUK_JS_COMPILER_H_INCLUDED */ +#endif /* DUK_JS_COMPILER_H_INCLUDED */ /* #include duk_regexp.h */ /* * Regular expression structs, constants, and bytecode defines. @@ -4377,39 +4474,39 @@ DUK_INTERNAL_DECL void duk_js_compile(duk_hthread *thr, const duk_uint8_t *src_b #define DUK_REGEXP_H_INCLUDED /* maximum bytecode copies for {n,m} quantifiers */ -#define DUK_RE_MAX_ATOM_COPIES 1000 +#define DUK_RE_MAX_ATOM_COPIES 1000 /* regexp compilation limits */ -#define DUK_RE_COMPILE_TOKEN_LIMIT 100000000L /* 1e8 */ +#define DUK_RE_COMPILE_TOKEN_LIMIT 100000000L /* 1e8 */ /* regexp execution limits */ -#define DUK_RE_EXECUTE_STEPS_LIMIT 1000000000L /* 1e9 */ +#define DUK_RE_EXECUTE_STEPS_LIMIT 1000000000L /* 1e9 */ /* regexp opcodes */ -#define DUK_REOP_MATCH 1 -#define DUK_REOP_CHAR 2 -#define DUK_REOP_PERIOD 3 -#define DUK_REOP_RANGES 4 -#define DUK_REOP_INVRANGES 5 -#define DUK_REOP_JUMP 6 -#define DUK_REOP_SPLIT1 7 -#define DUK_REOP_SPLIT2 8 -#define DUK_REOP_SQMINIMAL 9 -#define DUK_REOP_SQGREEDY 10 -#define DUK_REOP_SAVE 11 -#define DUK_REOP_WIPERANGE 12 -#define DUK_REOP_LOOKPOS 13 -#define DUK_REOP_LOOKNEG 14 -#define DUK_REOP_BACKREFERENCE 15 -#define DUK_REOP_ASSERT_START 16 -#define DUK_REOP_ASSERT_END 17 -#define DUK_REOP_ASSERT_WORD_BOUNDARY 18 -#define DUK_REOP_ASSERT_NOT_WORD_BOUNDARY 19 +#define DUK_REOP_MATCH 1 +#define DUK_REOP_CHAR 2 +#define DUK_REOP_PERIOD 3 +#define DUK_REOP_RANGES 4 +#define DUK_REOP_INVRANGES 5 +#define DUK_REOP_JUMP 6 +#define DUK_REOP_SPLIT1 7 +#define DUK_REOP_SPLIT2 8 +#define DUK_REOP_SQMINIMAL 9 +#define DUK_REOP_SQGREEDY 10 +#define DUK_REOP_SAVE 11 +#define DUK_REOP_WIPERANGE 12 +#define DUK_REOP_LOOKPOS 13 +#define DUK_REOP_LOOKNEG 14 +#define DUK_REOP_BACKREFERENCE 15 +#define DUK_REOP_ASSERT_START 16 +#define DUK_REOP_ASSERT_END 17 +#define DUK_REOP_ASSERT_WORD_BOUNDARY 18 +#define DUK_REOP_ASSERT_NOT_WORD_BOUNDARY 19 /* flags */ -#define DUK_RE_FLAG_GLOBAL (1U << 0) -#define DUK_RE_FLAG_IGNORE_CASE (1U << 1) -#define DUK_RE_FLAG_MULTILINE (1U << 2) +#define DUK_RE_FLAG_GLOBAL (1U << 0) +#define DUK_RE_FLAG_IGNORE_CASE (1U << 1) +#define DUK_RE_FLAG_MULTILINE (1U << 2) struct duk_re_matcher_ctx { duk_hthread *thr; @@ -4419,7 +4516,7 @@ struct duk_re_matcher_ctx { const duk_uint8_t *input_end; const duk_uint8_t *bytecode; const duk_uint8_t *bytecode_end; - const duk_uint8_t **saved; /* allocated from valstack (fixed buffer) */ + const duk_uint8_t **saved; /* allocated from valstack (fixed buffer) */ duk_uint32_t nsaved; duk_uint32_t recursion_depth; duk_uint32_t recursion_limit; @@ -4434,11 +4531,11 @@ struct duk_re_compiler_ctx { duk_lexer_ctx lex; duk_re_token curr_token; duk_bufwriter_ctx bw; - duk_uint32_t captures; /* highest capture number emitted so far (used as: ++captures) */ + duk_uint32_t captures; /* highest capture number emitted so far (used as: ++captures) */ duk_uint32_t highest_backref; duk_uint32_t recursion_depth; duk_uint32_t recursion_limit; - duk_uint32_t nranges; /* internal temporary value, used for char classes */ + duk_uint32_t nranges; /* internal temporary value, used for char classes */ }; /* @@ -4449,10 +4546,10 @@ struct duk_re_compiler_ctx { DUK_INTERNAL_DECL void duk_regexp_compile(duk_hthread *thr); DUK_INTERNAL_DECL void duk_regexp_create_instance(duk_hthread *thr); DUK_INTERNAL_DECL void duk_regexp_match(duk_hthread *thr); -DUK_INTERNAL_DECL void duk_regexp_match_force_global(duk_hthread *thr); /* hacky helper for String.prototype.split() */ +DUK_INTERNAL_DECL void duk_regexp_match_force_global(duk_hthread *thr); /* hacky helper for String.prototype.split() */ #endif -#endif /* DUK_REGEXP_H_INCLUDED */ +#endif /* DUK_REGEXP_H_INCLUDED */ /* #include duk_heaphdr.h */ /* * Heap header definition and assorted macros, including ref counting. @@ -4505,7 +4602,7 @@ struct duk_heaphdr { #else duk_size_t h_refcount; #endif -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ #if defined(DUK_USE_HEAPPTR16) duk_uint16_t h_next16; @@ -4553,7 +4650,7 @@ struct duk_heaphdr_string { #endif #if defined(DUK_USE_REFCOUNT16) duk_uint16_t h_refcount; - duk_uint16_t h_strextra16; /* round out to 8 bytes */ + duk_uint16_t h_strextra16; /* round out to 8 bytes */ #elif defined(DUK_USE_REFCOUNT32) duk_uint32_t h_refcount; #else @@ -4561,160 +4658,169 @@ struct duk_heaphdr_string { #endif #else duk_uint16_t h_strextra16; -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ duk_hstring *h_next; /* No 'h_prev' pointer for strings. */ }; -#define DUK_HEAPHDR_FLAGS_TYPE_MASK 0x00000003UL -#define DUK_HEAPHDR_FLAGS_FLAG_MASK (~DUK_HEAPHDR_FLAGS_TYPE_MASK) +#define DUK_HEAPHDR_FLAGS_TYPE_MASK 0x00000003UL +#define DUK_HEAPHDR_FLAGS_FLAG_MASK (~DUK_HEAPHDR_FLAGS_TYPE_MASK) - /* 2 bits for heap type */ -#define DUK_HEAPHDR_FLAGS_HEAP_START 2 /* 5 heap flags */ -#define DUK_HEAPHDR_FLAGS_USER_START 7 /* 25 user flags */ +/* 2 bits for heap type */ +#define DUK_HEAPHDR_FLAGS_HEAP_START 2 /* 5 heap flags */ +#define DUK_HEAPHDR_FLAGS_USER_START 7 /* 25 user flags */ -#define DUK_HEAPHDR_HEAP_FLAG_NUMBER(n) (DUK_HEAPHDR_FLAGS_HEAP_START + (n)) -#define DUK_HEAPHDR_USER_FLAG_NUMBER(n) (DUK_HEAPHDR_FLAGS_USER_START + (n)) -#define DUK_HEAPHDR_HEAP_FLAG(n) (1UL << (DUK_HEAPHDR_FLAGS_HEAP_START + (n))) -#define DUK_HEAPHDR_USER_FLAG(n) (1UL << (DUK_HEAPHDR_FLAGS_USER_START + (n))) +#define DUK_HEAPHDR_HEAP_FLAG_NUMBER(n) (DUK_HEAPHDR_FLAGS_HEAP_START + (n)) +#define DUK_HEAPHDR_USER_FLAG_NUMBER(n) (DUK_HEAPHDR_FLAGS_USER_START + (n)) +#define DUK_HEAPHDR_HEAP_FLAG(n) (1UL << (DUK_HEAPHDR_FLAGS_HEAP_START + (n))) +#define DUK_HEAPHDR_USER_FLAG(n) (1UL << (DUK_HEAPHDR_FLAGS_USER_START + (n))) -#define DUK_HEAPHDR_FLAG_REACHABLE DUK_HEAPHDR_HEAP_FLAG(0) /* mark-and-sweep: reachable */ -#define DUK_HEAPHDR_FLAG_TEMPROOT DUK_HEAPHDR_HEAP_FLAG(1) /* mark-and-sweep: children not processed */ -#define DUK_HEAPHDR_FLAG_FINALIZABLE DUK_HEAPHDR_HEAP_FLAG(2) /* mark-and-sweep: finalizable (on current pass) */ -#define DUK_HEAPHDR_FLAG_FINALIZED DUK_HEAPHDR_HEAP_FLAG(3) /* mark-and-sweep: finalized (on previous pass) */ -#define DUK_HEAPHDR_FLAG_READONLY DUK_HEAPHDR_HEAP_FLAG(4) /* read-only object, in code section */ +#define DUK_HEAPHDR_FLAG_REACHABLE DUK_HEAPHDR_HEAP_FLAG(0) /* mark-and-sweep: reachable */ +#define DUK_HEAPHDR_FLAG_TEMPROOT DUK_HEAPHDR_HEAP_FLAG(1) /* mark-and-sweep: children not processed */ +#define DUK_HEAPHDR_FLAG_FINALIZABLE DUK_HEAPHDR_HEAP_FLAG(2) /* mark-and-sweep: finalizable (on current pass) */ +#define DUK_HEAPHDR_FLAG_FINALIZED DUK_HEAPHDR_HEAP_FLAG(3) /* mark-and-sweep: finalized (on previous pass) */ +#define DUK_HEAPHDR_FLAG_READONLY DUK_HEAPHDR_HEAP_FLAG(4) /* read-only object, in code section */ -#define DUK_HTYPE_MIN 0 -#define DUK_HTYPE_STRING 0 -#define DUK_HTYPE_OBJECT 1 -#define DUK_HTYPE_BUFFER 2 -#define DUK_HTYPE_MAX 2 +#define DUK_HTYPE_MIN 0 +#define DUK_HTYPE_STRING 0 +#define DUK_HTYPE_OBJECT 1 +#define DUK_HTYPE_BUFFER 2 +#define DUK_HTYPE_MAX 2 #if defined(DUK_USE_HEAPPTR16) -#define DUK_HEAPHDR_GET_NEXT(heap,h) \ - ((duk_heaphdr *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->h_next16)) -#define DUK_HEAPHDR_SET_NEXT(heap,h,val) do { \ +#define DUK_HEAPHDR_GET_NEXT(heap, h) ((duk_heaphdr *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->h_next16)) +#define DUK_HEAPHDR_SET_NEXT(heap, h, val) \ + do { \ (h)->h_next16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) val); \ } while (0) #else -#define DUK_HEAPHDR_GET_NEXT(heap,h) ((h)->h_next) -#define DUK_HEAPHDR_SET_NEXT(heap,h,val) do { \ +#define DUK_HEAPHDR_GET_NEXT(heap, h) ((h)->h_next) +#define DUK_HEAPHDR_SET_NEXT(heap, h, val) \ + do { \ (h)->h_next = (val); \ } while (0) #endif #if defined(DUK_USE_DOUBLE_LINKED_HEAP) #if defined(DUK_USE_HEAPPTR16) -#define DUK_HEAPHDR_GET_PREV(heap,h) \ - ((duk_heaphdr *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->h_prev16)) -#define DUK_HEAPHDR_SET_PREV(heap,h,val) do { \ +#define DUK_HEAPHDR_GET_PREV(heap, h) ((duk_heaphdr *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->h_prev16)) +#define DUK_HEAPHDR_SET_PREV(heap, h, val) \ + do { \ (h)->h_prev16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (val)); \ } while (0) #else -#define DUK_HEAPHDR_GET_PREV(heap,h) ((h)->h_prev) -#define DUK_HEAPHDR_SET_PREV(heap,h,val) do { \ +#define DUK_HEAPHDR_GET_PREV(heap, h) ((h)->h_prev) +#define DUK_HEAPHDR_SET_PREV(heap, h, val) \ + do { \ (h)->h_prev = (val); \ } while (0) #endif #endif #if defined(DUK_USE_REFERENCE_COUNTING) -#define DUK_HEAPHDR_GET_REFCOUNT(h) ((h)->h_refcount) -#define DUK_HEAPHDR_SET_REFCOUNT(h,val) do { \ +#define DUK_HEAPHDR_GET_REFCOUNT(h) ((h)->h_refcount) +#define DUK_HEAPHDR_SET_REFCOUNT(h, val) \ + do { \ (h)->h_refcount = (val); \ - DUK_ASSERT((h)->h_refcount == (val)); /* No truncation. */ \ + DUK_ASSERT((h)->h_refcount == (val)); /* No truncation. */ \ } while (0) -#define DUK_HEAPHDR_PREINC_REFCOUNT(h) (++(h)->h_refcount) /* result: updated refcount */ -#define DUK_HEAPHDR_PREDEC_REFCOUNT(h) (--(h)->h_refcount) /* result: updated refcount */ +#define DUK_HEAPHDR_PREINC_REFCOUNT(h) (++(h)->h_refcount) /* result: updated refcount */ +#define DUK_HEAPHDR_PREDEC_REFCOUNT(h) (--(h)->h_refcount) /* result: updated refcount */ #else /* refcount macros not defined without refcounting, caller must #if defined() now */ -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ /* * Note: type is treated as a field separate from flags, so some masking is * involved in the macros below. */ -#define DUK_HEAPHDR_GET_FLAGS_RAW(h) ((h)->h_flags) -#define DUK_HEAPHDR_SET_FLAGS_RAW(h,val) do { \ - (h)->h_flags = (val); } \ +#define DUK_HEAPHDR_GET_FLAGS_RAW(h) ((h)->h_flags) +#define DUK_HEAPHDR_SET_FLAGS_RAW(h, val) \ + do { \ + (h)->h_flags = (val); \ + } \ } -#define DUK_HEAPHDR_GET_FLAGS(h) ((h)->h_flags & DUK_HEAPHDR_FLAGS_FLAG_MASK) -#define DUK_HEAPHDR_SET_FLAGS(h,val) do { \ +#define DUK_HEAPHDR_GET_FLAGS(h) ((h)->h_flags & DUK_HEAPHDR_FLAGS_FLAG_MASK) +#define DUK_HEAPHDR_SET_FLAGS(h, val) \ + do { \ (h)->h_flags = ((h)->h_flags & ~(DUK_HEAPHDR_FLAGS_FLAG_MASK)) | (val); \ } while (0) -#define DUK_HEAPHDR_GET_TYPE(h) ((h)->h_flags & DUK_HEAPHDR_FLAGS_TYPE_MASK) -#define DUK_HEAPHDR_SET_TYPE(h,val) do { \ +#define DUK_HEAPHDR_GET_TYPE(h) ((h)->h_flags & DUK_HEAPHDR_FLAGS_TYPE_MASK) +#define DUK_HEAPHDR_SET_TYPE(h, val) \ + do { \ (h)->h_flags = ((h)->h_flags & ~(DUK_HEAPHDR_FLAGS_TYPE_MASK)) | (val); \ } while (0) /* Comparison for type >= DUK_HTYPE_MIN skipped; because DUK_HTYPE_MIN is zero * and the comparison is unsigned, it's always true and generates warnings. */ -#define DUK_HEAPHDR_HTYPE_VALID(h) ( \ - DUK_HEAPHDR_GET_TYPE((h)) <= DUK_HTYPE_MAX \ - ) +#define DUK_HEAPHDR_HTYPE_VALID(h) (DUK_HEAPHDR_GET_TYPE((h)) <= DUK_HTYPE_MAX) -#define DUK_HEAPHDR_SET_TYPE_AND_FLAGS(h,tval,fval) do { \ - (h)->h_flags = ((tval) & DUK_HEAPHDR_FLAGS_TYPE_MASK) | \ - ((fval) & DUK_HEAPHDR_FLAGS_FLAG_MASK); \ +#define DUK_HEAPHDR_SET_TYPE_AND_FLAGS(h, tval, fval) \ + do { \ + (h)->h_flags = ((tval) &DUK_HEAPHDR_FLAGS_TYPE_MASK) | ((fval) &DUK_HEAPHDR_FLAGS_FLAG_MASK); \ } while (0) -#define DUK_HEAPHDR_SET_FLAG_BITS(h,bits) do { \ +#define DUK_HEAPHDR_SET_FLAG_BITS(h, bits) \ + do { \ DUK_ASSERT(((bits) & ~(DUK_HEAPHDR_FLAGS_FLAG_MASK)) == 0); \ (h)->h_flags |= (bits); \ } while (0) -#define DUK_HEAPHDR_CLEAR_FLAG_BITS(h,bits) do { \ +#define DUK_HEAPHDR_CLEAR_FLAG_BITS(h, bits) \ + do { \ DUK_ASSERT(((bits) & ~(DUK_HEAPHDR_FLAGS_FLAG_MASK)) == 0); \ (h)->h_flags &= ~((bits)); \ } while (0) -#define DUK_HEAPHDR_CHECK_FLAG_BITS(h,bits) (((h)->h_flags & (bits)) != 0) +#define DUK_HEAPHDR_CHECK_FLAG_BITS(h, bits) (((h)->h_flags & (bits)) != 0) -#define DUK_HEAPHDR_SET_REACHABLE(h) DUK_HEAPHDR_SET_FLAG_BITS((h),DUK_HEAPHDR_FLAG_REACHABLE) -#define DUK_HEAPHDR_CLEAR_REACHABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h),DUK_HEAPHDR_FLAG_REACHABLE) -#define DUK_HEAPHDR_HAS_REACHABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h),DUK_HEAPHDR_FLAG_REACHABLE) +#define DUK_HEAPHDR_SET_REACHABLE(h) DUK_HEAPHDR_SET_FLAG_BITS((h), DUK_HEAPHDR_FLAG_REACHABLE) +#define DUK_HEAPHDR_CLEAR_REACHABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h), DUK_HEAPHDR_FLAG_REACHABLE) +#define DUK_HEAPHDR_HAS_REACHABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h), DUK_HEAPHDR_FLAG_REACHABLE) -#define DUK_HEAPHDR_SET_TEMPROOT(h) DUK_HEAPHDR_SET_FLAG_BITS((h),DUK_HEAPHDR_FLAG_TEMPROOT) -#define DUK_HEAPHDR_CLEAR_TEMPROOT(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h),DUK_HEAPHDR_FLAG_TEMPROOT) -#define DUK_HEAPHDR_HAS_TEMPROOT(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h),DUK_HEAPHDR_FLAG_TEMPROOT) +#define DUK_HEAPHDR_SET_TEMPROOT(h) DUK_HEAPHDR_SET_FLAG_BITS((h), DUK_HEAPHDR_FLAG_TEMPROOT) +#define DUK_HEAPHDR_CLEAR_TEMPROOT(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h), DUK_HEAPHDR_FLAG_TEMPROOT) +#define DUK_HEAPHDR_HAS_TEMPROOT(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h), DUK_HEAPHDR_FLAG_TEMPROOT) -#define DUK_HEAPHDR_SET_FINALIZABLE(h) DUK_HEAPHDR_SET_FLAG_BITS((h),DUK_HEAPHDR_FLAG_FINALIZABLE) -#define DUK_HEAPHDR_CLEAR_FINALIZABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h),DUK_HEAPHDR_FLAG_FINALIZABLE) -#define DUK_HEAPHDR_HAS_FINALIZABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h),DUK_HEAPHDR_FLAG_FINALIZABLE) +#define DUK_HEAPHDR_SET_FINALIZABLE(h) DUK_HEAPHDR_SET_FLAG_BITS((h), DUK_HEAPHDR_FLAG_FINALIZABLE) +#define DUK_HEAPHDR_CLEAR_FINALIZABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h), DUK_HEAPHDR_FLAG_FINALIZABLE) +#define DUK_HEAPHDR_HAS_FINALIZABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h), DUK_HEAPHDR_FLAG_FINALIZABLE) -#define DUK_HEAPHDR_SET_FINALIZED(h) DUK_HEAPHDR_SET_FLAG_BITS((h),DUK_HEAPHDR_FLAG_FINALIZED) -#define DUK_HEAPHDR_CLEAR_FINALIZED(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h),DUK_HEAPHDR_FLAG_FINALIZED) -#define DUK_HEAPHDR_HAS_FINALIZED(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h),DUK_HEAPHDR_FLAG_FINALIZED) +#define DUK_HEAPHDR_SET_FINALIZED(h) DUK_HEAPHDR_SET_FLAG_BITS((h), DUK_HEAPHDR_FLAG_FINALIZED) +#define DUK_HEAPHDR_CLEAR_FINALIZED(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h), DUK_HEAPHDR_FLAG_FINALIZED) +#define DUK_HEAPHDR_HAS_FINALIZED(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h), DUK_HEAPHDR_FLAG_FINALIZED) -#define DUK_HEAPHDR_SET_READONLY(h) DUK_HEAPHDR_SET_FLAG_BITS((h),DUK_HEAPHDR_FLAG_READONLY) -#define DUK_HEAPHDR_CLEAR_READONLY(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h),DUK_HEAPHDR_FLAG_READONLY) -#define DUK_HEAPHDR_HAS_READONLY(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h),DUK_HEAPHDR_FLAG_READONLY) +#define DUK_HEAPHDR_SET_READONLY(h) DUK_HEAPHDR_SET_FLAG_BITS((h), DUK_HEAPHDR_FLAG_READONLY) +#define DUK_HEAPHDR_CLEAR_READONLY(h) DUK_HEAPHDR_CLEAR_FLAG_BITS((h), DUK_HEAPHDR_FLAG_READONLY) +#define DUK_HEAPHDR_HAS_READONLY(h) DUK_HEAPHDR_CHECK_FLAG_BITS((h), DUK_HEAPHDR_FLAG_READONLY) /* get or set a range of flags; m=first bit number, n=number of bits */ -#define DUK_HEAPHDR_GET_FLAG_RANGE(h,m,n) (((h)->h_flags >> (m)) & ((1UL << (n)) - 1UL)) +#define DUK_HEAPHDR_GET_FLAG_RANGE(h, m, n) (((h)->h_flags >> (m)) & ((1UL << (n)) - 1UL)) -#define DUK_HEAPHDR_SET_FLAG_RANGE(h,m,n,v) do { \ - (h)->h_flags = \ - ((h)->h_flags & (~(((1UL << (n)) - 1UL) << (m)))) \ - | ((v) << (m)); \ +#define DUK_HEAPHDR_SET_FLAG_RANGE(h, m, n, v) \ + do { \ + (h)->h_flags = ((h)->h_flags & (~(((1UL << (n)) - 1UL) << (m)))) | ((v) << (m)); \ } while (0) /* init pointer fields to null */ #if defined(DUK_USE_DOUBLE_LINKED_HEAP) -#define DUK_HEAPHDR_INIT_NULLS(h) do { \ +#define DUK_HEAPHDR_INIT_NULLS(h) \ + do { \ DUK_HEAPHDR_SET_NEXT((h), (void *) NULL); \ DUK_HEAPHDR_SET_PREV((h), (void *) NULL); \ } while (0) #else -#define DUK_HEAPHDR_INIT_NULLS(h) do { \ +#define DUK_HEAPHDR_INIT_NULLS(h) \ + do { \ DUK_HEAPHDR_SET_NEXT((h), (void *) NULL); \ } while (0) #endif -#define DUK_HEAPHDR_STRING_INIT_NULLS(h) do { \ +#define DUK_HEAPHDR_STRING_INIT_NULLS(h) \ + do { \ (h)->h_next = NULL; \ } while (0) @@ -4743,14 +4849,24 @@ struct duk_heaphdr_string { DUK_INTERNAL_DECL void duk_heaphdr_assert_valid_subclassed(duk_heaphdr *h); DUK_INTERNAL_DECL void duk_heaphdr_assert_links(duk_heap *heap, duk_heaphdr *h); DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); -#define DUK_HEAPHDR_ASSERT_LINKS(heap,h) do { duk_heaphdr_assert_links((heap), (h)); } while (0) -#define DUK_HEAPHDR_ASSERT_VALID(h) do { duk_heaphdr_assert_valid((h)); } while (0) +#define DUK_HEAPHDR_ASSERT_LINKS(heap, h) \ + do { \ + duk_heaphdr_assert_links((heap), (h)); \ + } while (0) +#define DUK_HEAPHDR_ASSERT_VALID(h) \ + do { \ + duk_heaphdr_assert_valid((h)); \ + } while (0) #else -#define DUK_HEAPHDR_ASSERT_LINKS(heap,h) do {} while (0) -#define DUK_HEAPHDR_ASSERT_VALID(h) do {} while (0) +#define DUK_HEAPHDR_ASSERT_LINKS(heap, h) \ + do { \ + } while (0) +#define DUK_HEAPHDR_ASSERT_VALID(h) \ + do { \ + } while (0) #endif -#endif /* DUK_HEAPHDR_H_INCLUDED */ +#endif /* DUK_HEAPHDR_H_INCLUDED */ /* #include duk_refcount.h */ /* * Reference counting helper macros. The macros take a thread argument @@ -4771,19 +4887,20 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); /* XXX: double evaluation for 'tv' argument. */ #define DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv) \ (DUK_TVAL_IS_HEAP_ALLOCATED((tv)) && !DUK_HEAPHDR_HAS_READONLY(DUK_TVAL_GET_HEAPHDR((tv)))) -#define DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(h) (!DUK_HEAPHDR_HAS_READONLY((h))) -#else /* DUK_USE_ROM_OBJECTS */ +#define DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(h) (!DUK_HEAPHDR_HAS_READONLY((h))) +#else /* DUK_USE_ROM_OBJECTS */ /* Without ROM objects "needs refcount update" == is heap allocated. */ -#define DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv) DUK_TVAL_IS_HEAP_ALLOCATED((tv)) -#define DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(h) 1 -#endif /* DUK_USE_ROM_OBJECTS */ +#define DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv) DUK_TVAL_IS_HEAP_ALLOCATED((tv)) +#define DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(h) 1 +#endif /* DUK_USE_ROM_OBJECTS */ /* Fast variants, inline refcount operations except for refzero handling. * Can be used explicitly when speed is always more important than size. * For a good compiler and a single file build, these are basically the * same as a forced inline. */ -#define DUK_TVAL_INCREF_FAST(thr,tv) do { \ +#define DUK_TVAL_INCREF_FAST(thr, tv) \ + do { \ duk_tval *duk__tv = (tv); \ DUK_ASSERT(duk__tv != NULL); \ if (DUK_TVAL_NEEDS_REFCOUNT_UPDATE(duk__tv)) { \ @@ -4791,10 +4908,11 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); DUK_ASSERT(duk__h != NULL); \ DUK_ASSERT(DUK_HEAPHDR_HTYPE_VALID(duk__h)); \ DUK_HEAPHDR_PREINC_REFCOUNT(duk__h); \ - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(duk__h) != 0); /* No wrapping. */ \ + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(duk__h) != 0); /* No wrapping. */ \ } \ } while (0) -#define DUK_TVAL_DECREF_FAST(thr,tv) do { \ +#define DUK_TVAL_DECREF_FAST(thr, tv) \ + do { \ duk_tval *duk__tv = (tv); \ DUK_ASSERT(duk__tv != NULL); \ if (DUK_TVAL_NEEDS_REFCOUNT_UPDATE(duk__tv)) { \ @@ -4807,7 +4925,8 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); } \ } \ } while (0) -#define DUK_TVAL_DECREF_NORZ_FAST(thr,tv) do { \ +#define DUK_TVAL_DECREF_NORZ_FAST(thr, tv) \ + do { \ duk_tval *duk__tv = (tv); \ DUK_ASSERT(duk__tv != NULL); \ if (DUK_TVAL_NEEDS_REFCOUNT_UPDATE(duk__tv)) { \ @@ -4820,16 +4939,18 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); } \ } \ } while (0) -#define DUK_HEAPHDR_INCREF_FAST(thr,h) do { \ +#define DUK_HEAPHDR_INCREF_FAST(thr, h) \ + do { \ duk_heaphdr *duk__h = (duk_heaphdr *) (h); \ DUK_ASSERT(duk__h != NULL); \ DUK_ASSERT(DUK_HEAPHDR_HTYPE_VALID(duk__h)); \ if (DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(duk__h)) { \ DUK_HEAPHDR_PREINC_REFCOUNT(duk__h); \ - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(duk__h) != 0); /* No wrapping. */ \ + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(duk__h) != 0); /* No wrapping. */ \ } \ } while (0) -#define DUK_HEAPHDR_DECREF_FAST_RAW(thr,h,rzcall,rzcast) do { \ +#define DUK_HEAPHDR_DECREF_FAST_RAW(thr, h, rzcall, rzcast) \ + do { \ duk_heaphdr *duk__h = (duk_heaphdr *) (h); \ DUK_ASSERT(duk__h != NULL); \ DUK_ASSERT(DUK_HEAPHDR_HTYPE_VALID(duk__h)); \ @@ -4840,29 +4961,72 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); } \ } \ } while (0) -#define DUK_HEAPHDR_DECREF_FAST(thr,h) \ - DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_heaphdr_refzero,duk_heaphdr *) -#define DUK_HEAPHDR_DECREF_NORZ_FAST(thr,h) \ - DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_heaphdr_refzero_norz,duk_heaphdr *) +#define DUK_HEAPHDR_DECREF_FAST(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_heaphdr_refzero, duk_heaphdr *) +#define DUK_HEAPHDR_DECREF_NORZ_FAST(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_heaphdr_refzero_norz, duk_heaphdr *) /* Slow variants, call to a helper to reduce code size. * Can be used explicitly when size is always more important than speed. */ -#define DUK_TVAL_INCREF_SLOW(thr,tv) do { duk_tval_incref((tv)); } while (0) -#define DUK_TVAL_DECREF_SLOW(thr,tv) do { duk_tval_decref((thr), (tv)); } while (0) -#define DUK_TVAL_DECREF_NORZ_SLOW(thr,tv) do { duk_tval_decref_norz((thr), (tv)); } while (0) -#define DUK_HEAPHDR_INCREF_SLOW(thr,h) do { duk_heaphdr_incref((duk_heaphdr *) (h)); } while (0) -#define DUK_HEAPHDR_DECREF_SLOW(thr,h) do { duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HEAPHDR_DECREF_NORZ_SLOW(thr,h) do { duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HSTRING_INCREF_SLOW(thr,h) do { duk_heaphdr_incref((duk_heaphdr *) (h)); } while (0) -#define DUK_HSTRING_DECREF_SLOW(thr,h) do { duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HSTRING_DECREF_NORZ_SLOW(thr,h) do { duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HBUFFER_INCREF_SLOW(thr,h) do { duk_heaphdr_incref((duk_heaphdr *) (h)); } while (0) -#define DUK_HBUFFER_DECREF_SLOW(thr,h) do { duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HBUFFER_DECREF_NORZ_SLOW(thr,h) do { duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HOBJECT_INCREF_SLOW(thr,h) do { duk_heaphdr_incref((duk_heaphdr *) (h)); } while (0) -#define DUK_HOBJECT_DECREF_SLOW(thr,h) do { duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); } while (0) -#define DUK_HOBJECT_DECREF_NORZ_SLOW(thr,h) do { duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); } while (0) +#define DUK_TVAL_INCREF_SLOW(thr, tv) \ + do { \ + duk_tval_incref((tv)); \ + } while (0) +#define DUK_TVAL_DECREF_SLOW(thr, tv) \ + do { \ + duk_tval_decref((thr), (tv)); \ + } while (0) +#define DUK_TVAL_DECREF_NORZ_SLOW(thr, tv) \ + do { \ + duk_tval_decref_norz((thr), (tv)); \ + } while (0) +#define DUK_HEAPHDR_INCREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_incref((duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HEAPHDR_DECREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HEAPHDR_DECREF_NORZ_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HSTRING_INCREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_incref((duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HSTRING_DECREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HSTRING_DECREF_NORZ_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HBUFFER_INCREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_incref((duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HBUFFER_DECREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HBUFFER_DECREF_NORZ_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HOBJECT_INCREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_incref((duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HOBJECT_DECREF_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref((thr), (duk_heaphdr *) (h)); \ + } while (0) +#define DUK_HOBJECT_DECREF_NORZ_SLOW(thr, h) \ + do { \ + duk_heaphdr_decref_norz((thr), (duk_heaphdr *) (h)); \ + } while (0) /* Default variants. Selection depends on speed/size preference. * Concretely: with gcc 4.8.1 -Os x64 the difference in final binary @@ -4872,122 +5036,136 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); /* XXX: It would be nice to specialize for specific duk_hobject subtypes * but current refzero queue handling prevents that. */ -#define DUK_TVAL_INCREF(thr,tv) DUK_TVAL_INCREF_FAST((thr),(tv)) -#define DUK_TVAL_DECREF(thr,tv) DUK_TVAL_DECREF_FAST((thr),(tv)) -#define DUK_TVAL_DECREF_NORZ(thr,tv) DUK_TVAL_DECREF_NORZ_FAST((thr),(tv)) -#define DUK_HEAPHDR_INCREF(thr,h) DUK_HEAPHDR_INCREF_FAST((thr),(h)) -#define DUK_HEAPHDR_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_heaphdr_refzero,duk_heaphdr *) -#define DUK_HEAPHDR_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_heaphdr_refzero_norz,duk_heaphdr *) -#define DUK_HSTRING_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) (h)) -#define DUK_HSTRING_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hstring_refzero,duk_hstring *) -#define DUK_HSTRING_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hstring_refzero,duk_hstring *) /* no 'norz' variant */ -#define DUK_HOBJECT_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) (h)) -#define DUK_HOBJECT_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero,duk_hobject *) -#define DUK_HOBJECT_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero_norz,duk_hobject *) -#define DUK_HBUFFER_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) (h)) -#define DUK_HBUFFER_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hbuffer_refzero,duk_hbuffer *) -#define DUK_HBUFFER_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hbuffer_refzero,duk_hbuffer *) /* no 'norz' variant */ -#define DUK_HCOMPFUNC_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HCOMPFUNC_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero,duk_hobject *) -#define DUK_HCOMPFUNC_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero_norz,duk_hobject *) -#define DUK_HNATFUNC_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HNATFUNC_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero,duk_hobject *) -#define DUK_HNATFUNC_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero_norz,duk_hobject *) -#define DUK_HBUFOBJ_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HBUFOBJ_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero,duk_hobject *) -#define DUK_HBUFOBJ_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero_norz,duk_hobject *) -#define DUK_HTHREAD_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HTHREAD_DECREF(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero,duk_hobject *) -#define DUK_HTHREAD_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_FAST_RAW((thr),(h),duk_hobject_refzero_norz,duk_hobject *) +#define DUK_TVAL_INCREF(thr, tv) DUK_TVAL_INCREF_FAST((thr), (tv)) +#define DUK_TVAL_DECREF(thr, tv) DUK_TVAL_DECREF_FAST((thr), (tv)) +#define DUK_TVAL_DECREF_NORZ(thr, tv) DUK_TVAL_DECREF_NORZ_FAST((thr), (tv)) +#define DUK_HEAPHDR_INCREF(thr, h) DUK_HEAPHDR_INCREF_FAST((thr), (h)) +#define DUK_HEAPHDR_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_heaphdr_refzero, duk_heaphdr *) +#define DUK_HEAPHDR_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_heaphdr_refzero_norz, duk_heaphdr *) +#define DUK_HSTRING_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)) +#define DUK_HSTRING_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hstring_refzero, duk_hstring *) +#define DUK_HSTRING_DECREF_NORZ(thr, h) \ + DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hstring_refzero, duk_hstring *) /* no 'norz' variant */ +#define DUK_HOBJECT_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)) +#define DUK_HOBJECT_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero, duk_hobject *) +#define DUK_HOBJECT_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero_norz, duk_hobject *) +#define DUK_HBUFFER_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)) +#define DUK_HBUFFER_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hbuffer_refzero, duk_hbuffer *) +#define DUK_HBUFFER_DECREF_NORZ(thr, h) \ + DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hbuffer_refzero, duk_hbuffer *) /* no 'norz' variant */ +#define DUK_HCOMPFUNC_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HCOMPFUNC_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero, duk_hobject *) +#define DUK_HCOMPFUNC_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero_norz, duk_hobject *) +#define DUK_HNATFUNC_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HNATFUNC_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero, duk_hobject *) +#define DUK_HNATFUNC_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero_norz, duk_hobject *) +#define DUK_HBUFOBJ_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HBUFOBJ_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero, duk_hobject *) +#define DUK_HBUFOBJ_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero_norz, duk_hobject *) +#define DUK_HTHREAD_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HTHREAD_DECREF(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero, duk_hobject *) +#define DUK_HTHREAD_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_FAST_RAW((thr), (h), duk_hobject_refzero_norz, duk_hobject *) #else -#define DUK_TVAL_INCREF(thr,tv) DUK_TVAL_INCREF_SLOW((thr),(tv)) -#define DUK_TVAL_DECREF(thr,tv) DUK_TVAL_DECREF_SLOW((thr),(tv)) -#define DUK_TVAL_DECREF_NORZ(thr,tv) DUK_TVAL_DECREF_NORZ_SLOW((thr),(tv)) -#define DUK_HEAPHDR_INCREF(thr,h) DUK_HEAPHDR_INCREF_SLOW((thr),(h)) -#define DUK_HEAPHDR_DECREF(thr,h) DUK_HEAPHDR_DECREF_SLOW((thr),(h)) -#define DUK_HEAPHDR_DECREF_NORZ(thr,h) DUK_HEAPHDR_DECREF_NORZ_SLOW((thr),(h)) -#define DUK_HSTRING_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) (h)) -#define DUK_HSTRING_DECREF(thr,h) DUK_HSTRING_DECREF_SLOW((thr),(h)) -#define DUK_HSTRING_DECREF_NORZ(thr,h) DUK_HSTRING_DECREF_NORZ_SLOW((thr),(h)) -#define DUK_HOBJECT_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) (h)) -#define DUK_HOBJECT_DECREF(thr,h) DUK_HOBJECT_DECREF_SLOW((thr),(h)) -#define DUK_HOBJECT_DECREF_NORZ(thr,h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr),(h)) -#define DUK_HBUFFER_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) (h)) -#define DUK_HBUFFER_DECREF(thr,h) DUK_HBUFFER_DECREF_SLOW((thr),(h)) -#define DUK_HBUFFER_DECREF_NORZ(thr,h) DUK_HBUFFER_DECREF_NORZ_SLOW((thr),(h)) -#define DUK_HCOMPFUNC_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HCOMPFUNC_DECREF(thr,h) DUK_HOBJECT_DECREF_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HCOMPFUNC_DECREF_NORZ(thr,h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HNATFUNC_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HNATFUNC_DECREF(thr,h) DUK_HOBJECT_DECREF_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HNATFUNC_DECREF_NORZ(thr,h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HBUFOBJ_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HBUFOBJ_DECREF(thr,h) DUK_HOBJECT_DECREF_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HBUFOB_DECREF_NORZ(thr,h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HTHREAD_INCREF(thr,h) DUK_HEAPHDR_INCREF((thr),(duk_heaphdr *) &(h)->obj) -#define DUK_HTHREAD_DECREF(thr,h) DUK_HOBJECT_DECREF_SLOW((thr),(duk_hobject *) &(h)->obj) -#define DUK_HTHREAD_DECREF_NORZ(thr,h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr),(duk_hobject *) &(h)->obj) +#define DUK_TVAL_INCREF(thr, tv) DUK_TVAL_INCREF_SLOW((thr), (tv)) +#define DUK_TVAL_DECREF(thr, tv) DUK_TVAL_DECREF_SLOW((thr), (tv)) +#define DUK_TVAL_DECREF_NORZ(thr, tv) DUK_TVAL_DECREF_NORZ_SLOW((thr), (tv)) +#define DUK_HEAPHDR_INCREF(thr, h) DUK_HEAPHDR_INCREF_SLOW((thr), (h)) +#define DUK_HEAPHDR_DECREF(thr, h) DUK_HEAPHDR_DECREF_SLOW((thr), (h)) +#define DUK_HEAPHDR_DECREF_NORZ(thr, h) DUK_HEAPHDR_DECREF_NORZ_SLOW((thr), (h)) +#define DUK_HSTRING_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)) +#define DUK_HSTRING_DECREF(thr, h) DUK_HSTRING_DECREF_SLOW((thr), (h)) +#define DUK_HSTRING_DECREF_NORZ(thr, h) DUK_HSTRING_DECREF_NORZ_SLOW((thr), (h)) +#define DUK_HOBJECT_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)) +#define DUK_HOBJECT_DECREF(thr, h) DUK_HOBJECT_DECREF_SLOW((thr), (h)) +#define DUK_HOBJECT_DECREF_NORZ(thr, h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr), (h)) +#define DUK_HBUFFER_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)) +#define DUK_HBUFFER_DECREF(thr, h) DUK_HBUFFER_DECREF_SLOW((thr), (h)) +#define DUK_HBUFFER_DECREF_NORZ(thr, h) DUK_HBUFFER_DECREF_NORZ_SLOW((thr), (h)) +#define DUK_HCOMPFUNC_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HCOMPFUNC_DECREF(thr, h) DUK_HOBJECT_DECREF_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HCOMPFUNC_DECREF_NORZ(thr, h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HNATFUNC_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HNATFUNC_DECREF(thr, h) DUK_HOBJECT_DECREF_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HNATFUNC_DECREF_NORZ(thr, h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HBUFOBJ_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HBUFOBJ_DECREF(thr, h) DUK_HOBJECT_DECREF_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HBUFOB_DECREF_NORZ(thr, h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HTHREAD_INCREF(thr, h) DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) &(h)->obj) +#define DUK_HTHREAD_DECREF(thr, h) DUK_HOBJECT_DECREF_SLOW((thr), (duk_hobject *) &(h)->obj) +#define DUK_HTHREAD_DECREF_NORZ(thr, h) DUK_HOBJECT_DECREF_NORZ_SLOW((thr), (duk_hobject *) &(h)->obj) #endif /* Convenience for some situations; the above macros don't allow NULLs * for performance reasons. Macros cover only actually needed cases. */ -#define DUK_HEAPHDR_INCREF_ALLOWNULL(thr,h) do { \ +#define DUK_HEAPHDR_INCREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HEAPHDR_INCREF((thr), (duk_heaphdr *) (h)); \ } \ } while (0) -#define DUK_HEAPHDR_DECREF_ALLOWNULL(thr,h) do { \ +#define DUK_HEAPHDR_DECREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HEAPHDR_DECREF((thr), (duk_heaphdr *) (h)); \ } \ } while (0) -#define DUK_HEAPHDR_DECREF_NORZ_ALLOWNULL(thr,h) do { \ +#define DUK_HEAPHDR_DECREF_NORZ_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HEAPHDR_DECREF_NORZ((thr), (duk_heaphdr *) (h)); \ } \ } while (0) -#define DUK_HOBJECT_INCREF_ALLOWNULL(thr,h) do { \ +#define DUK_HOBJECT_INCREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HOBJECT_INCREF((thr), (h)); \ } \ } while (0) -#define DUK_HOBJECT_DECREF_ALLOWNULL(thr,h) do { \ +#define DUK_HOBJECT_DECREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HOBJECT_DECREF((thr), (h)); \ } \ } while (0) -#define DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr,h) do { \ +#define DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HOBJECT_DECREF_NORZ((thr), (h)); \ } \ } while (0) -#define DUK_HBUFFER_INCREF_ALLOWNULL(thr,h) do { \ +#define DUK_HBUFFER_INCREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HBUFFER_INCREF((thr), (h)); \ } \ } while (0) -#define DUK_HBUFFER_DECREF_ALLOWNULL(thr,h) do { \ +#define DUK_HBUFFER_DECREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HBUFFER_DECREF((thr), (h)); \ } \ } while (0) -#define DUK_HBUFFER_DECREF_NORZ_ALLOWNULL(thr,h) do { \ +#define DUK_HBUFFER_DECREF_NORZ_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HBUFFER_DECREF_NORZ((thr), (h)); \ } \ } while (0) -#define DUK_HTHREAD_INCREF_ALLOWNULL(thr,h) do { \ +#define DUK_HTHREAD_INCREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HTHREAD_INCREF((thr), (h)); \ } \ } while (0) -#define DUK_HTHREAD_DECREF_ALLOWNULL(thr,h) do { \ +#define DUK_HTHREAD_DECREF_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HTHREAD_DECREF((thr), (h)); \ } \ } while (0) -#define DUK_HTHREAD_DECREF_NORZ_ALLOWNULL(thr,h) do { \ +#define DUK_HTHREAD_DECREF_NORZ_ALLOWNULL(thr, h) \ + do { \ if ((h) != NULL) { \ DUK_HTHREAD_DECREF_NORZ((thr), (h)); \ } \ @@ -4999,16 +5177,22 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); * variant is performance critical. */ #if defined(DUK_USE_FINALIZER_SUPPORT) -#define DUK_REFZERO_CHECK_FAST(thr) do { \ +#define DUK_REFZERO_CHECK_FAST(thr) \ + do { \ duk_refzero_check_fast((thr)); \ } while (0) -#define DUK_REFZERO_CHECK_SLOW(thr) do { \ +#define DUK_REFZERO_CHECK_SLOW(thr) \ + do { \ duk_refzero_check_slow((thr)); \ } while (0) -#else /* DUK_USE_FINALIZER_SUPPORT */ -#define DUK_REFZERO_CHECK_FAST(thr) do { } while (0) -#define DUK_REFZERO_CHECK_SLOW(thr) do { } while (0) -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#else /* DUK_USE_FINALIZER_SUPPORT */ +#define DUK_REFZERO_CHECK_FAST(thr) \ + do { \ + } while (0) +#define DUK_REFZERO_CHECK_SLOW(thr) \ + do { \ + } while (0) +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * Macros to set a duk_tval and update refcount of the target (decref the @@ -5016,125 +5200,176 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); * and footprint critical; any changes made should be measured for size/speed. */ -#define DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_UNDEFINED(tv__dst); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_UNDEFINED(tv__dst); \ DUK_TVAL_DECREF_NORZ((thr), &tv__tmp); \ } while (0) -#define DUK_TVAL_SET_UNUSED_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_UNUSED_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_UNUSED(tv__dst); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_NULL_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NULL_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_NULL(tv__dst); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_BOOLEAN(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_NUMBER_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NUMBER_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_NUMBER(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_DOUBLE_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_DOUBLE_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_DOUBLE(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_NAN_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NAN_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_NAN(tv__dst); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_SET_I48_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_I48_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_I48(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_I32_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_I32_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_I32(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_U32_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_U32_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_U32(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) #else -#define DUK_TVAL_SET_DOUBLE_CAST_UPDREF(thr,tvptr_dst,newval) \ +#define DUK_TVAL_SET_DOUBLE_CAST_UPDREF(thr, tvptr_dst, newval) \ DUK_TVAL_SET_DOUBLE_UPDREF((thr), (tvptr_dst), (duk_double_t) (newval)) -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0(thr,tvptr_dst,lf_v,lf_fp,lf_flags) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0(thr, tvptr_dst, lf_v, lf_fp, lf_flags) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_LIGHTFUNC(tv__dst, (lf_v), (lf_fp), (lf_flags)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_STRING_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_STRING_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_STRING(tv__dst, (newval)); \ DUK_HSTRING_INCREF((thr), (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_OBJECT_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_OBJECT_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_OBJECT(tv__dst, (newval)); \ DUK_HOBJECT_INCREF((thr), (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_BUFFER_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_BUFFER_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_BUFFER(tv__dst, (newval)); \ DUK_HBUFFER_INCREF((thr), (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) -#define DUK_TVAL_SET_POINTER_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; duk_tval tv__tmp; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_POINTER_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_POINTER(tv__dst, (newval)); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) /* DUK_TVAL_SET_TVAL_UPDREF() is used a lot in executor, property lookups, @@ -5145,281 +5380,452 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); */ /* Original idiom used, minimal code size. */ -#define DUK_TVAL_SET_TVAL_UPDREF_ALT0(thr,tvptr_dst,tvptr_src) do { \ - duk_tval *tv__dst, *tv__src; duk_tval tv__tmp; \ - tv__dst = (tvptr_dst); tv__src = (tvptr_src); \ +#define DUK_TVAL_SET_TVAL_UPDREF_ALT0(thr, tvptr_dst, tvptr_src) \ + do { \ + duk_tval *tv__dst, *tv__src; \ + duk_tval tv__tmp; \ + tv__dst = (tvptr_dst); \ + tv__src = (tvptr_src); \ DUK_TVAL_SET_TVAL(&tv__tmp, tv__dst); \ DUK_TVAL_SET_TVAL(tv__dst, tv__src); \ DUK_TVAL_INCREF((thr), tv__src); \ - DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ + DUK_TVAL_DECREF((thr), &tv__tmp); /* side effects */ \ } while (0) /* Faster alternative: avoid making a temporary copy of tvptr_dst and use * fast incref/decref macros. */ -#define DUK_TVAL_SET_TVAL_UPDREF_ALT1(thr,tvptr_dst,tvptr_src) do { \ - duk_tval *tv__dst, *tv__src; duk_heaphdr *h__obj; \ - tv__dst = (tvptr_dst); tv__src = (tvptr_src); \ +#define DUK_TVAL_SET_TVAL_UPDREF_ALT1(thr, tvptr_dst, tvptr_src) \ + do { \ + duk_tval *tv__dst, *tv__src; \ + duk_heaphdr *h__obj; \ + tv__dst = (tvptr_dst); \ + tv__src = (tvptr_src); \ DUK_TVAL_INCREF_FAST((thr), tv__src); \ if (DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv__dst)) { \ h__obj = DUK_TVAL_GET_HEAPHDR(tv__dst); \ DUK_ASSERT(h__obj != NULL); \ DUK_TVAL_SET_TVAL(tv__dst, tv__src); \ - DUK_HEAPHDR_DECREF_FAST((thr), h__obj); /* side effects */ \ + DUK_HEAPHDR_DECREF_FAST((thr), h__obj); /* side effects */ \ } else { \ DUK_TVAL_SET_TVAL(tv__dst, tv__src); \ } \ } while (0) /* XXX: no optimized variants yet */ -#define DUK_TVAL_SET_UNDEFINED_UPDREF DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0 -#define DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ_ALT0 -#define DUK_TVAL_SET_UNUSED_UPDREF DUK_TVAL_SET_UNUSED_UPDREF_ALT0 -#define DUK_TVAL_SET_NULL_UPDREF DUK_TVAL_SET_NULL_UPDREF_ALT0 -#define DUK_TVAL_SET_BOOLEAN_UPDREF DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0 -#define DUK_TVAL_SET_NUMBER_UPDREF DUK_TVAL_SET_NUMBER_UPDREF_ALT0 -#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0 -#define DUK_TVAL_SET_DOUBLE_UPDREF DUK_TVAL_SET_DOUBLE_UPDREF_ALT0 -#define DUK_TVAL_SET_NAN_UPDREF DUK_TVAL_SET_NAN_UPDREF_ALT0 +#define DUK_TVAL_SET_UNDEFINED_UPDREF DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0 +#define DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ_ALT0 +#define DUK_TVAL_SET_UNUSED_UPDREF DUK_TVAL_SET_UNUSED_UPDREF_ALT0 +#define DUK_TVAL_SET_NULL_UPDREF DUK_TVAL_SET_NULL_UPDREF_ALT0 +#define DUK_TVAL_SET_BOOLEAN_UPDREF DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0 +#define DUK_TVAL_SET_NUMBER_UPDREF DUK_TVAL_SET_NUMBER_UPDREF_ALT0 +#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0 +#define DUK_TVAL_SET_DOUBLE_UPDREF DUK_TVAL_SET_DOUBLE_UPDREF_ALT0 +#define DUK_TVAL_SET_NAN_UPDREF DUK_TVAL_SET_NAN_UPDREF_ALT0 #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_I48_UPDREF_ALT0 -#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_I32_UPDREF_ALT0 -#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_U32_UPDREF_ALT0 +#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_I48_UPDREF_ALT0 +#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_I32_UPDREF_ALT0 +#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_U32_UPDREF_ALT0 #else -#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF /* XXX: fast int-to-double */ -#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF -#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF -#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_FASTINT_UPDREF DUK_TVAL_SET_I48_UPDREF /* convenience */ -#define DUK_TVAL_SET_LIGHTFUNC_UPDREF DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0 -#define DUK_TVAL_SET_STRING_UPDREF DUK_TVAL_SET_STRING_UPDREF_ALT0 -#define DUK_TVAL_SET_OBJECT_UPDREF DUK_TVAL_SET_OBJECT_UPDREF_ALT0 -#define DUK_TVAL_SET_BUFFER_UPDREF DUK_TVAL_SET_BUFFER_UPDREF_ALT0 -#define DUK_TVAL_SET_POINTER_UPDREF DUK_TVAL_SET_POINTER_UPDREF_ALT0 +#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF /* XXX: fast int-to-double */ +#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF +#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF +#endif /* DUK_USE_FASTINT */ +#define DUK_TVAL_SET_FASTINT_UPDREF DUK_TVAL_SET_I48_UPDREF /* convenience */ +#define DUK_TVAL_SET_LIGHTFUNC_UPDREF DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0 +#define DUK_TVAL_SET_STRING_UPDREF DUK_TVAL_SET_STRING_UPDREF_ALT0 +#define DUK_TVAL_SET_OBJECT_UPDREF DUK_TVAL_SET_OBJECT_UPDREF_ALT0 +#define DUK_TVAL_SET_BUFFER_UPDREF DUK_TVAL_SET_BUFFER_UPDREF_ALT0 +#define DUK_TVAL_SET_POINTER_UPDREF DUK_TVAL_SET_POINTER_UPDREF_ALT0 #if defined(DUK_USE_FAST_REFCOUNT_DEFAULT) /* Optimized for speed. */ -#define DUK_TVAL_SET_TVAL_UPDREF DUK_TVAL_SET_TVAL_UPDREF_ALT1 -#define DUK_TVAL_SET_TVAL_UPDREF_FAST DUK_TVAL_SET_TVAL_UPDREF_ALT1 -#define DUK_TVAL_SET_TVAL_UPDREF_SLOW DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF DUK_TVAL_SET_TVAL_UPDREF_ALT1 +#define DUK_TVAL_SET_TVAL_UPDREF_FAST DUK_TVAL_SET_TVAL_UPDREF_ALT1 +#define DUK_TVAL_SET_TVAL_UPDREF_SLOW DUK_TVAL_SET_TVAL_UPDREF_ALT0 #else /* Optimized for size. */ -#define DUK_TVAL_SET_TVAL_UPDREF DUK_TVAL_SET_TVAL_UPDREF_ALT0 -#define DUK_TVAL_SET_TVAL_UPDREF_FAST DUK_TVAL_SET_TVAL_UPDREF_ALT0 -#define DUK_TVAL_SET_TVAL_UPDREF_SLOW DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF_FAST DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF_SLOW DUK_TVAL_SET_TVAL_UPDREF_ALT0 #endif -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ -#define DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv) 0 -#define DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(h) 0 +#define DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv) 0 +#define DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE(h) 0 -#define DUK_TVAL_INCREF_FAST(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_DECREF_FAST(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_DECREF_NORZ_FAST(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_INCREF_SLOW(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_DECREF_SLOW(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_DECREF_NORZ_SLOW(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_INCREF(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_DECREF(thr,v) do {} while (0) /* nop */ -#define DUK_TVAL_DECREF_NORZ(thr,v) do {} while (0) /* nop */ -#define DUK_HEAPHDR_INCREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_DECREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_DECREF_NORZ_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_INCREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_DECREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_DECREF_NORZ_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HEAPHDR_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_INCREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_DECREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_DECREF_NORZ_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_INCREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_DECREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_DECREF_NORZ_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HSTRING_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_INCREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_NORZ_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_INCREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_NORZ_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_INCREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_NORZ_FAST(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_INCREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_NORZ_SLOW(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_NORZ(thr,h) do {} while (0) /* nop */ +#define DUK_TVAL_INCREF_FAST(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_DECREF_FAST(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_DECREF_NORZ_FAST(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_INCREF_SLOW(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_DECREF_SLOW(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_DECREF_NORZ_SLOW(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_INCREF(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_DECREF(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_TVAL_DECREF_NORZ(thr, v) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_INCREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_DECREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_DECREF_NORZ_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_INCREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_DECREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_DECREF_NORZ_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HEAPHDR_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_INCREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_DECREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_DECREF_NORZ_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_INCREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_DECREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_DECREF_NORZ_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HSTRING_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_INCREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_NORZ_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_INCREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_NORZ_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_INCREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_NORZ_FAST(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_INCREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_NORZ_SLOW(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ -#define DUK_HCOMPFUNC_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HCOMPFUNC_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HCOMPFUNC_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HNATFUNC_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HNATFUNC_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HNATFUNC_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFOBJ_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFOBJ_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFOBJ_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HTHREAD_INCREF(thr,h) do {} while (0) /* nop */ -#define DUK_HTHREAD_DECREF(thr,h) do {} while (0) /* nop */ -#define DUK_HTHREAD_DECREF_NORZ(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_INCREF_ALLOWNULL(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_ALLOWNULL(thr,h) do {} while (0) /* nop */ -#define DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_INCREF_ALLOWNULL(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_ALLOWNULL(thr,h) do {} while (0) /* nop */ -#define DUK_HBUFFER_DECREF_NORZ_ALLOWNULL(thr,h) do {} while (0) /* nop */ +#define DUK_HCOMPFUNC_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HCOMPFUNC_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HCOMPFUNC_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HNATFUNC_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HNATFUNC_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HNATFUNC_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFOBJ_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFOBJ_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFOBJ_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HTHREAD_INCREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HTHREAD_DECREF(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HTHREAD_DECREF_NORZ(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_INCREF_ALLOWNULL(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_ALLOWNULL(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_INCREF_ALLOWNULL(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_ALLOWNULL(thr, h) \ + do { \ + } while (0) /* nop */ +#define DUK_HBUFFER_DECREF_NORZ_ALLOWNULL(thr, h) \ + do { \ + } while (0) /* nop */ -#define DUK_REFZERO_CHECK_FAST(thr) do {} while (0) /* nop */ -#define DUK_REFZERO_CHECK_SLOW(thr) do {} while (0) /* nop */ +#define DUK_REFZERO_CHECK_FAST(thr) \ + do { \ + } while (0) /* nop */ +#define DUK_REFZERO_CHECK_SLOW(thr) \ + do { \ + } while (0) /* nop */ -#define DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_UNDEFINED(tv__dst); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_UNUSED_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_UNUSED_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_UNUSED(tv__dst); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_NULL_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NULL_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_NULL(tv__dst); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_BOOLEAN(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_NUMBER_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NUMBER_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_NUMBER(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_NUMBER_CHKFAST_FAST(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_DOUBLE_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_DOUBLE_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_DOUBLE(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_NAN_UPDREF_ALT0(thr,tvptr_dst) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_NAN_UPDREF_ALT0(thr, tvptr_dst) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_NAN(tv__dst); \ DUK_UNREF((thr)); \ } while (0) #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_SET_I48_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_I48_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_I48(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_I32_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_I32_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_I32(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_U32_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_U32_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_U32(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) #else -#define DUK_TVAL_SET_DOUBLE_CAST_UPDREF(thr,tvptr_dst,newval) \ +#define DUK_TVAL_SET_DOUBLE_CAST_UPDREF(thr, tvptr_dst, newval) \ DUK_TVAL_SET_DOUBLE_UPDREF((thr), (tvptr_dst), (duk_double_t) (newval)) -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0(thr,tvptr_dst,lf_v,lf_fp,lf_flags) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0(thr, tvptr_dst, lf_v, lf_fp, lf_flags) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_LIGHTFUNC(tv__dst, (lf_v), (lf_fp), (lf_flags)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_STRING_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_STRING_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_STRING(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_OBJECT_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_OBJECT_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_OBJECT(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_BUFFER_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_BUFFER_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_BUFFER(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_POINTER_UPDREF_ALT0(thr,tvptr_dst,newval) do { \ - duk_tval *tv__dst; tv__dst = (tvptr_dst); \ +#define DUK_TVAL_SET_POINTER_UPDREF_ALT0(thr, tvptr_dst, newval) \ + do { \ + duk_tval *tv__dst; \ + tv__dst = (tvptr_dst); \ DUK_TVAL_SET_POINTER(tv__dst, (newval)); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_TVAL_UPDREF_ALT0(thr,tvptr_dst,tvptr_src) do { \ +#define DUK_TVAL_SET_TVAL_UPDREF_ALT0(thr, tvptr_dst, tvptr_src) \ + do { \ duk_tval *tv__dst, *tv__src; \ - tv__dst = (tvptr_dst); tv__src = (tvptr_src); \ + tv__dst = (tvptr_dst); \ + tv__src = (tvptr_src); \ DUK_TVAL_SET_TVAL(tv__dst, tv__src); \ DUK_UNREF((thr)); \ } while (0) -#define DUK_TVAL_SET_UNDEFINED_UPDREF DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0 -#define DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0 -#define DUK_TVAL_SET_UNUSED_UPDREF DUK_TVAL_SET_UNUSED_UPDREF_ALT0 -#define DUK_TVAL_SET_NULL_UPDREF DUK_TVAL_SET_NULL_UPDREF_ALT0 -#define DUK_TVAL_SET_BOOLEAN_UPDREF DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0 -#define DUK_TVAL_SET_NUMBER_UPDREF DUK_TVAL_SET_NUMBER_UPDREF_ALT0 -#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0 -#define DUK_TVAL_SET_DOUBLE_UPDREF DUK_TVAL_SET_DOUBLE_UPDREF_ALT0 -#define DUK_TVAL_SET_NAN_UPDREF DUK_TVAL_SET_NAN_UPDREF_ALT0 +#define DUK_TVAL_SET_UNDEFINED_UPDREF DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0 +#define DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ DUK_TVAL_SET_UNDEFINED_UPDREF_ALT0 +#define DUK_TVAL_SET_UNUSED_UPDREF DUK_TVAL_SET_UNUSED_UPDREF_ALT0 +#define DUK_TVAL_SET_NULL_UPDREF DUK_TVAL_SET_NULL_UPDREF_ALT0 +#define DUK_TVAL_SET_BOOLEAN_UPDREF DUK_TVAL_SET_BOOLEAN_UPDREF_ALT0 +#define DUK_TVAL_SET_NUMBER_UPDREF DUK_TVAL_SET_NUMBER_UPDREF_ALT0 +#define DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF_ALT0 +#define DUK_TVAL_SET_DOUBLE_UPDREF DUK_TVAL_SET_DOUBLE_UPDREF_ALT0 +#define DUK_TVAL_SET_NAN_UPDREF DUK_TVAL_SET_NAN_UPDREF_ALT0 #if defined(DUK_USE_FASTINT) -#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_I48_UPDREF_ALT0 -#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_I32_UPDREF_ALT0 -#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_U32_UPDREF_ALT0 +#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_I48_UPDREF_ALT0 +#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_I32_UPDREF_ALT0 +#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_U32_UPDREF_ALT0 #else -#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF /* XXX: fast-int-to-double */ -#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF -#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF -#endif /* DUK_USE_FASTINT */ -#define DUK_TVAL_SET_FASTINT_UPDREF DUK_TVAL_SET_I48_UPDREF /* convenience */ -#define DUK_TVAL_SET_LIGHTFUNC_UPDREF DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0 -#define DUK_TVAL_SET_STRING_UPDREF DUK_TVAL_SET_STRING_UPDREF_ALT0 -#define DUK_TVAL_SET_OBJECT_UPDREF DUK_TVAL_SET_OBJECT_UPDREF_ALT0 -#define DUK_TVAL_SET_BUFFER_UPDREF DUK_TVAL_SET_BUFFER_UPDREF_ALT0 -#define DUK_TVAL_SET_POINTER_UPDREF DUK_TVAL_SET_POINTER_UPDREF_ALT0 +#define DUK_TVAL_SET_I48_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF /* XXX: fast-int-to-double */ +#define DUK_TVAL_SET_I32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF +#define DUK_TVAL_SET_U32_UPDREF DUK_TVAL_SET_DOUBLE_CAST_UPDREF +#endif /* DUK_USE_FASTINT */ +#define DUK_TVAL_SET_FASTINT_UPDREF DUK_TVAL_SET_I48_UPDREF /* convenience */ +#define DUK_TVAL_SET_LIGHTFUNC_UPDREF DUK_TVAL_SET_LIGHTFUNC_UPDREF_ALT0 +#define DUK_TVAL_SET_STRING_UPDREF DUK_TVAL_SET_STRING_UPDREF_ALT0 +#define DUK_TVAL_SET_OBJECT_UPDREF DUK_TVAL_SET_OBJECT_UPDREF_ALT0 +#define DUK_TVAL_SET_BUFFER_UPDREF DUK_TVAL_SET_BUFFER_UPDREF_ALT0 +#define DUK_TVAL_SET_POINTER_UPDREF DUK_TVAL_SET_POINTER_UPDREF_ALT0 -#define DUK_TVAL_SET_TVAL_UPDREF DUK_TVAL_SET_TVAL_UPDREF_ALT0 -#define DUK_TVAL_SET_TVAL_UPDREF_FAST DUK_TVAL_SET_TVAL_UPDREF_ALT0 -#define DUK_TVAL_SET_TVAL_UPDREF_SLOW DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF_FAST DUK_TVAL_SET_TVAL_UPDREF_ALT0 +#define DUK_TVAL_SET_TVAL_UPDREF_SLOW DUK_TVAL_SET_TVAL_UPDREF_ALT0 -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ /* * Some convenience macros that don't have optimized implementations now. */ -#define DUK_TVAL_SET_TVAL_UPDREF_NORZ(thr,tv_dst,tv_src) do { \ +#define DUK_TVAL_SET_TVAL_UPDREF_NORZ(thr, tv_dst, tv_src) \ + do { \ duk_hthread *duk__thr = (thr); \ duk_tval *duk__dst = (tv_dst); \ duk_tval *duk__src = (tv_src); \ @@ -5429,7 +5835,8 @@ DUK_INTERNAL_DECL void duk_heaphdr_assert_valid(duk_heaphdr *h); DUK_TVAL_INCREF(thr, duk__dst); \ } while (0) -#define DUK_TVAL_SET_U32_UPDREF_NORZ(thr,tv_dst,val) do { \ +#define DUK_TVAL_SET_U32_UPDREF_NORZ(thr, tv_dst, val) \ + do { \ duk_hthread *duk__thr = (thr); \ duk_tval *duk__dst = (tv_dst); \ duk_uint32_t duk__val = (duk_uint32_t) (val); \ @@ -5449,7 +5856,7 @@ DUK_INTERNAL_DECL void duk_refzero_check_fast(duk_hthread *thr); #endif DUK_INTERNAL_DECL void duk_heaphdr_refcount_finalize_norz(duk_heap *heap, duk_heaphdr *hdr); DUK_INTERNAL_DECL void duk_hobject_refcount_finalize_norz(duk_heap *heap, duk_hobject *h); -#if 0 /* Not needed: fast path handles inline; slow path uses duk_heaphdr_decref() which is needed anyway. */ +#if 0 /* Not needed: fast path handles inline; slow path uses duk_heaphdr_decref() which is needed anyway. */ DUK_INTERNAL_DECL void duk_hstring_decref(duk_hthread *thr, duk_hstring *h); DUK_INTERNAL_DECL void duk_hstring_decref_norz(duk_hthread *thr, duk_hstring *h); DUK_INTERNAL_DECL void duk_hbuffer_decref(duk_hthread *thr, duk_hbuffer *h); @@ -5460,8 +5867,8 @@ DUK_INTERNAL_DECL void duk_hobject_decref_norz(duk_hthread *thr, duk_hobject *h) DUK_INTERNAL_DECL void duk_heaphdr_refzero(duk_hthread *thr, duk_heaphdr *h); DUK_INTERNAL_DECL void duk_heaphdr_refzero_norz(duk_hthread *thr, duk_heaphdr *h); #if defined(DUK_USE_FAST_REFCOUNT_DEFAULT) -DUK_INTERNAL_DECL void duk_hstring_refzero(duk_hthread *thr, duk_hstring *h); /* no 'norz' variant */ -DUK_INTERNAL_DECL void duk_hbuffer_refzero(duk_hthread *thr, duk_hbuffer *h); /* no 'norz' variant */ +DUK_INTERNAL_DECL void duk_hstring_refzero(duk_hthread *thr, duk_hstring *h); /* no 'norz' variant */ +DUK_INTERNAL_DECL void duk_hbuffer_refzero(duk_hthread *thr, duk_hbuffer *h); /* no 'norz' variant */ DUK_INTERNAL_DECL void duk_hobject_refzero(duk_hthread *thr, duk_hobject *h); DUK_INTERNAL_DECL void duk_hobject_refzero_norz(duk_hthread *thr, duk_hobject *h); #else @@ -5472,11 +5879,11 @@ DUK_INTERNAL_DECL void duk_heaphdr_incref(duk_heaphdr *h); DUK_INTERNAL_DECL void duk_heaphdr_decref(duk_hthread *thr, duk_heaphdr *h); DUK_INTERNAL_DECL void duk_heaphdr_decref_norz(duk_hthread *thr, duk_heaphdr *h); #endif -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ /* no refcounting */ -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ -#endif /* DUK_REFCOUNT_H_INCLUDED */ +#endif /* DUK_REFCOUNT_H_INCLUDED */ /* #include duk_api_internal.h */ /* * Internal API calls which have (stack and other) semantics similar @@ -5492,9 +5899,9 @@ DUK_INTERNAL_DECL void duk_heaphdr_decref_norz(duk_hthread *thr, duk_heaphdr *h) #define DUK_ALWAYS_INLINE_PERF #define DUK_NOINLINE_PERF #else -#define DUK_INLINE_PERF DUK_INLINE +#define DUK_INLINE_PERF DUK_INLINE #define DUK_ALWAYS_INLINE_PERF DUK_ALWAYS_INLINE -#define DUK_NOINLINE_PERF DUK_NOINLINE +#define DUK_NOINLINE_PERF DUK_NOINLINE #endif /* Inline macro helpers, for bytecode executor. */ @@ -5503,19 +5910,19 @@ DUK_INTERNAL_DECL void duk_heaphdr_decref_norz(duk_hthread *thr, duk_heaphdr *h) #define DUK_EXEC_ALWAYS_INLINE_PERF #define DUK_EXEC_NOINLINE_PERF #else -#define DUK_EXEC_INLINE_PERF DUK_INLINE +#define DUK_EXEC_INLINE_PERF DUK_INLINE #define DUK_EXEC_ALWAYS_INLINE_PERF DUK_ALWAYS_INLINE -#define DUK_EXEC_NOINLINE_PERF DUK_NOINLINE +#define DUK_EXEC_NOINLINE_PERF DUK_NOINLINE #endif /* duk_push_sprintf constants */ -#define DUK_PUSH_SPRINTF_INITIAL_SIZE 256L -#define DUK_PUSH_SPRINTF_SANITY_LIMIT (1L * 1024L * 1024L * 1024L) +#define DUK_PUSH_SPRINTF_INITIAL_SIZE 256L +#define DUK_PUSH_SPRINTF_SANITY_LIMIT (1L * 1024L * 1024L * 1024L) /* Flag ORed to err_code to indicate __FILE__ / __LINE__ is not * blamed as source of error for error fileName / lineNumber. */ -#define DUK_ERRCODE_FLAG_NOBLAME_FILELINE (1L << 24) +#define DUK_ERRCODE_FLAG_NOBLAME_FILELINE (1L << 24) /* Current convention is to use duk_size_t for value stack sizes and global indices, * and duk_idx_t for local frame indices. @@ -5577,24 +5984,17 @@ DUK_INTERNAL_DECL duk_hstring *duk_push_uint_to_hstring(duk_hthread *thr, duk_ui DUK_INTERNAL_DECL duk_tval *duk_get_borrowed_this_tval(duk_hthread *thr); /* XXX: add fastint support? */ -#define duk_push_u64(thr,val) \ - duk_push_number((thr), (duk_double_t) (val)) -#define duk_push_i64(thr,val) \ - duk_push_number((thr), (duk_double_t) (val)) +#define duk_push_u64(thr, val) duk_push_number((thr), (duk_double_t) (val)) +#define duk_push_i64(thr, val) duk_push_number((thr), (duk_double_t) (val)) /* duk_push_(u)int() is guaranteed to support at least (un)signed 32-bit range */ -#define duk_push_u32(thr,val) \ - duk_push_uint((thr), (duk_uint_t) (val)) -#define duk_push_i32(thr,val) \ - duk_push_int((thr), (duk_int_t) (val)) +#define duk_push_u32(thr, val) duk_push_uint((thr), (duk_uint_t) (val)) +#define duk_push_i32(thr, val) duk_push_int((thr), (duk_int_t) (val)) /* sometimes stack and array indices need to go on the stack */ -#define duk_push_idx(thr,val) \ - duk_push_int((thr), (duk_int_t) (val)) -#define duk_push_uarridx(thr,val) \ - duk_push_uint((thr), (duk_uint_t) (val)) -#define duk_push_size_t(thr,val) \ - duk_push_uint((thr), (duk_uint_t) (val)) /* XXX: assumed to fit for now */ +#define duk_push_idx(thr, val) duk_push_int((thr), (duk_int_t) (val)) +#define duk_push_uarridx(thr, val) duk_push_uint((thr), (duk_uint_t) (val)) +#define duk_push_size_t(thr, val) duk_push_uint((thr), (duk_uint_t) (val)) /* XXX: assumed to fit for now */ DUK_INTERNAL_DECL duk_bool_t duk_is_string_notsymbol(duk_hthread *thr, duk_idx_t idx); @@ -5611,19 +6011,23 @@ DUK_INTERNAL_DECL duk_hthread *duk_get_hthread(duk_hthread *thr, duk_idx_t idx); DUK_INTERNAL_DECL duk_hcompfunc *duk_get_hcompfunc(duk_hthread *thr, duk_idx_t idx); DUK_INTERNAL_DECL duk_hnatfunc *duk_get_hnatfunc(duk_hthread *thr, duk_idx_t idx); -DUK_INTERNAL_DECL void *duk_get_buffer_data_raw(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_size, void *def_ptr, duk_size_t def_len, duk_bool_t throw_flag, duk_bool_t *out_isbuffer); +DUK_INTERNAL_DECL void *duk_get_buffer_data_raw(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_size, + void *def_ptr, + duk_size_t def_len, + duk_bool_t throw_flag, + duk_bool_t *out_isbuffer); DUK_INTERNAL_DECL duk_hobject *duk_get_hobject_with_class(duk_hthread *thr, duk_idx_t idx, duk_small_uint_t classnum); DUK_INTERNAL_DECL duk_hobject *duk_get_hobject_promote_mask(duk_hthread *thr, duk_idx_t idx, duk_uint_t type_mask); DUK_INTERNAL_DECL duk_hobject *duk_require_hobject_promote_mask(duk_hthread *thr, duk_idx_t idx, duk_uint_t type_mask); DUK_INTERNAL_DECL duk_hobject *duk_require_hobject_accept_mask(duk_hthread *thr, duk_idx_t idx, duk_uint_t type_mask); -#define duk_require_hobject_promote_lfunc(thr,idx) \ - duk_require_hobject_promote_mask((thr), (idx), DUK_TYPE_MASK_LIGHTFUNC) -#define duk_get_hobject_promote_lfunc(thr,idx) \ - duk_get_hobject_promote_mask((thr), (idx), DUK_TYPE_MASK_LIGHTFUNC) +#define duk_require_hobject_promote_lfunc(thr, idx) duk_require_hobject_promote_mask((thr), (idx), DUK_TYPE_MASK_LIGHTFUNC) +#define duk_get_hobject_promote_lfunc(thr, idx) duk_get_hobject_promote_mask((thr), (idx), DUK_TYPE_MASK_LIGHTFUNC) -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL_DECL void *duk_get_voidptr(duk_hthread *thr, duk_idx_t idx); #endif @@ -5646,12 +6050,16 @@ DUK_INTERNAL_DECL duk_double_t duk_to_number_m2(duk_hthread *thr); DUK_INTERNAL_DECL duk_bool_t duk_to_boolean_top_pop(duk_hthread *thr); -#if defined(DUK_USE_DEBUGGER_SUPPORT) /* only needed by debugger for now */ +#if defined(DUK_USE_DEBUGGER_SUPPORT) /* only needed by debugger for now */ DUK_INTERNAL_DECL duk_hstring *duk_safe_to_hstring(duk_hthread *thr, duk_idx_t idx); #endif DUK_INTERNAL_DECL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk_bool_t avoid_side_effects); -DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped_raw(duk_hthread *thr, duk_idx_t idx, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped); /* out_clamped=NULL, RangeError if outside range */ +DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped_raw(duk_hthread *thr, + duk_idx_t idx, + duk_int_t minval, + duk_int_t maxval, + duk_bool_t *out_clamped); /* out_clamped=NULL, RangeError if outside range */ DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped(duk_hthread *thr, duk_idx_t idx, duk_int_t minval, duk_int_t maxval); DUK_INTERNAL_DECL duk_int_t duk_to_int_check_range(duk_hthread *thr, duk_idx_t idx, duk_int_t minval, duk_int_t maxval); #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) @@ -5676,13 +6084,15 @@ DUK_INTERNAL_DECL void duk_push_hstring_stridx(duk_hthread *thr, duk_small_uint_ DUK_INTERNAL_DECL void duk_push_hstring_empty(duk_hthread *thr); DUK_INTERNAL_DECL void duk_push_hobject(duk_hthread *thr, duk_hobject *h); DUK_INTERNAL_DECL void duk_push_hbuffer(duk_hthread *thr, duk_hbuffer *h); -#define duk_push_hthread(thr,h) \ - duk_push_hobject((thr), (duk_hobject *) (h)) -#define duk_push_hnatfunc(thr,h) \ - duk_push_hobject((thr), (duk_hobject *) (h)) +#define duk_push_hthread(thr, h) duk_push_hobject((thr), (duk_hobject *) (h)) +#define duk_push_hnatfunc(thr, h) duk_push_hobject((thr), (duk_hobject *) (h)) DUK_INTERNAL_DECL void duk_push_hobject_bidx(duk_hthread *thr, duk_small_int_t builtin_idx); -DUK_INTERNAL_DECL duk_hobject *duk_push_object_helper(duk_hthread *thr, duk_uint_t hobject_flags_and_class, duk_small_int_t prototype_bidx); -DUK_INTERNAL_DECL duk_hobject *duk_push_object_helper_proto(duk_hthread *thr, duk_uint_t hobject_flags_and_class, duk_hobject *proto); +DUK_INTERNAL_DECL duk_hobject *duk_push_object_helper(duk_hthread *thr, + duk_uint_t hobject_flags_and_class, + duk_small_int_t prototype_bidx); +DUK_INTERNAL_DECL duk_hobject *duk_push_object_helper_proto(duk_hthread *thr, + duk_uint_t hobject_flags_and_class, + duk_hobject *proto); DUK_INTERNAL_DECL duk_hcompfunc *duk_push_hcompfunc(duk_hthread *thr); DUK_INTERNAL_DECL duk_hboundfunc *duk_push_hboundfunc(duk_hthread *thr); DUK_INTERNAL_DECL void duk_push_c_function_builtin(duk_hthread *thr, duk_c_function func, duk_int_t nargs); @@ -5699,11 +6109,13 @@ DUK_INTERNAL_DECL void duk_push_string_funcptr(duk_hthread *thr, duk_uint8_t *pt DUK_INTERNAL_DECL void duk_push_lightfunc_name_raw(duk_hthread *thr, duk_c_function func, duk_small_uint_t lf_flags); DUK_INTERNAL_DECL void duk_push_lightfunc_name(duk_hthread *thr, duk_tval *tv); DUK_INTERNAL_DECL void duk_push_lightfunc_tostring(duk_hthread *thr, duk_tval *tv); -#if 0 /* not used yet */ +#if 0 /* not used yet */ DUK_INTERNAL_DECL void duk_push_hnatfunc_name(duk_hthread *thr, duk_hnatfunc *h); #endif #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -DUK_INTERNAL_DECL duk_hbufobj *duk_push_bufobj_raw(duk_hthread *thr, duk_uint_t hobject_flags_and_class, duk_small_int_t prototype_bidx); +DUK_INTERNAL_DECL duk_hbufobj *duk_push_bufobj_raw(duk_hthread *thr, + duk_uint_t hobject_flags_and_class, + duk_small_int_t prototype_bidx); #endif DUK_INTERNAL_DECL void *duk_push_fixed_buffer_nozero(duk_hthread *thr, duk_size_t len); @@ -5720,80 +6132,86 @@ DUK_INTERNAL_DECL const char *duk_push_string_tval_readable_error(duk_hthread *t * arguments and such call sites are also easiest to verify to be correct. */ -DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [val] */ +DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [val] */ DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args); -#define duk_get_prop_stridx_short(thr,obj_idx,stridx) \ +#define duk_get_prop_stridx_short(thr, obj_idx, stridx) \ (DUK_ASSERT_EXPR((duk_int_t) (obj_idx) >= -0x8000L && (duk_int_t) (obj_idx) <= 0x7fffL), \ DUK_ASSERT_EXPR((duk_int_t) (stridx) >= 0 && (duk_int_t) (stridx) <= 0xffffL), \ duk_get_prop_stridx_short_raw((thr), (((duk_uint_t) (obj_idx)) << 16) + ((duk_uint_t) (stridx)))) -DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx_boolean(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx, duk_bool_t *out_has_prop); /* [] -> [] */ +DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx_boolean(duk_hthread *thr, + duk_idx_t obj_idx, + duk_small_uint_t stridx, + duk_bool_t *out_has_prop); /* [] -> [] */ DUK_INTERNAL_DECL duk_bool_t duk_xget_owndataprop(duk_hthread *thr, duk_idx_t obj_idx); DUK_INTERNAL_DECL duk_bool_t duk_xget_owndataprop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); DUK_INTERNAL_DECL duk_bool_t duk_xget_owndataprop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args); -#define duk_xget_owndataprop_stridx_short(thr,obj_idx,stridx) \ +#define duk_xget_owndataprop_stridx_short(thr, obj_idx, stridx) \ (DUK_ASSERT_EXPR((duk_int_t) (obj_idx) >= -0x8000L && (duk_int_t) (obj_idx) <= 0x7fffL), \ DUK_ASSERT_EXPR((duk_int_t) (stridx) >= 0 && (duk_int_t) (stridx) <= 0xffffL), \ duk_xget_owndataprop_stridx_short_raw((thr), (((duk_uint_t) (obj_idx)) << 16) + ((duk_uint_t) (stridx)))) -DUK_INTERNAL_DECL duk_bool_t duk_put_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [val] -> [] */ +DUK_INTERNAL_DECL duk_bool_t duk_put_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [val] -> [] */ DUK_INTERNAL_DECL duk_bool_t duk_put_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args); -#define duk_put_prop_stridx_short(thr,obj_idx,stridx) \ +#define duk_put_prop_stridx_short(thr, obj_idx, stridx) \ (DUK_ASSERT_EXPR((duk_int_t) (obj_idx) >= -0x8000L && (duk_int_t) (obj_idx) <= 0x7fffL), \ DUK_ASSERT_EXPR((duk_int_t) (stridx) >= 0 && (duk_int_t) (stridx) <= 0xffffL), \ duk_put_prop_stridx_short_raw((thr), (((duk_uint_t) (obj_idx)) << 16) + ((duk_uint_t) (stridx)))) -DUK_INTERNAL_DECL duk_bool_t duk_del_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [] */ -#if 0 /* Too few call sites to be useful. */ +DUK_INTERNAL_DECL duk_bool_t duk_del_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [] */ +#if 0 /* Too few call sites to be useful. */ DUK_INTERNAL_DECL duk_bool_t duk_del_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args); -#define duk_del_prop_stridx_short(thr,obj_idx,stridx) \ +#define duk_del_prop_stridx_short(thr, obj_idx, stridx) \ (DUK_ASSERT_EXPR((obj_idx) >= -0x8000L && (obj_idx) <= 0x7fffL), \ DUK_ASSERT_EXPR((stridx) >= 0 && (stridx) <= 0xffffL), \ duk_del_prop_stridx_short_raw((thr), (((duk_uint_t) (obj_idx)) << 16) + ((duk_uint_t) (stridx)))) #endif -#define duk_del_prop_stridx_short(thr,obj_idx,stridx) \ - duk_del_prop_stridx((thr), (obj_idx), (stridx)) +#define duk_del_prop_stridx_short(thr, obj_idx, stridx) duk_del_prop_stridx((thr), (obj_idx), (stridx)) -DUK_INTERNAL_DECL duk_bool_t duk_has_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [] */ -#if 0 /* Too few call sites to be useful. */ +DUK_INTERNAL_DECL duk_bool_t duk_has_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [] */ +#if 0 /* Too few call sites to be useful. */ DUK_INTERNAL_DECL duk_bool_t duk_has_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args); -#define duk_has_prop_stridx_short(thr,obj_idx,stridx) \ +#define duk_has_prop_stridx_short(thr, obj_idx, stridx) \ (DUK_ASSERT_EXPR((obj_idx) >= -0x8000L && (obj_idx) <= 0x7fffL), \ DUK_ASSERT_EXPR((stridx) >= 0 && (stridx) <= 0xffffL), \ duk_has_prop_stridx_short_raw((thr), (((duk_uint_t) (obj_idx)) << 16) + ((duk_uint_t) (stridx)))) #endif -#define duk_has_prop_stridx_short(thr,obj_idx,stridx) \ - duk_has_prop_stridx((thr), (obj_idx), (stridx)) +#define duk_has_prop_stridx_short(thr, obj_idx, stridx) duk_has_prop_stridx((thr), (obj_idx), (stridx)) -DUK_INTERNAL_DECL void duk_xdef_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t desc_flags); /* [key val] -> [] */ +DUK_INTERNAL_DECL void duk_xdef_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t desc_flags); /* [key val] -> [] */ -DUK_INTERNAL_DECL void duk_xdef_prop_index(duk_hthread *thr, duk_idx_t obj_idx, duk_uarridx_t arr_idx, duk_small_uint_t desc_flags); /* [val] -> [] */ +DUK_INTERNAL_DECL void duk_xdef_prop_index(duk_hthread *thr, + duk_idx_t obj_idx, + duk_uarridx_t arr_idx, + duk_small_uint_t desc_flags); /* [val] -> [] */ /* XXX: Because stridx and desc_flags have a limited range, this call could * always pack stridx and desc_flags into a single argument. */ -DUK_INTERNAL_DECL void duk_xdef_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx, duk_small_uint_t desc_flags); /* [val] -> [] */ +DUK_INTERNAL_DECL void duk_xdef_prop_stridx(duk_hthread *thr, + duk_idx_t obj_idx, + duk_small_uint_t stridx, + duk_small_uint_t desc_flags); /* [val] -> [] */ DUK_INTERNAL_DECL void duk_xdef_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args); -#define duk_xdef_prop_stridx_short(thr,obj_idx,stridx,desc_flags) \ +#define duk_xdef_prop_stridx_short(thr, obj_idx, stridx, desc_flags) \ (DUK_ASSERT_EXPR((duk_int_t) (obj_idx) >= -0x80L && (duk_int_t) (obj_idx) <= 0x7fL), \ DUK_ASSERT_EXPR((duk_int_t) (stridx) >= 0 && (duk_int_t) (stridx) <= 0xffffL), \ DUK_ASSERT_EXPR((duk_int_t) (desc_flags) >= 0 && (duk_int_t) (desc_flags) <= 0xffL), \ - duk_xdef_prop_stridx_short_raw((thr), (((duk_uint_t) (obj_idx)) << 24) + (((duk_uint_t) (stridx)) << 8) + (duk_uint_t) (desc_flags))) + duk_xdef_prop_stridx_short_raw((thr), \ + (((duk_uint_t) (obj_idx)) << 24) + (((duk_uint_t) (stridx)) << 8) + \ + (duk_uint_t) (desc_flags))) -#define duk_xdef_prop_wec(thr,obj_idx) \ - duk_xdef_prop((thr), (obj_idx), DUK_PROPDESC_FLAGS_WEC) -#define duk_xdef_prop_index_wec(thr,obj_idx,arr_idx) \ - duk_xdef_prop_index((thr), (obj_idx), (arr_idx), DUK_PROPDESC_FLAGS_WEC) -#define duk_xdef_prop_stridx_wec(thr,obj_idx,stridx) \ - duk_xdef_prop_stridx((thr), (obj_idx), (stridx), DUK_PROPDESC_FLAGS_WEC) -#define duk_xdef_prop_stridx_short_wec(thr,obj_idx,stridx) \ +#define duk_xdef_prop_wec(thr, obj_idx) duk_xdef_prop((thr), (obj_idx), DUK_PROPDESC_FLAGS_WEC) +#define duk_xdef_prop_index_wec(thr, obj_idx, arr_idx) duk_xdef_prop_index((thr), (obj_idx), (arr_idx), DUK_PROPDESC_FLAGS_WEC) +#define duk_xdef_prop_stridx_wec(thr, obj_idx, stridx) duk_xdef_prop_stridx((thr), (obj_idx), (stridx), DUK_PROPDESC_FLAGS_WEC) +#define duk_xdef_prop_stridx_short_wec(thr, obj_idx, stridx) \ duk_xdef_prop_stridx_short((thr), (obj_idx), (stridx), DUK_PROPDESC_FLAGS_WEC) -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL_DECL void duk_xdef_prop_stridx_builtin(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx, duk_small_int_t builtin_idx, duk_small_uint_t desc_flags); /* [] -> [] */ #endif -DUK_INTERNAL_DECL void duk_xdef_prop_stridx_thrower(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [] */ +DUK_INTERNAL_DECL void duk_xdef_prop_stridx_thrower(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx); /* [] -> [] */ DUK_INTERNAL_DECL duk_bool_t duk_get_method_stridx(duk_hthread *thr, duk_idx_t idx, duk_small_uint_t stridx); @@ -5842,28 +6260,24 @@ DUK_INTERNAL_DECL void duk_clear_prototype(duk_hthread *thr, duk_idx_t idx); * using these macro results in faster and smaller code than duk_get_tval(). * Both 'ctx' and 'idx' are evaluted multiple times, but only for asserts. */ -#define DUK_ASSERT_VALID_NEGIDX(thr,idx) \ +#define DUK_ASSERT_VALID_NEGIDX(thr, idx) \ (DUK_ASSERT_EXPR((duk_int_t) (idx) < 0), DUK_ASSERT_EXPR(duk_is_valid_index((thr), (idx)))) -#define DUK_ASSERT_VALID_POSIDX(thr,idx) \ +#define DUK_ASSERT_VALID_POSIDX(thr, idx) \ (DUK_ASSERT_EXPR((duk_int_t) (idx) >= 0), DUK_ASSERT_EXPR(duk_is_valid_index((thr), (idx)))) -#define DUK_GET_TVAL_NEGIDX(thr,idx) \ - (DUK_ASSERT_VALID_NEGIDX((thr),(idx)), ((duk_hthread *) (thr))->valstack_top + (idx)) -#define DUK_GET_TVAL_POSIDX(thr,idx) \ - (DUK_ASSERT_VALID_POSIDX((thr),(idx)), ((duk_hthread *) (thr))->valstack_bottom + (idx)) -#define DUK_GET_HOBJECT_NEGIDX(thr,idx) \ - (DUK_ASSERT_VALID_NEGIDX((thr),(idx)), DUK_TVAL_GET_OBJECT(((duk_hthread *) (thr))->valstack_top + (idx))) -#define DUK_GET_HOBJECT_POSIDX(thr,idx) \ - (DUK_ASSERT_VALID_POSIDX((thr),(idx)), DUK_TVAL_GET_OBJECT(((duk_hthread *) (thr))->valstack_bottom + (idx))) +#define DUK_GET_TVAL_NEGIDX(thr, idx) (DUK_ASSERT_VALID_NEGIDX((thr), (idx)), ((duk_hthread *) (thr))->valstack_top + (idx)) +#define DUK_GET_TVAL_POSIDX(thr, idx) (DUK_ASSERT_VALID_POSIDX((thr), (idx)), ((duk_hthread *) (thr))->valstack_bottom + (idx)) +#define DUK_GET_HOBJECT_NEGIDX(thr, idx) \ + (DUK_ASSERT_VALID_NEGIDX((thr), (idx)), DUK_TVAL_GET_OBJECT(((duk_hthread *) (thr))->valstack_top + (idx))) +#define DUK_GET_HOBJECT_POSIDX(thr, idx) \ + (DUK_ASSERT_VALID_POSIDX((thr), (idx)), DUK_TVAL_GET_OBJECT(((duk_hthread *) (thr))->valstack_bottom + (idx))) -#define DUK_GET_THIS_TVAL_PTR(thr) \ - (DUK_ASSERT_EXPR((thr)->valstack_bottom > (thr)->valstack), \ - (thr)->valstack_bottom - 1) +#define DUK_GET_THIS_TVAL_PTR(thr) (DUK_ASSERT_EXPR((thr)->valstack_bottom > (thr)->valstack), (thr)->valstack_bottom - 1) DUK_INTERNAL_DECL duk_double_t duk_time_get_ecmascript_time(duk_hthread *thr); DUK_INTERNAL_DECL duk_double_t duk_time_get_ecmascript_time_nofrac(duk_hthread *thr); DUK_INTERNAL_DECL duk_double_t duk_time_get_monotonic_time(duk_hthread *thr); -#endif /* DUK_API_INTERNAL_H_INCLUDED */ +#endif /* DUK_API_INTERNAL_H_INCLUDED */ /* #include duk_hstring.h */ /* * Heap string representation. @@ -5894,9 +6308,9 @@ DUK_INTERNAL_DECL duk_double_t duk_time_get_monotonic_time(duk_hthread *thr); */ #if defined(DUK_USE_STRLEN16) -#define DUK_HSTRING_MAX_BYTELEN (0x0000ffffUL) +#define DUK_HSTRING_MAX_BYTELEN (0x0000ffffUL) #else -#define DUK_HSTRING_MAX_BYTELEN (0x7fffffffUL) +#define DUK_HSTRING_MAX_BYTELEN (0x7fffffffUL) #endif /* XXX: could add flags for "is valid CESU-8" (ECMAScript compatible strings), @@ -5908,139 +6322,148 @@ DUK_INTERNAL_DECL duk_double_t duk_time_get_monotonic_time(duk_hthread *thr); /* With lowmem builds the high 16 bits of duk_heaphdr are used for other * purposes, so this leaves 7 duk_heaphdr flags and 9 duk_hstring flags. */ -#define DUK_HSTRING_FLAG_ASCII DUK_HEAPHDR_USER_FLAG(0) /* string is ASCII, clen == blen */ -#define DUK_HSTRING_FLAG_ARRIDX DUK_HEAPHDR_USER_FLAG(1) /* string is a valid array index */ -#define DUK_HSTRING_FLAG_SYMBOL DUK_HEAPHDR_USER_FLAG(2) /* string is a symbol (invalid utf-8) */ -#define DUK_HSTRING_FLAG_HIDDEN DUK_HEAPHDR_USER_FLAG(3) /* string is a hidden symbol (implies symbol, Duktape 1.x internal string) */ -#define DUK_HSTRING_FLAG_RESERVED_WORD DUK_HEAPHDR_USER_FLAG(4) /* string is a reserved word (non-strict) */ -#define DUK_HSTRING_FLAG_STRICT_RESERVED_WORD DUK_HEAPHDR_USER_FLAG(5) /* string is a reserved word (strict) */ -#define DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS DUK_HEAPHDR_USER_FLAG(6) /* string is 'eval' or 'arguments' */ -#define DUK_HSTRING_FLAG_EXTDATA DUK_HEAPHDR_USER_FLAG(7) /* string data is external (duk_hstring_external) */ -#define DUK_HSTRING_FLAG_PINNED_LITERAL DUK_HEAPHDR_USER_FLAG(8) /* string is a literal, and pinned */ +#define DUK_HSTRING_FLAG_ASCII DUK_HEAPHDR_USER_FLAG(0) /* string is ASCII, clen == blen */ +#define DUK_HSTRING_FLAG_ARRIDX DUK_HEAPHDR_USER_FLAG(1) /* string is a valid array index */ +#define DUK_HSTRING_FLAG_SYMBOL DUK_HEAPHDR_USER_FLAG(2) /* string is a symbol (invalid utf-8) */ +#define DUK_HSTRING_FLAG_HIDDEN \ + DUK_HEAPHDR_USER_FLAG(3) /* string is a hidden symbol (implies symbol, Duktape 1.x internal string) */ +#define DUK_HSTRING_FLAG_RESERVED_WORD DUK_HEAPHDR_USER_FLAG(4) /* string is a reserved word (non-strict) */ +#define DUK_HSTRING_FLAG_STRICT_RESERVED_WORD DUK_HEAPHDR_USER_FLAG(5) /* string is a reserved word (strict) */ +#define DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS DUK_HEAPHDR_USER_FLAG(6) /* string is 'eval' or 'arguments' */ +#define DUK_HSTRING_FLAG_EXTDATA DUK_HEAPHDR_USER_FLAG(7) /* string data is external (duk_hstring_external) */ +#define DUK_HSTRING_FLAG_PINNED_LITERAL DUK_HEAPHDR_USER_FLAG(8) /* string is a literal, and pinned */ -#define DUK_HSTRING_HAS_ASCII(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ASCII) -#define DUK_HSTRING_HAS_ARRIDX(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ARRIDX) -#define DUK_HSTRING_HAS_SYMBOL(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_SYMBOL) -#define DUK_HSTRING_HAS_HIDDEN(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_HIDDEN) -#define DUK_HSTRING_HAS_RESERVED_WORD(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_RESERVED_WORD) -#define DUK_HSTRING_HAS_STRICT_RESERVED_WORD(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_STRICT_RESERVED_WORD) -#define DUK_HSTRING_HAS_EVAL_OR_ARGUMENTS(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS) -#define DUK_HSTRING_HAS_EXTDATA(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EXTDATA) -#define DUK_HSTRING_HAS_PINNED_LITERAL(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_PINNED_LITERAL) +#define DUK_HSTRING_HAS_ASCII(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ASCII) +#define DUK_HSTRING_HAS_ARRIDX(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ARRIDX) +#define DUK_HSTRING_HAS_SYMBOL(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_SYMBOL) +#define DUK_HSTRING_HAS_HIDDEN(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_HIDDEN) +#define DUK_HSTRING_HAS_RESERVED_WORD(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_RESERVED_WORD) +#define DUK_HSTRING_HAS_STRICT_RESERVED_WORD(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_STRICT_RESERVED_WORD) +#define DUK_HSTRING_HAS_EVAL_OR_ARGUMENTS(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS) +#define DUK_HSTRING_HAS_EXTDATA(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EXTDATA) +#define DUK_HSTRING_HAS_PINNED_LITERAL(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_PINNED_LITERAL) -#define DUK_HSTRING_SET_ASCII(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ASCII) -#define DUK_HSTRING_SET_ARRIDX(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ARRIDX) -#define DUK_HSTRING_SET_SYMBOL(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_SYMBOL) -#define DUK_HSTRING_SET_HIDDEN(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_HIDDEN) -#define DUK_HSTRING_SET_RESERVED_WORD(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_RESERVED_WORD) -#define DUK_HSTRING_SET_STRICT_RESERVED_WORD(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_STRICT_RESERVED_WORD) -#define DUK_HSTRING_SET_EVAL_OR_ARGUMENTS(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS) -#define DUK_HSTRING_SET_EXTDATA(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EXTDATA) -#define DUK_HSTRING_SET_PINNED_LITERAL(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_PINNED_LITERAL) +#define DUK_HSTRING_SET_ASCII(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ASCII) +#define DUK_HSTRING_SET_ARRIDX(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ARRIDX) +#define DUK_HSTRING_SET_SYMBOL(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_SYMBOL) +#define DUK_HSTRING_SET_HIDDEN(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_HIDDEN) +#define DUK_HSTRING_SET_RESERVED_WORD(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_RESERVED_WORD) +#define DUK_HSTRING_SET_STRICT_RESERVED_WORD(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_STRICT_RESERVED_WORD) +#define DUK_HSTRING_SET_EVAL_OR_ARGUMENTS(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS) +#define DUK_HSTRING_SET_EXTDATA(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EXTDATA) +#define DUK_HSTRING_SET_PINNED_LITERAL(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_PINNED_LITERAL) -#define DUK_HSTRING_CLEAR_ASCII(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ASCII) -#define DUK_HSTRING_CLEAR_ARRIDX(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ARRIDX) -#define DUK_HSTRING_CLEAR_SYMBOL(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_SYMBOL) -#define DUK_HSTRING_CLEAR_HIDDEN(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_HIDDEN) -#define DUK_HSTRING_CLEAR_RESERVED_WORD(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_RESERVED_WORD) -#define DUK_HSTRING_CLEAR_STRICT_RESERVED_WORD(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_STRICT_RESERVED_WORD) -#define DUK_HSTRING_CLEAR_EVAL_OR_ARGUMENTS(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS) -#define DUK_HSTRING_CLEAR_EXTDATA(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EXTDATA) -#define DUK_HSTRING_CLEAR_PINNED_LITERAL(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_PINNED_LITERAL) +#define DUK_HSTRING_CLEAR_ASCII(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ASCII) +#define DUK_HSTRING_CLEAR_ARRIDX(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_ARRIDX) +#define DUK_HSTRING_CLEAR_SYMBOL(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_SYMBOL) +#define DUK_HSTRING_CLEAR_HIDDEN(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_HIDDEN) +#define DUK_HSTRING_CLEAR_RESERVED_WORD(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_RESERVED_WORD) +#define DUK_HSTRING_CLEAR_STRICT_RESERVED_WORD(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_STRICT_RESERVED_WORD) +#define DUK_HSTRING_CLEAR_EVAL_OR_ARGUMENTS(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS) +#define DUK_HSTRING_CLEAR_EXTDATA(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_EXTDATA) +#define DUK_HSTRING_CLEAR_PINNED_LITERAL(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HSTRING_FLAG_PINNED_LITERAL) -#if 0 /* Slightly smaller code without explicit flag, but explicit flag - * is very useful when 'clen' is dropped. - */ -#define DUK_HSTRING_IS_ASCII(x) (DUK_HSTRING_GET_BYTELEN((x)) == DUK_HSTRING_GET_CHARLEN((x))) +#if 0 /* Slightly smaller code without explicit flag, but explicit flag \ + * is very useful when 'clen' is dropped. \ + */ +#define DUK_HSTRING_IS_ASCII(x) (DUK_HSTRING_GET_BYTELEN((x)) == DUK_HSTRING_GET_CHARLEN((x))) #endif -#define DUK_HSTRING_IS_ASCII(x) DUK_HSTRING_HAS_ASCII((x)) /* lazily set! */ -#define DUK_HSTRING_IS_EMPTY(x) (DUK_HSTRING_GET_BYTELEN((x)) == 0) +#define DUK_HSTRING_IS_ASCII(x) DUK_HSTRING_HAS_ASCII((x)) /* lazily set! */ +#define DUK_HSTRING_IS_EMPTY(x) (DUK_HSTRING_GET_BYTELEN((x)) == 0) #if defined(DUK_USE_STRHASH16) -#define DUK_HSTRING_GET_HASH(x) ((x)->hdr.h_flags >> 16) -#define DUK_HSTRING_SET_HASH(x,v) do { \ +#define DUK_HSTRING_GET_HASH(x) ((x)->hdr.h_flags >> 16) +#define DUK_HSTRING_SET_HASH(x, v) \ + do { \ (x)->hdr.h_flags = ((x)->hdr.h_flags & 0x0000ffffUL) | ((v) << 16); \ } while (0) #else -#define DUK_HSTRING_GET_HASH(x) ((x)->hash) -#define DUK_HSTRING_SET_HASH(x,v) do { \ +#define DUK_HSTRING_GET_HASH(x) ((x)->hash) +#define DUK_HSTRING_SET_HASH(x, v) \ + do { \ (x)->hash = (v); \ } while (0) #endif #if defined(DUK_USE_STRLEN16) -#define DUK_HSTRING_GET_BYTELEN(x) ((x)->hdr.h_strextra16) -#define DUK_HSTRING_SET_BYTELEN(x,v) do { \ +#define DUK_HSTRING_GET_BYTELEN(x) ((x)->hdr.h_strextra16) +#define DUK_HSTRING_SET_BYTELEN(x, v) \ + do { \ (x)->hdr.h_strextra16 = (v); \ } while (0) #if defined(DUK_USE_HSTRING_CLEN) -#define DUK_HSTRING_GET_CHARLEN(x) duk_hstring_get_charlen((x)) -#define DUK_HSTRING_SET_CHARLEN(x,v) do { \ +#define DUK_HSTRING_GET_CHARLEN(x) duk_hstring_get_charlen((x)) +#define DUK_HSTRING_SET_CHARLEN(x, v) \ + do { \ (x)->clen16 = (v); \ } while (0) #else -#define DUK_HSTRING_GET_CHARLEN(x) duk_hstring_get_charlen((x)) -#define DUK_HSTRING_SET_CHARLEN(x,v) do { \ - DUK_ASSERT(0); /* should never be called */ \ +#define DUK_HSTRING_GET_CHARLEN(x) duk_hstring_get_charlen((x)) +#define DUK_HSTRING_SET_CHARLEN(x, v) \ + do { \ + DUK_ASSERT(0); /* should never be called */ \ } while (0) #endif #else -#define DUK_HSTRING_GET_BYTELEN(x) ((x)->blen) -#define DUK_HSTRING_SET_BYTELEN(x,v) do { \ +#define DUK_HSTRING_GET_BYTELEN(x) ((x)->blen) +#define DUK_HSTRING_SET_BYTELEN(x, v) \ + do { \ (x)->blen = (v); \ } while (0) -#define DUK_HSTRING_GET_CHARLEN(x) duk_hstring_get_charlen((x)) -#define DUK_HSTRING_SET_CHARLEN(x,v) do { \ +#define DUK_HSTRING_GET_CHARLEN(x) duk_hstring_get_charlen((x)) +#define DUK_HSTRING_SET_CHARLEN(x, v) \ + do { \ (x)->clen = (v); \ } while (0) #endif #if defined(DUK_USE_HSTRING_EXTDATA) -#define DUK_HSTRING_GET_EXTDATA(x) \ - ((x)->extdata) +#define DUK_HSTRING_GET_EXTDATA(x) ((x)->extdata) #define DUK_HSTRING_GET_DATA(x) \ - (DUK_HSTRING_HAS_EXTDATA((x)) ? \ - DUK_HSTRING_GET_EXTDATA((const duk_hstring_external *) (x)) : ((const duk_uint8_t *) ((x) + 1))) + (DUK_HSTRING_HAS_EXTDATA((x)) ? DUK_HSTRING_GET_EXTDATA((const duk_hstring_external *) (x)) : \ + ((const duk_uint8_t *) ((x) + 1))) #else -#define DUK_HSTRING_GET_DATA(x) \ - ((const duk_uint8_t *) ((x) + 1)) +#define DUK_HSTRING_GET_DATA(x) ((const duk_uint8_t *) ((x) + 1)) #endif -#define DUK_HSTRING_GET_DATA_END(x) \ - (DUK_HSTRING_GET_DATA((x)) + (x)->blen) +#define DUK_HSTRING_GET_DATA_END(x) (DUK_HSTRING_GET_DATA((x)) + (x)->blen) /* Marker value; in E5 2^32-1 is not a valid array index (2^32-2 is highest * valid). */ -#define DUK_HSTRING_NO_ARRAY_INDEX (0xffffffffUL) +#define DUK_HSTRING_NO_ARRAY_INDEX (0xffffffffUL) #if defined(DUK_USE_HSTRING_ARRIDX) -#define DUK_HSTRING_GET_ARRIDX_FAST(h) ((h)->arridx) -#define DUK_HSTRING_GET_ARRIDX_SLOW(h) ((h)->arridx) +#define DUK_HSTRING_GET_ARRIDX_FAST(h) ((h)->arridx) +#define DUK_HSTRING_GET_ARRIDX_SLOW(h) ((h)->arridx) #else /* Get array index related to string (or return DUK_HSTRING_NO_ARRAY_INDEX); * avoids helper call if string has no array index value. */ -#define DUK_HSTRING_GET_ARRIDX_FAST(h) \ +#define DUK_HSTRING_GET_ARRIDX_FAST(h) \ (DUK_HSTRING_HAS_ARRIDX((h)) ? duk_js_to_arrayindex_hstring_fast_known((h)) : DUK_HSTRING_NO_ARRAY_INDEX) /* Slower but more compact variant. */ -#define DUK_HSTRING_GET_ARRIDX_SLOW(h) \ - (duk_js_to_arrayindex_hstring_fast((h))) +#define DUK_HSTRING_GET_ARRIDX_SLOW(h) (duk_js_to_arrayindex_hstring_fast((h))) #endif /* XXX: these actually fit into duk_hstring */ -#define DUK_SYMBOL_TYPE_HIDDEN 0 -#define DUK_SYMBOL_TYPE_GLOBAL 1 -#define DUK_SYMBOL_TYPE_LOCAL 2 +#define DUK_SYMBOL_TYPE_HIDDEN 0 +#define DUK_SYMBOL_TYPE_GLOBAL 1 +#define DUK_SYMBOL_TYPE_LOCAL 2 #define DUK_SYMBOL_TYPE_WELLKNOWN 3 /* Assertion for duk_hstring validity. */ #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hstring_assert_valid(duk_hstring *h); -#define DUK_HSTRING_ASSERT_VALID(h) do { duk_hstring_assert_valid((h)); } while (0) +#define DUK_HSTRING_ASSERT_VALID(h) \ + do { \ + duk_hstring_assert_valid((h)); \ + } while (0) #else -#define DUK_HSTRING_ASSERT_VALID(h) do {} while (0) +#define DUK_HSTRING_ASSERT_VALID(h) \ + do { \ + } while (0) #endif /* @@ -6110,14 +6533,17 @@ struct duk_hstring_external { * Prototypes */ -DUK_INTERNAL_DECL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk_hstring *h, duk_uint_t pos, duk_bool_t surrogate_aware); +DUK_INTERNAL_DECL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, + duk_hstring *h, + duk_uint_t pos, + duk_bool_t surrogate_aware); DUK_INTERNAL_DECL duk_bool_t duk_hstring_equals_ascii_cstring(duk_hstring *h, const char *cstr); DUK_INTERNAL_DECL duk_size_t duk_hstring_get_charlen(duk_hstring *h); #if !defined(DUK_USE_HSTRING_LAZY_CLEN) DUK_INTERNAL_DECL void duk_hstring_init_charlen(duk_hstring *h); #endif -#endif /* DUK_HSTRING_H_INCLUDED */ +#endif /* DUK_HSTRING_H_INCLUDED */ /* #include duk_hobject.h */ /* * Heap object representation. @@ -6160,36 +6586,40 @@ DUK_INTERNAL_DECL void duk_hstring_init_charlen(duk_hstring *h); /* XXX: some flags are object subtype specific (e.g. common to all function * subtypes, duk_harray, etc) and could be reused for different subtypes. */ -#define DUK_HOBJECT_FLAG_EXTENSIBLE DUK_HEAPHDR_USER_FLAG(0) /* object is extensible */ -#define DUK_HOBJECT_FLAG_CONSTRUCTABLE DUK_HEAPHDR_USER_FLAG(1) /* object is constructable */ -#define DUK_HOBJECT_FLAG_CALLABLE DUK_HEAPHDR_USER_FLAG(2) /* object is callable */ -#define DUK_HOBJECT_FLAG_BOUNDFUNC DUK_HEAPHDR_USER_FLAG(3) /* object established using Function.prototype.bind() */ -#define DUK_HOBJECT_FLAG_COMPFUNC DUK_HEAPHDR_USER_FLAG(4) /* object is a compiled function (duk_hcompfunc) */ -#define DUK_HOBJECT_FLAG_NATFUNC DUK_HEAPHDR_USER_FLAG(5) /* object is a native function (duk_hnatfunc) */ -#define DUK_HOBJECT_FLAG_BUFOBJ DUK_HEAPHDR_USER_FLAG(6) /* object is a buffer object (duk_hbufobj) (always exotic) */ -#define DUK_HOBJECT_FLAG_FASTREFS DUK_HEAPHDR_USER_FLAG(7) /* object has no fields needing DECREF/marking beyond base duk_hobject header */ -#define DUK_HOBJECT_FLAG_ARRAY_PART DUK_HEAPHDR_USER_FLAG(8) /* object has an array part (a_size may still be 0) */ -#define DUK_HOBJECT_FLAG_STRICT DUK_HEAPHDR_USER_FLAG(9) /* function: function object is strict */ -#define DUK_HOBJECT_FLAG_NOTAIL DUK_HEAPHDR_USER_FLAG(10) /* function: function must not be tail called */ -#define DUK_HOBJECT_FLAG_NEWENV DUK_HEAPHDR_USER_FLAG(11) /* function: create new environment when called (see duk_hcompfunc) */ -#define DUK_HOBJECT_FLAG_NAMEBINDING DUK_HEAPHDR_USER_FLAG(12) /* function: create binding for func name (function templates only, used for named function expressions) */ -#define DUK_HOBJECT_FLAG_CREATEARGS DUK_HEAPHDR_USER_FLAG(13) /* function: create an arguments object on function call */ -#define DUK_HOBJECT_FLAG_HAVE_FINALIZER DUK_HEAPHDR_USER_FLAG(14) /* object has a callable (own) finalizer property */ -#define DUK_HOBJECT_FLAG_EXOTIC_ARRAY DUK_HEAPHDR_USER_FLAG(15) /* 'Array' object, array length and index exotic behavior */ -#define DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ DUK_HEAPHDR_USER_FLAG(16) /* 'String' object, array index exotic behavior */ -#define DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS DUK_HEAPHDR_USER_FLAG(17) /* 'Arguments' object and has arguments exotic behavior (non-strict callee) */ -#define DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ DUK_HEAPHDR_USER_FLAG(18) /* 'Proxy' object */ -#define DUK_HOBJECT_FLAG_SPECIAL_CALL DUK_HEAPHDR_USER_FLAG(19) /* special casing in call behavior, for .call(), .apply(), etc. */ +#define DUK_HOBJECT_FLAG_EXTENSIBLE DUK_HEAPHDR_USER_FLAG(0) /* object is extensible */ +#define DUK_HOBJECT_FLAG_CONSTRUCTABLE DUK_HEAPHDR_USER_FLAG(1) /* object is constructable */ +#define DUK_HOBJECT_FLAG_CALLABLE DUK_HEAPHDR_USER_FLAG(2) /* object is callable */ +#define DUK_HOBJECT_FLAG_BOUNDFUNC DUK_HEAPHDR_USER_FLAG(3) /* object established using Function.prototype.bind() */ +#define DUK_HOBJECT_FLAG_COMPFUNC DUK_HEAPHDR_USER_FLAG(4) /* object is a compiled function (duk_hcompfunc) */ +#define DUK_HOBJECT_FLAG_NATFUNC DUK_HEAPHDR_USER_FLAG(5) /* object is a native function (duk_hnatfunc) */ +#define DUK_HOBJECT_FLAG_BUFOBJ DUK_HEAPHDR_USER_FLAG(6) /* object is a buffer object (duk_hbufobj) (always exotic) */ +#define DUK_HOBJECT_FLAG_FASTREFS \ + DUK_HEAPHDR_USER_FLAG(7) /* object has no fields needing DECREF/marking beyond base duk_hobject header */ +#define DUK_HOBJECT_FLAG_ARRAY_PART DUK_HEAPHDR_USER_FLAG(8) /* object has an array part (a_size may still be 0) */ +#define DUK_HOBJECT_FLAG_STRICT DUK_HEAPHDR_USER_FLAG(9) /* function: function object is strict */ +#define DUK_HOBJECT_FLAG_NOTAIL DUK_HEAPHDR_USER_FLAG(10) /* function: function must not be tail called */ +#define DUK_HOBJECT_FLAG_NEWENV DUK_HEAPHDR_USER_FLAG(11) /* function: create new environment when called (see duk_hcompfunc) */ +#define DUK_HOBJECT_FLAG_NAMEBINDING \ + DUK_HEAPHDR_USER_FLAG( \ + 12) /* function: create binding for func name (function templates only, used for named function expressions) */ +#define DUK_HOBJECT_FLAG_CREATEARGS DUK_HEAPHDR_USER_FLAG(13) /* function: create an arguments object on function call */ +#define DUK_HOBJECT_FLAG_HAVE_FINALIZER DUK_HEAPHDR_USER_FLAG(14) /* object has a callable (own) finalizer property */ +#define DUK_HOBJECT_FLAG_EXOTIC_ARRAY DUK_HEAPHDR_USER_FLAG(15) /* 'Array' object, array length and index exotic behavior */ +#define DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ DUK_HEAPHDR_USER_FLAG(16) /* 'String' object, array index exotic behavior */ +#define DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS \ + DUK_HEAPHDR_USER_FLAG(17) /* 'Arguments' object and has arguments exotic behavior (non-strict callee) */ +#define DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ DUK_HEAPHDR_USER_FLAG(18) /* 'Proxy' object */ +#define DUK_HOBJECT_FLAG_SPECIAL_CALL DUK_HEAPHDR_USER_FLAG(19) /* special casing in call behavior, for .call(), .apply(), etc. */ -#define DUK_HOBJECT_FLAG_CLASS_BASE DUK_HEAPHDR_USER_FLAG_NUMBER(20) -#define DUK_HOBJECT_FLAG_CLASS_BITS 5 +#define DUK_HOBJECT_FLAG_CLASS_BASE DUK_HEAPHDR_USER_FLAG_NUMBER(20) +#define DUK_HOBJECT_FLAG_CLASS_BITS 5 -#define DUK_HOBJECT_GET_CLASS_NUMBER(h) \ +#define DUK_HOBJECT_GET_CLASS_NUMBER(h) \ DUK_HEAPHDR_GET_FLAG_RANGE(&(h)->hdr, DUK_HOBJECT_FLAG_CLASS_BASE, DUK_HOBJECT_FLAG_CLASS_BITS) -#define DUK_HOBJECT_SET_CLASS_NUMBER(h,v) \ +#define DUK_HOBJECT_SET_CLASS_NUMBER(h, v) \ DUK_HEAPHDR_SET_FLAG_RANGE(&(h)->hdr, DUK_HOBJECT_FLAG_CLASS_BASE, DUK_HOBJECT_FLAG_CLASS_BITS, (v)) -#define DUK_HOBJECT_GET_CLASS_MASK(h) \ +#define DUK_HOBJECT_GET_CLASS_MASK(h) \ (1UL << DUK_HEAPHDR_GET_FLAG_RANGE(&(h)->hdr, DUK_HOBJECT_FLAG_CLASS_BASE, DUK_HOBJECT_FLAG_CLASS_BITS)) /* Macro for creating flag initializer from a class number. @@ -6197,256 +6627,239 @@ DUK_INTERNAL_DECL void duk_hstring_init_charlen(duk_hstring *h); * a signed integer to an unsigned one; the largest class values * have the highest bit (bit 31) set which causes this. */ -#define DUK_HOBJECT_CLASS_AS_FLAGS(v) (((duk_uint_t) (v)) << DUK_HOBJECT_FLAG_CLASS_BASE) +#define DUK_HOBJECT_CLASS_AS_FLAGS(v) (((duk_uint_t) (v)) << DUK_HOBJECT_FLAG_CLASS_BASE) /* E5 Section 8.6.2 + custom classes */ -#define DUK_HOBJECT_CLASS_NONE 0 -#define DUK_HOBJECT_CLASS_OBJECT 1 -#define DUK_HOBJECT_CLASS_ARRAY 2 -#define DUK_HOBJECT_CLASS_FUNCTION 3 -#define DUK_HOBJECT_CLASS_ARGUMENTS 4 -#define DUK_HOBJECT_CLASS_BOOLEAN 5 -#define DUK_HOBJECT_CLASS_DATE 6 -#define DUK_HOBJECT_CLASS_ERROR 7 -#define DUK_HOBJECT_CLASS_JSON 8 -#define DUK_HOBJECT_CLASS_MATH 9 -#define DUK_HOBJECT_CLASS_NUMBER 10 -#define DUK_HOBJECT_CLASS_REGEXP 11 -#define DUK_HOBJECT_CLASS_STRING 12 -#define DUK_HOBJECT_CLASS_GLOBAL 13 -#define DUK_HOBJECT_CLASS_SYMBOL 14 -#define DUK_HOBJECT_CLASS_OBJENV 15 /* custom */ -#define DUK_HOBJECT_CLASS_DECENV 16 /* custom */ -#define DUK_HOBJECT_CLASS_POINTER 17 /* custom */ -#define DUK_HOBJECT_CLASS_THREAD 18 /* custom; implies DUK_HOBJECT_IS_THREAD */ -#define DUK_HOBJECT_CLASS_BUFOBJ_MIN 19 -#define DUK_HOBJECT_CLASS_ARRAYBUFFER 19 /* implies DUK_HOBJECT_IS_BUFOBJ */ -#define DUK_HOBJECT_CLASS_DATAVIEW 20 -#define DUK_HOBJECT_CLASS_INT8ARRAY 21 -#define DUK_HOBJECT_CLASS_UINT8ARRAY 22 -#define DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY 23 -#define DUK_HOBJECT_CLASS_INT16ARRAY 24 -#define DUK_HOBJECT_CLASS_UINT16ARRAY 25 -#define DUK_HOBJECT_CLASS_INT32ARRAY 26 -#define DUK_HOBJECT_CLASS_UINT32ARRAY 27 -#define DUK_HOBJECT_CLASS_FLOAT32ARRAY 28 -#define DUK_HOBJECT_CLASS_FLOAT64ARRAY 29 -#define DUK_HOBJECT_CLASS_BUFOBJ_MAX 29 -#define DUK_HOBJECT_CLASS_MAX 29 +#define DUK_HOBJECT_CLASS_NONE 0 +#define DUK_HOBJECT_CLASS_OBJECT 1 +#define DUK_HOBJECT_CLASS_ARRAY 2 +#define DUK_HOBJECT_CLASS_FUNCTION 3 +#define DUK_HOBJECT_CLASS_ARGUMENTS 4 +#define DUK_HOBJECT_CLASS_BOOLEAN 5 +#define DUK_HOBJECT_CLASS_DATE 6 +#define DUK_HOBJECT_CLASS_ERROR 7 +#define DUK_HOBJECT_CLASS_JSON 8 +#define DUK_HOBJECT_CLASS_MATH 9 +#define DUK_HOBJECT_CLASS_NUMBER 10 +#define DUK_HOBJECT_CLASS_REGEXP 11 +#define DUK_HOBJECT_CLASS_STRING 12 +#define DUK_HOBJECT_CLASS_GLOBAL 13 +#define DUK_HOBJECT_CLASS_SYMBOL 14 +#define DUK_HOBJECT_CLASS_OBJENV 15 /* custom */ +#define DUK_HOBJECT_CLASS_DECENV 16 /* custom */ +#define DUK_HOBJECT_CLASS_POINTER 17 /* custom */ +#define DUK_HOBJECT_CLASS_THREAD 18 /* custom; implies DUK_HOBJECT_IS_THREAD */ +#define DUK_HOBJECT_CLASS_BUFOBJ_MIN 19 +#define DUK_HOBJECT_CLASS_ARRAYBUFFER 19 /* implies DUK_HOBJECT_IS_BUFOBJ */ +#define DUK_HOBJECT_CLASS_DATAVIEW 20 +#define DUK_HOBJECT_CLASS_INT8ARRAY 21 +#define DUK_HOBJECT_CLASS_UINT8ARRAY 22 +#define DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY 23 +#define DUK_HOBJECT_CLASS_INT16ARRAY 24 +#define DUK_HOBJECT_CLASS_UINT16ARRAY 25 +#define DUK_HOBJECT_CLASS_INT32ARRAY 26 +#define DUK_HOBJECT_CLASS_UINT32ARRAY 27 +#define DUK_HOBJECT_CLASS_FLOAT32ARRAY 28 +#define DUK_HOBJECT_CLASS_FLOAT64ARRAY 29 +#define DUK_HOBJECT_CLASS_BUFOBJ_MAX 29 +#define DUK_HOBJECT_CLASS_MAX 29 /* Class masks. */ -#define DUK_HOBJECT_CMASK_ALL ((1UL << (DUK_HOBJECT_CLASS_MAX + 1)) - 1UL) -#define DUK_HOBJECT_CMASK_NONE (1UL << DUK_HOBJECT_CLASS_NONE) -#define DUK_HOBJECT_CMASK_ARGUMENTS (1UL << DUK_HOBJECT_CLASS_ARGUMENTS) -#define DUK_HOBJECT_CMASK_ARRAY (1UL << DUK_HOBJECT_CLASS_ARRAY) -#define DUK_HOBJECT_CMASK_BOOLEAN (1UL << DUK_HOBJECT_CLASS_BOOLEAN) -#define DUK_HOBJECT_CMASK_DATE (1UL << DUK_HOBJECT_CLASS_DATE) -#define DUK_HOBJECT_CMASK_ERROR (1UL << DUK_HOBJECT_CLASS_ERROR) -#define DUK_HOBJECT_CMASK_FUNCTION (1UL << DUK_HOBJECT_CLASS_FUNCTION) -#define DUK_HOBJECT_CMASK_JSON (1UL << DUK_HOBJECT_CLASS_JSON) -#define DUK_HOBJECT_CMASK_MATH (1UL << DUK_HOBJECT_CLASS_MATH) -#define DUK_HOBJECT_CMASK_NUMBER (1UL << DUK_HOBJECT_CLASS_NUMBER) -#define DUK_HOBJECT_CMASK_OBJECT (1UL << DUK_HOBJECT_CLASS_OBJECT) -#define DUK_HOBJECT_CMASK_REGEXP (1UL << DUK_HOBJECT_CLASS_REGEXP) -#define DUK_HOBJECT_CMASK_STRING (1UL << DUK_HOBJECT_CLASS_STRING) -#define DUK_HOBJECT_CMASK_GLOBAL (1UL << DUK_HOBJECT_CLASS_GLOBAL) -#define DUK_HOBJECT_CMASK_SYMBOL (1UL << DUK_HOBJECT_CLASS_SYMBOL) -#define DUK_HOBJECT_CMASK_OBJENV (1UL << DUK_HOBJECT_CLASS_OBJENV) -#define DUK_HOBJECT_CMASK_DECENV (1UL << DUK_HOBJECT_CLASS_DECENV) -#define DUK_HOBJECT_CMASK_POINTER (1UL << DUK_HOBJECT_CLASS_POINTER) -#define DUK_HOBJECT_CMASK_ARRAYBUFFER (1UL << DUK_HOBJECT_CLASS_ARRAYBUFFER) -#define DUK_HOBJECT_CMASK_DATAVIEW (1UL << DUK_HOBJECT_CLASS_DATAVIEW) -#define DUK_HOBJECT_CMASK_INT8ARRAY (1UL << DUK_HOBJECT_CLASS_INT8ARRAY) -#define DUK_HOBJECT_CMASK_UINT8ARRAY (1UL << DUK_HOBJECT_CLASS_UINT8ARRAY) -#define DUK_HOBJECT_CMASK_UINT8CLAMPEDARRAY (1UL << DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY) -#define DUK_HOBJECT_CMASK_INT16ARRAY (1UL << DUK_HOBJECT_CLASS_INT16ARRAY) -#define DUK_HOBJECT_CMASK_UINT16ARRAY (1UL << DUK_HOBJECT_CLASS_UINT16ARRAY) -#define DUK_HOBJECT_CMASK_INT32ARRAY (1UL << DUK_HOBJECT_CLASS_INT32ARRAY) -#define DUK_HOBJECT_CMASK_UINT32ARRAY (1UL << DUK_HOBJECT_CLASS_UINT32ARRAY) -#define DUK_HOBJECT_CMASK_FLOAT32ARRAY (1UL << DUK_HOBJECT_CLASS_FLOAT32ARRAY) -#define DUK_HOBJECT_CMASK_FLOAT64ARRAY (1UL << DUK_HOBJECT_CLASS_FLOAT64ARRAY) +#define DUK_HOBJECT_CMASK_ALL ((1UL << (DUK_HOBJECT_CLASS_MAX + 1)) - 1UL) +#define DUK_HOBJECT_CMASK_NONE (1UL << DUK_HOBJECT_CLASS_NONE) +#define DUK_HOBJECT_CMASK_ARGUMENTS (1UL << DUK_HOBJECT_CLASS_ARGUMENTS) +#define DUK_HOBJECT_CMASK_ARRAY (1UL << DUK_HOBJECT_CLASS_ARRAY) +#define DUK_HOBJECT_CMASK_BOOLEAN (1UL << DUK_HOBJECT_CLASS_BOOLEAN) +#define DUK_HOBJECT_CMASK_DATE (1UL << DUK_HOBJECT_CLASS_DATE) +#define DUK_HOBJECT_CMASK_ERROR (1UL << DUK_HOBJECT_CLASS_ERROR) +#define DUK_HOBJECT_CMASK_FUNCTION (1UL << DUK_HOBJECT_CLASS_FUNCTION) +#define DUK_HOBJECT_CMASK_JSON (1UL << DUK_HOBJECT_CLASS_JSON) +#define DUK_HOBJECT_CMASK_MATH (1UL << DUK_HOBJECT_CLASS_MATH) +#define DUK_HOBJECT_CMASK_NUMBER (1UL << DUK_HOBJECT_CLASS_NUMBER) +#define DUK_HOBJECT_CMASK_OBJECT (1UL << DUK_HOBJECT_CLASS_OBJECT) +#define DUK_HOBJECT_CMASK_REGEXP (1UL << DUK_HOBJECT_CLASS_REGEXP) +#define DUK_HOBJECT_CMASK_STRING (1UL << DUK_HOBJECT_CLASS_STRING) +#define DUK_HOBJECT_CMASK_GLOBAL (1UL << DUK_HOBJECT_CLASS_GLOBAL) +#define DUK_HOBJECT_CMASK_SYMBOL (1UL << DUK_HOBJECT_CLASS_SYMBOL) +#define DUK_HOBJECT_CMASK_OBJENV (1UL << DUK_HOBJECT_CLASS_OBJENV) +#define DUK_HOBJECT_CMASK_DECENV (1UL << DUK_HOBJECT_CLASS_DECENV) +#define DUK_HOBJECT_CMASK_POINTER (1UL << DUK_HOBJECT_CLASS_POINTER) +#define DUK_HOBJECT_CMASK_ARRAYBUFFER (1UL << DUK_HOBJECT_CLASS_ARRAYBUFFER) +#define DUK_HOBJECT_CMASK_DATAVIEW (1UL << DUK_HOBJECT_CLASS_DATAVIEW) +#define DUK_HOBJECT_CMASK_INT8ARRAY (1UL << DUK_HOBJECT_CLASS_INT8ARRAY) +#define DUK_HOBJECT_CMASK_UINT8ARRAY (1UL << DUK_HOBJECT_CLASS_UINT8ARRAY) +#define DUK_HOBJECT_CMASK_UINT8CLAMPEDARRAY (1UL << DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY) +#define DUK_HOBJECT_CMASK_INT16ARRAY (1UL << DUK_HOBJECT_CLASS_INT16ARRAY) +#define DUK_HOBJECT_CMASK_UINT16ARRAY (1UL << DUK_HOBJECT_CLASS_UINT16ARRAY) +#define DUK_HOBJECT_CMASK_INT32ARRAY (1UL << DUK_HOBJECT_CLASS_INT32ARRAY) +#define DUK_HOBJECT_CMASK_UINT32ARRAY (1UL << DUK_HOBJECT_CLASS_UINT32ARRAY) +#define DUK_HOBJECT_CMASK_FLOAT32ARRAY (1UL << DUK_HOBJECT_CLASS_FLOAT32ARRAY) +#define DUK_HOBJECT_CMASK_FLOAT64ARRAY (1UL << DUK_HOBJECT_CLASS_FLOAT64ARRAY) #define DUK_HOBJECT_CMASK_ALL_BUFOBJS \ - (DUK_HOBJECT_CMASK_ARRAYBUFFER | \ - DUK_HOBJECT_CMASK_DATAVIEW | \ - DUK_HOBJECT_CMASK_INT8ARRAY | \ - DUK_HOBJECT_CMASK_UINT8ARRAY | \ - DUK_HOBJECT_CMASK_UINT8CLAMPEDARRAY | \ - DUK_HOBJECT_CMASK_INT16ARRAY | \ - DUK_HOBJECT_CMASK_UINT16ARRAY | \ - DUK_HOBJECT_CMASK_INT32ARRAY | \ - DUK_HOBJECT_CMASK_UINT32ARRAY | \ - DUK_HOBJECT_CMASK_FLOAT32ARRAY | \ + (DUK_HOBJECT_CMASK_ARRAYBUFFER | DUK_HOBJECT_CMASK_DATAVIEW | DUK_HOBJECT_CMASK_INT8ARRAY | DUK_HOBJECT_CMASK_UINT8ARRAY | \ + DUK_HOBJECT_CMASK_UINT8CLAMPEDARRAY | DUK_HOBJECT_CMASK_INT16ARRAY | DUK_HOBJECT_CMASK_UINT16ARRAY | \ + DUK_HOBJECT_CMASK_INT32ARRAY | DUK_HOBJECT_CMASK_UINT32ARRAY | DUK_HOBJECT_CMASK_FLOAT32ARRAY | \ DUK_HOBJECT_CMASK_FLOAT64ARRAY) -#define DUK_HOBJECT_IS_OBJENV(h) (DUK_HOBJECT_GET_CLASS_NUMBER((h)) == DUK_HOBJECT_CLASS_OBJENV) -#define DUK_HOBJECT_IS_DECENV(h) (DUK_HOBJECT_GET_CLASS_NUMBER((h)) == DUK_HOBJECT_CLASS_DECENV) -#define DUK_HOBJECT_IS_ENV(h) (DUK_HOBJECT_IS_OBJENV((h)) || DUK_HOBJECT_IS_DECENV((h))) -#define DUK_HOBJECT_IS_ARRAY(h) DUK_HOBJECT_HAS_EXOTIC_ARRAY((h)) /* Rely on class Array <=> exotic Array */ -#define DUK_HOBJECT_IS_BOUNDFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) -#define DUK_HOBJECT_IS_COMPFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) -#define DUK_HOBJECT_IS_NATFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) +#define DUK_HOBJECT_IS_OBJENV(h) (DUK_HOBJECT_GET_CLASS_NUMBER((h)) == DUK_HOBJECT_CLASS_OBJENV) +#define DUK_HOBJECT_IS_DECENV(h) (DUK_HOBJECT_GET_CLASS_NUMBER((h)) == DUK_HOBJECT_CLASS_DECENV) +#define DUK_HOBJECT_IS_ENV(h) (DUK_HOBJECT_IS_OBJENV((h)) || DUK_HOBJECT_IS_DECENV((h))) +#define DUK_HOBJECT_IS_ARRAY(h) DUK_HOBJECT_HAS_EXOTIC_ARRAY((h)) /* Rely on class Array <=> exotic Array */ +#define DUK_HOBJECT_IS_BOUNDFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) +#define DUK_HOBJECT_IS_COMPFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) +#define DUK_HOBJECT_IS_NATFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -#define DUK_HOBJECT_IS_BUFOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) +#define DUK_HOBJECT_IS_BUFOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) #else -#define DUK_HOBJECT_IS_BUFOBJ(h) 0 +#define DUK_HOBJECT_IS_BUFOBJ(h) 0 #endif -#define DUK_HOBJECT_IS_THREAD(h) (DUK_HOBJECT_GET_CLASS_NUMBER((h)) == DUK_HOBJECT_CLASS_THREAD) +#define DUK_HOBJECT_IS_THREAD(h) (DUK_HOBJECT_GET_CLASS_NUMBER((h)) == DUK_HOBJECT_CLASS_THREAD) #if defined(DUK_USE_ES6_PROXY) -#define DUK_HOBJECT_IS_PROXY(h) DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ((h)) +#define DUK_HOBJECT_IS_PROXY(h) DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ((h)) #else -#define DUK_HOBJECT_IS_PROXY(h) 0 +#define DUK_HOBJECT_IS_PROXY(h) 0 #endif -#define DUK_HOBJECT_IS_NONBOUND_FUNCTION(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, \ - DUK_HOBJECT_FLAG_COMPFUNC | \ - DUK_HOBJECT_FLAG_NATFUNC) +#define DUK_HOBJECT_IS_NONBOUND_FUNCTION(h) \ + DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC | DUK_HOBJECT_FLAG_NATFUNC) -#define DUK_HOBJECT_IS_FUNCTION(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, \ - DUK_HOBJECT_FLAG_BOUNDFUNC | \ - DUK_HOBJECT_FLAG_COMPFUNC | \ - DUK_HOBJECT_FLAG_NATFUNC) +#define DUK_HOBJECT_IS_FUNCTION(h) \ + DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC | DUK_HOBJECT_FLAG_COMPFUNC | DUK_HOBJECT_FLAG_NATFUNC) -#define DUK_HOBJECT_IS_CALLABLE(h) DUK_HOBJECT_HAS_CALLABLE((h)) +#define DUK_HOBJECT_IS_CALLABLE(h) DUK_HOBJECT_HAS_CALLABLE((h)) /* Object has any exotic behavior(s). */ -#define DUK_HOBJECT_EXOTIC_BEHAVIOR_FLAGS (DUK_HOBJECT_FLAG_EXOTIC_ARRAY | \ - DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS | \ - DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | \ - DUK_HOBJECT_FLAG_BUFOBJ | \ - DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) -#define DUK_HOBJECT_HAS_EXOTIC_BEHAVIOR(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_EXOTIC_BEHAVIOR_FLAGS) +#define DUK_HOBJECT_EXOTIC_BEHAVIOR_FLAGS \ + (DUK_HOBJECT_FLAG_EXOTIC_ARRAY | DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS | DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | \ + DUK_HOBJECT_FLAG_BUFOBJ | DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) +#define DUK_HOBJECT_HAS_EXOTIC_BEHAVIOR(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_EXOTIC_BEHAVIOR_FLAGS) /* Object has any virtual properties (not counting Proxy behavior). */ -#define DUK_HOBJECT_VIRTUAL_PROPERTY_FLAGS (DUK_HOBJECT_FLAG_EXOTIC_ARRAY | \ - DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | \ - DUK_HOBJECT_FLAG_BUFOBJ) -#define DUK_HOBJECT_HAS_VIRTUAL_PROPERTIES(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_VIRTUAL_PROPERTY_FLAGS) +#define DUK_HOBJECT_VIRTUAL_PROPERTY_FLAGS \ + (DUK_HOBJECT_FLAG_EXOTIC_ARRAY | DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | DUK_HOBJECT_FLAG_BUFOBJ) +#define DUK_HOBJECT_HAS_VIRTUAL_PROPERTIES(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_VIRTUAL_PROPERTY_FLAGS) -#define DUK_HOBJECT_HAS_EXTENSIBLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXTENSIBLE) -#define DUK_HOBJECT_HAS_CONSTRUCTABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CONSTRUCTABLE) -#define DUK_HOBJECT_HAS_CALLABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CALLABLE) -#define DUK_HOBJECT_HAS_BOUNDFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) -#define DUK_HOBJECT_HAS_COMPFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) -#define DUK_HOBJECT_HAS_NATFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) +#define DUK_HOBJECT_HAS_EXTENSIBLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXTENSIBLE) +#define DUK_HOBJECT_HAS_CONSTRUCTABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CONSTRUCTABLE) +#define DUK_HOBJECT_HAS_CALLABLE(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CALLABLE) +#define DUK_HOBJECT_HAS_BOUNDFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) +#define DUK_HOBJECT_HAS_COMPFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) +#define DUK_HOBJECT_HAS_NATFUNC(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -#define DUK_HOBJECT_HAS_BUFOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) +#define DUK_HOBJECT_HAS_BUFOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) #else -#define DUK_HOBJECT_HAS_BUFOBJ(h) 0 +#define DUK_HOBJECT_HAS_BUFOBJ(h) 0 #endif -#define DUK_HOBJECT_HAS_FASTREFS(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_FASTREFS) -#define DUK_HOBJECT_HAS_ARRAY_PART(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_ARRAY_PART) -#define DUK_HOBJECT_HAS_STRICT(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_STRICT) -#define DUK_HOBJECT_HAS_NOTAIL(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NOTAIL) -#define DUK_HOBJECT_HAS_NEWENV(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NEWENV) -#define DUK_HOBJECT_HAS_NAMEBINDING(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NAMEBINDING) -#define DUK_HOBJECT_HAS_CREATEARGS(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CREATEARGS) -#define DUK_HOBJECT_HAS_HAVE_FINALIZER(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_HAVE_FINALIZER) -#define DUK_HOBJECT_HAS_EXOTIC_ARRAY(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARRAY) -#define DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ) -#define DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS) +#define DUK_HOBJECT_HAS_FASTREFS(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_FASTREFS) +#define DUK_HOBJECT_HAS_ARRAY_PART(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_ARRAY_PART) +#define DUK_HOBJECT_HAS_STRICT(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_STRICT) +#define DUK_HOBJECT_HAS_NOTAIL(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NOTAIL) +#define DUK_HOBJECT_HAS_NEWENV(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NEWENV) +#define DUK_HOBJECT_HAS_NAMEBINDING(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NAMEBINDING) +#define DUK_HOBJECT_HAS_CREATEARGS(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CREATEARGS) +#define DUK_HOBJECT_HAS_HAVE_FINALIZER(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_HAVE_FINALIZER) +#define DUK_HOBJECT_HAS_EXOTIC_ARRAY(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARRAY) +#define DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ) +#define DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS) #if defined(DUK_USE_ES6_PROXY) -#define DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) +#define DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) #else -#define DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h) 0 +#define DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h) 0 #endif -#define DUK_HOBJECT_HAS_SPECIAL_CALL(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_SPECIAL_CALL) +#define DUK_HOBJECT_HAS_SPECIAL_CALL(h) DUK_HEAPHDR_CHECK_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_SPECIAL_CALL) -#define DUK_HOBJECT_SET_EXTENSIBLE(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXTENSIBLE) -#define DUK_HOBJECT_SET_CONSTRUCTABLE(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CONSTRUCTABLE) -#define DUK_HOBJECT_SET_CALLABLE(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CALLABLE) -#define DUK_HOBJECT_SET_BOUNDFUNC(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) -#define DUK_HOBJECT_SET_COMPFUNC(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) -#define DUK_HOBJECT_SET_NATFUNC(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) +#define DUK_HOBJECT_SET_EXTENSIBLE(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXTENSIBLE) +#define DUK_HOBJECT_SET_CONSTRUCTABLE(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CONSTRUCTABLE) +#define DUK_HOBJECT_SET_CALLABLE(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CALLABLE) +#define DUK_HOBJECT_SET_BOUNDFUNC(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) +#define DUK_HOBJECT_SET_COMPFUNC(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) +#define DUK_HOBJECT_SET_NATFUNC(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -#define DUK_HOBJECT_SET_BUFOBJ(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) +#define DUK_HOBJECT_SET_BUFOBJ(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) #endif -#define DUK_HOBJECT_SET_FASTREFS(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_FASTREFS) -#define DUK_HOBJECT_SET_ARRAY_PART(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_ARRAY_PART) -#define DUK_HOBJECT_SET_STRICT(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_STRICT) -#define DUK_HOBJECT_SET_NOTAIL(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NOTAIL) -#define DUK_HOBJECT_SET_NEWENV(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NEWENV) -#define DUK_HOBJECT_SET_NAMEBINDING(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NAMEBINDING) -#define DUK_HOBJECT_SET_CREATEARGS(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CREATEARGS) -#define DUK_HOBJECT_SET_HAVE_FINALIZER(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_HAVE_FINALIZER) -#define DUK_HOBJECT_SET_EXOTIC_ARRAY(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARRAY) -#define DUK_HOBJECT_SET_EXOTIC_STRINGOBJ(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ) -#define DUK_HOBJECT_SET_EXOTIC_ARGUMENTS(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS) +#define DUK_HOBJECT_SET_FASTREFS(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_FASTREFS) +#define DUK_HOBJECT_SET_ARRAY_PART(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_ARRAY_PART) +#define DUK_HOBJECT_SET_STRICT(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_STRICT) +#define DUK_HOBJECT_SET_NOTAIL(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NOTAIL) +#define DUK_HOBJECT_SET_NEWENV(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NEWENV) +#define DUK_HOBJECT_SET_NAMEBINDING(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NAMEBINDING) +#define DUK_HOBJECT_SET_CREATEARGS(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CREATEARGS) +#define DUK_HOBJECT_SET_HAVE_FINALIZER(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_HAVE_FINALIZER) +#define DUK_HOBJECT_SET_EXOTIC_ARRAY(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARRAY) +#define DUK_HOBJECT_SET_EXOTIC_STRINGOBJ(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ) +#define DUK_HOBJECT_SET_EXOTIC_ARGUMENTS(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS) #if defined(DUK_USE_ES6_PROXY) -#define DUK_HOBJECT_SET_EXOTIC_PROXYOBJ(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) +#define DUK_HOBJECT_SET_EXOTIC_PROXYOBJ(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) #endif -#define DUK_HOBJECT_SET_SPECIAL_CALL(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_SPECIAL_CALL) +#define DUK_HOBJECT_SET_SPECIAL_CALL(h) DUK_HEAPHDR_SET_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_SPECIAL_CALL) -#define DUK_HOBJECT_CLEAR_EXTENSIBLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXTENSIBLE) -#define DUK_HOBJECT_CLEAR_CONSTRUCTABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CONSTRUCTABLE) -#define DUK_HOBJECT_CLEAR_CALLABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CALLABLE) -#define DUK_HOBJECT_CLEAR_BOUNDFUNC(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) -#define DUK_HOBJECT_CLEAR_COMPFUNC(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) -#define DUK_HOBJECT_CLEAR_NATFUNC(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) +#define DUK_HOBJECT_CLEAR_EXTENSIBLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXTENSIBLE) +#define DUK_HOBJECT_CLEAR_CONSTRUCTABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CONSTRUCTABLE) +#define DUK_HOBJECT_CLEAR_CALLABLE(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CALLABLE) +#define DUK_HOBJECT_CLEAR_BOUNDFUNC(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BOUNDFUNC) +#define DUK_HOBJECT_CLEAR_COMPFUNC(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_COMPFUNC) +#define DUK_HOBJECT_CLEAR_NATFUNC(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NATFUNC) #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -#define DUK_HOBJECT_CLEAR_BUFOBJ(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) +#define DUK_HOBJECT_CLEAR_BUFOBJ(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_BUFOBJ) #endif -#define DUK_HOBJECT_CLEAR_FASTREFS(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_FASTREFS) -#define DUK_HOBJECT_CLEAR_ARRAY_PART(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_ARRAY_PART) -#define DUK_HOBJECT_CLEAR_STRICT(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_STRICT) -#define DUK_HOBJECT_CLEAR_NOTAIL(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NOTAIL) -#define DUK_HOBJECT_CLEAR_NEWENV(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NEWENV) -#define DUK_HOBJECT_CLEAR_NAMEBINDING(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NAMEBINDING) -#define DUK_HOBJECT_CLEAR_CREATEARGS(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CREATEARGS) -#define DUK_HOBJECT_CLEAR_HAVE_FINALIZER(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_HAVE_FINALIZER) -#define DUK_HOBJECT_CLEAR_EXOTIC_ARRAY(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARRAY) -#define DUK_HOBJECT_CLEAR_EXOTIC_STRINGOBJ(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ) -#define DUK_HOBJECT_CLEAR_EXOTIC_ARGUMENTS(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS) +#define DUK_HOBJECT_CLEAR_FASTREFS(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_FASTREFS) +#define DUK_HOBJECT_CLEAR_ARRAY_PART(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_ARRAY_PART) +#define DUK_HOBJECT_CLEAR_STRICT(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_STRICT) +#define DUK_HOBJECT_CLEAR_NOTAIL(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NOTAIL) +#define DUK_HOBJECT_CLEAR_NEWENV(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NEWENV) +#define DUK_HOBJECT_CLEAR_NAMEBINDING(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_NAMEBINDING) +#define DUK_HOBJECT_CLEAR_CREATEARGS(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_CREATEARGS) +#define DUK_HOBJECT_CLEAR_HAVE_FINALIZER(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_HAVE_FINALIZER) +#define DUK_HOBJECT_CLEAR_EXOTIC_ARRAY(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARRAY) +#define DUK_HOBJECT_CLEAR_EXOTIC_STRINGOBJ(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ) +#define DUK_HOBJECT_CLEAR_EXOTIC_ARGUMENTS(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS) #if defined(DUK_USE_ES6_PROXY) -#define DUK_HOBJECT_CLEAR_EXOTIC_PROXYOBJ(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) +#define DUK_HOBJECT_CLEAR_EXOTIC_PROXYOBJ(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ) #endif -#define DUK_HOBJECT_CLEAR_SPECIAL_CALL(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_SPECIAL_CALL) +#define DUK_HOBJECT_CLEAR_SPECIAL_CALL(h) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(h)->hdr, DUK_HOBJECT_FLAG_SPECIAL_CALL) /* Object can/cannot use FASTREFS, i.e. has no strong reference fields beyond * duk_hobject base header. This is used just for asserts so doesn't need to * be optimized. */ #define DUK_HOBJECT_PROHIBITS_FASTREFS(h) \ - (DUK_HOBJECT_IS_COMPFUNC((h)) || DUK_HOBJECT_IS_DECENV((h)) || DUK_HOBJECT_IS_OBJENV((h)) || \ - DUK_HOBJECT_IS_BUFOBJ((h)) || DUK_HOBJECT_IS_THREAD((h)) || DUK_HOBJECT_IS_PROXY((h)) || \ - DUK_HOBJECT_IS_BOUNDFUNC((h))) + (DUK_HOBJECT_IS_COMPFUNC((h)) || DUK_HOBJECT_IS_DECENV((h)) || DUK_HOBJECT_IS_OBJENV((h)) || DUK_HOBJECT_IS_BUFOBJ((h)) || \ + DUK_HOBJECT_IS_THREAD((h)) || DUK_HOBJECT_IS_PROXY((h)) || DUK_HOBJECT_IS_BOUNDFUNC((h))) #define DUK_HOBJECT_ALLOWS_FASTREFS(h) (!DUK_HOBJECT_PROHIBITS_FASTREFS((h))) /* Flags used for property attributes in duk_propdesc and packed flags. * Must fit into 8 bits. */ -#define DUK_PROPDESC_FLAG_WRITABLE (1U << 0) /* E5 Section 8.6.1 */ -#define DUK_PROPDESC_FLAG_ENUMERABLE (1U << 1) /* E5 Section 8.6.1 */ -#define DUK_PROPDESC_FLAG_CONFIGURABLE (1U << 2) /* E5 Section 8.6.1 */ -#define DUK_PROPDESC_FLAG_ACCESSOR (1U << 3) /* accessor */ -#define DUK_PROPDESC_FLAG_VIRTUAL (1U << 4) /* property is virtual: used in duk_propdesc, never stored - * (used by e.g. buffer virtual properties) - */ -#define DUK_PROPDESC_FLAGS_MASK (DUK_PROPDESC_FLAG_WRITABLE | \ - DUK_PROPDESC_FLAG_ENUMERABLE | \ - DUK_PROPDESC_FLAG_CONFIGURABLE | \ - DUK_PROPDESC_FLAG_ACCESSOR) +#define DUK_PROPDESC_FLAG_WRITABLE (1U << 0) /* E5 Section 8.6.1 */ +#define DUK_PROPDESC_FLAG_ENUMERABLE (1U << 1) /* E5 Section 8.6.1 */ +#define DUK_PROPDESC_FLAG_CONFIGURABLE (1U << 2) /* E5 Section 8.6.1 */ +#define DUK_PROPDESC_FLAG_ACCESSOR (1U << 3) /* accessor */ +#define DUK_PROPDESC_FLAG_VIRTUAL \ + (1U << 4) /* property is virtual: used in duk_propdesc, never stored \ + * (used by e.g. buffer virtual properties) \ + */ +#define DUK_PROPDESC_FLAGS_MASK \ + (DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE | DUK_PROPDESC_FLAG_CONFIGURABLE | DUK_PROPDESC_FLAG_ACCESSOR) /* Additional flags which are passed in the same flags argument as property * flags but are not stored in object properties. */ -#define DUK_PROPDESC_FLAG_NO_OVERWRITE (1U << 4) /* internal define property: skip write silently if exists */ +#define DUK_PROPDESC_FLAG_NO_OVERWRITE (1U << 4) /* internal define property: skip write silently if exists */ /* Convenience defines for property attributes. */ -#define DUK_PROPDESC_FLAGS_NONE 0 -#define DUK_PROPDESC_FLAGS_W (DUK_PROPDESC_FLAG_WRITABLE) -#define DUK_PROPDESC_FLAGS_E (DUK_PROPDESC_FLAG_ENUMERABLE) -#define DUK_PROPDESC_FLAGS_C (DUK_PROPDESC_FLAG_CONFIGURABLE) -#define DUK_PROPDESC_FLAGS_WE (DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE) -#define DUK_PROPDESC_FLAGS_WC (DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_CONFIGURABLE) -#define DUK_PROPDESC_FLAGS_EC (DUK_PROPDESC_FLAG_ENUMERABLE | DUK_PROPDESC_FLAG_CONFIGURABLE) -#define DUK_PROPDESC_FLAGS_WEC (DUK_PROPDESC_FLAG_WRITABLE | \ - DUK_PROPDESC_FLAG_ENUMERABLE | \ - DUK_PROPDESC_FLAG_CONFIGURABLE) +#define DUK_PROPDESC_FLAGS_NONE 0 +#define DUK_PROPDESC_FLAGS_W (DUK_PROPDESC_FLAG_WRITABLE) +#define DUK_PROPDESC_FLAGS_E (DUK_PROPDESC_FLAG_ENUMERABLE) +#define DUK_PROPDESC_FLAGS_C (DUK_PROPDESC_FLAG_CONFIGURABLE) +#define DUK_PROPDESC_FLAGS_WE (DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE) +#define DUK_PROPDESC_FLAGS_WC (DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_CONFIGURABLE) +#define DUK_PROPDESC_FLAGS_EC (DUK_PROPDESC_FLAG_ENUMERABLE | DUK_PROPDESC_FLAG_CONFIGURABLE) +#define DUK_PROPDESC_FLAGS_WEC (DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE | DUK_PROPDESC_FLAG_CONFIGURABLE) /* Flags for duk_hobject_get_own_propdesc() and variants. */ -#define DUK_GETDESC_FLAG_PUSH_VALUE (1U << 0) /* push value to stack */ -#define DUK_GETDESC_FLAG_IGNORE_PROTOLOOP (1U << 1) /* don't throw for prototype loop */ +#define DUK_GETDESC_FLAG_PUSH_VALUE (1U << 0) /* push value to stack */ +#define DUK_GETDESC_FLAG_IGNORE_PROTOLOOP (1U << 1) /* don't throw for prototype loop */ /* * Macro for object validity check @@ -6456,9 +6869,14 @@ DUK_INTERNAL_DECL void duk_hstring_init_charlen(duk_hstring *h); #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); -#define DUK_HOBJECT_ASSERT_VALID(h) do { duk_hobject_assert_valid((h)); } while (0) +#define DUK_HOBJECT_ASSERT_VALID(h) \ + do { \ + duk_hobject_assert_valid((h)); \ + } while (0) #else -#define DUK_HOBJECT_ASSERT_VALID(h) do {} while (0) +#define DUK_HOBJECT_ASSERT_VALID(h) \ + do { \ + } while (0) #endif /* @@ -6466,52 +6884,41 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HOBJECT_GET_PROPS(heap,h) \ - ((duk_uint8_t *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, ((duk_heaphdr *) (h))->h_extra16)) -#define DUK_HOBJECT_SET_PROPS(heap,h,x) do { \ +#define DUK_HOBJECT_GET_PROPS(heap, h) ((duk_uint8_t *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, ((duk_heaphdr *) (h))->h_extra16)) +#define DUK_HOBJECT_SET_PROPS(heap, h, x) \ + do { \ ((duk_heaphdr *) (h))->h_extra16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (x)); \ } while (0) #else -#define DUK_HOBJECT_GET_PROPS(heap,h) \ - ((h)->props) -#define DUK_HOBJECT_SET_PROPS(heap,h,x) do { \ +#define DUK_HOBJECT_GET_PROPS(heap, h) ((h)->props) +#define DUK_HOBJECT_SET_PROPS(heap, h, x) \ + do { \ (h)->props = (duk_uint8_t *) (x); \ } while (0) #endif #if defined(DUK_USE_HOBJECT_LAYOUT_1) /* LAYOUT 1 */ -#define DUK_HOBJECT_E_GET_KEY_BASE(heap,h) \ - ((duk_hstring **) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) \ - )) -#define DUK_HOBJECT_E_GET_VALUE_BASE(heap,h) \ - ((duk_propvalue *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_hstring *) \ - )) -#define DUK_HOBJECT_E_GET_FLAGS_BASE(heap,h) \ - ((duk_uint8_t *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue)) \ - )) -#define DUK_HOBJECT_A_GET_BASE(heap,h) \ - ((duk_tval *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) \ - )) -#define DUK_HOBJECT_H_GET_BASE(heap,h) \ - ((duk_uint32_t *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ - DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval) \ - )) -#define DUK_HOBJECT_P_COMPUTE_SIZE(n_ent,n_arr,n_hash) \ - ( \ - (n_ent) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ - (n_arr) * sizeof(duk_tval) + \ - (n_hash) * sizeof(duk_uint32_t) \ - ) -#define DUK_HOBJECT_P_SET_REALLOC_PTRS(p_base,set_e_k,set_e_pv,set_e_f,set_a,set_h,n_ent,n_arr,n_hash) do { \ +#define DUK_HOBJECT_E_GET_KEY_BASE(heap, h) ((duk_hstring **) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)))) +#define DUK_HOBJECT_E_GET_VALUE_BASE(heap, h) \ + ((duk_propvalue *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_hstring *))) +#define DUK_HOBJECT_E_GET_FLAGS_BASE(heap, h) \ + ((duk_uint8_t *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue)))) +#define DUK_HOBJECT_A_GET_BASE(heap, h) \ + ((duk_tval *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * \ + (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)))) +#define DUK_HOBJECT_H_GET_BASE(heap, h) \ + ((duk_uint32_t *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * \ + (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ + DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval))) +#define DUK_HOBJECT_P_COMPUTE_SIZE(n_ent, n_arr, n_hash) \ + ((n_ent) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + (n_arr) * sizeof(duk_tval) + \ + (n_hash) * sizeof(duk_uint32_t)) +#define DUK_HOBJECT_P_SET_REALLOC_PTRS(p_base, set_e_k, set_e_pv, set_e_f, set_a, set_h, n_ent, n_arr, n_hash) \ + do { \ (set_e_k) = (duk_hstring **) (void *) (p_base); \ (set_e_pv) = (duk_propvalue *) (void *) ((set_e_k) + (n_ent)); \ (set_e_f) = (duk_uint8_t *) (void *) ((set_e_pv) + (n_ent)); \ @@ -6529,85 +6936,57 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); #else #error invalid DUK_USE_ALIGN_BY #endif -#define DUK_HOBJECT_E_GET_KEY_BASE(heap,h) \ - ((duk_hstring **) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_propvalue) \ - )) -#define DUK_HOBJECT_E_GET_VALUE_BASE(heap,h) \ - ((duk_propvalue *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) \ - )) -#define DUK_HOBJECT_E_GET_FLAGS_BASE(heap,h) \ - ((duk_uint8_t *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue)) \ - )) -#define DUK_HOBJECT_A_GET_BASE(heap,h) \ - ((duk_tval *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ - DUK_HOBJECT_E_FLAG_PADDING(DUK_HOBJECT_GET_ESIZE((h))) \ - )) -#define DUK_HOBJECT_H_GET_BASE(heap,h) \ - ((duk_uint32_t *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ - DUK_HOBJECT_E_FLAG_PADDING(DUK_HOBJECT_GET_ESIZE((h))) + \ - DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval) \ - )) -#define DUK_HOBJECT_P_COMPUTE_SIZE(n_ent,n_arr,n_hash) \ - ( \ - (n_ent) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ - DUK_HOBJECT_E_FLAG_PADDING((n_ent)) + \ - (n_arr) * sizeof(duk_tval) + \ - (n_hash) * sizeof(duk_uint32_t) \ - ) -#define DUK_HOBJECT_P_SET_REALLOC_PTRS(p_base,set_e_k,set_e_pv,set_e_f,set_a,set_h,n_ent,n_arr,n_hash) do { \ +#define DUK_HOBJECT_E_GET_KEY_BASE(heap, h) \ + ((duk_hstring **) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_propvalue))) +#define DUK_HOBJECT_E_GET_VALUE_BASE(heap, h) ((duk_propvalue *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)))) +#define DUK_HOBJECT_E_GET_FLAGS_BASE(heap, h) \ + ((duk_uint8_t *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_hstring *) + sizeof(duk_propvalue)))) +#define DUK_HOBJECT_A_GET_BASE(heap, h) \ + ((duk_tval *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * \ + (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ + DUK_HOBJECT_E_FLAG_PADDING(DUK_HOBJECT_GET_ESIZE((h))))) +#define DUK_HOBJECT_H_GET_BASE(heap, h) \ + ((duk_uint32_t *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * \ + (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + \ + DUK_HOBJECT_E_FLAG_PADDING(DUK_HOBJECT_GET_ESIZE((h))) + \ + DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval))) +#define DUK_HOBJECT_P_COMPUTE_SIZE(n_ent, n_arr, n_hash) \ + ((n_ent) * (sizeof(duk_hstring *) + sizeof(duk_propvalue) + sizeof(duk_uint8_t)) + DUK_HOBJECT_E_FLAG_PADDING((n_ent)) + \ + (n_arr) * sizeof(duk_tval) + (n_hash) * sizeof(duk_uint32_t)) +#define DUK_HOBJECT_P_SET_REALLOC_PTRS(p_base, set_e_k, set_e_pv, set_e_f, set_a, set_h, n_ent, n_arr, n_hash) \ + do { \ (set_e_pv) = (duk_propvalue *) (void *) (p_base); \ (set_e_k) = (duk_hstring **) (void *) ((set_e_pv) + (n_ent)); \ (set_e_f) = (duk_uint8_t *) (void *) ((set_e_k) + (n_ent)); \ - (set_a) = (duk_tval *) (void *) (((duk_uint8_t *) (set_e_f)) + \ - sizeof(duk_uint8_t) * (n_ent) + \ + (set_a) = (duk_tval *) (void *) (((duk_uint8_t *) (set_e_f)) + sizeof(duk_uint8_t) * (n_ent) + \ DUK_HOBJECT_E_FLAG_PADDING((n_ent))); \ (set_h) = (duk_uint32_t *) (void *) ((set_a) + (n_arr)); \ } while (0) #elif defined(DUK_USE_HOBJECT_LAYOUT_3) /* LAYOUT 3 */ -#define DUK_HOBJECT_E_GET_KEY_BASE(heap,h) \ - ((duk_hstring **) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_propvalue) + \ - DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval) \ - )) -#define DUK_HOBJECT_E_GET_VALUE_BASE(heap,h) \ - ((duk_propvalue *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) \ - )) -#define DUK_HOBJECT_E_GET_FLAGS_BASE(heap,h) \ - ((duk_uint8_t *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_propvalue) + sizeof(duk_hstring *)) + \ - DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval) + \ - DUK_HOBJECT_GET_HSIZE((h)) * sizeof(duk_uint32_t) \ - )) -#define DUK_HOBJECT_A_GET_BASE(heap,h) \ - ((duk_tval *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_propvalue) \ - )) -#define DUK_HOBJECT_H_GET_BASE(heap,h) \ - ((duk_uint32_t *) (void *) ( \ - DUK_HOBJECT_GET_PROPS((heap), (h)) + \ - DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_propvalue) + sizeof(duk_hstring *)) + \ - DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval) \ - )) -#define DUK_HOBJECT_P_COMPUTE_SIZE(n_ent,n_arr,n_hash) \ - ( \ - (n_ent) * (sizeof(duk_propvalue) + sizeof(duk_hstring *) + sizeof(duk_uint8_t)) + \ - (n_arr) * sizeof(duk_tval) + \ - (n_hash) * sizeof(duk_uint32_t) \ - ) -#define DUK_HOBJECT_P_SET_REALLOC_PTRS(p_base,set_e_k,set_e_pv,set_e_f,set_a,set_h,n_ent,n_arr,n_hash) do { \ +#define DUK_HOBJECT_E_GET_KEY_BASE(heap, h) \ + ((duk_hstring **) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_propvalue) + \ + DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval))) +#define DUK_HOBJECT_E_GET_VALUE_BASE(heap, h) ((duk_propvalue *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)))) +#define DUK_HOBJECT_E_GET_FLAGS_BASE(heap, h) \ + ((duk_uint8_t *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_propvalue) + sizeof(duk_hstring *)) + \ + DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval) + \ + DUK_HOBJECT_GET_HSIZE((h)) * sizeof(duk_uint32_t))) +#define DUK_HOBJECT_A_GET_BASE(heap, h) \ + ((duk_tval *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + DUK_HOBJECT_GET_ESIZE((h)) * sizeof(duk_propvalue))) +#define DUK_HOBJECT_H_GET_BASE(heap, h) \ + ((duk_uint32_t *) (void *) (DUK_HOBJECT_GET_PROPS((heap), (h)) + \ + DUK_HOBJECT_GET_ESIZE((h)) * (sizeof(duk_propvalue) + sizeof(duk_hstring *)) + \ + DUK_HOBJECT_GET_ASIZE((h)) * sizeof(duk_tval))) +#define DUK_HOBJECT_P_COMPUTE_SIZE(n_ent, n_arr, n_hash) \ + ((n_ent) * (sizeof(duk_propvalue) + sizeof(duk_hstring *) + sizeof(duk_uint8_t)) + (n_arr) * sizeof(duk_tval) + \ + (n_hash) * sizeof(duk_uint32_t)) +#define DUK_HOBJECT_P_SET_REALLOC_PTRS(p_base, set_e_k, set_e_pv, set_e_f, set_a, set_h, n_ent, n_arr, n_hash) \ + do { \ (set_e_pv) = (duk_propvalue *) (void *) (p_base); \ (set_a) = (duk_tval *) (void *) ((set_e_pv) + (n_ent)); \ (set_e_k) = (duk_hstring **) (void *) ((set_a) + (n_arr)); \ @@ -6616,85 +6995,99 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); } while (0) #else #error invalid hobject layout defines -#endif /* hobject property layout */ +#endif /* hobject property layout */ #define DUK_HOBJECT_P_ALLOC_SIZE(h) \ DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE((h)), DUK_HOBJECT_GET_ASIZE((h)), DUK_HOBJECT_GET_HSIZE((h))) -#define DUK_HOBJECT_E_GET_KEY(heap,h,i) (DUK_HOBJECT_E_GET_KEY_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_E_GET_KEY_PTR(heap,h,i) (&DUK_HOBJECT_E_GET_KEY_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_E_GET_VALUE(heap,h,i) (DUK_HOBJECT_E_GET_VALUE_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_E_GET_VALUE_PTR(heap,h,i) (&DUK_HOBJECT_E_GET_VALUE_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_E_GET_VALUE_TVAL(heap,h,i) (DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).v) -#define DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(heap,h,i) (&DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).v) -#define DUK_HOBJECT_E_GET_VALUE_GETTER(heap,h,i) (DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.get) -#define DUK_HOBJECT_E_GET_VALUE_GETTER_PTR(heap,h,i) (&DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.get) -#define DUK_HOBJECT_E_GET_VALUE_SETTER(heap,h,i) (DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.set) -#define DUK_HOBJECT_E_GET_VALUE_SETTER_PTR(heap,h,i) (&DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.set) -#define DUK_HOBJECT_E_GET_FLAGS(heap,h,i) (DUK_HOBJECT_E_GET_FLAGS_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_E_GET_FLAGS_PTR(heap,h,i) (&DUK_HOBJECT_E_GET_FLAGS_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_A_GET_VALUE(heap,h,i) (DUK_HOBJECT_A_GET_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_A_GET_VALUE_PTR(heap,h,i) (&DUK_HOBJECT_A_GET_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_H_GET_INDEX(heap,h,i) (DUK_HOBJECT_H_GET_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_H_GET_INDEX_PTR(heap,h,i) (&DUK_HOBJECT_H_GET_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_E_GET_KEY(heap, h, i) (DUK_HOBJECT_E_GET_KEY_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_E_GET_KEY_PTR(heap, h, i) (&DUK_HOBJECT_E_GET_KEY_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_E_GET_VALUE(heap, h, i) (DUK_HOBJECT_E_GET_VALUE_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_E_GET_VALUE_PTR(heap, h, i) (&DUK_HOBJECT_E_GET_VALUE_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_E_GET_VALUE_TVAL(heap, h, i) (DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).v) +#define DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(heap, h, i) (&DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).v) +#define DUK_HOBJECT_E_GET_VALUE_GETTER(heap, h, i) (DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.get) +#define DUK_HOBJECT_E_GET_VALUE_GETTER_PTR(heap, h, i) (&DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.get) +#define DUK_HOBJECT_E_GET_VALUE_SETTER(heap, h, i) (DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.set) +#define DUK_HOBJECT_E_GET_VALUE_SETTER_PTR(heap, h, i) (&DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.set) +#define DUK_HOBJECT_E_GET_FLAGS(heap, h, i) (DUK_HOBJECT_E_GET_FLAGS_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_E_GET_FLAGS_PTR(heap, h, i) (&DUK_HOBJECT_E_GET_FLAGS_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_A_GET_VALUE(heap, h, i) (DUK_HOBJECT_A_GET_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_A_GET_VALUE_PTR(heap, h, i) (&DUK_HOBJECT_A_GET_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_H_GET_INDEX(heap, h, i) (DUK_HOBJECT_H_GET_BASE((heap), (h))[(i)]) +#define DUK_HOBJECT_H_GET_INDEX_PTR(heap, h, i) (&DUK_HOBJECT_H_GET_BASE((heap), (h))[(i)]) -#define DUK_HOBJECT_E_SET_KEY(heap,h,i,k) do { \ +#define DUK_HOBJECT_E_SET_KEY(heap, h, i, k) \ + do { \ DUK_HOBJECT_E_GET_KEY((heap), (h), (i)) = (k); \ } while (0) -#define DUK_HOBJECT_E_SET_VALUE(heap,h,i,v) do { \ +#define DUK_HOBJECT_E_SET_VALUE(heap, h, i, v) \ + do { \ DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)) = (v); \ } while (0) -#define DUK_HOBJECT_E_SET_VALUE_TVAL(heap,h,i,v) do { \ +#define DUK_HOBJECT_E_SET_VALUE_TVAL(heap, h, i, v) \ + do { \ DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).v = (v); \ } while (0) -#define DUK_HOBJECT_E_SET_VALUE_GETTER(heap,h,i,v) do { \ +#define DUK_HOBJECT_E_SET_VALUE_GETTER(heap, h, i, v) \ + do { \ DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.get = (v); \ } while (0) -#define DUK_HOBJECT_E_SET_VALUE_SETTER(heap,h,i,v) do { \ +#define DUK_HOBJECT_E_SET_VALUE_SETTER(heap, h, i, v) \ + do { \ DUK_HOBJECT_E_GET_VALUE((heap), (h), (i)).a.set = (v); \ } while (0) -#define DUK_HOBJECT_E_SET_FLAGS(heap,h,i,f) do { \ +#define DUK_HOBJECT_E_SET_FLAGS(heap, h, i, f) \ + do { \ DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) = (duk_uint8_t) (f); \ } while (0) -#define DUK_HOBJECT_A_SET_VALUE(heap,h,i,v) do { \ +#define DUK_HOBJECT_A_SET_VALUE(heap, h, i, v) \ + do { \ DUK_HOBJECT_A_GET_VALUE((heap), (h), (i)) = (v); \ } while (0) -#define DUK_HOBJECT_A_SET_VALUE_TVAL(heap,h,i,v) \ - DUK_HOBJECT_A_SET_VALUE((heap), (h), (i), (v)) /* alias for above */ -#define DUK_HOBJECT_H_SET_INDEX(heap,h,i,v) do { \ +#define DUK_HOBJECT_A_SET_VALUE_TVAL(heap, h, i, v) DUK_HOBJECT_A_SET_VALUE((heap), (h), (i), (v)) /* alias for above */ +#define DUK_HOBJECT_H_SET_INDEX(heap, h, i, v) \ + do { \ DUK_HOBJECT_H_GET_INDEX((heap), (h), (i)) = (v); \ } while (0) -#define DUK_HOBJECT_E_SET_FLAG_BITS(heap,h,i,mask) do { \ +#define DUK_HOBJECT_E_SET_FLAG_BITS(heap, h, i, mask) \ + do { \ DUK_HOBJECT_E_GET_FLAGS_BASE((heap), (h))[(i)] |= (mask); \ } while (0) -#define DUK_HOBJECT_E_CLEAR_FLAG_BITS(heap,h,i,mask) do { \ +#define DUK_HOBJECT_E_CLEAR_FLAG_BITS(heap, h, i, mask) \ + do { \ DUK_HOBJECT_E_GET_FLAGS_BASE((heap), (h))[(i)] &= ~(mask); \ } while (0) -#define DUK_HOBJECT_E_SLOT_IS_WRITABLE(heap,h,i) ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_WRITABLE) != 0) -#define DUK_HOBJECT_E_SLOT_IS_ENUMERABLE(heap,h,i) ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_ENUMERABLE) != 0) -#define DUK_HOBJECT_E_SLOT_IS_CONFIGURABLE(heap,h,i) ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_CONFIGURABLE) != 0) -#define DUK_HOBJECT_E_SLOT_IS_ACCESSOR(heap,h,i) ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_ACCESSOR) != 0) +#define DUK_HOBJECT_E_SLOT_IS_WRITABLE(heap, h, i) ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_WRITABLE) != 0) +#define DUK_HOBJECT_E_SLOT_IS_ENUMERABLE(heap, h, i) \ + ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_ENUMERABLE) != 0) +#define DUK_HOBJECT_E_SLOT_IS_CONFIGURABLE(heap, h, i) \ + ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_CONFIGURABLE) != 0) +#define DUK_HOBJECT_E_SLOT_IS_ACCESSOR(heap, h, i) ((DUK_HOBJECT_E_GET_FLAGS((heap), (h), (i)) & DUK_PROPDESC_FLAG_ACCESSOR) != 0) -#define DUK_HOBJECT_E_SLOT_SET_WRITABLE(heap,h,i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_WRITABLE) -#define DUK_HOBJECT_E_SLOT_SET_ENUMERABLE(heap,h,i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_ENUMERABLE) -#define DUK_HOBJECT_E_SLOT_SET_CONFIGURABLE(heap,h,i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_CONFIGURABLE) -#define DUK_HOBJECT_E_SLOT_SET_ACCESSOR(heap,h,i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_ACCESSOR) +#define DUK_HOBJECT_E_SLOT_SET_WRITABLE(heap, h, i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_WRITABLE) +#define DUK_HOBJECT_E_SLOT_SET_ENUMERABLE(heap, h, i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_ENUMERABLE) +#define DUK_HOBJECT_E_SLOT_SET_CONFIGURABLE(heap, h, i) \ + DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_CONFIGURABLE) +#define DUK_HOBJECT_E_SLOT_SET_ACCESSOR(heap, h, i) DUK_HOBJECT_E_SET_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_ACCESSOR) -#define DUK_HOBJECT_E_SLOT_CLEAR_WRITABLE(heap,h,i) DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_WRITABLE) -#define DUK_HOBJECT_E_SLOT_CLEAR_ENUMERABLE(heap,h,i) DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_ENUMERABLE) -#define DUK_HOBJECT_E_SLOT_CLEAR_CONFIGURABLE(heap,h,i) DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_CONFIGURABLE) -#define DUK_HOBJECT_E_SLOT_CLEAR_ACCESSOR(heap,h,i) DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i),DUK_PROPDESC_FLAG_ACCESSOR) +#define DUK_HOBJECT_E_SLOT_CLEAR_WRITABLE(heap, h, i) DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_WRITABLE) +#define DUK_HOBJECT_E_SLOT_CLEAR_ENUMERABLE(heap, h, i) \ + DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_ENUMERABLE) +#define DUK_HOBJECT_E_SLOT_CLEAR_CONFIGURABLE(heap, h, i) \ + DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_CONFIGURABLE) +#define DUK_HOBJECT_E_SLOT_CLEAR_ACCESSOR(heap, h, i) DUK_HOBJECT_E_CLEAR_FLAG_BITS((heap), (h), (i), DUK_PROPDESC_FLAG_ACCESSOR) -#define DUK_PROPDESC_IS_WRITABLE(p) (((p)->flags & DUK_PROPDESC_FLAG_WRITABLE) != 0) -#define DUK_PROPDESC_IS_ENUMERABLE(p) (((p)->flags & DUK_PROPDESC_FLAG_ENUMERABLE) != 0) -#define DUK_PROPDESC_IS_CONFIGURABLE(p) (((p)->flags & DUK_PROPDESC_FLAG_CONFIGURABLE) != 0) -#define DUK_PROPDESC_IS_ACCESSOR(p) (((p)->flags & DUK_PROPDESC_FLAG_ACCESSOR) != 0) +#define DUK_PROPDESC_IS_WRITABLE(p) (((p)->flags & DUK_PROPDESC_FLAG_WRITABLE) != 0) +#define DUK_PROPDESC_IS_ENUMERABLE(p) (((p)->flags & DUK_PROPDESC_FLAG_ENUMERABLE) != 0) +#define DUK_PROPDESC_IS_CONFIGURABLE(p) (((p)->flags & DUK_PROPDESC_FLAG_CONFIGURABLE) != 0) +#define DUK_PROPDESC_IS_ACCESSOR(p) (((p)->flags & DUK_PROPDESC_FLAG_ACCESSOR) != 0) -#define DUK_HOBJECT_HASHIDX_UNUSED 0xffffffffUL -#define DUK_HOBJECT_HASHIDX_DELETED 0xfffffffeUL +#define DUK_HOBJECT_HASHIDX_UNUSED 0xffffffffUL +#define DUK_HOBJECT_HASHIDX_DELETED 0xfffffffeUL /* * Macros for accessing size fields @@ -6702,33 +7095,63 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); #if defined(DUK_USE_OBJSIZES16) #define DUK_HOBJECT_GET_ESIZE(h) ((h)->e_size16) -#define DUK_HOBJECT_SET_ESIZE(h,v) do { (h)->e_size16 = (v); } while (0) +#define DUK_HOBJECT_SET_ESIZE(h, v) \ + do { \ + (h)->e_size16 = (v); \ + } while (0) #define DUK_HOBJECT_GET_ENEXT(h) ((h)->e_next16) -#define DUK_HOBJECT_SET_ENEXT(h,v) do { (h)->e_next16 = (v); } while (0) +#define DUK_HOBJECT_SET_ENEXT(h, v) \ + do { \ + (h)->e_next16 = (v); \ + } while (0) #define DUK_HOBJECT_POSTINC_ENEXT(h) ((h)->e_next16++) -#define DUK_HOBJECT_GET_ASIZE(h) ((h)->a_size16) -#define DUK_HOBJECT_SET_ASIZE(h,v) do { (h)->a_size16 = (v); } while (0) +#define DUK_HOBJECT_GET_ASIZE(h) ((h)->a_size16) +#define DUK_HOBJECT_SET_ASIZE(h, v) \ + do { \ + (h)->a_size16 = (v); \ + } while (0) #if defined(DUK_USE_HOBJECT_HASH_PART) #define DUK_HOBJECT_GET_HSIZE(h) ((h)->h_size16) -#define DUK_HOBJECT_SET_HSIZE(h,v) do { (h)->h_size16 = (v); } while (0) +#define DUK_HOBJECT_SET_HSIZE(h, v) \ + do { \ + (h)->h_size16 = (v); \ + } while (0) #else #define DUK_HOBJECT_GET_HSIZE(h) 0 -#define DUK_HOBJECT_SET_HSIZE(h,v) do { DUK_ASSERT((v) == 0); } while (0) +#define DUK_HOBJECT_SET_HSIZE(h, v) \ + do { \ + DUK_ASSERT((v) == 0); \ + } while (0) #endif #else #define DUK_HOBJECT_GET_ESIZE(h) ((h)->e_size) -#define DUK_HOBJECT_SET_ESIZE(h,v) do { (h)->e_size = (v); } while (0) +#define DUK_HOBJECT_SET_ESIZE(h, v) \ + do { \ + (h)->e_size = (v); \ + } while (0) #define DUK_HOBJECT_GET_ENEXT(h) ((h)->e_next) -#define DUK_HOBJECT_SET_ENEXT(h,v) do { (h)->e_next = (v); } while (0) +#define DUK_HOBJECT_SET_ENEXT(h, v) \ + do { \ + (h)->e_next = (v); \ + } while (0) #define DUK_HOBJECT_POSTINC_ENEXT(h) ((h)->e_next++) -#define DUK_HOBJECT_GET_ASIZE(h) ((h)->a_size) -#define DUK_HOBJECT_SET_ASIZE(h,v) do { (h)->a_size = (v); } while (0) +#define DUK_HOBJECT_GET_ASIZE(h) ((h)->a_size) +#define DUK_HOBJECT_SET_ASIZE(h, v) \ + do { \ + (h)->a_size = (v); \ + } while (0) #if defined(DUK_USE_HOBJECT_HASH_PART) #define DUK_HOBJECT_GET_HSIZE(h) ((h)->h_size) -#define DUK_HOBJECT_SET_HSIZE(h,v) do { (h)->h_size = (v); } while (0) +#define DUK_HOBJECT_SET_HSIZE(h, v) \ + do { \ + (h)->h_size = (v); \ + } while (0) #else #define DUK_HOBJECT_GET_HSIZE(h) 0 -#define DUK_HOBJECT_SET_HSIZE(h,v) do { DUK_ASSERT((v) == 0); } while (0) +#define DUK_HOBJECT_SET_HSIZE(h, v) \ + do { \ + DUK_ASSERT((v) == 0); \ + } while (0) #endif #endif @@ -6739,46 +7162,44 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); /* Maximum prototype traversal depth. Sanity limit which handles e.g. * prototype loops (even complex ones like 1->2->3->4->2->3->4->2->3->4). */ -#define DUK_HOBJECT_PROTOTYPE_CHAIN_SANITY 10000L +#define DUK_HOBJECT_PROTOTYPE_CHAIN_SANITY 10000L /* * ECMAScript [[Class]] */ /* range check not necessary because all 4-bit values are mapped */ -#define DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(n) duk_class_number_to_stridx[(n)] +#define DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(n) duk_class_number_to_stridx[(n)] -#define DUK_HOBJECT_GET_CLASS_STRING(heap,h) \ - DUK_HEAP_GET_STRING( \ - (heap), \ - DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(DUK_HOBJECT_GET_CLASS_NUMBER((h))) \ - ) +#define DUK_HOBJECT_GET_CLASS_STRING(heap, h) \ + DUK_HEAP_GET_STRING((heap), DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(DUK_HOBJECT_GET_CLASS_NUMBER((h)))) /* * Macros for property handling */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HOBJECT_GET_PROTOTYPE(heap,h) \ - ((duk_hobject *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->prototype16)) -#define DUK_HOBJECT_SET_PROTOTYPE(heap,h,x) do { \ +#define DUK_HOBJECT_GET_PROTOTYPE(heap, h) ((duk_hobject *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->prototype16)) +#define DUK_HOBJECT_SET_PROTOTYPE(heap, h, x) \ + do { \ (h)->prototype16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (x)); \ } while (0) #else -#define DUK_HOBJECT_GET_PROTOTYPE(heap,h) \ - ((h)->prototype) -#define DUK_HOBJECT_SET_PROTOTYPE(heap,h,x) do { \ +#define DUK_HOBJECT_GET_PROTOTYPE(heap, h) ((h)->prototype) +#define DUK_HOBJECT_SET_PROTOTYPE(heap, h, x) \ + do { \ (h)->prototype = (x); \ } while (0) #endif /* Set prototype, DECREF earlier value, INCREF new value (tolerating NULLs). */ -#define DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr,h,p) duk_hobject_set_prototype_updref((thr), (h), (p)) +#define DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr, h, p) duk_hobject_set_prototype_updref((thr), (h), (p)) /* Set initial prototype, assume NULL previous prototype, INCREF new value, * tolerate NULL. */ -#define DUK_HOBJECT_SET_PROTOTYPE_INIT_INCREF(thr,h,proto) do { \ +#define DUK_HOBJECT_SET_PROTOTYPE_INIT_INCREF(thr, h, proto) \ + do { \ duk_hthread *duk__thr = (thr); \ duk_hobject *duk__obj = (h); \ duk_hobject *duk__proto = (proto); \ @@ -6793,9 +7214,9 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HOBJECT_HAS_FINALIZER_FAST(heap,h) duk_hobject_has_finalizer_fast_raw((heap), (h)) +#define DUK_HOBJECT_HAS_FINALIZER_FAST(heap, h) duk_hobject_has_finalizer_fast_raw((heap), (h)) #else -#define DUK_HOBJECT_HAS_FINALIZER_FAST(heap,h) duk_hobject_has_finalizer_fast_raw((h)) +#define DUK_HOBJECT_HAS_FINALIZER_FAST(heap, h) duk_hobject_has_finalizer_fast_raw((h)) #endif /* @@ -6809,18 +7230,18 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); * so anything above 0x80000000 will cause trouble now. */ #if defined(DUK_USE_OBJSIZES16) -#define DUK_HOBJECT_MAX_PROPERTIES 0x0000ffffUL +#define DUK_HOBJECT_MAX_PROPERTIES 0x0000ffffUL #else -#define DUK_HOBJECT_MAX_PROPERTIES 0x3fffffffUL /* 2**30-1 ~= 1G properties */ +#define DUK_HOBJECT_MAX_PROPERTIES 0x3fffffffUL /* 2**30-1 ~= 1G properties */ #endif /* internal align target for props allocation, must be 2*n for some n */ #if (DUK_USE_ALIGN_BY == 4) -#define DUK_HOBJECT_ALIGN_TARGET 4 +#define DUK_HOBJECT_ALIGN_TARGET 4 #elif (DUK_USE_ALIGN_BY == 8) -#define DUK_HOBJECT_ALIGN_TARGET 8 +#define DUK_HOBJECT_ALIGN_TARGET 8 #elif (DUK_USE_ALIGN_BY == 1) -#define DUK_HOBJECT_ALIGN_TARGET 1 +#define DUK_HOBJECT_ALIGN_TARGET 1 #else #error invalid DUK_USE_ALIGN_BY #endif @@ -6829,10 +7250,10 @@ DUK_INTERNAL_DECL void duk_hobject_assert_valid(duk_hobject *h); * PC-to-line constants */ -#define DUK_PC2LINE_SKIP 64 +#define DUK_PC2LINE_SKIP 64 /* maximum length for a SKIP-1 diffstream: 35 bits per entry, rounded up to bytes */ -#define DUK_PC2LINE_MAX_DIFF_LENGTH (((DUK_PC2LINE_SKIP - 1) * 35 + 7) / 8) +#define DUK_PC2LINE_MAX_DIFF_LENGTH (((DUK_PC2LINE_SKIP - 1) * 35 + 7) / 8) /* * Struct defs @@ -6859,9 +7280,9 @@ struct duk_propdesc { duk_hobject *set; /* for updating (all are set to < 0 for virtual properties) */ - duk_int_t e_idx; /* prop index in 'entry part', < 0 if not there */ - duk_int_t h_idx; /* prop index in 'hash part', < 0 if not there */ - duk_int_t a_idx; /* prop index in 'array part', < 0 if not there */ + duk_int_t e_idx; /* prop index in 'entry part', < 0 if not there */ + duk_int_t h_idx; /* prop index in 'hash part', < 0 if not there */ + duk_int_t a_idx; /* prop index in 'array part', < 0 if not there */ }; struct duk_hobject { @@ -6956,11 +7377,11 @@ struct duk_hobject { duk_uint16_t h_size16; #endif #else - duk_uint32_t e_size; /* entry part size */ - duk_uint32_t e_next; /* index for next new key ([0,e_next[ are gc reachable) */ - duk_uint32_t a_size; /* array part size (entirely gc reachable) */ + duk_uint32_t e_size; /* entry part size */ + duk_uint32_t e_next; /* index for next new key ([0,e_next[ are gc reachable) */ + duk_uint32_t a_size; /* array part size (entirely gc reachable) */ #if defined(DUK_USE_HOBJECT_HASH_PART) - duk_uint32_t h_size; /* hash part size or 0 if unused */ + duk_uint32_t h_size; /* hash part size or 0 if unused */ #endif #endif }; @@ -6971,7 +7392,7 @@ struct duk_hobject { #if !defined(DUK_SINGLE_FILE) DUK_INTERNAL_DECL duk_uint8_t duk_class_number_to_stridx[32]; -#endif /* !DUK_SINGLE_FILE */ +#endif /* !DUK_SINGLE_FILE */ /* * Prototypes @@ -7000,36 +7421,46 @@ DUK_INTERNAL_DECL void duk_hobject_realloc_props(duk_hthread *thr, duk_uint32_t new_a_size, duk_uint32_t new_h_size, duk_bool_t abandon_array); -DUK_INTERNAL_DECL void duk_hobject_resize_entrypart(duk_hthread *thr, - duk_hobject *obj, - duk_uint32_t new_e_size); -#if 0 /*unused*/ +DUK_INTERNAL_DECL void duk_hobject_resize_entrypart(duk_hthread *thr, duk_hobject *obj, duk_uint32_t new_e_size); +#if 0 /*unused*/ DUK_INTERNAL_DECL void duk_hobject_resize_arraypart(duk_hthread *thr, duk_hobject *obj, duk_uint32_t new_a_size); #endif /* low-level property functions */ -DUK_INTERNAL_DECL duk_bool_t duk_hobject_find_entry(duk_heap *heap, duk_hobject *obj, duk_hstring *key, duk_int_t *e_idx, duk_int_t *h_idx); +DUK_INTERNAL_DECL duk_bool_t +duk_hobject_find_entry(duk_heap *heap, duk_hobject *obj, duk_hstring *key, duk_int_t *e_idx, duk_int_t *h_idx); DUK_INTERNAL_DECL duk_tval *duk_hobject_find_entry_tval_ptr(duk_heap *heap, duk_hobject *obj, duk_hstring *key); DUK_INTERNAL_DECL duk_tval *duk_hobject_find_entry_tval_ptr_stridx(duk_heap *heap, duk_hobject *obj, duk_small_uint_t stridx); -DUK_INTERNAL_DECL duk_tval *duk_hobject_find_entry_tval_ptr_and_attrs(duk_heap *heap, duk_hobject *obj, duk_hstring *key, duk_uint_t *out_attrs); +DUK_INTERNAL_DECL duk_tval *duk_hobject_find_entry_tval_ptr_and_attrs(duk_heap *heap, + duk_hobject *obj, + duk_hstring *key, + duk_uint_t *out_attrs); DUK_INTERNAL_DECL duk_tval *duk_hobject_find_array_entry_tval_ptr(duk_heap *heap, duk_hobject *obj, duk_uarridx_t i); -DUK_INTERNAL_DECL duk_bool_t duk_hobject_get_own_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags); +DUK_INTERNAL_DECL duk_bool_t +duk_hobject_get_own_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags); /* core property functions */ DUK_INTERNAL_DECL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key); -DUK_INTERNAL_DECL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key, duk_tval *tv_val, duk_bool_t throw_flag); +DUK_INTERNAL_DECL duk_bool_t +duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key, duk_tval *tv_val, duk_bool_t throw_flag); DUK_INTERNAL_DECL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key, duk_bool_t throw_flag); DUK_INTERNAL_DECL duk_bool_t duk_hobject_hasprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key); /* internal property functions */ -#define DUK_DELPROP_FLAG_THROW (1U << 0) -#define DUK_DELPROP_FLAG_FORCE (1U << 1) +#define DUK_DELPROP_FLAG_THROW (1U << 0) +#define DUK_DELPROP_FLAG_FORCE (1U << 1) DUK_INTERNAL_DECL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_small_uint_t flags); DUK_INTERNAL_DECL duk_bool_t duk_hobject_hasprop_raw(duk_hthread *thr, duk_hobject *obj, duk_hstring *key); -DUK_INTERNAL_DECL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_small_uint_t flags); -DUK_INTERNAL_DECL void duk_hobject_define_property_internal_arridx(duk_hthread *thr, duk_hobject *obj, duk_uarridx_t arr_idx, duk_small_uint_t flags); +DUK_INTERNAL_DECL void duk_hobject_define_property_internal(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_small_uint_t flags); +DUK_INTERNAL_DECL void duk_hobject_define_property_internal_arridx(duk_hthread *thr, + duk_hobject *obj, + duk_uarridx_t arr_idx, + duk_small_uint_t flags); DUK_INTERNAL_DECL duk_size_t duk_hobject_get_length(duk_hthread *thr, duk_hobject *obj); #if defined(DUK_USE_HEAPPTR16) DUK_INTERNAL_DECL duk_bool_t duk_hobject_has_finalizer_fast_raw(duk_heap *heap, duk_hobject *obj); @@ -7089,7 +7520,10 @@ DUK_INTERNAL_DECL duk_uint_fast32_t duk_hobject_pc2line_query(duk_hthread *thr, #endif /* misc */ -DUK_INTERNAL_DECL duk_bool_t duk_hobject_prototype_chain_contains(duk_hthread *thr, duk_hobject *h, duk_hobject *p, duk_bool_t ignore_loop); +DUK_INTERNAL_DECL duk_bool_t duk_hobject_prototype_chain_contains(duk_hthread *thr, + duk_hobject *h, + duk_hobject *p, + duk_bool_t ignore_loop); #if !defined(DUK_USE_OBJECT_BUILTIN) /* These declarations are needed when related built-in is disabled and @@ -7099,7 +7533,7 @@ DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_to_string(duk_hthread *thr); DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype(duk_hthread *thr); #endif -#endif /* DUK_HOBJECT_H_INCLUDED */ +#endif /* DUK_HOBJECT_H_INCLUDED */ /* #include duk_hcompfunc.h */ /* * Heap compiled function (ECMAScript function) representation. @@ -7118,50 +7552,55 @@ DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype(duk_hthread *thr); /* XXX: casts could be improved, especially for GET/SET DATA */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HCOMPFUNC_GET_DATA(heap,h) \ - ((duk_hbuffer_fixed *) (void *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->data16)) -#define DUK_HCOMPFUNC_SET_DATA(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_DATA(heap, h) ((duk_hbuffer_fixed *) (void *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->data16)) +#define DUK_HCOMPFUNC_SET_DATA(heap, h, v) \ + do { \ (h)->data16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (v)); \ } while (0) -#define DUK_HCOMPFUNC_GET_FUNCS(heap,h) \ - ((duk_hobject **) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->funcs16))) -#define DUK_HCOMPFUNC_SET_FUNCS(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_FUNCS(heap, h) ((duk_hobject **) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->funcs16))) +#define DUK_HCOMPFUNC_SET_FUNCS(heap, h, v) \ + do { \ (h)->funcs16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (v)); \ } while (0) -#define DUK_HCOMPFUNC_GET_BYTECODE(heap,h) \ - ((duk_instr_t *) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->bytecode16))) -#define DUK_HCOMPFUNC_SET_BYTECODE(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_BYTECODE(heap, h) ((duk_instr_t *) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->bytecode16))) +#define DUK_HCOMPFUNC_SET_BYTECODE(heap, h, v) \ + do { \ (h)->bytecode16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (v)); \ } while (0) -#define DUK_HCOMPFUNC_GET_LEXENV(heap,h) \ - ((duk_hobject *) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->lex_env16))) -#define DUK_HCOMPFUNC_SET_LEXENV(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_LEXENV(heap, h) ((duk_hobject *) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->lex_env16))) +#define DUK_HCOMPFUNC_SET_LEXENV(heap, h, v) \ + do { \ (h)->lex_env16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (v)); \ } while (0) -#define DUK_HCOMPFUNC_GET_VARENV(heap,h) \ - ((duk_hobject *) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->var_env16))) -#define DUK_HCOMPFUNC_SET_VARENV(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_VARENV(heap, h) ((duk_hobject *) (void *) (DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (h)->var_env16))) +#define DUK_HCOMPFUNC_SET_VARENV(heap, h, v) \ + do { \ (h)->var_env16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (v)); \ } while (0) #else -#define DUK_HCOMPFUNC_GET_DATA(heap,h) ((duk_hbuffer_fixed *) (void *) (h)->data) -#define DUK_HCOMPFUNC_SET_DATA(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_DATA(heap, h) ((duk_hbuffer_fixed *) (void *) (h)->data) +#define DUK_HCOMPFUNC_SET_DATA(heap, h, v) \ + do { \ (h)->data = (duk_hbuffer *) (v); \ } while (0) -#define DUK_HCOMPFUNC_GET_FUNCS(heap,h) ((h)->funcs) -#define DUK_HCOMPFUNC_SET_FUNCS(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_FUNCS(heap, h) ((h)->funcs) +#define DUK_HCOMPFUNC_SET_FUNCS(heap, h, v) \ + do { \ (h)->funcs = (v); \ } while (0) -#define DUK_HCOMPFUNC_GET_BYTECODE(heap,h) ((h)->bytecode) -#define DUK_HCOMPFUNC_SET_BYTECODE(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_BYTECODE(heap, h) ((h)->bytecode) +#define DUK_HCOMPFUNC_SET_BYTECODE(heap, h, v) \ + do { \ (h)->bytecode = (v); \ } while (0) -#define DUK_HCOMPFUNC_GET_LEXENV(heap,h) ((h)->lex_env) -#define DUK_HCOMPFUNC_SET_LEXENV(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_LEXENV(heap, h) ((h)->lex_env) +#define DUK_HCOMPFUNC_SET_LEXENV(heap, h, v) \ + do { \ (h)->lex_env = (v); \ } while (0) -#define DUK_HCOMPFUNC_GET_VARENV(heap,h) ((h)->var_env) -#define DUK_HCOMPFUNC_SET_VARENV(heap,h,v) do { \ +#define DUK_HCOMPFUNC_GET_VARENV(heap, h) ((h)->var_env) +#define DUK_HCOMPFUNC_SET_VARENV(heap, h, v) \ + do { \ (h)->var_env = (v); \ } while (0) #endif @@ -7171,64 +7610,40 @@ DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype(duk_hthread *thr); */ /* Note: assumes 'data' is always a fixed buffer */ -#define DUK_HCOMPFUNC_GET_BUFFER_BASE(heap,h) \ - DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), DUK_HCOMPFUNC_GET_DATA((heap), (h))) +#define DUK_HCOMPFUNC_GET_BUFFER_BASE(heap, h) DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), DUK_HCOMPFUNC_GET_DATA((heap), (h))) -#define DUK_HCOMPFUNC_GET_CONSTS_BASE(heap,h) \ - ((duk_tval *) (void *) DUK_HCOMPFUNC_GET_BUFFER_BASE((heap), (h))) +#define DUK_HCOMPFUNC_GET_CONSTS_BASE(heap, h) ((duk_tval *) (void *) DUK_HCOMPFUNC_GET_BUFFER_BASE((heap), (h))) -#define DUK_HCOMPFUNC_GET_FUNCS_BASE(heap,h) \ - DUK_HCOMPFUNC_GET_FUNCS((heap), (h)) +#define DUK_HCOMPFUNC_GET_FUNCS_BASE(heap, h) DUK_HCOMPFUNC_GET_FUNCS((heap), (h)) -#define DUK_HCOMPFUNC_GET_CODE_BASE(heap,h) \ - DUK_HCOMPFUNC_GET_BYTECODE((heap), (h)) +#define DUK_HCOMPFUNC_GET_CODE_BASE(heap, h) DUK_HCOMPFUNC_GET_BYTECODE((heap), (h)) -#define DUK_HCOMPFUNC_GET_CONSTS_END(heap,h) \ - ((duk_tval *) (void *) DUK_HCOMPFUNC_GET_FUNCS((heap), (h))) +#define DUK_HCOMPFUNC_GET_CONSTS_END(heap, h) ((duk_tval *) (void *) DUK_HCOMPFUNC_GET_FUNCS((heap), (h))) -#define DUK_HCOMPFUNC_GET_FUNCS_END(heap,h) \ - ((duk_hobject **) (void *) DUK_HCOMPFUNC_GET_BYTECODE((heap), (h))) +#define DUK_HCOMPFUNC_GET_FUNCS_END(heap, h) ((duk_hobject **) (void *) DUK_HCOMPFUNC_GET_BYTECODE((heap), (h))) /* XXX: double evaluation of DUK_HCOMPFUNC_GET_DATA() */ -#define DUK_HCOMPFUNC_GET_CODE_END(heap,h) \ +#define DUK_HCOMPFUNC_GET_CODE_END(heap, h) \ ((duk_instr_t *) (void *) (DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), DUK_HCOMPFUNC_GET_DATA((heap), (h))) + \ - DUK_HBUFFER_GET_SIZE((duk_hbuffer *) DUK_HCOMPFUNC_GET_DATA((heap), h)))) + DUK_HBUFFER_GET_SIZE((duk_hbuffer *) DUK_HCOMPFUNC_GET_DATA((heap), h)))) -#define DUK_HCOMPFUNC_GET_CONSTS_SIZE(heap,h) \ - ( \ - (duk_size_t) \ - ( \ - ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CONSTS_END((heap), (h))) - \ - ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CONSTS_BASE((heap), (h))) \ - ) \ - ) +#define DUK_HCOMPFUNC_GET_CONSTS_SIZE(heap, h) \ + ((duk_size_t) (((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CONSTS_END((heap), (h))) - \ + ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CONSTS_BASE((heap), (h))))) -#define DUK_HCOMPFUNC_GET_FUNCS_SIZE(heap,h) \ - ( \ - (duk_size_t) \ - ( \ - ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_FUNCS_END((heap), (h))) - \ - ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_FUNCS_BASE((heap), (h))) \ - ) \ - ) +#define DUK_HCOMPFUNC_GET_FUNCS_SIZE(heap, h) \ + ((duk_size_t) (((const duk_uint8_t *) DUK_HCOMPFUNC_GET_FUNCS_END((heap), (h))) - \ + ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_FUNCS_BASE((heap), (h))))) -#define DUK_HCOMPFUNC_GET_CODE_SIZE(heap,h) \ - ( \ - (duk_size_t) \ - ( \ - ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CODE_END((heap),(h))) - \ - ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CODE_BASE((heap),(h))) \ - ) \ - ) +#define DUK_HCOMPFUNC_GET_CODE_SIZE(heap, h) \ + ((duk_size_t) (((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CODE_END((heap), (h))) - \ + ((const duk_uint8_t *) DUK_HCOMPFUNC_GET_CODE_BASE((heap), (h))))) -#define DUK_HCOMPFUNC_GET_CONSTS_COUNT(heap,h) \ - ((duk_size_t) (DUK_HCOMPFUNC_GET_CONSTS_SIZE((heap), (h)) / sizeof(duk_tval))) +#define DUK_HCOMPFUNC_GET_CONSTS_COUNT(heap, h) ((duk_size_t) (DUK_HCOMPFUNC_GET_CONSTS_SIZE((heap), (h)) / sizeof(duk_tval))) -#define DUK_HCOMPFUNC_GET_FUNCS_COUNT(heap,h) \ - ((duk_size_t) (DUK_HCOMPFUNC_GET_FUNCS_SIZE((heap), (h)) / sizeof(duk_hobject *))) +#define DUK_HCOMPFUNC_GET_FUNCS_COUNT(heap, h) ((duk_size_t) (DUK_HCOMPFUNC_GET_FUNCS_SIZE((heap), (h)) / sizeof(duk_hobject *))) -#define DUK_HCOMPFUNC_GET_CODE_COUNT(heap,h) \ - ((duk_size_t) (DUK_HCOMPFUNC_GET_CODE_SIZE((heap), (h)) / sizeof(duk_instr_t))) +#define DUK_HCOMPFUNC_GET_CODE_COUNT(heap, h) ((duk_size_t) (DUK_HCOMPFUNC_GET_CODE_SIZE((heap), (h)) / sizeof(duk_instr_t))) /* * Validity assert @@ -7236,9 +7651,14 @@ DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype(duk_hthread *thr); #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hcompfunc_assert_valid(duk_hcompfunc *h); -#define DUK_HCOMPFUNC_ASSERT_VALID(h) do { duk_hcompfunc_assert_valid((h)); } while (0) +#define DUK_HCOMPFUNC_ASSERT_VALID(h) \ + do { \ + duk_hcompfunc_assert_valid((h)); \ + } while (0) #else -#define DUK_HCOMPFUNC_ASSERT_VALID(h) do {} while (0) +#define DUK_HCOMPFUNC_ASSERT_VALID(h) \ + do { \ + } while (0) #endif /* @@ -7325,8 +7745,8 @@ struct duk_hcompfunc { * at run time, except for debugging, so it is not maintained. */ - duk_uint16_t nregs; /* regs to allocate */ - duk_uint16_t nargs; /* number of arguments allocated to regs */ + duk_uint16_t nregs; /* regs to allocate */ + duk_uint16_t nargs; /* number of arguments allocated to regs */ /* * Additional control information is placed into the object itself @@ -7373,7 +7793,7 @@ struct duk_hcompfunc { #endif }; -#endif /* DUK_HCOMPFUNC_H_INCLUDED */ +#endif /* DUK_HCOMPFUNC_H_INCLUDED */ /* #include duk_hnatfunc.h */ /* * Heap native function representation. @@ -7384,13 +7804,18 @@ struct duk_hcompfunc { #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hnatfunc_assert_valid(duk_hnatfunc *h); -#define DUK_HNATFUNC_ASSERT_VALID(h) do { duk_hnatfunc_assert_valid((h)); } while (0) +#define DUK_HNATFUNC_ASSERT_VALID(h) \ + do { \ + duk_hnatfunc_assert_valid((h)); \ + } while (0) #else -#define DUK_HNATFUNC_ASSERT_VALID(h) do {} while (0) +#define DUK_HNATFUNC_ASSERT_VALID(h) \ + do { \ + } while (0) #endif -#define DUK_HNATFUNC_NARGS_VARARGS ((duk_int16_t) -1) -#define DUK_HNATFUNC_NARGS_MAX ((duk_int16_t) 0x7fff) +#define DUK_HNATFUNC_NARGS_VARARGS ((duk_int16_t) -1) +#define DUK_HNATFUNC_NARGS_MAX ((duk_int16_t) 0x7fff) struct duk_hnatfunc { /* shared object part */ @@ -7413,7 +7838,7 @@ struct duk_hnatfunc { */ }; -#endif /* DUK_HNATFUNC_H_INCLUDED */ +#endif /* DUK_HNATFUNC_H_INCLUDED */ /* #include duk_hboundfunc.h */ /* * Bound function representation. @@ -7429,9 +7854,14 @@ struct duk_hnatfunc { #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hboundfunc_assert_valid(duk_hboundfunc *h); -#define DUK_HBOUNDFUNC_ASSERT_VALID(h) do { duk_hboundfunc_assert_valid((h)); } while (0) +#define DUK_HBOUNDFUNC_ASSERT_VALID(h) \ + do { \ + duk_hboundfunc_assert_valid((h)); \ + } while (0) #else -#define DUK_HBOUNDFUNC_ASSERT_VALID(h) do {} while (0) +#define DUK_HBOUNDFUNC_ASSERT_VALID(h) \ + do { \ + } while (0) #endif struct duk_hboundfunc { @@ -7447,11 +7877,11 @@ struct duk_hboundfunc { duk_tval this_binding; /* Arguments to prepend. */ - duk_tval *args; /* Separate allocation. */ + duk_tval *args; /* Separate allocation. */ duk_idx_t nargs; }; -#endif /* DUK_HBOUNDFUNC_H_INCLUDED */ +#endif /* DUK_HBOUNDFUNC_H_INCLUDED */ /* #include duk_hbufobj.h */ /* * Heap Buffer object representation. Used for all Buffer variants. @@ -7463,31 +7893,37 @@ struct duk_hboundfunc { #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) /* All element accessors are host endian now (driven by TypedArray spec). */ -#define DUK_HBUFOBJ_ELEM_UINT8 0 -#define DUK_HBUFOBJ_ELEM_UINT8CLAMPED 1 -#define DUK_HBUFOBJ_ELEM_INT8 2 -#define DUK_HBUFOBJ_ELEM_UINT16 3 -#define DUK_HBUFOBJ_ELEM_INT16 4 -#define DUK_HBUFOBJ_ELEM_UINT32 5 -#define DUK_HBUFOBJ_ELEM_INT32 6 -#define DUK_HBUFOBJ_ELEM_FLOAT32 7 -#define DUK_HBUFOBJ_ELEM_FLOAT64 8 -#define DUK_HBUFOBJ_ELEM_MAX 8 +#define DUK_HBUFOBJ_ELEM_UINT8 0 +#define DUK_HBUFOBJ_ELEM_UINT8CLAMPED 1 +#define DUK_HBUFOBJ_ELEM_INT8 2 +#define DUK_HBUFOBJ_ELEM_UINT16 3 +#define DUK_HBUFOBJ_ELEM_INT16 4 +#define DUK_HBUFOBJ_ELEM_UINT32 5 +#define DUK_HBUFOBJ_ELEM_INT32 6 +#define DUK_HBUFOBJ_ELEM_FLOAT32 7 +#define DUK_HBUFOBJ_ELEM_FLOAT64 8 +#define DUK_HBUFOBJ_ELEM_MAX 8 #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hbufobj_assert_valid(duk_hbufobj *h); -#define DUK_HBUFOBJ_ASSERT_VALID(h) do { duk_hbufobj_assert_valid((h)); } while (0) +#define DUK_HBUFOBJ_ASSERT_VALID(h) \ + do { \ + duk_hbufobj_assert_valid((h)); \ + } while (0) #else -#define DUK_HBUFOBJ_ASSERT_VALID(h) do {} while (0) +#define DUK_HBUFOBJ_ASSERT_VALID(h) \ + do { \ + } while (0) #endif /* Get the current data pointer (caller must ensure buf != NULL) as a * duk_uint8_t ptr. Note that the result may be NULL if the underlying * buffer has zero size and is not a fixed buffer. */ -#define DUK_HBUFOBJ_GET_SLICE_BASE(heap,h) \ - (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ - (((duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR((heap), (h)->buf)) + (h)->offset)) +#define DUK_HBUFOBJ_GET_SLICE_BASE(heap, h) \ + (DUK_ASSERT_EXPR((h) != NULL), \ + DUK_ASSERT_EXPR((h)->buf != NULL), \ + (((duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR((heap), (h)->buf)) + (h)->offset)) /* True if slice is full, i.e. offset is zero and length covers the entire * buffer. This status may change independently of the duk_hbufobj if @@ -7495,15 +7931,17 @@ DUK_INTERNAL_DECL void duk_hbufobj_assert_valid(duk_hbufobj *h); * being changed. */ #define DUK_HBUFOBJ_FULL_SLICE(h) \ - (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ - ((h)->offset == 0 && (h)->length == DUK_HBUFFER_GET_SIZE((h)->buf))) + (DUK_ASSERT_EXPR((h) != NULL), \ + DUK_ASSERT_EXPR((h)->buf != NULL), \ + ((h)->offset == 0 && (h)->length == DUK_HBUFFER_GET_SIZE((h)->buf))) /* Validate that the whole slice [0,length[ is contained in the underlying * buffer. Caller must ensure 'buf' != NULL. */ #define DUK_HBUFOBJ_VALID_SLICE(h) \ - (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ - ((h)->offset + (h)->length <= DUK_HBUFFER_GET_SIZE((h)->buf))) + (DUK_ASSERT_EXPR((h) != NULL), \ + DUK_ASSERT_EXPR((h)->buf != NULL), \ + ((h)->offset + (h)->length <= DUK_HBUFFER_GET_SIZE((h)->buf))) /* Validate byte read/write for virtual 'offset', i.e. check that the * offset, taking into account h->offset, is within the underlying @@ -7512,13 +7950,11 @@ DUK_INTERNAL_DECL void duk_hbufobj_assert_valid(duk_hbufobj *h); * behavior (e.g. if an underlying dynamic buffer changes after being * setup). Caller must ensure 'buf' != NULL. */ -#define DUK_HBUFOBJ_VALID_BYTEOFFSET_INCL(h,off) \ - (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ - ((h)->offset + (off) < DUK_HBUFFER_GET_SIZE((h)->buf))) +#define DUK_HBUFOBJ_VALID_BYTEOFFSET_INCL(h, off) \ + (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), ((h)->offset + (off) < DUK_HBUFFER_GET_SIZE((h)->buf))) -#define DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h,off) \ - (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ - ((h)->offset + (off) <= DUK_HBUFFER_GET_SIZE((h)->buf))) +#define DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h, off) \ + (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), ((h)->offset + (off) <= DUK_HBUFFER_GET_SIZE((h)->buf))) /* Clamp an input byte length (already assumed to be within the nominal * duk_hbufobj 'length') to the current dynamic buffer limits to yield @@ -7526,12 +7962,10 @@ DUK_INTERNAL_DECL void duk_hbufobj_assert_valid(duk_hbufobj *h); * be invalidated by any side effect because it may trigger a user * callback that resizes the underlying buffer. */ -#define DUK_HBUFOBJ_CLAMP_BYTELENGTH(h,len) \ - (DUK_ASSERT_EXPR((h) != NULL), \ - duk_hbufobj_clamp_bytelength((h), (len))) +#define DUK_HBUFOBJ_CLAMP_BYTELENGTH(h, len) (DUK_ASSERT_EXPR((h) != NULL), duk_hbufobj_clamp_bytelength((h), (len))) /* Typed arrays have virtual indices, ArrayBuffer and DataView do not. */ -#define DUK_HBUFOBJ_HAS_VIRTUAL_INDICES(h) ((h)->is_typedarray) +#define DUK_HBUFOBJ_HAS_VIRTUAL_INDICES(h) ((h)->is_typedarray) struct duk_hbufobj { /* Shared object part. */ @@ -7556,30 +7990,36 @@ struct duk_hbufobj { * be dynamic and its pointer unstable. */ - duk_uint_t offset; /* byte offset to buf */ - duk_uint_t length; /* byte index limit for element access, exclusive */ - duk_uint8_t shift; /* element size shift: - * 0 = u8/i8 - * 1 = u16/i16 - * 2 = u32/i32/float - * 3 = double - */ - duk_uint8_t elem_type; /* element type */ + duk_uint_t offset; /* byte offset to buf */ + duk_uint_t length; /* byte index limit for element access, exclusive */ + duk_uint8_t shift; /* element size shift: + * 0 = u8/i8 + * 1 = u16/i16 + * 2 = u32/i32/float + * 3 = double + */ + duk_uint8_t elem_type; /* element type */ duk_uint8_t is_typedarray; }; DUK_INTERNAL_DECL duk_uint_t duk_hbufobj_clamp_bytelength(duk_hbufobj *h_bufobj, duk_uint_t len); DUK_INTERNAL_DECL void duk_hbufobj_push_uint8array_from_plain(duk_hthread *thr, duk_hbuffer *h_buf); -DUK_INTERNAL_DECL void duk_hbufobj_push_validated_read(duk_hthread *thr, duk_hbufobj *h_bufobj, duk_uint8_t *p, duk_small_uint_t elem_size); -DUK_INTERNAL_DECL void duk_hbufobj_validated_write(duk_hthread *thr, duk_hbufobj *h_bufobj, duk_uint8_t *p, duk_small_uint_t elem_size); +DUK_INTERNAL_DECL void duk_hbufobj_push_validated_read(duk_hthread *thr, + duk_hbufobj *h_bufobj, + duk_uint8_t *p, + duk_small_uint_t elem_size); +DUK_INTERNAL_DECL void duk_hbufobj_validated_write(duk_hthread *thr, + duk_hbufobj *h_bufobj, + duk_uint8_t *p, + duk_small_uint_t elem_size); DUK_INTERNAL_DECL void duk_hbufobj_promote_plain(duk_hthread *thr, duk_idx_t idx); -#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* nothing */ -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ -#endif /* DUK_HBUFOBJ_H_INCLUDED */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_HBUFOBJ_H_INCLUDED */ /* #include duk_hthread.h */ /* * Heap thread object representation. @@ -7597,38 +8037,38 @@ DUK_INTERNAL_DECL void duk_hbufobj_promote_plain(duk_hthread *thr, duk_idx_t idx */ /* Initial valstack size, roughly 0.7kiB. */ -#define DUK_VALSTACK_INITIAL_SIZE 96U +#define DUK_VALSTACK_INITIAL_SIZE 96U /* Internal extra elements assumed on function entry, always added to * user-defined 'extra' for e.g. the duk_check_stack() call. */ -#define DUK_VALSTACK_INTERNAL_EXTRA 32U +#define DUK_VALSTACK_INTERNAL_EXTRA 32U /* Number of elements guaranteed to be user accessible (in addition to call * arguments) on Duktape/C function entry. This is the major public API * commitment. */ -#define DUK_VALSTACK_API_ENTRY_MINIMUM DUK_API_ENTRY_STACK +#define DUK_VALSTACK_API_ENTRY_MINIMUM DUK_API_ENTRY_STACK /* * Activation defines */ -#define DUK_ACT_FLAG_STRICT (1U << 0) /* function executes in strict mode */ -#define DUK_ACT_FLAG_TAILCALLED (1U << 1) /* activation has tail called one or more times */ -#define DUK_ACT_FLAG_CONSTRUCT (1U << 2) /* function executes as a constructor (called via "new") */ -#define DUK_ACT_FLAG_PREVENT_YIELD (1U << 3) /* activation prevents yield (native call or "new") */ -#define DUK_ACT_FLAG_DIRECT_EVAL (1U << 4) /* activation is a direct eval call */ -#define DUK_ACT_FLAG_CONSTRUCT_PROXY (1U << 5) /* activation is for Proxy 'construct' call, special return value handling */ -#define DUK_ACT_FLAG_BREAKPOINT_ACTIVE (1U << 6) /* activation has active breakpoint(s) */ +#define DUK_ACT_FLAG_STRICT (1U << 0) /* function executes in strict mode */ +#define DUK_ACT_FLAG_TAILCALLED (1U << 1) /* activation has tail called one or more times */ +#define DUK_ACT_FLAG_CONSTRUCT (1U << 2) /* function executes as a constructor (called via "new") */ +#define DUK_ACT_FLAG_PREVENT_YIELD (1U << 3) /* activation prevents yield (native call or "new") */ +#define DUK_ACT_FLAG_DIRECT_EVAL (1U << 4) /* activation is a direct eval call */ +#define DUK_ACT_FLAG_CONSTRUCT_PROXY (1U << 5) /* activation is for Proxy 'construct' call, special return value handling */ +#define DUK_ACT_FLAG_BREAKPOINT_ACTIVE (1U << 6) /* activation has active breakpoint(s) */ -#define DUK_ACT_GET_FUNC(act) ((act)->func) +#define DUK_ACT_GET_FUNC(act) ((act)->func) /* * Flags for __FILE__ / __LINE__ registered into tracedata */ -#define DUK_TB_FLAG_NOBLAME_FILELINE (1U << 0) /* don't report __FILE__ / __LINE__ as fileName/lineNumber */ +#define DUK_TB_FLAG_NOBLAME_FILELINE (1U << 0) /* don't report __FILE__ / __LINE__ as fileName/lineNumber */ /* * Catcher defines @@ -7637,52 +8077,60 @@ DUK_INTERNAL_DECL void duk_hbufobj_promote_plain(duk_hthread *thr, duk_idx_t idx /* XXX: remove catcher type entirely */ /* flags field: LLLLLLFT, L = label (24 bits), F = flags (4 bits), T = type (4 bits) */ -#define DUK_CAT_TYPE_MASK 0x0000000fUL -#define DUK_CAT_TYPE_BITS 4 -#define DUK_CAT_LABEL_MASK 0xffffff00UL -#define DUK_CAT_LABEL_BITS 24 -#define DUK_CAT_LABEL_SHIFT 8 +#define DUK_CAT_TYPE_MASK 0x0000000fUL +#define DUK_CAT_TYPE_BITS 4 +#define DUK_CAT_LABEL_MASK 0xffffff00UL +#define DUK_CAT_LABEL_BITS 24 +#define DUK_CAT_LABEL_SHIFT 8 -#define DUK_CAT_FLAG_CATCH_ENABLED (1U << 4) /* catch part will catch */ -#define DUK_CAT_FLAG_FINALLY_ENABLED (1U << 5) /* finally part will catch */ -#define DUK_CAT_FLAG_CATCH_BINDING_ENABLED (1U << 6) /* request to create catch binding */ -#define DUK_CAT_FLAG_LEXENV_ACTIVE (1U << 7) /* catch or with binding is currently active */ +#define DUK_CAT_FLAG_CATCH_ENABLED (1U << 4) /* catch part will catch */ +#define DUK_CAT_FLAG_FINALLY_ENABLED (1U << 5) /* finally part will catch */ +#define DUK_CAT_FLAG_CATCH_BINDING_ENABLED (1U << 6) /* request to create catch binding */ +#define DUK_CAT_FLAG_LEXENV_ACTIVE (1U << 7) /* catch or with binding is currently active */ -#define DUK_CAT_TYPE_UNKNOWN 0 -#define DUK_CAT_TYPE_TCF 1 -#define DUK_CAT_TYPE_LABEL 2 +#define DUK_CAT_TYPE_UNKNOWN 0 +#define DUK_CAT_TYPE_TCF 1 +#define DUK_CAT_TYPE_LABEL 2 -#define DUK_CAT_GET_TYPE(c) ((c)->flags & DUK_CAT_TYPE_MASK) -#define DUK_CAT_GET_LABEL(c) (((c)->flags & DUK_CAT_LABEL_MASK) >> DUK_CAT_LABEL_SHIFT) +#define DUK_CAT_GET_TYPE(c) ((c)->flags & DUK_CAT_TYPE_MASK) +#define DUK_CAT_GET_LABEL(c) (((c)->flags & DUK_CAT_LABEL_MASK) >> DUK_CAT_LABEL_SHIFT) -#define DUK_CAT_HAS_CATCH_ENABLED(c) ((c)->flags & DUK_CAT_FLAG_CATCH_ENABLED) -#define DUK_CAT_HAS_FINALLY_ENABLED(c) ((c)->flags & DUK_CAT_FLAG_FINALLY_ENABLED) -#define DUK_CAT_HAS_CATCH_BINDING_ENABLED(c) ((c)->flags & DUK_CAT_FLAG_CATCH_BINDING_ENABLED) -#define DUK_CAT_HAS_LEXENV_ACTIVE(c) ((c)->flags & DUK_CAT_FLAG_LEXENV_ACTIVE) +#define DUK_CAT_HAS_CATCH_ENABLED(c) ((c)->flags & DUK_CAT_FLAG_CATCH_ENABLED) +#define DUK_CAT_HAS_FINALLY_ENABLED(c) ((c)->flags & DUK_CAT_FLAG_FINALLY_ENABLED) +#define DUK_CAT_HAS_CATCH_BINDING_ENABLED(c) ((c)->flags & DUK_CAT_FLAG_CATCH_BINDING_ENABLED) +#define DUK_CAT_HAS_LEXENV_ACTIVE(c) ((c)->flags & DUK_CAT_FLAG_LEXENV_ACTIVE) -#define DUK_CAT_SET_CATCH_ENABLED(c) do { \ +#define DUK_CAT_SET_CATCH_ENABLED(c) \ + do { \ (c)->flags |= DUK_CAT_FLAG_CATCH_ENABLED; \ } while (0) -#define DUK_CAT_SET_FINALLY_ENABLED(c) do { \ +#define DUK_CAT_SET_FINALLY_ENABLED(c) \ + do { \ (c)->flags |= DUK_CAT_FLAG_FINALLY_ENABLED; \ } while (0) -#define DUK_CAT_SET_CATCH_BINDING_ENABLED(c) do { \ +#define DUK_CAT_SET_CATCH_BINDING_ENABLED(c) \ + do { \ (c)->flags |= DUK_CAT_FLAG_CATCH_BINDING_ENABLED; \ } while (0) -#define DUK_CAT_SET_LEXENV_ACTIVE(c) do { \ +#define DUK_CAT_SET_LEXENV_ACTIVE(c) \ + do { \ (c)->flags |= DUK_CAT_FLAG_LEXENV_ACTIVE; \ } while (0) -#define DUK_CAT_CLEAR_CATCH_ENABLED(c) do { \ +#define DUK_CAT_CLEAR_CATCH_ENABLED(c) \ + do { \ (c)->flags &= ~DUK_CAT_FLAG_CATCH_ENABLED; \ } while (0) -#define DUK_CAT_CLEAR_FINALLY_ENABLED(c) do { \ +#define DUK_CAT_CLEAR_FINALLY_ENABLED(c) \ + do { \ (c)->flags &= ~DUK_CAT_FLAG_FINALLY_ENABLED; \ } while (0) -#define DUK_CAT_CLEAR_CATCH_BINDING_ENABLED(c) do { \ +#define DUK_CAT_CLEAR_CATCH_BINDING_ENABLED(c) \ + do { \ (c)->flags &= ~DUK_CAT_FLAG_CATCH_BINDING_ENABLED; \ } while (0) -#define DUK_CAT_CLEAR_LEXENV_ACTIVE(c) do { \ +#define DUK_CAT_CLEAR_LEXENV_ACTIVE(c) \ + do { \ (c)->flags &= ~DUK_CAT_FLAG_LEXENV_ACTIVE; \ } while (0) @@ -7691,24 +8139,21 @@ DUK_INTERNAL_DECL void duk_hbufobj_promote_plain(duk_hthread *thr, duk_idx_t idx */ #if defined(DUK_USE_ROM_STRINGS) -#define DUK_HTHREAD_GET_STRING(thr,idx) \ - ((duk_hstring *) DUK_LOSE_CONST(duk_rom_strings_stridx[(idx)])) -#else /* DUK_USE_ROM_STRINGS */ +#define DUK_HTHREAD_GET_STRING(thr, idx) ((duk_hstring *) DUK_LOSE_CONST(duk_rom_strings_stridx[(idx)])) +#else /* DUK_USE_ROM_STRINGS */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HTHREAD_GET_STRING(thr,idx) \ - ((duk_hstring *) DUK_USE_HEAPPTR_DEC16((thr)->heap->heap_udata, (thr)->strs16[(idx)])) +#define DUK_HTHREAD_GET_STRING(thr, idx) ((duk_hstring *) DUK_USE_HEAPPTR_DEC16((thr)->heap->heap_udata, (thr)->strs16[(idx)])) #else -#define DUK_HTHREAD_GET_STRING(thr,idx) \ - ((thr)->strs[(idx)]) +#define DUK_HTHREAD_GET_STRING(thr, idx) ((thr)->strs[(idx)]) #endif -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ /* values for the state field */ -#define DUK_HTHREAD_STATE_INACTIVE 1 /* thread not currently running */ -#define DUK_HTHREAD_STATE_RUNNING 2 /* thread currently running (only one at a time) */ -#define DUK_HTHREAD_STATE_RESUMED 3 /* thread resumed another thread (active but not running) */ -#define DUK_HTHREAD_STATE_YIELDED 4 /* thread has yielded */ -#define DUK_HTHREAD_STATE_TERMINATED 5 /* thread has terminated */ +#define DUK_HTHREAD_STATE_INACTIVE 1 /* thread not currently running */ +#define DUK_HTHREAD_STATE_RUNNING 2 /* thread currently running (only one at a time) */ +#define DUK_HTHREAD_STATE_RESUMED 3 /* thread resumed another thread (active but not running) */ +#define DUK_HTHREAD_STATE_YIELDED 4 /* thread has yielded */ +#define DUK_HTHREAD_STATE_TERMINATED 5 /* thread has terminated */ /* Executor interrupt default interval when nothing else requires a * smaller value. The default interval must be small enough to allow @@ -7716,7 +8161,7 @@ DUK_INTERNAL_DECL void duk_hbufobj_promote_plain(duk_hthread *thr, duk_idx_t idx * impact on execution performance low. */ #if defined(DUK_USE_INTERRUPT_COUNTER) -#define DUK_HTHREAD_INTCTR_DEFAULT (256L * 1024L) +#define DUK_HTHREAD_INTCTR_DEFAULT (256L * 1024L) #endif /* @@ -7730,20 +8175,31 @@ DUK_INTERNAL_DECL void duk_hbufobj_promote_plain(duk_hthread *thr, duk_idx_t idx #if defined(DUK_USE_ASSERTIONS) /* Assertions for internals. */ DUK_INTERNAL_DECL void duk_hthread_assert_valid(duk_hthread *thr); -#define DUK_HTHREAD_ASSERT_VALID(thr) do { duk_hthread_assert_valid((thr)); } while (0) +#define DUK_HTHREAD_ASSERT_VALID(thr) \ + do { \ + duk_hthread_assert_valid((thr)); \ + } while (0) /* Assertions for public API calls; a bit stronger. */ DUK_INTERNAL_DECL void duk_ctx_assert_valid(duk_hthread *thr); -#define DUK_CTX_ASSERT_VALID(thr) do { duk_ctx_assert_valid((thr)); } while (0) +#define DUK_CTX_ASSERT_VALID(thr) \ + do { \ + duk_ctx_assert_valid((thr)); \ + } while (0) #else -#define DUK_HTHREAD_ASSERT_VALID(thr) do {} while (0) -#define DUK_CTX_ASSERT_VALID(thr) do {} while (0) +#define DUK_HTHREAD_ASSERT_VALID(thr) \ + do { \ + } while (0) +#define DUK_CTX_ASSERT_VALID(thr) \ + do { \ + } while (0) #endif /* Assertions for API call entry specifically. Checks 'ctx' but also may * check internal state (e.g. not in a debugger transport callback). */ -#define DUK_ASSERT_API_ENTRY(thr) do { \ +#define DUK_ASSERT_API_ENTRY(thr) \ + do { \ DUK_CTX_ASSERT_VALID((thr)); \ DUK_ASSERT((thr)->heap != NULL); \ DUK_ASSERT((thr)->heap->dbg_calling_transport == 0); \ @@ -7753,11 +8209,9 @@ DUK_INTERNAL_DECL void duk_ctx_assert_valid(duk_hthread *thr); * Assertion helpers. */ -#define DUK_ASSERT_STRIDX_VALID(val) \ - DUK_ASSERT((duk_uint_t) (val) < DUK_HEAP_NUM_STRINGS) +#define DUK_ASSERT_STRIDX_VALID(val) DUK_ASSERT((duk_uint_t) (val) < DUK_HEAP_NUM_STRINGS) -#define DUK_ASSERT_BIDX_VALID(val) \ - DUK_ASSERT((duk_uint_t) (val) < DUK_NUM_BUILTINS) +#define DUK_ASSERT_BIDX_VALID(val) DUK_ASSERT((duk_uint_t) (val) < DUK_NUM_BUILTINS) /* * Misc @@ -7765,9 +8219,7 @@ DUK_INTERNAL_DECL void duk_ctx_assert_valid(duk_hthread *thr); /* Fast access to 'this' binding. Assumes there's a call in progress. */ #define DUK_HTHREAD_THIS_PTR(thr) \ - (DUK_ASSERT_EXPR((thr) != NULL), \ - DUK_ASSERT_EXPR((thr)->valstack_bottom > (thr)->valstack), \ - (thr)->valstack_bottom - 1) + (DUK_ASSERT_EXPR((thr) != NULL), DUK_ASSERT_EXPR((thr)->valstack_bottom > (thr)->valstack), (thr)->valstack_bottom - 1) /* * Struct defines @@ -7775,12 +8227,13 @@ DUK_INTERNAL_DECL void duk_ctx_assert_valid(duk_hthread *thr); /* Fields are ordered for alignment/packing. */ struct duk_activation { - duk_tval tv_func; /* borrowed: full duk_tval for function being executed; for lightfuncs */ - duk_hobject *func; /* borrowed: function being executed; for bound function calls, this is the final, real function, NULL for lightfuncs */ + duk_tval tv_func; /* borrowed: full duk_tval for function being executed; for lightfuncs */ + duk_hobject *func; /* borrowed: function being executed; for bound function calls, this is the final, real function, NULL + for lightfuncs */ duk_activation *parent; /* previous (parent) activation (or NULL if none) */ - duk_hobject *var_env; /* current variable environment (may be NULL if delayed) */ - duk_hobject *lex_env; /* current lexical environment (may be NULL if delayed) */ - duk_catcher *cat; /* current catcher (or NULL) */ + duk_hobject *var_env; /* current variable environment (may be NULL if delayed) */ + duk_hobject *lex_env; /* current lexical environment (may be NULL if delayed) */ + duk_catcher *cat; /* current catcher (or NULL) */ #if defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) /* Previous value of 'func' caller, restored when unwound. Only in use @@ -7789,7 +8242,7 @@ struct duk_activation { duk_hobject *prev_caller; #endif - duk_instr_t *curr_pc; /* next instruction to execute (points to 'func' bytecode, stable pointer), NULL for native calls */ + duk_instr_t *curr_pc; /* next instruction to execute (points to 'func' bytecode, stable pointer), NULL for native calls */ /* bottom_byteoff and retval_byteoff are only used for book-keeping * of ECMAScript-initiated calls, to allow returning to an ECMAScript @@ -7836,12 +8289,12 @@ struct duk_activation { }; struct duk_catcher { - duk_catcher *parent; /* previous (parent) catcher (or NULL if none) */ - duk_hstring *h_varname; /* borrowed reference to catch variable name (or NULL if none) */ - /* (reference is valid as long activation exists) */ - duk_instr_t *pc_base; /* resume execution from pc_base or pc_base+1 (points to 'func' bytecode, stable pointer) */ - duk_size_t idx_base; /* idx_base and idx_base+1 get completion value and type */ - duk_uint32_t flags; /* type and control flags, label number */ + duk_catcher *parent; /* previous (parent) catcher (or NULL if none) */ + duk_hstring *h_varname; /* borrowed reference to catch variable name (or NULL if none) */ + /* (reference is valid as long activation exists) */ + duk_instr_t *pc_base; /* resume execution from pc_base or pc_base+1 (points to 'func' bytecode, stable pointer) */ + duk_size_t idx_base; /* idx_base and idx_base+1 get completion value and type */ + duk_uint32_t flags; /* type and control flags, label number */ /* XXX: could pack 'flags' and 'idx_base' to same value in practice, * on 32-bit targets this would make duk_catcher 16 bytes. */ @@ -7899,21 +8352,21 @@ struct duk_hthread { * yyy = arbitrary values, inside current frame * uuu = outside active value stack, initialized to 'undefined' */ - duk_tval *valstack; /* start of valstack allocation */ - duk_tval *valstack_end; /* end of valstack reservation/guarantee (exclusive) */ - duk_tval *valstack_alloc_end; /* end of valstack allocation */ - duk_tval *valstack_bottom; /* bottom of current frame */ - duk_tval *valstack_top; /* top of current frame (exclusive) */ + duk_tval *valstack; /* start of valstack allocation */ + duk_tval *valstack_end; /* end of valstack reservation/guarantee (exclusive) */ + duk_tval *valstack_alloc_end; /* end of valstack allocation */ + duk_tval *valstack_bottom; /* bottom of current frame */ + duk_tval *valstack_top; /* top of current frame (exclusive) */ /* Call stack, represented as a linked list starting from the current * activation (or NULL if nothing is active). */ - duk_activation *callstack_curr; /* current activation (or NULL if none) */ - duk_size_t callstack_top; /* number of activation records in callstack (0 if none) */ - duk_size_t callstack_preventcount; /* number of activation records in callstack preventing a yield */ + duk_activation *callstack_curr; /* current activation (or NULL if none) */ + duk_size_t callstack_top; /* number of activation records in callstack (0 if none) */ + duk_size_t callstack_preventcount; /* number of activation records in callstack preventing a yield */ /* Yield/resume book-keeping. */ - duk_hthread *resumer; /* who resumed us (if any) */ + duk_hthread *resumer; /* who resumed us (if any) */ /* Current compiler state (if any), used for augmenting SyntaxErrors. */ duk_compiler_ctx *compile_ctx; @@ -7926,8 +8379,8 @@ struct duk_hthread { * important for the counter to be conveniently accessible for the * bytecode executor inner loop for performance reasons. */ - duk_int_t interrupt_counter; /* countdown state */ - duk_int_t interrupt_init; /* start value for current countdown */ + duk_int_t interrupt_counter; /* countdown state */ + duk_int_t interrupt_init; /* start value for current countdown */ #endif /* Builtin-objects; may or may not be shared with other threads, @@ -7979,7 +8432,7 @@ DUK_INTERNAL_DECL void duk_hthread_catcher_unwind_nolexenv_norz(duk_hthread *thr DUK_INTERNAL_DECL void duk_hthread_valstack_torture_realloc(duk_hthread *thr); #endif -DUK_INTERNAL_DECL void *duk_hthread_get_valstack_ptr(duk_heap *heap, void *ud); /* indirect allocs */ +DUK_INTERNAL_DECL void *duk_hthread_get_valstack_ptr(duk_heap *heap, void *ud); /* indirect allocs */ #if defined(DUK_USE_DEBUGGER_SUPPORT) DUK_INTERNAL_DECL duk_uint_fast32_t duk_hthread_get_act_curr_pc(duk_hthread *thr, duk_activation *act); @@ -7988,7 +8441,7 @@ DUK_INTERNAL_DECL duk_uint_fast32_t duk_hthread_get_act_prev_pc(duk_hthread *thr DUK_INTERNAL_DECL void duk_hthread_sync_currpc(duk_hthread *thr); DUK_INTERNAL_DECL void duk_hthread_sync_and_null_currpc(duk_hthread *thr); -#endif /* DUK_HTHREAD_H_INCLUDED */ +#endif /* DUK_HTHREAD_H_INCLUDED */ /* #include duk_harray.h */ /* * Array object representation, used for actual Array instances. @@ -8003,15 +8456,26 @@ DUK_INTERNAL_DECL void duk_hthread_sync_and_null_currpc(duk_hthread *thr); #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_harray_assert_valid(duk_harray *h); -#define DUK_HARRAY_ASSERT_VALID(h) do { duk_harray_assert_valid((h)); } while (0) +#define DUK_HARRAY_ASSERT_VALID(h) \ + do { \ + duk_harray_assert_valid((h)); \ + } while (0) #else -#define DUK_HARRAY_ASSERT_VALID(h) do {} while (0) +#define DUK_HARRAY_ASSERT_VALID(h) \ + do { \ + } while (0) #endif -#define DUK_HARRAY_LENGTH_WRITABLE(h) (!(h)->length_nonwritable) -#define DUK_HARRAY_LENGTH_NONWRITABLE(h) ((h)->length_nonwritable) -#define DUK_HARRAY_SET_LENGTH_WRITABLE(h) do { (h)->length_nonwritable = 0; } while (0) -#define DUK_HARRAY_SET_LENGTH_NONWRITABLE(h) do { (h)->length_nonwritable = 1; } while (0) +#define DUK_HARRAY_LENGTH_WRITABLE(h) (!(h)->length_nonwritable) +#define DUK_HARRAY_LENGTH_NONWRITABLE(h) ((h)->length_nonwritable) +#define DUK_HARRAY_SET_LENGTH_WRITABLE(h) \ + do { \ + (h)->length_nonwritable = 0; \ + } while (0) +#define DUK_HARRAY_SET_LENGTH_NONWRITABLE(h) \ + do { \ + (h)->length_nonwritable = 1; \ + } while (0) struct duk_harray { /* Shared object part. */ @@ -8037,7 +8501,7 @@ struct duk_harray { duk_bool_t length_nonwritable; }; -#endif /* DUK_HARRAY_H_INCLUDED */ +#endif /* DUK_HARRAY_H_INCLUDED */ /* #include duk_henv.h */ /* * Environment object representation. @@ -8049,11 +8513,21 @@ struct duk_harray { #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hdecenv_assert_valid(duk_hdecenv *h); DUK_INTERNAL_DECL void duk_hobjenv_assert_valid(duk_hobjenv *h); -#define DUK_HDECENV_ASSERT_VALID(h) do { duk_hdecenv_assert_valid((h)); } while (0) -#define DUK_HOBJENV_ASSERT_VALID(h) do { duk_hobjenv_assert_valid((h)); } while (0) +#define DUK_HDECENV_ASSERT_VALID(h) \ + do { \ + duk_hdecenv_assert_valid((h)); \ + } while (0) +#define DUK_HOBJENV_ASSERT_VALID(h) \ + do { \ + duk_hobjenv_assert_valid((h)); \ + } while (0) #else -#define DUK_HDECENV_ASSERT_VALID(h) do {} while (0) -#define DUK_HOBJENV_ASSERT_VALID(h) do {} while (0) +#define DUK_HDECENV_ASSERT_VALID(h) \ + do { \ + } while (0) +#define DUK_HOBJENV_ASSERT_VALID(h) \ + do { \ + } while (0) #endif struct duk_hdecenv { @@ -8083,7 +8557,7 @@ struct duk_hobjenv { duk_bool_t has_this; }; -#endif /* DUK_HENV_H_INCLUDED */ +#endif /* DUK_HENV_H_INCLUDED */ /* #include duk_hbuffer.h */ /* * Heap buffer representation. @@ -8107,17 +8581,17 @@ struct duk_hobjenv { * External buffer: DUK_HBUFFER_FLAG_DYNAMIC | DUK_HBUFFER_FLAG_EXTERNAL */ -#define DUK_HBUFFER_FLAG_DYNAMIC DUK_HEAPHDR_USER_FLAG(0) /* buffer is behind a pointer, dynamic or external */ -#define DUK_HBUFFER_FLAG_EXTERNAL DUK_HEAPHDR_USER_FLAG(1) /* buffer pointer is to an externally allocated buffer */ +#define DUK_HBUFFER_FLAG_DYNAMIC DUK_HEAPHDR_USER_FLAG(0) /* buffer is behind a pointer, dynamic or external */ +#define DUK_HBUFFER_FLAG_EXTERNAL DUK_HEAPHDR_USER_FLAG(1) /* buffer pointer is to an externally allocated buffer */ -#define DUK_HBUFFER_HAS_DYNAMIC(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC) -#define DUK_HBUFFER_HAS_EXTERNAL(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL) +#define DUK_HBUFFER_HAS_DYNAMIC(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC) +#define DUK_HBUFFER_HAS_EXTERNAL(x) DUK_HEAPHDR_CHECK_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL) -#define DUK_HBUFFER_SET_DYNAMIC(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC) -#define DUK_HBUFFER_SET_EXTERNAL(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL) +#define DUK_HBUFFER_SET_DYNAMIC(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC) +#define DUK_HBUFFER_SET_EXTERNAL(x) DUK_HEAPHDR_SET_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL) -#define DUK_HBUFFER_CLEAR_DYNAMIC(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC) -#define DUK_HBUFFER_CLEAR_EXTERNAL(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL) +#define DUK_HBUFFER_CLEAR_DYNAMIC(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_DYNAMIC) +#define DUK_HBUFFER_CLEAR_EXTERNAL(x) DUK_HEAPHDR_CLEAR_FLAG_BITS(&(x)->hdr, DUK_HBUFFER_FLAG_EXTERNAL) /* * Misc defines @@ -8130,12 +8604,12 @@ struct duk_hobjenv { */ #if defined(DUK_USE_BUFLEN16) -#define DUK_HBUFFER_MAX_BYTELEN (0x0000ffffUL) +#define DUK_HBUFFER_MAX_BYTELEN (0x0000ffffUL) #else /* Intentionally not 0x7fffffffUL; at least JSON code expects that * 2*len + 2 fits in 32 bits. */ -#define DUK_HBUFFER_MAX_BYTELEN (0x7ffffffeUL) +#define DUK_HBUFFER_MAX_BYTELEN (0x7ffffffeUL) #endif /* @@ -8144,60 +8618,70 @@ struct duk_hobjenv { #if defined(DUK_USE_BUFLEN16) /* size stored in duk_heaphdr unused flag bits */ -#define DUK_HBUFFER_GET_SIZE(x) ((x)->hdr.h_flags >> 16) -#define DUK_HBUFFER_SET_SIZE(x,v) do { \ +#define DUK_HBUFFER_GET_SIZE(x) ((x)->hdr.h_flags >> 16) +#define DUK_HBUFFER_SET_SIZE(x, v) \ + do { \ duk_size_t duk__v; \ duk__v = (v); \ DUK_ASSERT(duk__v <= 0xffffUL); \ (x)->hdr.h_flags = ((x)->hdr.h_flags & 0x0000ffffUL) | (((duk_uint32_t) duk__v) << 16); \ } while (0) -#define DUK_HBUFFER_ADD_SIZE(x,dv) do { \ +#define DUK_HBUFFER_ADD_SIZE(x, dv) \ + do { \ (x)->hdr.h_flags += ((dv) << 16); \ } while (0) -#define DUK_HBUFFER_SUB_SIZE(x,dv) do { \ +#define DUK_HBUFFER_SUB_SIZE(x, dv) \ + do { \ (x)->hdr.h_flags -= ((dv) << 16); \ } while (0) #else -#define DUK_HBUFFER_GET_SIZE(x) (((duk_hbuffer *) (x))->size) -#define DUK_HBUFFER_SET_SIZE(x,v) do { \ +#define DUK_HBUFFER_GET_SIZE(x) (((duk_hbuffer *) (x))->size) +#define DUK_HBUFFER_SET_SIZE(x, v) \ + do { \ ((duk_hbuffer *) (x))->size = (v); \ } while (0) -#define DUK_HBUFFER_ADD_SIZE(x,dv) do { \ +#define DUK_HBUFFER_ADD_SIZE(x, dv) \ + do { \ (x)->size += (dv); \ } while (0) -#define DUK_HBUFFER_SUB_SIZE(x,dv) do { \ +#define DUK_HBUFFER_SUB_SIZE(x, dv) \ + do { \ (x)->size -= (dv); \ } while (0) #endif -#define DUK_HBUFFER_FIXED_GET_SIZE(x) DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x)) -#define DUK_HBUFFER_FIXED_SET_SIZE(x,v) DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x)) +#define DUK_HBUFFER_FIXED_GET_SIZE(x) DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x)) +#define DUK_HBUFFER_FIXED_SET_SIZE(x, v) DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x)) #define DUK_HBUFFER_DYNAMIC_GET_SIZE(x) DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x)) -#define DUK_HBUFFER_DYNAMIC_SET_SIZE(x,v) DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v)) -#define DUK_HBUFFER_DYNAMIC_ADD_SIZE(x,dv) DUK_HBUFFER_ADD_SIZE((duk_hbuffer *) (x), (dv)) -#define DUK_HBUFFER_DYNAMIC_SUB_SIZE(x,dv) DUK_HBUFFER_SUB_SIZE((duk_hbuffer *) (x), (dv)) +#define DUK_HBUFFER_DYNAMIC_SET_SIZE(x, v) DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v)) +#define DUK_HBUFFER_DYNAMIC_ADD_SIZE(x, dv) DUK_HBUFFER_ADD_SIZE((duk_hbuffer *) (x), (dv)) +#define DUK_HBUFFER_DYNAMIC_SUB_SIZE(x, dv) DUK_HBUFFER_SUB_SIZE((duk_hbuffer *) (x), (dv)) #define DUK_HBUFFER_EXTERNAL_GET_SIZE(x) DUK_HBUFFER_GET_SIZE((duk_hbuffer *) (x)) -#define DUK_HBUFFER_EXTERNAL_SET_SIZE(x,v) DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v)) +#define DUK_HBUFFER_EXTERNAL_SET_SIZE(x, v) DUK_HBUFFER_SET_SIZE((duk_hbuffer *) (x), (v)) -#define DUK_HBUFFER_FIXED_GET_DATA_PTR(heap,x) ((duk_uint8_t *) (((duk_hbuffer_fixed *) (void *) (x)) + 1)) +#define DUK_HBUFFER_FIXED_GET_DATA_PTR(heap, x) ((duk_uint8_t *) (((duk_hbuffer_fixed *) (void *) (x)) + 1)) #if defined(DUK_USE_HEAPPTR16) -#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap,x) \ +#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, x) \ ((void *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, ((duk_heaphdr *) (x))->h_extra16)) -#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap,x,v) do { \ +#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, x, v) \ + do { \ ((duk_heaphdr *) (x))->h_extra16 = DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (void *) (v)); \ } while (0) -#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap,x) do { \ - ((duk_heaphdr *) (x))->h_extra16 = 0; /* assume 0 <=> NULL */ \ +#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap, x) \ + do { \ + ((duk_heaphdr *) (x))->h_extra16 = 0; /* assume 0 <=> NULL */ \ } while (0) #else -#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap,x) ((x)->curr_alloc) -#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap,x,v) do { \ +#define DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(heap, x) ((x)->curr_alloc) +#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(heap, x, v) \ + do { \ (x)->curr_alloc = (void *) (v); \ } while (0) -#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap,x) do { \ +#define DUK_HBUFFER_DYNAMIC_SET_DATA_PTR_NULL(heap, x) \ + do { \ (x)->curr_alloc = (void *) NULL; \ } while (0) #endif @@ -8206,21 +8690,23 @@ struct duk_hobjenv { * Duktape heap. */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap,x) \ - ((void *) (x)->curr_alloc) -#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap,x,v) do { \ +#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap, x) ((void *) (x)->curr_alloc) +#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap, x, v) \ + do { \ (x)->curr_alloc = (void *) (v); \ } while (0) -#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL(heap,x) do { \ +#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL(heap, x) \ + do { \ (x)->curr_alloc = (void *) NULL; \ } while (0) #else -#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap,x) \ - ((void *) (x)->curr_alloc) -#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap,x,v) do { \ +#define DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(heap, x) ((void *) (x)->curr_alloc) +#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR(heap, x, v) \ + do { \ (x)->curr_alloc = (void *) (v); \ } while (0) -#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL(heap,x) do { \ +#define DUK_HBUFFER_EXTERNAL_SET_DATA_PTR_NULL(heap, x) \ + do { \ (x)->curr_alloc = (void *) NULL; \ } while (0) #endif @@ -8229,32 +8715,31 @@ struct duk_hobjenv { * size). May be NULL for zero size dynamic/external buffer. */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HBUFFER_GET_DATA_PTR(heap,x) ( \ - DUK_HBUFFER_HAS_DYNAMIC((x)) ? \ - ( \ - DUK_HBUFFER_HAS_EXTERNAL((x)) ? \ - DUK_HBUFFER_EXTERNAL_GET_DATA_PTR((heap), (duk_hbuffer_external *) (x)) : \ - DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((heap), (duk_hbuffer_dynamic *) (x)) \ - ) : \ - DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), (duk_hbuffer_fixed *) (void *) (x)) \ - ) +#define DUK_HBUFFER_GET_DATA_PTR(heap, x) \ + (DUK_HBUFFER_HAS_DYNAMIC((x)) ? \ + (DUK_HBUFFER_HAS_EXTERNAL((x)) ? DUK_HBUFFER_EXTERNAL_GET_DATA_PTR((heap), (duk_hbuffer_external *) (x)) : \ + DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((heap), (duk_hbuffer_dynamic *) (x))) : \ + DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), (duk_hbuffer_fixed *) (void *) (x))) #else /* Without heap pointer compression duk_hbuffer_dynamic and duk_hbuffer_external * have the same layout so checking for fixed vs. dynamic (or external) is enough. */ -#define DUK_HBUFFER_GET_DATA_PTR(heap,x) ( \ - DUK_HBUFFER_HAS_DYNAMIC((x)) ? \ - DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((heap), (duk_hbuffer_dynamic *) (x)) : \ - DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), (duk_hbuffer_fixed *) (void *) (x)) \ - ) +#define DUK_HBUFFER_GET_DATA_PTR(heap, x) \ + (DUK_HBUFFER_HAS_DYNAMIC((x)) ? DUK_HBUFFER_DYNAMIC_GET_DATA_PTR((heap), (duk_hbuffer_dynamic *) (x)) : \ + DUK_HBUFFER_FIXED_GET_DATA_PTR((heap), (duk_hbuffer_fixed *) (void *) (x))) #endif /* Validity assert. */ #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hbuffer_assert_valid(duk_hbuffer *h); -#define DUK_HBUFFER_ASSERT_VALID(h) do { duk_hbuffer_assert_valid((h)); } while (0) +#define DUK_HBUFFER_ASSERT_VALID(h) \ + do { \ + duk_hbuffer_assert_valid((h)); \ + } while (0) #else -#define DUK_HBUFFER_ASSERT_VALID(h) do {} while (0) +#define DUK_HBUFFER_ASSERT_VALID(h) \ + do { \ + } while (0) #endif /* @@ -8352,9 +8837,9 @@ struct duk_hbuffer_fixed { */ } #if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_GCC_ATTR) -__attribute__ ((aligned (8))) +__attribute__((aligned(8))) #elif (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_CLANG_ATTR) -__attribute__ ((aligned (8))) +__attribute__((aligned(8))) #endif ; #if (DUK_USE_ALIGN_BY == 8) && defined(DUK_USE_PACK_MSVC_PRAGMA) @@ -8377,7 +8862,7 @@ struct duk_hbuffer_dynamic { #if defined(DUK_USE_HEAPPTR16) /* Stored in duk_heaphdr h_extra16. */ #else - void *curr_alloc; /* may be NULL if alloc_size == 0 */ + void *curr_alloc; /* may be NULL if alloc_size == 0 */ #endif /* @@ -8406,7 +8891,7 @@ struct duk_hbuffer_external { /* Cannot be compressed as a heap pointer because may point to * an arbitrary address. */ - void *curr_alloc; /* may be NULL if alloc_size == 0 */ + void *curr_alloc; /* may be NULL if alloc_size == 0 */ }; /* @@ -8414,13 +8899,13 @@ struct duk_hbuffer_external { */ DUK_INTERNAL_DECL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk_small_uint_t flags, void **out_bufdata); -DUK_INTERNAL_DECL void *duk_hbuffer_get_dynalloc_ptr(duk_heap *heap, void *ud); /* indirect allocs */ +DUK_INTERNAL_DECL void *duk_hbuffer_get_dynalloc_ptr(duk_heap *heap, void *ud); /* indirect allocs */ /* dynamic buffer ops */ DUK_INTERNAL_DECL void duk_hbuffer_resize(duk_hthread *thr, duk_hbuffer_dynamic *buf, duk_size_t new_size); DUK_INTERNAL_DECL void duk_hbuffer_reset(duk_hthread *thr, duk_hbuffer_dynamic *buf); -#endif /* DUK_HBUFFER_H_INCLUDED */ +#endif /* DUK_HBUFFER_H_INCLUDED */ /* #include duk_hproxy.h */ /* * Proxy object representation. @@ -8431,9 +8916,14 @@ DUK_INTERNAL_DECL void duk_hbuffer_reset(duk_hthread *thr, duk_hbuffer_dynamic * #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_hproxy_assert_valid(duk_hproxy *h); -#define DUK_HPROXY_ASSERT_VALID(h) do { duk_hproxy_assert_valid((h)); } while (0) +#define DUK_HPROXY_ASSERT_VALID(h) \ + do { \ + duk_hproxy_assert_valid((h)); \ + } while (0) #else -#define DUK_HPROXY_ASSERT_VALID(h) do {} while (0) +#define DUK_HPROXY_ASSERT_VALID(h) \ + do { \ + } while (0) #endif struct duk_hproxy { @@ -8447,7 +8937,7 @@ struct duk_hproxy { duk_hobject *handler; }; -#endif /* DUK_HPROXY_H_INCLUDED */ +#endif /* DUK_HPROXY_H_INCLUDED */ /* #include duk_heap.h */ /* * Heap structure. @@ -8465,46 +8955,50 @@ struct duk_hproxy { * Heap flags */ -#define DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED (1U << 0) /* mark-and-sweep marking reached a recursion limit and must use multi-pass marking */ -#define DUK_HEAP_FLAG_INTERRUPT_RUNNING (1U << 1) /* executor interrupt running (used to avoid nested interrupts) */ -#define DUK_HEAP_FLAG_FINALIZER_NORESCUE (1U << 2) /* heap destruction ongoing, finalizer rescue no longer possible */ -#define DUK_HEAP_FLAG_DEBUGGER_PAUSED (1U << 3) /* debugger is paused: talk with debug client until step/resume */ +#define DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED \ + (1U << 0) /* mark-and-sweep marking reached a recursion limit and must use multi-pass marking */ +#define DUK_HEAP_FLAG_INTERRUPT_RUNNING (1U << 1) /* executor interrupt running (used to avoid nested interrupts) */ +#define DUK_HEAP_FLAG_FINALIZER_NORESCUE (1U << 2) /* heap destruction ongoing, finalizer rescue no longer possible */ +#define DUK_HEAP_FLAG_DEBUGGER_PAUSED (1U << 3) /* debugger is paused: talk with debug client until step/resume */ -#define DUK__HEAP_HAS_FLAGS(heap,bits) ((heap)->flags & (bits)) -#define DUK__HEAP_SET_FLAGS(heap,bits) do { \ +#define DUK__HEAP_HAS_FLAGS(heap, bits) ((heap)->flags & (bits)) +#define DUK__HEAP_SET_FLAGS(heap, bits) \ + do { \ (heap)->flags |= (bits); \ } while (0) -#define DUK__HEAP_CLEAR_FLAGS(heap,bits) do { \ +#define DUK__HEAP_CLEAR_FLAGS(heap, bits) \ + do { \ (heap)->flags &= ~(bits); \ } while (0) -#define DUK_HEAP_HAS_MARKANDSWEEP_RECLIMIT_REACHED(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED) -#define DUK_HEAP_HAS_INTERRUPT_RUNNING(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_INTERRUPT_RUNNING) -#define DUK_HEAP_HAS_FINALIZER_NORESCUE(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_FINALIZER_NORESCUE) -#define DUK_HEAP_HAS_DEBUGGER_PAUSED(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_DEBUGGER_PAUSED) +#define DUK_HEAP_HAS_MARKANDSWEEP_RECLIMIT_REACHED(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED) +#define DUK_HEAP_HAS_INTERRUPT_RUNNING(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_INTERRUPT_RUNNING) +#define DUK_HEAP_HAS_FINALIZER_NORESCUE(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_FINALIZER_NORESCUE) +#define DUK_HEAP_HAS_DEBUGGER_PAUSED(heap) DUK__HEAP_HAS_FLAGS((heap), DUK_HEAP_FLAG_DEBUGGER_PAUSED) -#define DUK_HEAP_SET_MARKANDSWEEP_RECLIMIT_REACHED(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED) -#define DUK_HEAP_SET_INTERRUPT_RUNNING(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_INTERRUPT_RUNNING) -#define DUK_HEAP_SET_FINALIZER_NORESCUE(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_FINALIZER_NORESCUE) -#define DUK_HEAP_SET_DEBUGGER_PAUSED(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_DEBUGGER_PAUSED) +#define DUK_HEAP_SET_MARKANDSWEEP_RECLIMIT_REACHED(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED) +#define DUK_HEAP_SET_INTERRUPT_RUNNING(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_INTERRUPT_RUNNING) +#define DUK_HEAP_SET_FINALIZER_NORESCUE(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_FINALIZER_NORESCUE) +#define DUK_HEAP_SET_DEBUGGER_PAUSED(heap) DUK__HEAP_SET_FLAGS((heap), DUK_HEAP_FLAG_DEBUGGER_PAUSED) -#define DUK_HEAP_CLEAR_MARKANDSWEEP_RECLIMIT_REACHED(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED) -#define DUK_HEAP_CLEAR_INTERRUPT_RUNNING(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_INTERRUPT_RUNNING) -#define DUK_HEAP_CLEAR_FINALIZER_NORESCUE(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_FINALIZER_NORESCUE) -#define DUK_HEAP_CLEAR_DEBUGGER_PAUSED(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_DEBUGGER_PAUSED) +#define DUK_HEAP_CLEAR_MARKANDSWEEP_RECLIMIT_REACHED(heap) \ + DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_MARKANDSWEEP_RECLIMIT_REACHED) +#define DUK_HEAP_CLEAR_INTERRUPT_RUNNING(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_INTERRUPT_RUNNING) +#define DUK_HEAP_CLEAR_FINALIZER_NORESCUE(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_FINALIZER_NORESCUE) +#define DUK_HEAP_CLEAR_DEBUGGER_PAUSED(heap) DUK__HEAP_CLEAR_FLAGS((heap), DUK_HEAP_FLAG_DEBUGGER_PAUSED) /* * Longjmp types, also double as identifying continuation type for a rethrow (in 'finally') */ -#define DUK_LJ_TYPE_UNKNOWN 0 /* unused */ -#define DUK_LJ_TYPE_THROW 1 /* value1 -> error object */ -#define DUK_LJ_TYPE_YIELD 2 /* value1 -> yield value, iserror -> error / normal */ -#define DUK_LJ_TYPE_RESUME 3 /* value1 -> resume value, value2 -> resumee thread, iserror -> error/normal */ -#define DUK_LJ_TYPE_BREAK 4 /* value1 -> label number, pseudo-type to indicate a break continuation (for ENDFIN) */ -#define DUK_LJ_TYPE_CONTINUE 5 /* value1 -> label number, pseudo-type to indicate a continue continuation (for ENDFIN) */ -#define DUK_LJ_TYPE_RETURN 6 /* value1 -> return value, pseudo-type to indicate a return continuation (for ENDFIN) */ -#define DUK_LJ_TYPE_NORMAL 7 /* no value, pseudo-type to indicate a normal continuation (for ENDFIN) */ +#define DUK_LJ_TYPE_UNKNOWN 0 /* unused */ +#define DUK_LJ_TYPE_THROW 1 /* value1 -> error object */ +#define DUK_LJ_TYPE_YIELD 2 /* value1 -> yield value, iserror -> error / normal */ +#define DUK_LJ_TYPE_RESUME 3 /* value1 -> resume value, value2 -> resumee thread, iserror -> error/normal */ +#define DUK_LJ_TYPE_BREAK 4 /* value1 -> label number, pseudo-type to indicate a break continuation (for ENDFIN) */ +#define DUK_LJ_TYPE_CONTINUE 5 /* value1 -> label number, pseudo-type to indicate a continue continuation (for ENDFIN) */ +#define DUK_LJ_TYPE_RETURN 6 /* value1 -> return value, pseudo-type to indicate a return continuation (for ENDFIN) */ +#define DUK_LJ_TYPE_NORMAL 7 /* no value, pseudo-type to indicate a normal continuation (for ENDFIN) */ /* * Mark-and-sweep flags @@ -8517,19 +9011,19 @@ struct duk_hproxy { /* Emergency mark-and-sweep: try extra hard, even at the cost of * performance. */ -#define DUK_MS_FLAG_EMERGENCY (1U << 0) +#define DUK_MS_FLAG_EMERGENCY (1U << 0) /* Postpone rescue decisions for reachable objects with FINALIZED set. * Used during finalize_list processing to avoid incorrect rescue * decisions due to finalize_list being a reachability root. */ -#define DUK_MS_FLAG_POSTPONE_RESCUE (1U << 1) +#define DUK_MS_FLAG_POSTPONE_RESCUE (1U << 1) /* Don't compact objects; needed during object property table resize * to prevent a recursive resize. It would suffice to protect only the * current object being resized, but this is not yet implemented. */ -#define DUK_MS_FLAG_NO_OBJECT_COMPACTION (1U << 2) +#define DUK_MS_FLAG_NO_OBJECT_COMPACTION (1U << 2) /* * Thread switching @@ -8540,9 +9034,10 @@ struct duk_hproxy { */ #if defined(DUK_USE_INTERRUPT_COUNTER) -#define DUK_HEAP_SWITCH_THREAD(heap,newthr) duk_heap_switch_thread((heap), (newthr)) +#define DUK_HEAP_SWITCH_THREAD(heap, newthr) duk_heap_switch_thread((heap), (newthr)) #else -#define DUK_HEAP_SWITCH_THREAD(heap,newthr) do { \ +#define DUK_HEAP_SWITCH_THREAD(heap, newthr) \ + do { \ (heap)->curr_thread = (newthr); \ } while (0) #endif @@ -8552,11 +9047,14 @@ struct duk_hproxy { */ #if defined(DUK_USE_DEBUG) -#define DUK_STATS_INC(heap,fieldname) do { \ +#define DUK_STATS_INC(heap, fieldname) \ + do { \ (heap)->fieldname += 1; \ } while (0) #else -#define DUK_STATS_INC(heap,fieldname) do {} while (0) +#define DUK_STATS_INC(heap, fieldname) \ + do { \ + } while (0) #endif /* @@ -8574,36 +9072,41 @@ struct duk_hproxy { * only during init phases). */ #if defined(DUK_USE_REFERENCE_COUNTING) -#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_MULT 12800L /* 50x heap size */ -#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_ADD 1024L -#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_SKIP 256L +#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_MULT 12800L /* 50x heap size */ +#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_ADD 1024L +#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_SKIP 256L #else -#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_MULT 256L /* 1x heap size */ -#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_ADD 1024L -#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_SKIP 256L +#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_MULT 256L /* 1x heap size */ +#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_ADD 1024L +#define DUK_HEAP_MARK_AND_SWEEP_TRIGGER_SKIP 256L #endif /* GC torture. */ #if defined(DUK_USE_GC_TORTURE) -#define DUK_GC_TORTURE(heap) do { duk_heap_mark_and_sweep((heap), 0); } while (0) +#define DUK_GC_TORTURE(heap) \ + do { \ + duk_heap_mark_and_sweep((heap), 0); \ + } while (0) #else -#define DUK_GC_TORTURE(heap) do { } while (0) +#define DUK_GC_TORTURE(heap) \ + do { \ + } while (0) #endif /* Stringcache is used for speeding up char-offset-to-byte-offset * translations for non-ASCII strings. */ -#define DUK_HEAP_STRCACHE_SIZE 4 -#define DUK_HEAP_STRINGCACHE_NOCACHE_LIMIT 16 /* strings up to the this length are not cached */ +#define DUK_HEAP_STRCACHE_SIZE 4 +#define DUK_HEAP_STRINGCACHE_NOCACHE_LIMIT 16 /* strings up to the this length are not cached */ /* Some list management macros. */ -#define DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap,hdr) duk_heap_insert_into_heap_allocated((heap), (hdr)) +#define DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, hdr) duk_heap_insert_into_heap_allocated((heap), (hdr)) #if defined(DUK_USE_REFERENCE_COUNTING) -#define DUK_HEAP_REMOVE_FROM_HEAP_ALLOCATED(heap,hdr) duk_heap_remove_from_heap_allocated((heap), (hdr)) +#define DUK_HEAP_REMOVE_FROM_HEAP_ALLOCATED(heap, hdr) duk_heap_remove_from_heap_allocated((heap), (hdr)) #endif #if defined(DUK_USE_FINALIZER_SUPPORT) -#define DUK_HEAP_INSERT_INTO_FINALIZE_LIST(heap,hdr) duk_heap_insert_into_finalize_list((heap), (hdr)) -#define DUK_HEAP_REMOVE_FROM_FINALIZE_LIST(heap,hdr) duk_heap_remove_from_finalize_list((heap), (hdr)) +#define DUK_HEAP_INSERT_INTO_FINALIZE_LIST(heap, hdr) duk_heap_insert_into_finalize_list((heap), (hdr)) +#define DUK_HEAP_REMOVE_FROM_FINALIZE_LIST(heap, hdr) duk_heap_remove_from_finalize_list((heap), (hdr)) #endif /* @@ -8612,30 +9115,24 @@ struct duk_hproxy { /* heap string indices are autogenerated in duk_strings.h */ #if defined(DUK_USE_ROM_STRINGS) -#define DUK_HEAP_GET_STRING(heap,idx) \ - ((duk_hstring *) DUK_LOSE_CONST(duk_rom_strings_stridx[(idx)])) -#else /* DUK_USE_ROM_STRINGS */ +#define DUK_HEAP_GET_STRING(heap, idx) ((duk_hstring *) DUK_LOSE_CONST(duk_rom_strings_stridx[(idx)])) +#else /* DUK_USE_ROM_STRINGS */ #if defined(DUK_USE_HEAPPTR16) -#define DUK_HEAP_GET_STRING(heap,idx) \ - ((duk_hstring *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (heap)->strs16[(idx)])) +#define DUK_HEAP_GET_STRING(heap, idx) ((duk_hstring *) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (heap)->strs16[(idx)])) #else -#define DUK_HEAP_GET_STRING(heap,idx) \ - ((heap)->strs[(idx)]) +#define DUK_HEAP_GET_STRING(heap, idx) ((heap)->strs[(idx)]) #endif -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ /* * Raw memory calls: relative to heap, but no GC interaction */ -#define DUK_ALLOC_RAW(heap,size) \ - ((heap)->alloc_func((heap)->heap_udata, (size))) +#define DUK_ALLOC_RAW(heap, size) ((heap)->alloc_func((heap)->heap_udata, (size))) -#define DUK_REALLOC_RAW(heap,ptr,newsize) \ - ((heap)->realloc_func((heap)->heap_udata, (void *) (ptr), (newsize))) +#define DUK_REALLOC_RAW(heap, ptr, newsize) ((heap)->realloc_func((heap)->heap_udata, (void *) (ptr), (newsize))) -#define DUK_FREE_RAW(heap,ptr) \ - ((heap)->free_func((heap)->heap_udata, (void *) (ptr))) +#define DUK_FREE_RAW(heap, ptr) ((heap)->free_func((heap)->heap_udata, (void *) (ptr))) /* * Memory calls: relative to heap, GC interaction, but no error throwing. @@ -8668,11 +9165,11 @@ struct duk_hproxy { /* callback for indirect reallocs, request for current pointer */ typedef void *(*duk_mem_getptr)(duk_heap *heap, void *ud); -#define DUK_ALLOC(heap,size) duk_heap_mem_alloc((heap), (size)) -#define DUK_ALLOC_ZEROED(heap,size) duk_heap_mem_alloc_zeroed((heap), (size)) -#define DUK_REALLOC(heap,ptr,newsize) duk_heap_mem_realloc((heap), (ptr), (newsize)) -#define DUK_REALLOC_INDIRECT(heap,cb,ud,newsize) duk_heap_mem_realloc_indirect((heap), (cb), (ud), (newsize)) -#define DUK_FREE(heap,ptr) duk_heap_mem_free((heap), (ptr)) +#define DUK_ALLOC(heap, size) duk_heap_mem_alloc((heap), (size)) +#define DUK_ALLOC_ZEROED(heap, size) duk_heap_mem_alloc_zeroed((heap), (size)) +#define DUK_REALLOC(heap, ptr, newsize) duk_heap_mem_realloc((heap), (ptr), (newsize)) +#define DUK_REALLOC_INDIRECT(heap, cb, ud, newsize) duk_heap_mem_realloc_indirect((heap), (cb), (ud), (newsize)) +#define DUK_FREE(heap, ptr) duk_heap_mem_free((heap), (ptr)) /* * Checked allocation, relative to a thread @@ -8681,24 +9178,26 @@ typedef void *(*duk_mem_getptr)(duk_heap *heap, void *ud); * for convenience. */ -#define DUK_ALLOC_CHECKED(thr,size) duk_heap_mem_alloc_checked((thr), (size)) -#define DUK_ALLOC_CHECKED_ZEROED(thr,size) duk_heap_mem_alloc_checked_zeroed((thr), (size)) -#define DUK_FREE_CHECKED(thr,ptr) duk_heap_mem_free((thr)->heap, (ptr)) +#define DUK_ALLOC_CHECKED(thr, size) duk_heap_mem_alloc_checked((thr), (size)) +#define DUK_ALLOC_CHECKED_ZEROED(thr, size) duk_heap_mem_alloc_checked_zeroed((thr), (size)) +#define DUK_FREE_CHECKED(thr, ptr) duk_heap_mem_free((thr)->heap, (ptr)) /* * Memory constants */ -#define DUK_HEAP_ALLOC_FAIL_MARKANDSWEEP_LIMIT 10 /* Retry allocation after mark-and-sweep for this - * many times. A single mark-and-sweep round is - * not guaranteed to free all unreferenced memory - * because of finalization (in fact, ANY number of - * rounds is strictly not enough). - */ +#define DUK_HEAP_ALLOC_FAIL_MARKANDSWEEP_LIMIT \ + 10 /* Retry allocation after mark-and-sweep for this \ + * many times. A single mark-and-sweep round is \ + * not guaranteed to free all unreferenced memory \ + * because of finalization (in fact, ANY number of \ + * rounds is strictly not enough). \ + */ -#define DUK_HEAP_ALLOC_FAIL_MARKANDSWEEP_EMERGENCY_LIMIT 3 /* Starting from this round, use emergency mode - * for mark-and-sweep. - */ +#define DUK_HEAP_ALLOC_FAIL_MARKANDSWEEP_EMERGENCY_LIMIT \ + 3 /* Starting from this round, use emergency mode \ + * for mark-and-sweep. \ + */ /* * Debugger support @@ -8707,26 +9206,26 @@ typedef void *(*duk_mem_getptr)(duk_heap *heap, void *ud); /* Maximum number of breakpoints. Only breakpoints that are set are * consulted so increasing this has no performance impact. */ -#define DUK_HEAP_MAX_BREAKPOINTS 16 +#define DUK_HEAP_MAX_BREAKPOINTS 16 /* Opcode interval for a Date-based status/peek rate limit check. Only * relevant when debugger is attached. Requesting a timestamp may be a * slow operation on some platforms so this shouldn't be too low. On the * other hand a high value makes Duktape react to a pause request slowly. */ -#define DUK_HEAP_DBG_RATELIMIT_OPCODES 4000 +#define DUK_HEAP_DBG_RATELIMIT_OPCODES 4000 /* Milliseconds between status notify and transport peeks. */ -#define DUK_HEAP_DBG_RATELIMIT_MILLISECS 200 +#define DUK_HEAP_DBG_RATELIMIT_MILLISECS 200 /* Debugger pause flags. */ -#define DUK_PAUSE_FLAG_ONE_OPCODE (1U << 0) /* pause when a single opcode has been executed */ -#define DUK_PAUSE_FLAG_ONE_OPCODE_ACTIVE (1U << 1) /* one opcode pause actually active; artifact of current implementation */ -#define DUK_PAUSE_FLAG_LINE_CHANGE (1U << 2) /* pause when current line number changes */ -#define DUK_PAUSE_FLAG_FUNC_ENTRY (1U << 3) /* pause when entering a function */ -#define DUK_PAUSE_FLAG_FUNC_EXIT (1U << 4) /* pause when exiting current function */ -#define DUK_PAUSE_FLAG_CAUGHT_ERROR (1U << 5) /* pause when about to throw an error that is caught */ -#define DUK_PAUSE_FLAG_UNCAUGHT_ERROR (1U << 6) /* pause when about to throw an error that won't be caught */ +#define DUK_PAUSE_FLAG_ONE_OPCODE (1U << 0) /* pause when a single opcode has been executed */ +#define DUK_PAUSE_FLAG_ONE_OPCODE_ACTIVE (1U << 1) /* one opcode pause actually active; artifact of current implementation */ +#define DUK_PAUSE_FLAG_LINE_CHANGE (1U << 2) /* pause when current line number changes */ +#define DUK_PAUSE_FLAG_FUNC_ENTRY (1U << 3) /* pause when entering a function */ +#define DUK_PAUSE_FLAG_FUNC_EXIT (1U << 4) /* pause when exiting current function */ +#define DUK_PAUSE_FLAG_CAUGHT_ERROR (1U << 5) /* pause when about to throw an error that is caught */ +#define DUK_PAUSE_FLAG_UNCAUGHT_ERROR (1U << 6) /* pause when about to throw an error that won't be caught */ struct duk_breakpoint { duk_hstring *filename; @@ -8754,21 +9253,23 @@ struct duk_strcache_entry { */ struct duk_ljstate { - duk_jmpbuf *jmpbuf_ptr; /* current setjmp() catchpoint */ - duk_small_uint_t type; /* longjmp type */ - duk_bool_t iserror; /* isError flag for yield */ - duk_tval value1; /* 1st related value (type specific) */ - duk_tval value2; /* 2nd related value (type specific) */ + duk_jmpbuf *jmpbuf_ptr; /* current setjmp() catchpoint */ + duk_small_uint_t type; /* longjmp type */ + duk_bool_t iserror; /* isError flag for yield */ + duk_tval value1; /* 1st related value (type specific) */ + duk_tval value2; /* 2nd related value (type specific) */ }; -#define DUK_ASSERT_LJSTATE_UNSET(heap) do { \ +#define DUK_ASSERT_LJSTATE_UNSET(heap) \ + do { \ DUK_ASSERT(heap != NULL); \ DUK_ASSERT(heap->lj.type == DUK_LJ_TYPE_UNKNOWN); \ DUK_ASSERT(heap->lj.iserror == 0); \ DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(&heap->lj.value1)); \ DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(&heap->lj.value2)); \ } while (0) -#define DUK_ASSERT_LJSTATE_SET(heap) do { \ +#define DUK_ASSERT_LJSTATE_SET(heap) \ + do { \ DUK_ASSERT(heap != NULL); \ DUK_ASSERT(heap->lj.type != DUK_LJ_TYPE_UNKNOWN); \ } while (0) @@ -8788,9 +9289,14 @@ struct duk_litcache_entry { #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL_DECL void duk_heap_assert_valid(duk_heap *heap); -#define DUK_HEAP_ASSERT_VALID(heap) do { duk_heap_assert_valid((heap)); } while (0) +#define DUK_HEAP_ASSERT_VALID(heap) \ + do { \ + duk_heap_assert_valid((heap)); \ + } while (0) #else -#define DUK_HEAP_ASSERT_VALID(heap) do {} while (0) +#define DUK_HEAP_ASSERT_VALID(heap) \ + do { \ + } while (0) #endif struct duk_heap { @@ -8944,9 +9450,9 @@ struct duk_heap { /* Random number state for duk_util_tinyrandom.c. */ #if !defined(DUK_USE_GET_RANDOM_DOUBLE) #if defined(DUK_USE_PREFER_SIZE) || !defined(DUK_USE_64BIT_OPS) - duk_uint32_t rnd_state; /* State for Shamir's three-op algorithm */ + duk_uint32_t rnd_state; /* State for Shamir's three-op algorithm */ #else - duk_uint64_t rnd_state[2]; /* State for xoroshiro128+ */ + duk_uint64_t rnd_state[2]; /* State for xoroshiro128+ */ #endif #endif @@ -8969,8 +9475,8 @@ struct duk_heap { /* Debugger state. */ #if defined(DUK_USE_DEBUGGER_SUPPORT) /* Callbacks and udata; dbg_read_cb != NULL is used to indicate attached state. */ - duk_debug_read_function dbg_read_cb; /* required, NULL implies detached */ - duk_debug_write_function dbg_write_cb; /* required */ + duk_debug_read_function dbg_read_cb; /* required, NULL implies detached */ + duk_debug_write_function dbg_write_cb; /* required */ duk_debug_peek_function dbg_peek_cb; duk_debug_read_flush_function dbg_read_flush_cb; duk_debug_write_flush_function dbg_write_flush_cb; @@ -8979,29 +9485,32 @@ struct duk_heap { void *dbg_udata; /* The following are only relevant when debugger is attached. */ - duk_bool_t dbg_processing; /* currently processing messages or breakpoints: don't enter message processing recursively (e.g. no breakpoints when processing debugger eval) */ - duk_bool_t dbg_state_dirty; /* resend state next time executor is about to run */ - duk_bool_t dbg_force_restart; /* force executor restart to recheck breakpoints; used to handle function returns (see GH-303) */ - duk_bool_t dbg_detaching; /* debugger detaching; used to avoid calling detach handler recursively */ - duk_small_uint_t dbg_pause_flags; /* flags for automatic pause behavior */ - duk_activation *dbg_pause_act; /* activation related to pause behavior (pause on line change, function entry/exit) */ - duk_uint32_t dbg_pause_startline; /* starting line number for line change related pause behavior */ - duk_breakpoint dbg_breakpoints[DUK_HEAP_MAX_BREAKPOINTS]; /* breakpoints: [0,breakpoint_count[ gc reachable */ + duk_bool_t dbg_processing; /* currently processing messages or breakpoints: don't enter message processing recursively (e.g. + no breakpoints when processing debugger eval) */ + duk_bool_t dbg_state_dirty; /* resend state next time executor is about to run */ + duk_bool_t + dbg_force_restart; /* force executor restart to recheck breakpoints; used to handle function returns (see GH-303) */ + duk_bool_t dbg_detaching; /* debugger detaching; used to avoid calling detach handler recursively */ + duk_small_uint_t dbg_pause_flags; /* flags for automatic pause behavior */ + duk_activation *dbg_pause_act; /* activation related to pause behavior (pause on line change, function entry/exit) */ + duk_uint32_t dbg_pause_startline; /* starting line number for line change related pause behavior */ + duk_breakpoint dbg_breakpoints[DUK_HEAP_MAX_BREAKPOINTS]; /* breakpoints: [0,breakpoint_count[ gc reachable */ duk_small_uint_t dbg_breakpoint_count; - duk_breakpoint *dbg_breakpoints_active[DUK_HEAP_MAX_BREAKPOINTS + 1]; /* currently active breakpoints: NULL term, borrowed pointers */ + duk_breakpoint + *dbg_breakpoints_active[DUK_HEAP_MAX_BREAKPOINTS + 1]; /* currently active breakpoints: NULL term, borrowed pointers */ /* XXX: make active breakpoints actual copies instead of pointers? */ /* These are for rate limiting Status notifications and transport peeking. */ - duk_uint_t dbg_exec_counter; /* cumulative opcode execution count (overflows are OK) */ - duk_uint_t dbg_last_counter; /* value of dbg_exec_counter when we last did a Date-based check */ - duk_double_t dbg_last_time; /* time when status/peek was last done (Date-based rate limit) */ + duk_uint_t dbg_exec_counter; /* cumulative opcode execution count (overflows are OK) */ + duk_uint_t dbg_last_counter; /* value of dbg_exec_counter when we last did a Date-based check */ + duk_double_t dbg_last_time; /* time when status/peek was last done (Date-based rate limit) */ /* Used to support single-byte stream lookahead. */ duk_bool_t dbg_have_next_byte; duk_uint8_t dbg_next_byte; -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ #if defined(DUK_USE_ASSERTIONS) - duk_bool_t dbg_calling_transport; /* transport call in progress, calling into Duktape forbidden */ + duk_bool_t dbg_calling_transport; /* transport call in progress, calling into Duktape forbidden */ #endif /* String intern table (weak refs). */ @@ -9010,12 +9519,12 @@ struct duk_heap { #else duk_hstring **strtable; #endif - duk_uint32_t st_mask; /* mask for lookup, st_size - 1 */ - duk_uint32_t st_size; /* stringtable size */ + duk_uint32_t st_mask; /* mask for lookup, st_size - 1 */ + duk_uint32_t st_size; /* stringtable size */ #if (DUK_USE_STRTAB_MINSIZE != DUK_USE_STRTAB_MAXSIZE) - duk_uint32_t st_count; /* string count for resize load factor checks */ + duk_uint32_t st_count; /* string count for resize load factor checks */ #endif - duk_bool_t st_resizing; /* string table is being resized; avoid recursive resize */ + duk_bool_t st_resizing; /* string table is being resized; avoid recursive resize */ /* String access cache (codepoint offset -> byte offset) for fast string * character looping; 'weak' reference which needs special handling in GC. @@ -9129,7 +9638,9 @@ DUK_INTERNAL_DECL void duk_heap_switch_thread(duk_heap *heap, duk_hthread *new_t DUK_INTERNAL_DECL duk_hstring *duk_heap_strtable_intern(duk_heap *heap, const duk_uint8_t *str, duk_uint32_t blen); DUK_INTERNAL_DECL duk_hstring *duk_heap_strtable_intern_checked(duk_hthread *thr, const duk_uint8_t *str, duk_uint32_t len); #if defined(DUK_USE_LITCACHE_SIZE) -DUK_INTERNAL_DECL duk_hstring *duk_heap_strtable_intern_literal_checked(duk_hthread *thr, const duk_uint8_t *str, duk_uint32_t blen); +DUK_INTERNAL_DECL duk_hstring *duk_heap_strtable_intern_literal_checked(duk_hthread *thr, + const duk_uint8_t *str, + duk_uint32_t blen); #endif DUK_INTERNAL_DECL duk_hstring *duk_heap_strtable_intern_u32(duk_heap *heap, duk_uint32_t val); DUK_INTERNAL_DECL duk_hstring *duk_heap_strtable_intern_u32_checked(duk_hthread *thr, duk_uint32_t val); @@ -9144,7 +9655,9 @@ DUK_INTERNAL void duk_heap_strtable_dump(duk_heap *heap); #endif DUK_INTERNAL_DECL void duk_heap_strcache_string_remove(duk_heap *heap, duk_hstring *h); -DUK_INTERNAL_DECL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *thr, duk_hstring *h, duk_uint_fast32_t char_offset); +DUK_INTERNAL_DECL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *thr, + duk_hstring *h, + duk_uint_fast32_t char_offset); #if defined(DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS) DUK_INTERNAL_DECL void *duk_default_alloc_function(void *udata, duk_size_t size); @@ -9165,13 +9678,13 @@ DUK_INTERNAL_DECL void duk_heap_free_freelists(duk_heap *heap); #if defined(DUK_USE_FINALIZER_SUPPORT) DUK_INTERNAL_DECL void duk_heap_run_finalizer(duk_heap *heap, duk_hobject *obj); DUK_INTERNAL_DECL void duk_heap_process_finalize_list(duk_heap *heap); -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ DUK_INTERNAL_DECL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags); DUK_INTERNAL_DECL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uint8_t *str, duk_size_t len); -#endif /* DUK_HEAP_H_INCLUDED */ +#endif /* DUK_HEAP_H_INCLUDED */ /* #include duk_debugger.h */ #if !defined(DUK_DEBUGGER_H_INCLUDED) #define DUK_DEBUGGER_H_INCLUDED @@ -9179,77 +9692,77 @@ DUK_INTERNAL_DECL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uin /* Debugger protocol version is defined in the public API header. */ /* Initial bytes for markers. */ -#define DUK_DBG_IB_EOM 0x00 -#define DUK_DBG_IB_REQUEST 0x01 -#define DUK_DBG_IB_REPLY 0x02 -#define DUK_DBG_IB_ERROR 0x03 -#define DUK_DBG_IB_NOTIFY 0x04 +#define DUK_DBG_IB_EOM 0x00 +#define DUK_DBG_IB_REQUEST 0x01 +#define DUK_DBG_IB_REPLY 0x02 +#define DUK_DBG_IB_ERROR 0x03 +#define DUK_DBG_IB_NOTIFY 0x04 /* Other initial bytes. */ -#define DUK_DBG_IB_INT4 0x10 -#define DUK_DBG_IB_STR4 0x11 -#define DUK_DBG_IB_STR2 0x12 -#define DUK_DBG_IB_BUF4 0x13 -#define DUK_DBG_IB_BUF2 0x14 -#define DUK_DBG_IB_UNUSED 0x15 -#define DUK_DBG_IB_UNDEFINED 0x16 -#define DUK_DBG_IB_NULL 0x17 -#define DUK_DBG_IB_TRUE 0x18 -#define DUK_DBG_IB_FALSE 0x19 -#define DUK_DBG_IB_NUMBER 0x1a -#define DUK_DBG_IB_OBJECT 0x1b -#define DUK_DBG_IB_POINTER 0x1c -#define DUK_DBG_IB_LIGHTFUNC 0x1d -#define DUK_DBG_IB_HEAPPTR 0x1e +#define DUK_DBG_IB_INT4 0x10 +#define DUK_DBG_IB_STR4 0x11 +#define DUK_DBG_IB_STR2 0x12 +#define DUK_DBG_IB_BUF4 0x13 +#define DUK_DBG_IB_BUF2 0x14 +#define DUK_DBG_IB_UNUSED 0x15 +#define DUK_DBG_IB_UNDEFINED 0x16 +#define DUK_DBG_IB_NULL 0x17 +#define DUK_DBG_IB_TRUE 0x18 +#define DUK_DBG_IB_FALSE 0x19 +#define DUK_DBG_IB_NUMBER 0x1a +#define DUK_DBG_IB_OBJECT 0x1b +#define DUK_DBG_IB_POINTER 0x1c +#define DUK_DBG_IB_LIGHTFUNC 0x1d +#define DUK_DBG_IB_HEAPPTR 0x1e /* The short string/integer initial bytes starting from 0x60 don't have * defines now. */ /* Error codes. */ -#define DUK_DBG_ERR_UNKNOWN 0x00 -#define DUK_DBG_ERR_UNSUPPORTED 0x01 -#define DUK_DBG_ERR_TOOMANY 0x02 -#define DUK_DBG_ERR_NOTFOUND 0x03 -#define DUK_DBG_ERR_APPLICATION 0x04 +#define DUK_DBG_ERR_UNKNOWN 0x00 +#define DUK_DBG_ERR_UNSUPPORTED 0x01 +#define DUK_DBG_ERR_TOOMANY 0x02 +#define DUK_DBG_ERR_NOTFOUND 0x03 +#define DUK_DBG_ERR_APPLICATION 0x04 /* Commands and notifys initiated by Duktape. */ -#define DUK_DBG_CMD_STATUS 0x01 -#define DUK_DBG_CMD_UNUSED_2 0x02 /* Duktape 1.x: print notify */ -#define DUK_DBG_CMD_UNUSED_3 0x03 /* Duktape 1.x: alert notify */ -#define DUK_DBG_CMD_UNUSED_4 0x04 /* Duktape 1.x: log notify */ -#define DUK_DBG_CMD_THROW 0x05 -#define DUK_DBG_CMD_DETACHING 0x06 -#define DUK_DBG_CMD_APPNOTIFY 0x07 +#define DUK_DBG_CMD_STATUS 0x01 +#define DUK_DBG_CMD_UNUSED_2 0x02 /* Duktape 1.x: print notify */ +#define DUK_DBG_CMD_UNUSED_3 0x03 /* Duktape 1.x: alert notify */ +#define DUK_DBG_CMD_UNUSED_4 0x04 /* Duktape 1.x: log notify */ +#define DUK_DBG_CMD_THROW 0x05 +#define DUK_DBG_CMD_DETACHING 0x06 +#define DUK_DBG_CMD_APPNOTIFY 0x07 /* Commands initiated by debug client. */ -#define DUK_DBG_CMD_BASICINFO 0x10 -#define DUK_DBG_CMD_TRIGGERSTATUS 0x11 -#define DUK_DBG_CMD_PAUSE 0x12 -#define DUK_DBG_CMD_RESUME 0x13 -#define DUK_DBG_CMD_STEPINTO 0x14 -#define DUK_DBG_CMD_STEPOVER 0x15 -#define DUK_DBG_CMD_STEPOUT 0x16 -#define DUK_DBG_CMD_LISTBREAK 0x17 -#define DUK_DBG_CMD_ADDBREAK 0x18 -#define DUK_DBG_CMD_DELBREAK 0x19 -#define DUK_DBG_CMD_GETVAR 0x1a -#define DUK_DBG_CMD_PUTVAR 0x1b -#define DUK_DBG_CMD_GETCALLSTACK 0x1c -#define DUK_DBG_CMD_GETLOCALS 0x1d -#define DUK_DBG_CMD_EVAL 0x1e -#define DUK_DBG_CMD_DETACH 0x1f -#define DUK_DBG_CMD_DUMPHEAP 0x20 -#define DUK_DBG_CMD_GETBYTECODE 0x21 -#define DUK_DBG_CMD_APPREQUEST 0x22 -#define DUK_DBG_CMD_GETHEAPOBJINFO 0x23 -#define DUK_DBG_CMD_GETOBJPROPDESC 0x24 -#define DUK_DBG_CMD_GETOBJPROPDESCRANGE 0x25 +#define DUK_DBG_CMD_BASICINFO 0x10 +#define DUK_DBG_CMD_TRIGGERSTATUS 0x11 +#define DUK_DBG_CMD_PAUSE 0x12 +#define DUK_DBG_CMD_RESUME 0x13 +#define DUK_DBG_CMD_STEPINTO 0x14 +#define DUK_DBG_CMD_STEPOVER 0x15 +#define DUK_DBG_CMD_STEPOUT 0x16 +#define DUK_DBG_CMD_LISTBREAK 0x17 +#define DUK_DBG_CMD_ADDBREAK 0x18 +#define DUK_DBG_CMD_DELBREAK 0x19 +#define DUK_DBG_CMD_GETVAR 0x1a +#define DUK_DBG_CMD_PUTVAR 0x1b +#define DUK_DBG_CMD_GETCALLSTACK 0x1c +#define DUK_DBG_CMD_GETLOCALS 0x1d +#define DUK_DBG_CMD_EVAL 0x1e +#define DUK_DBG_CMD_DETACH 0x1f +#define DUK_DBG_CMD_DUMPHEAP 0x20 +#define DUK_DBG_CMD_GETBYTECODE 0x21 +#define DUK_DBG_CMD_APPREQUEST 0x22 +#define DUK_DBG_CMD_GETHEAPOBJINFO 0x23 +#define DUK_DBG_CMD_GETOBJPROPDESC 0x24 +#define DUK_DBG_CMD_GETOBJPROPDESCRANGE 0x25 /* The low 8 bits map directly to duk_hobject.h DUK_PROPDESC_FLAG_xxx. * The remaining flags are specific to the debugger. */ -#define DUK_DBG_PROPFLAG_SYMBOL (1U << 8) -#define DUK_DBG_PROPFLAG_HIDDEN (1U << 9) +#define DUK_DBG_PROPFLAG_SYMBOL (1U << 8) +#define DUK_DBG_PROPFLAG_HIDDEN (1U << 9) #if defined(DUK_USE_DEBUGGER_SUPPORT) DUK_INTERNAL_DECL void duk_debug_do_detach(duk_heap *heap); @@ -9296,7 +9809,7 @@ DUK_INTERNAL_DECL void duk_debug_write_heapptr(duk_hthread *thr, duk_heaphdr *h) #endif DUK_INTERNAL_DECL void duk_debug_write_hobject(duk_hthread *thr, duk_hobject *obj); DUK_INTERNAL_DECL void duk_debug_write_tval(duk_hthread *thr, duk_tval *tv); -#if 0 /* unused */ +#if 0 /* unused */ DUK_INTERNAL_DECL void duk_debug_write_request(duk_hthread *thr, duk_small_uint_t command); #endif DUK_INTERNAL_DECL void duk_debug_write_reply(duk_hthread *thr); @@ -9321,9 +9834,9 @@ DUK_INTERNAL_DECL duk_bool_t duk_debug_is_paused(duk_heap *heap); DUK_INTERNAL_DECL void duk_debug_set_paused(duk_heap *heap); DUK_INTERNAL_DECL void duk_debug_clear_paused(duk_heap *heap); DUK_INTERNAL_DECL void duk_debug_clear_pause_state(duk_heap *heap); -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ -#endif /* DUK_DEBUGGER_H_INCLUDED */ +#endif /* DUK_DEBUGGER_H_INCLUDED */ /* #include duk_debug.h */ /* * Debugging macros, DUK_DPRINT() and its variants in particular. @@ -9355,19 +9868,25 @@ DUK_INTERNAL_DECL void duk_debug_clear_pause_state(duk_heap *heap); #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 0) #define DUK_D(x) x #else -#define DUK_D(x) do { } while (0) /* omit */ +#define DUK_D(x) \ + do { \ + } while (0) /* omit */ #endif #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 1) #define DUK_DD(x) x #else -#define DUK_DD(x) do { } while (0) /* omit */ +#define DUK_DD(x) \ + do { \ + } while (0) /* omit */ #endif #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 2) #define DUK_DDD(x) x #else -#define DUK_DDD(x) do { } while (0) /* omit */ +#define DUK_DDD(x) \ + do { \ + } while (0) /* omit */ #endif /* @@ -9379,35 +9898,35 @@ DUK_INTERNAL_DECL void duk_debug_clear_pause_state(duk_heap *heap); /* Note: combining __FILE__, __LINE__, and __func__ into fmt would be * possible compile time, but waste some space with shared function names. */ -#define DUK__DEBUG_LOG(lev,...) duk_debug_log((duk_int_t) (lev), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, DUK_FUNC_MACRO, __VA_ARGS__); +#define DUK__DEBUG_LOG(lev, ...) \ + duk_debug_log((duk_int_t) (lev), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, DUK_FUNC_MACRO, __VA_ARGS__); #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 0) -#define DUK_DPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DEBUG, __VA_ARGS__) +#define DUK_DPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DEBUG, __VA_ARGS__) #else #define DUK_DPRINT(...) #endif #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 1) -#define DUK_DDPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DDEBUG, __VA_ARGS__) +#define DUK_DDPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DDEBUG, __VA_ARGS__) #else #define DUK_DDPRINT(...) #endif #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 2) -#define DUK_DDDPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DDDEBUG, __VA_ARGS__) +#define DUK_DDDPRINT(...) DUK__DEBUG_LOG(DUK_LEVEL_DDDEBUG, __VA_ARGS__) #else #define DUK_DDDPRINT(...) #endif -#else /* DUK_USE_VARIADIC_MACROS */ +#else /* DUK_USE_VARIADIC_MACROS */ -#define DUK__DEBUG_STASH(lev) \ +#define DUK__DEBUG_STASH(lev) \ (void) DUK_SNPRINTF(duk_debug_file_stash, DUK_DEBUG_STASH_SIZE, "%s", (const char *) DUK_FILE_MACRO), \ - (void) (duk_debug_file_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0), \ - (void) (duk_debug_line_stash = (duk_int_t) DUK_LINE_MACRO), \ - (void) DUK_SNPRINTF(duk_debug_func_stash, DUK_DEBUG_STASH_SIZE, "%s", (const char *) DUK_FUNC_MACRO), \ - (void) (duk_debug_func_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0), \ - (void) (duk_debug_level_stash = (lev)) + (void) (duk_debug_file_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0), \ + (void) (duk_debug_line_stash = (duk_int_t) DUK_LINE_MACRO), \ + (void) DUK_SNPRINTF(duk_debug_func_stash, DUK_DEBUG_STASH_SIZE, "%s", (const char *) DUK_FUNC_MACRO), \ + (void) (duk_debug_func_stash[DUK_DEBUG_STASH_SIZE - 1] = (char) 0), (void) (duk_debug_level_stash = (lev)) /* Without variadic macros resort to comma expression trickery to handle debug * prints. This generates a lot of harmless warnings. These hacks are not @@ -9416,34 +9935,40 @@ DUK_INTERNAL_DECL void duk_debug_clear_pause_state(duk_heap *heap); */ #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 0) -#define DUK_DPRINT DUK__DEBUG_STASH(DUK_LEVEL_DEBUG), (void) duk_debug_log /* args go here in parens */ +#define DUK_DPRINT DUK__DEBUG_STASH(DUK_LEVEL_DEBUG), (void) duk_debug_log /* args go here in parens */ #else -#define DUK_DPRINT 0 && /* args go here as a comma expression in parens */ +#define DUK_DPRINT 0 && /* args go here as a comma expression in parens */ #endif #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 1) -#define DUK_DDPRINT DUK__DEBUG_STASH(DUK_LEVEL_DDEBUG), (void) duk_debug_log /* args go here in parens */ +#define DUK_DDPRINT DUK__DEBUG_STASH(DUK_LEVEL_DDEBUG), (void) duk_debug_log /* args go here in parens */ #else -#define DUK_DDPRINT 0 && /* args */ +#define DUK_DDPRINT 0 && /* args */ #endif #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 2) -#define DUK_DDDPRINT DUK__DEBUG_STASH(DUK_LEVEL_DDDEBUG), (void) duk_debug_log /* args go here in parens */ +#define DUK_DDDPRINT DUK__DEBUG_STASH(DUK_LEVEL_DDDEBUG), (void) duk_debug_log /* args go here in parens */ #else -#define DUK_DDDPRINT 0 && /* args */ +#define DUK_DDDPRINT 0 && /* args */ #endif -#endif /* DUK_USE_VARIADIC_MACROS */ +#endif /* DUK_USE_VARIADIC_MACROS */ -#else /* DUK_USE_DEBUG */ +#else /* DUK_USE_DEBUG */ /* * Exposed debug macros: debugging disabled */ -#define DUK_D(x) do { } while (0) /* omit */ -#define DUK_DD(x) do { } while (0) /* omit */ -#define DUK_DDD(x) do { } while (0) /* omit */ +#define DUK_D(x) \ + do { \ + } while (0) /* omit */ +#define DUK_DD(x) \ + do { \ + } while (0) /* omit */ +#define DUK_DDD(x) \ + do { \ + } while (0) /* omit */ #if defined(DUK_USE_VARIADIC_MACROS) @@ -9451,15 +9976,15 @@ DUK_INTERNAL_DECL void duk_debug_clear_pause_state(duk_heap *heap); #define DUK_DDPRINT(...) #define DUK_DDDPRINT(...) -#else /* DUK_USE_VARIADIC_MACROS */ +#else /* DUK_USE_VARIADIC_MACROS */ -#define DUK_DPRINT 0 && /* args go here as a comma expression in parens */ -#define DUK_DDPRINT 0 && /* args */ -#define DUK_DDDPRINT 0 && /* args */ +#define DUK_DPRINT 0 && /* args go here as a comma expression in parens */ +#define DUK_DDPRINT 0 && /* args */ +#define DUK_DDDPRINT 0 && /* args */ -#endif /* DUK_USE_VARIADIC_MACROS */ +#endif /* DUK_USE_VARIADIC_MACROS */ -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ /* * Structs @@ -9480,16 +10005,16 @@ struct duk_fixedbuffer { #if defined(DUK_USE_DEBUG) DUK_INTERNAL_DECL duk_int_t duk_debug_vsnprintf(char *str, duk_size_t size, const char *format, va_list ap); -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL_DECL duk_int_t duk_debug_snprintf(char *str, duk_size_t size, const char *format, ...); #endif DUK_INTERNAL_DECL void duk_debug_format_funcptr(char *buf, duk_size_t buf_size, duk_uint8_t *fptr, duk_size_t fptr_size); #if defined(DUK_USE_VARIADIC_MACROS) DUK_INTERNAL_DECL void duk_debug_log(duk_int_t level, const char *file, duk_int_t line, const char *func, const char *fmt, ...); -#else /* DUK_USE_VARIADIC_MACROS */ +#else /* DUK_USE_VARIADIC_MACROS */ /* parameter passing, not thread safe */ -#define DUK_DEBUG_STASH_SIZE 128 +#define DUK_DEBUG_STASH_SIZE 128 #if !defined(DUK_SINGLE_FILE) DUK_INTERNAL_DECL char duk_debug_file_stash[DUK_DEBUG_STASH_SIZE]; DUK_INTERNAL_DECL duk_int_t duk_debug_line_stash; @@ -9497,7 +10022,7 @@ DUK_INTERNAL_DECL char duk_debug_func_stash[DUK_DEBUG_STASH_SIZE]; DUK_INTERNAL_DECL duk_int_t duk_debug_level_stash; #endif DUK_INTERNAL_DECL void duk_debug_log(const char *fmt, ...); -#endif /* DUK_USE_VARIADIC_MACROS */ +#endif /* DUK_USE_VARIADIC_MACROS */ DUK_INTERNAL_DECL void duk_fb_put_bytes(duk_fixedbuffer *fb, const duk_uint8_t *buffer, duk_size_t length); DUK_INTERNAL_DECL void duk_fb_put_byte(duk_fixedbuffer *fb, duk_uint8_t x); @@ -9506,9 +10031,9 @@ DUK_INTERNAL_DECL void duk_fb_sprintf(duk_fixedbuffer *fb, const char *fmt, ...) DUK_INTERNAL_DECL void duk_fb_put_funcptr(duk_fixedbuffer *fb, duk_uint8_t *fptr, duk_size_t fptr_size); DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ -#endif /* DUK_DEBUG_H_INCLUDED */ +#endif /* DUK_DEBUG_H_INCLUDED */ /* #include duk_error.h */ /* * Error handling macros, assertion macro, error codes. @@ -9565,79 +10090,153 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); /* Because there are quite many call sites, pack error code (require at most * 8-bit) into a single argument. */ -#define DUK_ERROR(thr,err,msg) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ +#define DUK_ERROR(thr, err, msg) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ duk_err_handle_error((thr), DUK_FILE_MACRO, (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (msg)); \ } while (0) -#define DUK_ERROR_RAW(thr,file,line,err,msg) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) (line); \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ +#define DUK_ERROR_RAW(thr, file, line, err, msg) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) (line); \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ duk_err_handle_error((thr), (file), (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (msg)); \ } while (0) -#define DUK_ERROR_FMT1(thr,err,fmt,arg1) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), DUK_FILE_MACRO, (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1)); \ +#define DUK_ERROR_FMT1(thr, err, fmt, arg1) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + DUK_FILE_MACRO, \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1)); \ } while (0) -#define DUK_ERROR_RAW_FMT1(thr,file,line,err,fmt,arg1) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) (line); \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), (file), (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1)); \ +#define DUK_ERROR_RAW_FMT1(thr, file, line, err, fmt, arg1) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) (line); \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + (file), \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1)); \ } while (0) -#define DUK_ERROR_FMT2(thr,err,fmt,arg1,arg2) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), DUK_FILE_MACRO, (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1), (arg2)); \ +#define DUK_ERROR_FMT2(thr, err, fmt, arg1, arg2) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + DUK_FILE_MACRO, \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1), \ + (arg2)); \ } while (0) -#define DUK_ERROR_RAW_FMT2(thr,file,line,err,fmt,arg1,arg2) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) (line); \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), (file), (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1), (arg2)); \ +#define DUK_ERROR_RAW_FMT2(thr, file, line, err, fmt, arg1, arg2) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) (line); \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + (file), \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1), \ + (arg2)); \ } while (0) -#define DUK_ERROR_FMT3(thr,err,fmt,arg1,arg2,arg3) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), DUK_FILE_MACRO, (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1), (arg2), (arg3)); \ +#define DUK_ERROR_FMT3(thr, err, fmt, arg1, arg2, arg3) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + DUK_FILE_MACRO, \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1), \ + (arg2), \ + (arg3)); \ } while (0) -#define DUK_ERROR_RAW_FMT3(thr,file,line,err,fmt,arg1,arg2,arg3) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) (line); \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), (file), (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1), (arg2), (arg3)); \ +#define DUK_ERROR_RAW_FMT3(thr, file, line, err, fmt, arg1, arg2, arg3) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) (line); \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + (file), \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1), \ + (arg2), \ + (arg3)); \ } while (0) -#define DUK_ERROR_FMT4(thr,err,fmt,arg1,arg2,arg3,arg4) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), DUK_FILE_MACRO, (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1), (arg2), (arg3), (arg4)); \ +#define DUK_ERROR_FMT4(thr, err, fmt, arg1, arg2, arg3, arg4) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) DUK_LINE_MACRO; \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + DUK_FILE_MACRO, \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1), \ + (arg2), \ + (arg3), \ + (arg4)); \ } while (0) -#define DUK_ERROR_RAW_FMT4(thr,file,line,err,fmt,arg1,arg2,arg3,arg4) do { \ - duk_errcode_t duk__err = (err); duk_int_t duk__line = (duk_int_t) (line); \ - DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ - duk_err_handle_error_fmt((thr), (file), (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), (fmt), (arg1), (arg2), (arg3), (arg4)); \ +#define DUK_ERROR_RAW_FMT4(thr, file, line, err, fmt, arg1, arg2, arg3, arg4) \ + do { \ + duk_errcode_t duk__err = (err); \ + duk_int_t duk__line = (duk_int_t) (line); \ + DUK_ASSERT(duk__err >= 0 && duk__err <= 0xff); \ + DUK_ASSERT(duk__line >= 0 && duk__line <= 0x00ffffffL); \ + duk_err_handle_error_fmt((thr), \ + (file), \ + (((duk_uint_t) duk__err) << 24) | ((duk_uint_t) duk__line), \ + (fmt), \ + (arg1), \ + (arg2), \ + (arg3), \ + (arg4)); \ } while (0) -#else /* DUK_USE_VERBOSE_ERRORS */ +#else /* DUK_USE_VERBOSE_ERRORS */ -#define DUK_ERROR(thr,err,msg) duk_err_handle_error((thr), (err)) -#define DUK_ERROR_RAW(thr,file,line,err,msg) duk_err_handle_error((thr), (err)) +#define DUK_ERROR(thr, err, msg) duk_err_handle_error((thr), (err)) +#define DUK_ERROR_RAW(thr, file, line, err, msg) duk_err_handle_error((thr), (err)) -#define DUK_ERROR_FMT1(thr,err,fmt,arg1) DUK_ERROR((thr),(err),(fmt)) -#define DUK_ERROR_RAW_FMT1(thr,file,line,err,fmt,arg1) DUK_ERROR_RAW((thr),(file),(line),(err),(fmt)) +#define DUK_ERROR_FMT1(thr, err, fmt, arg1) DUK_ERROR((thr), (err), (fmt)) +#define DUK_ERROR_RAW_FMT1(thr, file, line, err, fmt, arg1) DUK_ERROR_RAW((thr), (file), (line), (err), (fmt)) -#define DUK_ERROR_FMT2(thr,err,fmt,arg1,arg2) DUK_ERROR((thr),(err),(fmt)) -#define DUK_ERROR_RAW_FMT2(thr,file,line,err,fmt,arg1,arg2) DUK_ERROR_RAW((thr),(file),(line),(err),(fmt)) +#define DUK_ERROR_FMT2(thr, err, fmt, arg1, arg2) DUK_ERROR((thr), (err), (fmt)) +#define DUK_ERROR_RAW_FMT2(thr, file, line, err, fmt, arg1, arg2) DUK_ERROR_RAW((thr), (file), (line), (err), (fmt)) -#define DUK_ERROR_FMT3(thr,err,fmt,arg1,arg2,arg3) DUK_ERROR((thr),(err),(fmt)) -#define DUK_ERROR_RAW_FMT3(thr,file,line,err,fmt,arg1,arg2,arg3) DUK_ERROR_RAW((thr),(file),(line),(err),(fmt)) +#define DUK_ERROR_FMT3(thr, err, fmt, arg1, arg2, arg3) DUK_ERROR((thr), (err), (fmt)) +#define DUK_ERROR_RAW_FMT3(thr, file, line, err, fmt, arg1, arg2, arg3) DUK_ERROR_RAW((thr), (file), (line), (err), (fmt)) -#define DUK_ERROR_FMT4(thr,err,fmt,arg1,arg2,arg3,arg4) DUK_ERROR((thr),(err),(fmt)) -#define DUK_ERROR_RAW_FMT4(thr,file,line,err,fmt,arg1,arg2,arg3,arg4) DUK_ERROR_RAW((thr),(file),(line),(err),(fmt)) +#define DUK_ERROR_FMT4(thr, err, fmt, arg1, arg2, arg3, arg4) DUK_ERROR((thr), (err), (fmt)) +#define DUK_ERROR_RAW_FMT4(thr, file, line, err, fmt, arg1, arg2, arg3, arg4) DUK_ERROR_RAW((thr), (file), (line), (err), (fmt)) -#endif /* DUK_USE_VERBOSE_ERRORS */ +#endif /* DUK_USE_VERBOSE_ERRORS */ /* * Fatal error without context @@ -9645,8 +10244,7 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); * The macro is an expression to make it compatible with DUK_ASSERT_EXPR(). */ -#define DUK_FATAL_WITHOUT_CONTEXT(msg) \ - duk_default_fatal_handler(NULL, (msg)) +#define DUK_FATAL_WITHOUT_CONTEXT(msg) duk_default_fatal_handler(NULL, (msg)) /* * Error throwing helpers @@ -9671,196 +10269,252 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); * vs. non-paranoid distinction affects only a few specific errors. */ #if defined(DUK_USE_PARANOID_ERRORS) -#define DUK_ERROR_REQUIRE_TYPE_INDEX(thr,idx,expectname,lowmemstr) do { \ +#define DUK_ERROR_REQUIRE_TYPE_INDEX(thr, idx, expectname, lowmemstr) \ + do { \ duk_err_require_type_index((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, (idx), (expectname)); \ } while (0) -#else /* DUK_USE_PARANOID_ERRORS */ -#define DUK_ERROR_REQUIRE_TYPE_INDEX(thr,idx,expectname,lowmemstr) do { \ +#else /* DUK_USE_PARANOID_ERRORS */ +#define DUK_ERROR_REQUIRE_TYPE_INDEX(thr, idx, expectname, lowmemstr) \ + do { \ duk_err_require_type_index((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, (idx), (expectname)); \ } while (0) -#endif /* DUK_USE_PARANOID_ERRORS */ +#endif /* DUK_USE_PARANOID_ERRORS */ -#define DUK_ERROR_INTERNAL(thr) do { \ +#define DUK_ERROR_INTERNAL(thr) \ + do { \ duk_err_error_internal((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO); \ } while (0) -#define DUK_DCERROR_INTERNAL(thr) do { \ +#define DUK_DCERROR_INTERNAL(thr) \ + do { \ DUK_ERROR_INTERNAL((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_ALLOC_FAILED(thr) do { \ +#define DUK_ERROR_ALLOC_FAILED(thr) \ + do { \ duk_err_error_alloc_failed((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO); \ } while (0) -#define DUK_ERROR_UNSUPPORTED(thr) do { \ +#define DUK_ERROR_UNSUPPORTED(thr) \ + do { \ DUK_ERROR((thr), DUK_ERR_ERROR, DUK_STR_UNSUPPORTED); \ } while (0) -#define DUK_DCERROR_UNSUPPORTED(thr) do { \ +#define DUK_DCERROR_UNSUPPORTED(thr) \ + do { \ DUK_ERROR_UNSUPPORTED((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_ERROR(thr,msg) do { \ +#define DUK_ERROR_ERROR(thr, msg) \ + do { \ duk_err_error((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, (msg)); \ } while (0) -#define DUK_ERROR_RANGE_INDEX(thr,idx) do { \ +#define DUK_ERROR_RANGE_INDEX(thr, idx) \ + do { \ duk_err_range_index((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, (idx)); \ } while (0) -#define DUK_ERROR_RANGE_PUSH_BEYOND(thr) do { \ +#define DUK_ERROR_RANGE_PUSH_BEYOND(thr) \ + do { \ duk_err_range_push_beyond((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO); \ } while (0) -#define DUK_ERROR_RANGE_INVALID_ARGS(thr) do { \ +#define DUK_ERROR_RANGE_INVALID_ARGS(thr) \ + do { \ DUK_ERROR_RANGE((thr), DUK_STR_INVALID_ARGS); \ } while (0) -#define DUK_DCERROR_RANGE_INVALID_ARGS(thr) do { \ +#define DUK_DCERROR_RANGE_INVALID_ARGS(thr) \ + do { \ DUK_ERROR_RANGE_INVALID_ARGS((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_RANGE_INVALID_COUNT(thr) do { \ +#define DUK_ERROR_RANGE_INVALID_COUNT(thr) \ + do { \ DUK_ERROR_RANGE((thr), DUK_STR_INVALID_COUNT); \ } while (0) -#define DUK_DCERROR_RANGE_INVALID_COUNT(thr) do { \ +#define DUK_DCERROR_RANGE_INVALID_COUNT(thr) \ + do { \ DUK_ERROR_RANGE_INVALID_COUNT((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_RANGE_INVALID_LENGTH(thr) do { \ +#define DUK_ERROR_RANGE_INVALID_LENGTH(thr) \ + do { \ DUK_ERROR_RANGE((thr), DUK_STR_INVALID_LENGTH); \ } while (0) -#define DUK_DCERROR_RANGE_INVALID_LENGTH(thr) do { \ +#define DUK_DCERROR_RANGE_INVALID_LENGTH(thr) \ + do { \ DUK_ERROR_RANGE_INVALID_LENGTH((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_RANGE(thr,msg) do { \ +#define DUK_ERROR_RANGE(thr, msg) \ + do { \ duk_err_range((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO, (msg)); \ } while (0) -#define DUK_ERROR_EVAL(thr,msg) do { \ +#define DUK_ERROR_EVAL(thr, msg) \ + do { \ DUK_ERROR((thr), DUK_ERR_EVAL_ERROR, (msg)); \ } while (0) -#define DUK_ERROR_REFERENCE(thr,msg) do { \ +#define DUK_ERROR_REFERENCE(thr, msg) \ + do { \ DUK_ERROR((thr), DUK_ERR_REFERENCE_ERROR, (msg)); \ } while (0) -#define DUK_ERROR_SYNTAX(thr,msg) do { \ +#define DUK_ERROR_SYNTAX(thr, msg) \ + do { \ DUK_ERROR((thr), DUK_ERR_SYNTAX_ERROR, (msg)); \ } while (0) -#define DUK_ERROR_TYPE_INVALID_ARGS(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_ARGS(thr) \ + do { \ duk_err_type_invalid_args((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO); \ } while (0) -#define DUK_DCERROR_TYPE_INVALID_ARGS(thr) do { \ +#define DUK_DCERROR_TYPE_INVALID_ARGS(thr) \ + do { \ DUK_ERROR_TYPE_INVALID_ARGS((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_TYPE_INVALID_STATE(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_STATE(thr) \ + do { \ duk_err_type_invalid_state((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO); \ } while (0) -#define DUK_DCERROR_TYPE_INVALID_STATE(thr) do { \ +#define DUK_DCERROR_TYPE_INVALID_STATE(thr) \ + do { \ DUK_ERROR_TYPE_INVALID_STATE((thr)); \ return 0; \ } while (0) -#define DUK_ERROR_TYPE_INVALID_TRAP_RESULT(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_TRAP_RESULT(thr) \ + do { \ duk_err_type_invalid_trap_result((thr), DUK_FILE_MACRO, (duk_int_t) DUK_LINE_MACRO); \ } while (0) -#define DUK_DCERROR_TYPE_INVALID_TRAP_RESULT(thr) do { \ +#define DUK_DCERROR_TYPE_INVALID_TRAP_RESULT(thr) \ + do { \ DUK_ERROR_TYPE((thr), DUK_STR_INVALID_TRAP_RESULT); \ } while (0) -#define DUK_ERROR_TYPE(thr,msg) do { \ +#define DUK_ERROR_TYPE(thr, msg) \ + do { \ DUK_ERROR((thr), DUK_ERR_TYPE_ERROR, (msg)); \ } while (0) -#define DUK_ERROR_URI(thr,msg) do { \ +#define DUK_ERROR_URI(thr, msg) \ + do { \ DUK_ERROR((thr), DUK_ERR_URI_ERROR, (msg)); \ } while (0) -#else /* DUK_USE_VERBOSE_ERRORS */ +#else /* DUK_USE_VERBOSE_ERRORS */ /* Non-verbose errors for low memory targets: no file, line, or message. */ -#define DUK_ERROR_REQUIRE_TYPE_INDEX(thr,idx,expectname,lowmemstr) do { \ +#define DUK_ERROR_REQUIRE_TYPE_INDEX(thr, idx, expectname, lowmemstr) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_ERROR_INTERNAL(thr) do { \ +#define DUK_ERROR_INTERNAL(thr) \ + do { \ duk_err_error((thr)); \ } while (0) -#define DUK_DCERROR_INTERNAL(thr) do { \ +#define DUK_DCERROR_INTERNAL(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_ERROR; \ } while (0) -#define DUK_ERROR_ALLOC_FAILED(thr) do { \ +#define DUK_ERROR_ALLOC_FAILED(thr) \ + do { \ duk_err_error((thr)); \ } while (0) -#define DUK_ERROR_UNSUPPORTED(thr) do { \ +#define DUK_ERROR_UNSUPPORTED(thr) \ + do { \ duk_err_error((thr)); \ } while (0) -#define DUK_DCERROR_UNSUPPORTED(thr) do { \ +#define DUK_DCERROR_UNSUPPORTED(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_ERROR; \ } while (0) -#define DUK_ERROR_ERROR(thr,msg) do { \ +#define DUK_ERROR_ERROR(thr, msg) \ + do { \ duk_err_error((thr)); \ } while (0) -#define DUK_ERROR_RANGE_INDEX(thr,idx) do { \ +#define DUK_ERROR_RANGE_INDEX(thr, idx) \ + do { \ duk_err_range((thr)); \ } while (0) -#define DUK_ERROR_RANGE_PUSH_BEYOND(thr) do { \ +#define DUK_ERROR_RANGE_PUSH_BEYOND(thr) \ + do { \ duk_err_range((thr)); \ } while (0) -#define DUK_ERROR_RANGE_INVALID_ARGS(thr) do { \ +#define DUK_ERROR_RANGE_INVALID_ARGS(thr) \ + do { \ duk_err_range((thr)); \ } while (0) -#define DUK_DCERROR_RANGE_INVALID_ARGS(thr) do { \ +#define DUK_DCERROR_RANGE_INVALID_ARGS(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_RANGE_ERROR; \ } while (0) -#define DUK_ERROR_RANGE_INVALID_COUNT(thr) do { \ +#define DUK_ERROR_RANGE_INVALID_COUNT(thr) \ + do { \ duk_err_range((thr)); \ } while (0) -#define DUK_DCERROR_RANGE_INVALID_COUNT(thr) do { \ +#define DUK_DCERROR_RANGE_INVALID_COUNT(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_RANGE_ERROR; \ } while (0) -#define DUK_ERROR_RANGE_INVALID_LENGTH(thr) do { \ +#define DUK_ERROR_RANGE_INVALID_LENGTH(thr) \ + do { \ duk_err_range((thr)); \ } while (0) -#define DUK_DCERROR_RANGE_INVALID_LENGTH(thr) do { \ +#define DUK_DCERROR_RANGE_INVALID_LENGTH(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_RANGE_ERROR; \ } while (0) -#define DUK_ERROR_RANGE(thr,msg) do { \ +#define DUK_ERROR_RANGE(thr, msg) \ + do { \ duk_err_range((thr)); \ } while (0) -#define DUK_ERROR_EVAL(thr,msg) do { \ +#define DUK_ERROR_EVAL(thr, msg) \ + do { \ duk_err_eval((thr)); \ } while (0) -#define DUK_ERROR_REFERENCE(thr,msg) do { \ +#define DUK_ERROR_REFERENCE(thr, msg) \ + do { \ duk_err_reference((thr)); \ } while (0) -#define DUK_ERROR_SYNTAX(thr,msg) do { \ +#define DUK_ERROR_SYNTAX(thr, msg) \ + do { \ duk_err_syntax((thr)); \ } while (0) -#define DUK_ERROR_TYPE_INVALID_ARGS(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_ARGS(thr) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_DCERROR_TYPE_INVALID_ARGS(thr) do { \ +#define DUK_DCERROR_TYPE_INVALID_ARGS(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_TYPE_ERROR; \ } while (0) -#define DUK_ERROR_TYPE_INVALID_STATE(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_STATE(thr) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_DCERROR_TYPE_INVALID_STATE(thr) do { \ +#define DUK_DCERROR_TYPE_INVALID_STATE(thr) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_ERROR_TYPE_INVALID_TRAP_RESULT(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_TRAP_RESULT(thr) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_DCERROR_TYPE_INVALID_TRAP_RESULT(thr) do { \ +#define DUK_DCERROR_TYPE_INVALID_TRAP_RESULT(thr) \ + do { \ DUK_UNREF((thr)); \ return DUK_RET_TYPE_ERROR; \ } while (0) -#define DUK_ERROR_TYPE_INVALID_TRAP_RESULT(thr) do { \ +#define DUK_ERROR_TYPE_INVALID_TRAP_RESULT(thr) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_ERROR_TYPE(thr,msg) do { \ +#define DUK_ERROR_TYPE(thr, msg) \ + do { \ duk_err_type((thr)); \ } while (0) -#define DUK_ERROR_URI(thr,msg) do { \ +#define DUK_ERROR_URI(thr, msg) \ + do { \ duk_err_uri((thr)); \ } while (0) -#endif /* DUK_USE_VERBOSE_ERRORS */ +#endif /* DUK_USE_VERBOSE_ERRORS */ /* * Assert macro: failure causes a fatal error. @@ -9878,63 +10532,72 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); * we don't care about assertion text size because they're not used in production * builds. */ -#define DUK_ASSERT(x) do { \ - if (!(x)) { \ - DUK_FATAL_WITHOUT_CONTEXT("assertion failed: " #x \ - " (" DUK_FILE_MACRO ":" DUK_MACRO_STRINGIFY(DUK_LINE_MACRO) ")"); \ - } \ +#define DUK_ASSERT(x) \ + do { \ + if (!(x)) { \ + DUK_FATAL_WITHOUT_CONTEXT("assertion failed: " #x " (" DUK_FILE_MACRO \ + ":" DUK_MACRO_STRINGIFY(DUK_LINE_MACRO) ")"); \ + } \ } while (0) /* Assertion compatible inside a comma expression, evaluates to void. */ #define DUK_ASSERT_EXPR(x) \ - ((void) ((x) ? 0 : (DUK_FATAL_WITHOUT_CONTEXT("assertion failed: " #x \ - " (" DUK_FILE_MACRO ":" DUK_MACRO_STRINGIFY(DUK_LINE_MACRO) ")"), 0))) + ((void) ((x) ? 0 : \ + (DUK_FATAL_WITHOUT_CONTEXT("assertion failed: " #x " (" DUK_FILE_MACRO \ + ":" DUK_MACRO_STRINGIFY(DUK_LINE_MACRO) ")"), \ + 0))) -#else /* DUK_USE_ASSERTIONS */ +#else /* DUK_USE_ASSERTIONS */ -#define DUK_ASSERT(x) do { /* assertion omitted */ } while (0) +#define DUK_ASSERT(x) \ + do { /* assertion omitted */ \ + } while (0) -#define DUK_ASSERT_EXPR(x) ((void) 0) +#define DUK_ASSERT_EXPR(x) ((void) 0) -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* this variant is used when an assert would generate a compile warning by * being always true (e.g. >= 0 comparison for an unsigned value */ -#define DUK_ASSERT_DISABLE(x) do { /* assertion disabled */ } while (0) +#define DUK_ASSERT_DISABLE(x) \ + do { /* assertion disabled */ \ + } while (0) /* * Assertion helpers */ #if defined(DUK_USE_ASSERTIONS) && defined(DUK_USE_REFERENCE_COUNTING) -#define DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(h) do { \ +#define DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(h) \ + do { \ DUK_ASSERT((h) == NULL || DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) (h)) > 0); \ } while (0) -#define DUK_ASSERT_REFCOUNT_NONZERO_TVAL(tv) do { \ +#define DUK_ASSERT_REFCOUNT_NONZERO_TVAL(tv) \ + do { \ if ((tv) != NULL && DUK_TVAL_IS_HEAP_ALLOCATED((tv))) { \ DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(DUK_TVAL_GET_HEAPHDR((tv))) > 0); \ } \ } while (0) #else -#define DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(h) /* no refcount check */ -#define DUK_ASSERT_REFCOUNT_NONZERO_TVAL(tv) /* no refcount check */ +#define DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(h) /* no refcount check */ +#define DUK_ASSERT_REFCOUNT_NONZERO_TVAL(tv) /* no refcount check */ #endif -#define DUK_ASSERT_TOP(ctx,n) DUK_ASSERT((duk_idx_t) duk_get_top((ctx)) == (duk_idx_t) (n)) +#define DUK_ASSERT_TOP(ctx, n) DUK_ASSERT((duk_idx_t) duk_get_top((ctx)) == (duk_idx_t) (n)) #if defined(DUK_USE_ASSERTIONS) && defined(DUK_USE_PACKED_TVAL) -#define DUK_ASSERT_DOUBLE_IS_NORMALIZED(dval) do { \ +#define DUK_ASSERT_DOUBLE_IS_NORMALIZED(dval) \ + do { \ duk_double_union duk__assert_tmp_du; \ duk__assert_tmp_du.d = (dval); \ DUK_ASSERT(DUK_DBLUNION_IS_NORMALIZED(&duk__assert_tmp_du)); \ } while (0) #else -#define DUK_ASSERT_DOUBLE_IS_NORMALIZED(dval) /* nop */ +#define DUK_ASSERT_DOUBLE_IS_NORMALIZED(dval) /* nop */ #endif -#define DUK_ASSERT_VS_SPACE(thr) \ - DUK_ASSERT(thr->valstack_top < thr->valstack_end) +#define DUK_ASSERT_VS_SPACE(thr) DUK_ASSERT(thr->valstack_top < thr->valstack_end) /* * Helper to initialize a memory area (e.g. struct) with garbage when @@ -9942,11 +10605,14 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); */ #if defined(DUK_USE_ASSERTIONS) -#define DUK_ASSERT_SET_GARBAGE(ptr,size) do { \ +#define DUK_ASSERT_SET_GARBAGE(ptr, size) \ + do { \ duk_memset_unsafe((void *) (ptr), 0x5a, size); \ } while (0) #else -#define DUK_ASSERT_SET_GARBAGE(ptr,size) do {} while (0) +#define DUK_ASSERT_SET_GARBAGE(ptr, size) \ + do { \ + } while (0) #endif /* @@ -9957,16 +10623,18 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); * or (b) Duktape calls which involve extending the valstack (e.g. getter call). */ -#define DUK_VALSTACK_ASSERT_EXTRA 5 /* this is added to checks to allow for Duktape - * API calls in addition to function's own use - */ +#define DUK_VALSTACK_ASSERT_EXTRA \ + 5 /* this is added to checks to allow for Duktape \ + * API calls in addition to function's own use \ + */ #if defined(DUK_USE_ASSERTIONS) -#define DUK_ASSERT_VALSTACK_SPACE(thr,n) do { \ +#define DUK_ASSERT_VALSTACK_SPACE(thr, n) \ + do { \ DUK_ASSERT((thr) != NULL); \ DUK_ASSERT((thr)->valstack_end - (thr)->valstack_top >= (n) + DUK_VALSTACK_ASSERT_EXTRA); \ } while (0) #else -#define DUK_ASSERT_VALSTACK_SPACE(thr,n) /* no valstack space check */ +#define DUK_ASSERT_VALSTACK_SPACE(thr, n) /* no valstack space check */ #endif /* @@ -9974,25 +10642,35 @@ DUK_INTERNAL_DECL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb); */ #if defined(DUK_USE_VERBOSE_ERRORS) -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_handle_error(duk_hthread *thr, const char *filename, duk_uint_t line_and_code, const char *msg)); -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_handle_error_fmt(duk_hthread *thr, const char *filename, duk_uint_t line_and_code, const char *fmt, ...)); -#else /* DUK_USE_VERBOSE_ERRORS */ +DUK_NORETURN( + DUK_INTERNAL_DECL void duk_err_handle_error(duk_hthread *thr, const char *filename, duk_uint_t line_and_code, const char *msg)); +DUK_NORETURN(DUK_INTERNAL_DECL void + duk_err_handle_error_fmt(duk_hthread *thr, const char *filename, duk_uint_t line_and_code, const char *fmt, ...)); +#else /* DUK_USE_VERBOSE_ERRORS */ DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_handle_error(duk_hthread *thr, duk_errcode_t code)); -#endif /* DUK_USE_VERBOSE_ERRORS */ +#endif /* DUK_USE_VERBOSE_ERRORS */ #if defined(DUK_USE_VERBOSE_ERRORS) -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code, const char *msg, const char *filename, duk_int_t line)); +DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_create_and_throw(duk_hthread *thr, + duk_errcode_t code, + const char *msg, + const char *filename, + duk_int_t line)); #else DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code)); #endif DUK_NORETURN(DUK_INTERNAL_DECL void duk_error_throw_from_negative_rc(duk_hthread *thr, duk_ret_t rc)); -#define DUK_AUGMENT_FLAG_NOBLAME_FILELINE (1U << 0) /* if set, don't blame C file/line for .fileName and .lineNumber */ -#define DUK_AUGMENT_FLAG_SKIP_ONE (1U << 1) /* if set, skip topmost activation in traceback construction */ +#define DUK_AUGMENT_FLAG_NOBLAME_FILELINE (1U << 0) /* if set, don't blame C file/line for .fileName and .lineNumber */ +#define DUK_AUGMENT_FLAG_SKIP_ONE (1U << 1) /* if set, skip topmost activation in traceback construction */ #if defined(DUK_USE_AUGMENT_ERROR_CREATE) -DUK_INTERNAL_DECL void duk_err_augment_error_create(duk_hthread *thr, duk_hthread *thr_callstack, const char *filename, duk_int_t line, duk_small_uint_t flags); +DUK_INTERNAL_DECL void duk_err_augment_error_create(duk_hthread *thr, + duk_hthread *thr_callstack, + const char *filename, + duk_int_t line, + duk_small_uint_t flags); #endif #if defined(DUK_USE_AUGMENT_ERROR_THROW) DUK_INTERNAL_DECL void duk_err_augment_error_throw(duk_hthread *thr); @@ -10000,20 +10678,31 @@ DUK_INTERNAL_DECL void duk_err_augment_error_throw(duk_hthread *thr); #if defined(DUK_USE_VERBOSE_ERRORS) #if defined(DUK_USE_PARANOID_ERRORS) -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_require_type_index(duk_hthread *thr, const char *filename, duk_int_t linenumber, duk_idx_t idx, const char *expect_name)); +DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_require_type_index(duk_hthread *thr, + const char *filename, + duk_int_t linenumber, + duk_idx_t idx, + const char *expect_name)); #else -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_require_type_index(duk_hthread *thr, const char *filename, duk_int_t linenumber, duk_idx_t idx, const char *expect_name)); +DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_require_type_index(duk_hthread *thr, + const char *filename, + duk_int_t linenumber, + duk_idx_t idx, + const char *expect_name)); #endif DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_error_internal(duk_hthread *thr, const char *filename, duk_int_t linenumber)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_error_alloc_failed(duk_hthread *thr, const char *filename, duk_int_t linenumber)); -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_error(duk_hthread *thr, const char *filename, duk_int_t linenumber, const char *message)); -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_range_index(duk_hthread *thr, const char *filename, duk_int_t linenumber, duk_idx_t idx)); +DUK_NORETURN( + DUK_INTERNAL_DECL void duk_err_error(duk_hthread *thr, const char *filename, duk_int_t linenumber, const char *message)); +DUK_NORETURN( + DUK_INTERNAL_DECL void duk_err_range_index(duk_hthread *thr, const char *filename, duk_int_t linenumber, duk_idx_t idx)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_range_push_beyond(duk_hthread *thr, const char *filename, duk_int_t linenumber)); -DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_range(duk_hthread *thr, const char *filename, duk_int_t linenumber, const char *message)); +DUK_NORETURN( + DUK_INTERNAL_DECL void duk_err_range(duk_hthread *thr, const char *filename, duk_int_t linenumber, const char *message)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_type_invalid_args(duk_hthread *thr, const char *filename, duk_int_t linenumber)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_type_invalid_state(duk_hthread *thr, const char *filename, duk_int_t linenumber)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_type_invalid_trap_result(duk_hthread *thr, const char *filename, duk_int_t linenumber)); -#else /* DUK_VERBOSE_ERRORS */ +#else /* DUK_VERBOSE_ERRORS */ DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_error(duk_hthread *thr)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_range(duk_hthread *thr)); DUK_NORETURN(DUK_INTERNAL_DECL void duk_err_eval(duk_hthread *thr)); @@ -10034,7 +10723,7 @@ DUK_INTERNAL_DECL void duk_err_check_debugger_integration(duk_hthread *thr); DUK_INTERNAL_DECL duk_hobject *duk_error_prototype_from_code(duk_hthread *thr, duk_errcode_t err_code); -#endif /* DUK_ERROR_H_INCLUDED */ +#endif /* DUK_ERROR_H_INCLUDED */ /* #include duk_unicode.h */ /* * Unicode helpers @@ -10047,10 +10736,10 @@ DUK_INTERNAL_DECL duk_hobject *duk_error_prototype_from_code(duk_hthread *thr, d * UTF-8 / XUTF-8 / CESU-8 constants */ -#define DUK_UNICODE_MAX_XUTF8_LENGTH 7 /* up to 36 bit codepoints */ -#define DUK_UNICODE_MAX_XUTF8_BMP_LENGTH 3 /* all codepoints up to U+FFFF */ -#define DUK_UNICODE_MAX_CESU8_LENGTH 6 /* all codepoints up to U+10FFFF */ -#define DUK_UNICODE_MAX_CESU8_BMP_LENGTH 3 /* all codepoints up to U+FFFF */ +#define DUK_UNICODE_MAX_XUTF8_LENGTH 7 /* up to 36 bit codepoints */ +#define DUK_UNICODE_MAX_XUTF8_BMP_LENGTH 3 /* all codepoints up to U+FFFF */ +#define DUK_UNICODE_MAX_CESU8_LENGTH 6 /* all codepoints up to U+10FFFF */ +#define DUK_UNICODE_MAX_CESU8_BMP_LENGTH 3 /* all codepoints up to U+FFFF */ /* * Useful Unicode codepoints @@ -10059,9 +10748,11 @@ DUK_INTERNAL_DECL duk_hobject *duk_error_prototype_from_code(duk_hthread *thr, d * in comparisons. */ -#define DUK_UNICODE_CP_ZWNJ 0x200cL /* zero-width non-joiner */ -#define DUK_UNICODE_CP_ZWJ 0x200dL /* zero-width joiner */ -#define DUK_UNICODE_CP_REPLACEMENT_CHARACTER 0xfffdL /* http://en.wikipedia.org/wiki/Replacement_character#Replacement_character */ +#define DUK_UNICODE_CP_ZWNJ 0x200cL /* zero-width non-joiner */ +#define DUK_UNICODE_CP_ZWJ 0x200dL /* zero-width joiner */ +#define DUK_UNICODE_CP_REPLACEMENT_CHARACTER \ + 0xfffdL /* http://en.wikipedia.org/wiki/Replacement_character#Replacement_character \ + */ /* * ASCII character constants @@ -10074,134 +10765,134 @@ DUK_INTERNAL_DECL duk_hobject *duk_error_prototype_from_code(duk_hthread *thr, d * http://en.wikipedia.org/wiki/ASCII */ -#define DUK_ASC_NUL 0x00 -#define DUK_ASC_SOH 0x01 -#define DUK_ASC_STX 0x02 -#define DUK_ASC_ETX 0x03 -#define DUK_ASC_EOT 0x04 -#define DUK_ASC_ENQ 0x05 -#define DUK_ASC_ACK 0x06 -#define DUK_ASC_BEL 0x07 -#define DUK_ASC_BS 0x08 -#define DUK_ASC_HT 0x09 -#define DUK_ASC_LF 0x0a -#define DUK_ASC_VT 0x0b -#define DUK_ASC_FF 0x0c -#define DUK_ASC_CR 0x0d -#define DUK_ASC_SO 0x0e -#define DUK_ASC_SI 0x0f -#define DUK_ASC_DLE 0x10 -#define DUK_ASC_DC1 0x11 -#define DUK_ASC_DC2 0x12 -#define DUK_ASC_DC3 0x13 -#define DUK_ASC_DC4 0x14 -#define DUK_ASC_NAK 0x15 -#define DUK_ASC_SYN 0x16 -#define DUK_ASC_ETB 0x17 -#define DUK_ASC_CAN 0x18 -#define DUK_ASC_EM 0x19 -#define DUK_ASC_SUB 0x1a -#define DUK_ASC_ESC 0x1b -#define DUK_ASC_FS 0x1c -#define DUK_ASC_GS 0x1d -#define DUK_ASC_RS 0x1e -#define DUK_ASC_US 0x1f -#define DUK_ASC_SPACE 0x20 -#define DUK_ASC_EXCLAMATION 0x21 -#define DUK_ASC_DOUBLEQUOTE 0x22 -#define DUK_ASC_HASH 0x23 -#define DUK_ASC_DOLLAR 0x24 -#define DUK_ASC_PERCENT 0x25 -#define DUK_ASC_AMP 0x26 -#define DUK_ASC_SINGLEQUOTE 0x27 -#define DUK_ASC_LPAREN 0x28 -#define DUK_ASC_RPAREN 0x29 -#define DUK_ASC_STAR 0x2a -#define DUK_ASC_PLUS 0x2b -#define DUK_ASC_COMMA 0x2c -#define DUK_ASC_MINUS 0x2d -#define DUK_ASC_PERIOD 0x2e -#define DUK_ASC_SLASH 0x2f -#define DUK_ASC_0 0x30 -#define DUK_ASC_1 0x31 -#define DUK_ASC_2 0x32 -#define DUK_ASC_3 0x33 -#define DUK_ASC_4 0x34 -#define DUK_ASC_5 0x35 -#define DUK_ASC_6 0x36 -#define DUK_ASC_7 0x37 -#define DUK_ASC_8 0x38 -#define DUK_ASC_9 0x39 -#define DUK_ASC_COLON 0x3a -#define DUK_ASC_SEMICOLON 0x3b -#define DUK_ASC_LANGLE 0x3c -#define DUK_ASC_EQUALS 0x3d -#define DUK_ASC_RANGLE 0x3e -#define DUK_ASC_QUESTION 0x3f -#define DUK_ASC_ATSIGN 0x40 -#define DUK_ASC_UC_A 0x41 -#define DUK_ASC_UC_B 0x42 -#define DUK_ASC_UC_C 0x43 -#define DUK_ASC_UC_D 0x44 -#define DUK_ASC_UC_E 0x45 -#define DUK_ASC_UC_F 0x46 -#define DUK_ASC_UC_G 0x47 -#define DUK_ASC_UC_H 0x48 -#define DUK_ASC_UC_I 0x49 -#define DUK_ASC_UC_J 0x4a -#define DUK_ASC_UC_K 0x4b -#define DUK_ASC_UC_L 0x4c -#define DUK_ASC_UC_M 0x4d -#define DUK_ASC_UC_N 0x4e -#define DUK_ASC_UC_O 0x4f -#define DUK_ASC_UC_P 0x50 -#define DUK_ASC_UC_Q 0x51 -#define DUK_ASC_UC_R 0x52 -#define DUK_ASC_UC_S 0x53 -#define DUK_ASC_UC_T 0x54 -#define DUK_ASC_UC_U 0x55 -#define DUK_ASC_UC_V 0x56 -#define DUK_ASC_UC_W 0x57 -#define DUK_ASC_UC_X 0x58 -#define DUK_ASC_UC_Y 0x59 -#define DUK_ASC_UC_Z 0x5a -#define DUK_ASC_LBRACKET 0x5b -#define DUK_ASC_BACKSLASH 0x5c -#define DUK_ASC_RBRACKET 0x5d -#define DUK_ASC_CARET 0x5e -#define DUK_ASC_UNDERSCORE 0x5f -#define DUK_ASC_GRAVE 0x60 -#define DUK_ASC_LC_A 0x61 -#define DUK_ASC_LC_B 0x62 -#define DUK_ASC_LC_C 0x63 -#define DUK_ASC_LC_D 0x64 -#define DUK_ASC_LC_E 0x65 -#define DUK_ASC_LC_F 0x66 -#define DUK_ASC_LC_G 0x67 -#define DUK_ASC_LC_H 0x68 -#define DUK_ASC_LC_I 0x69 -#define DUK_ASC_LC_J 0x6a -#define DUK_ASC_LC_K 0x6b -#define DUK_ASC_LC_L 0x6c -#define DUK_ASC_LC_M 0x6d -#define DUK_ASC_LC_N 0x6e -#define DUK_ASC_LC_O 0x6f -#define DUK_ASC_LC_P 0x70 -#define DUK_ASC_LC_Q 0x71 -#define DUK_ASC_LC_R 0x72 -#define DUK_ASC_LC_S 0x73 -#define DUK_ASC_LC_T 0x74 -#define DUK_ASC_LC_U 0x75 -#define DUK_ASC_LC_V 0x76 -#define DUK_ASC_LC_W 0x77 -#define DUK_ASC_LC_X 0x78 -#define DUK_ASC_LC_Y 0x79 -#define DUK_ASC_LC_Z 0x7a -#define DUK_ASC_LCURLY 0x7b -#define DUK_ASC_PIPE 0x7c -#define DUK_ASC_RCURLY 0x7d -#define DUK_ASC_TILDE 0x7e -#define DUK_ASC_DEL 0x7f +#define DUK_ASC_NUL 0x00 +#define DUK_ASC_SOH 0x01 +#define DUK_ASC_STX 0x02 +#define DUK_ASC_ETX 0x03 +#define DUK_ASC_EOT 0x04 +#define DUK_ASC_ENQ 0x05 +#define DUK_ASC_ACK 0x06 +#define DUK_ASC_BEL 0x07 +#define DUK_ASC_BS 0x08 +#define DUK_ASC_HT 0x09 +#define DUK_ASC_LF 0x0a +#define DUK_ASC_VT 0x0b +#define DUK_ASC_FF 0x0c +#define DUK_ASC_CR 0x0d +#define DUK_ASC_SO 0x0e +#define DUK_ASC_SI 0x0f +#define DUK_ASC_DLE 0x10 +#define DUK_ASC_DC1 0x11 +#define DUK_ASC_DC2 0x12 +#define DUK_ASC_DC3 0x13 +#define DUK_ASC_DC4 0x14 +#define DUK_ASC_NAK 0x15 +#define DUK_ASC_SYN 0x16 +#define DUK_ASC_ETB 0x17 +#define DUK_ASC_CAN 0x18 +#define DUK_ASC_EM 0x19 +#define DUK_ASC_SUB 0x1a +#define DUK_ASC_ESC 0x1b +#define DUK_ASC_FS 0x1c +#define DUK_ASC_GS 0x1d +#define DUK_ASC_RS 0x1e +#define DUK_ASC_US 0x1f +#define DUK_ASC_SPACE 0x20 +#define DUK_ASC_EXCLAMATION 0x21 +#define DUK_ASC_DOUBLEQUOTE 0x22 +#define DUK_ASC_HASH 0x23 +#define DUK_ASC_DOLLAR 0x24 +#define DUK_ASC_PERCENT 0x25 +#define DUK_ASC_AMP 0x26 +#define DUK_ASC_SINGLEQUOTE 0x27 +#define DUK_ASC_LPAREN 0x28 +#define DUK_ASC_RPAREN 0x29 +#define DUK_ASC_STAR 0x2a +#define DUK_ASC_PLUS 0x2b +#define DUK_ASC_COMMA 0x2c +#define DUK_ASC_MINUS 0x2d +#define DUK_ASC_PERIOD 0x2e +#define DUK_ASC_SLASH 0x2f +#define DUK_ASC_0 0x30 +#define DUK_ASC_1 0x31 +#define DUK_ASC_2 0x32 +#define DUK_ASC_3 0x33 +#define DUK_ASC_4 0x34 +#define DUK_ASC_5 0x35 +#define DUK_ASC_6 0x36 +#define DUK_ASC_7 0x37 +#define DUK_ASC_8 0x38 +#define DUK_ASC_9 0x39 +#define DUK_ASC_COLON 0x3a +#define DUK_ASC_SEMICOLON 0x3b +#define DUK_ASC_LANGLE 0x3c +#define DUK_ASC_EQUALS 0x3d +#define DUK_ASC_RANGLE 0x3e +#define DUK_ASC_QUESTION 0x3f +#define DUK_ASC_ATSIGN 0x40 +#define DUK_ASC_UC_A 0x41 +#define DUK_ASC_UC_B 0x42 +#define DUK_ASC_UC_C 0x43 +#define DUK_ASC_UC_D 0x44 +#define DUK_ASC_UC_E 0x45 +#define DUK_ASC_UC_F 0x46 +#define DUK_ASC_UC_G 0x47 +#define DUK_ASC_UC_H 0x48 +#define DUK_ASC_UC_I 0x49 +#define DUK_ASC_UC_J 0x4a +#define DUK_ASC_UC_K 0x4b +#define DUK_ASC_UC_L 0x4c +#define DUK_ASC_UC_M 0x4d +#define DUK_ASC_UC_N 0x4e +#define DUK_ASC_UC_O 0x4f +#define DUK_ASC_UC_P 0x50 +#define DUK_ASC_UC_Q 0x51 +#define DUK_ASC_UC_R 0x52 +#define DUK_ASC_UC_S 0x53 +#define DUK_ASC_UC_T 0x54 +#define DUK_ASC_UC_U 0x55 +#define DUK_ASC_UC_V 0x56 +#define DUK_ASC_UC_W 0x57 +#define DUK_ASC_UC_X 0x58 +#define DUK_ASC_UC_Y 0x59 +#define DUK_ASC_UC_Z 0x5a +#define DUK_ASC_LBRACKET 0x5b +#define DUK_ASC_BACKSLASH 0x5c +#define DUK_ASC_RBRACKET 0x5d +#define DUK_ASC_CARET 0x5e +#define DUK_ASC_UNDERSCORE 0x5f +#define DUK_ASC_GRAVE 0x60 +#define DUK_ASC_LC_A 0x61 +#define DUK_ASC_LC_B 0x62 +#define DUK_ASC_LC_C 0x63 +#define DUK_ASC_LC_D 0x64 +#define DUK_ASC_LC_E 0x65 +#define DUK_ASC_LC_F 0x66 +#define DUK_ASC_LC_G 0x67 +#define DUK_ASC_LC_H 0x68 +#define DUK_ASC_LC_I 0x69 +#define DUK_ASC_LC_J 0x6a +#define DUK_ASC_LC_K 0x6b +#define DUK_ASC_LC_L 0x6c +#define DUK_ASC_LC_M 0x6d +#define DUK_ASC_LC_N 0x6e +#define DUK_ASC_LC_O 0x6f +#define DUK_ASC_LC_P 0x70 +#define DUK_ASC_LC_Q 0x71 +#define DUK_ASC_LC_R 0x72 +#define DUK_ASC_LC_S 0x73 +#define DUK_ASC_LC_T 0x74 +#define DUK_ASC_LC_U 0x75 +#define DUK_ASC_LC_V 0x76 +#define DUK_ASC_LC_W 0x77 +#define DUK_ASC_LC_X 0x78 +#define DUK_ASC_LC_Y 0x79 +#define DUK_ASC_LC_Z 0x7a +#define DUK_ASC_LCURLY 0x7b +#define DUK_ASC_PIPE 0x7c +#define DUK_ASC_RCURLY 0x7d +#define DUK_ASC_TILDE 0x7e +#define DUK_ASC_DEL 0x7f /* * Miscellaneous @@ -10210,7 +10901,7 @@ DUK_INTERNAL_DECL duk_hobject *duk_error_prototype_from_code(duk_hthread *thr, d /* Uppercase A is 0x41, lowercase a is 0x61; OR 0x20 to convert uppercase * to lowercase. */ -#define DUK_LOWERCASE_CHAR_ASCII(x) ((x) | 0x20) +#define DUK_LOWERCASE_CHAR_ASCII(x) ((x) | 0x20) /* * Unicode tables @@ -10298,7 +10989,7 @@ DUK_INTERNAL_DECL const duk_uint16_t duk_unicode_re_ranges_not_digit[4]; DUK_INTERNAL_DECL const duk_uint16_t duk_unicode_re_ranges_not_white[24]; DUK_INTERNAL_DECL const duk_uint16_t duk_unicode_re_ranges_not_wordchar[10]; DUK_INTERNAL_DECL const duk_int8_t duk_is_idchar_tab[128]; -#endif /* !DUK_SINGLE_FILE */ +#endif /* !DUK_SINGLE_FILE */ /* * Prototypes @@ -10310,8 +11001,15 @@ DUK_INTERNAL_DECL duk_small_int_t duk_unicode_get_cesu8_length(duk_ucodepoint_t #endif DUK_INTERNAL_DECL duk_small_int_t duk_unicode_encode_xutf8(duk_ucodepoint_t cp, duk_uint8_t *out); DUK_INTERNAL_DECL duk_small_int_t duk_unicode_encode_cesu8(duk_ucodepoint_t cp, duk_uint8_t *out); -DUK_INTERNAL_DECL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end, duk_ucodepoint_t *out_cp); -DUK_INTERNAL_DECL duk_ucodepoint_t duk_unicode_decode_xutf8_checked(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end); +DUK_INTERNAL_DECL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, + const duk_uint8_t **ptr, + const duk_uint8_t *ptr_start, + const duk_uint8_t *ptr_end, + duk_ucodepoint_t *out_cp); +DUK_INTERNAL_DECL duk_ucodepoint_t duk_unicode_decode_xutf8_checked(duk_hthread *thr, + const duk_uint8_t **ptr, + const duk_uint8_t *ptr_start, + const duk_uint8_t *ptr_end); DUK_INTERNAL_DECL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *data, duk_size_t blen); DUK_INTERNAL_DECL duk_bool_t duk_unicode_is_utf8_compatible(const duk_uint8_t *buf, duk_size_t len); DUK_INTERNAL_DECL duk_small_int_t duk_unicode_is_whitespace(duk_codepoint_t cp); @@ -10325,7 +11023,7 @@ DUK_INTERNAL_DECL duk_codepoint_t duk_unicode_re_canonicalize_char(duk_hthread * DUK_INTERNAL_DECL duk_small_int_t duk_unicode_re_is_wordchar(duk_codepoint_t cp); #endif -#endif /* DUK_UNICODE_H_INCLUDED */ +#endif /* DUK_UNICODE_H_INCLUDED */ /* #include duk_json.h */ /* * Defines for JSON, especially duk_bi_json.c. @@ -10335,28 +11033,28 @@ DUK_INTERNAL_DECL duk_small_int_t duk_unicode_re_is_wordchar(duk_codepoint_t cp) #define DUK_JSON_H_INCLUDED /* Encoding/decoding flags */ -#define DUK_JSON_FLAG_ASCII_ONLY (1U << 0) /* escape any non-ASCII characters */ -#define DUK_JSON_FLAG_AVOID_KEY_QUOTES (1U << 1) /* avoid key quotes when key is an ASCII Identifier */ -#define DUK_JSON_FLAG_EXT_CUSTOM (1U << 2) /* extended types: custom encoding */ -#define DUK_JSON_FLAG_EXT_COMPATIBLE (1U << 3) /* extended types: compatible encoding */ +#define DUK_JSON_FLAG_ASCII_ONLY (1U << 0) /* escape any non-ASCII characters */ +#define DUK_JSON_FLAG_AVOID_KEY_QUOTES (1U << 1) /* avoid key quotes when key is an ASCII Identifier */ +#define DUK_JSON_FLAG_EXT_CUSTOM (1U << 2) /* extended types: custom encoding */ +#define DUK_JSON_FLAG_EXT_COMPATIBLE (1U << 3) /* extended types: compatible encoding */ /* How much stack to require on entry to object/array encode */ -#define DUK_JSON_ENC_REQSTACK 32 +#define DUK_JSON_ENC_REQSTACK 32 /* How much stack to require on entry to object/array decode */ -#define DUK_JSON_DEC_REQSTACK 32 +#define DUK_JSON_DEC_REQSTACK 32 /* How large a loop detection stack to use */ -#define DUK_JSON_ENC_LOOPARRAY 64 +#define DUK_JSON_ENC_LOOPARRAY 64 /* Encoding state. Heap object references are all borrowed. */ typedef struct { duk_hthread *thr; - duk_bufwriter_ctx bw; /* output bufwriter */ - duk_hobject *h_replacer; /* replacer function */ - duk_hstring *h_gap; /* gap (if empty string, NULL) */ - duk_idx_t idx_proplist; /* explicit PropertyList */ - duk_idx_t idx_loop; /* valstack index of loop detection object */ + duk_bufwriter_ctx bw; /* output bufwriter */ + duk_hobject *h_replacer; /* replacer function */ + duk_hstring *h_gap; /* gap (if empty string, NULL) */ + duk_idx_t idx_proplist; /* explicit PropertyList */ + duk_idx_t idx_loop; /* valstack index of loop detection object */ duk_small_uint_t flags; duk_small_uint_t flag_ascii_only; duk_small_uint_t flag_avoid_key_quotes; @@ -10367,7 +11065,7 @@ typedef struct { #endif duk_uint_t recursion_depth; duk_uint_t recursion_limit; - duk_uint_t mask_for_undefined; /* type bit mask: types which certainly produce 'undefined' */ + duk_uint_t mask_for_undefined; /* type bit mask: types which certainly produce 'undefined' */ #if defined(DUK_USE_JX) || defined(DUK_USE_JC) duk_small_uint_t stridx_custom_undefined; duk_small_uint_t stridx_custom_nan; @@ -10375,7 +11073,7 @@ typedef struct { duk_small_uint_t stridx_custom_posinf; duk_small_uint_t stridx_custom_function; #endif - duk_hobject *visiting[DUK_JSON_ENC_LOOPARRAY]; /* indexed by recursion_depth */ + duk_hobject *visiting[DUK_JSON_ENC_LOOPARRAY]; /* indexed by recursion_depth */ } duk_json_enc_ctx; typedef struct { @@ -10394,7 +11092,7 @@ typedef struct { duk_int_t recursion_limit; } duk_json_dec_ctx; -#endif /* DUK_JSON_H_INCLUDED */ +#endif /* DUK_JSON_H_INCLUDED */ /* #include duk_js.h */ /* * ECMAScript execution, support primitives. @@ -10404,21 +11102,22 @@ typedef struct { #define DUK_JS_H_INCLUDED /* Flags for call handling. Lowest flags must match bytecode DUK_BC_CALL_FLAG_xxx 1:1. */ -#define DUK_CALL_FLAG_TAILCALL (1U << 0) /* setup for a tail call */ -#define DUK_CALL_FLAG_CONSTRUCT (1U << 1) /* constructor call (i.e. called as 'new Foo()') */ -#define DUK_CALL_FLAG_CALLED_AS_EVAL (1U << 2) /* call was made using the identifier 'eval' */ -#define DUK_CALL_FLAG_ALLOW_ECMATOECMA (1U << 3) /* ecma-to-ecma call with executor reuse is possible */ -#define DUK_CALL_FLAG_DIRECT_EVAL (1U << 4) /* call is a direct eval call */ -#define DUK_CALL_FLAG_CONSTRUCT_PROXY (1U << 5) /* handled via 'construct' proxy trap, check return value invariant(s) */ -#define DUK_CALL_FLAG_DEFAULT_INSTANCE_UPDATED (1U << 6) /* prototype of 'default instance' updated, temporary flag in call handling */ +#define DUK_CALL_FLAG_TAILCALL (1U << 0) /* setup for a tail call */ +#define DUK_CALL_FLAG_CONSTRUCT (1U << 1) /* constructor call (i.e. called as 'new Foo()') */ +#define DUK_CALL_FLAG_CALLED_AS_EVAL (1U << 2) /* call was made using the identifier 'eval' */ +#define DUK_CALL_FLAG_ALLOW_ECMATOECMA (1U << 3) /* ecma-to-ecma call with executor reuse is possible */ +#define DUK_CALL_FLAG_DIRECT_EVAL (1U << 4) /* call is a direct eval call */ +#define DUK_CALL_FLAG_CONSTRUCT_PROXY (1U << 5) /* handled via 'construct' proxy trap, check return value invariant(s) */ +#define DUK_CALL_FLAG_DEFAULT_INSTANCE_UPDATED \ + (1U << 6) /* prototype of 'default instance' updated, temporary flag in call handling */ /* Flags for duk_js_equals_helper(). */ -#define DUK_EQUALS_FLAG_SAMEVALUE (1U << 0) /* use SameValue instead of non-strict equality */ -#define DUK_EQUALS_FLAG_STRICT (1U << 1) /* use strict equality instead of non-strict equality */ +#define DUK_EQUALS_FLAG_SAMEVALUE (1U << 0) /* use SameValue instead of non-strict equality */ +#define DUK_EQUALS_FLAG_STRICT (1U << 1) /* use strict equality instead of non-strict equality */ /* Flags for duk_js_compare_helper(). */ -#define DUK_COMPARE_FLAG_NEGATE (1U << 0) /* negate result */ -#define DUK_COMPARE_FLAG_EVAL_LEFT_FIRST (1U << 1) /* eval left argument first */ +#define DUK_COMPARE_FLAG_NEGATE (1U << 0) /* negate result */ +#define DUK_COMPARE_FLAG_EVAL_LEFT_FIRST (1U << 1) /* eval left argument first */ /* conversions, coercions, comparison, etc */ DUK_INTERNAL_DECL duk_bool_t duk_js_toboolean(duk_tval *tv); @@ -10434,9 +11133,12 @@ DUK_INTERNAL_DECL duk_uarridx_t duk_js_to_arrayindex_hstring_fast_known(duk_hstr DUK_INTERNAL_DECL duk_uarridx_t duk_js_to_arrayindex_hstring_fast(duk_hstring *h); #endif DUK_INTERNAL_DECL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_t flags); -DUK_INTERNAL_DECL duk_small_int_t duk_js_data_compare(const duk_uint8_t *buf1, const duk_uint8_t *buf2, duk_size_t len1, duk_size_t len2); +DUK_INTERNAL_DECL duk_small_int_t duk_js_data_compare(const duk_uint8_t *buf1, + const duk_uint8_t *buf2, + duk_size_t len1, + duk_size_t len2); DUK_INTERNAL_DECL duk_small_int_t duk_js_string_compare(duk_hstring *h1, duk_hstring *h2); -#if 0 /* unused */ +#if 0 /* unused */ DUK_INTERNAL_DECL duk_small_int_t duk_js_buffer_compare(duk_heap *heap, duk_hbuffer *h1, duk_hbuffer *h2); #endif DUK_INTERNAL_DECL duk_bool_t duk_js_compare_helper(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_t flags); @@ -10453,45 +11155,57 @@ DUK_INTERNAL_DECL duk_bool_t duk_js_isarray(duk_tval *tv); DUK_INTERNAL_DECL double duk_js_arith_pow(double x, double y); DUK_INTERNAL_DECL double duk_js_arith_mod(double x, double y); -#define duk_js_equals(thr,tv_x,tv_y) \ - duk_js_equals_helper((thr), (tv_x), (tv_y), 0) -#define duk_js_strict_equals(tv_x,tv_y) \ - duk_js_equals_helper(NULL, (tv_x), (tv_y), DUK_EQUALS_FLAG_STRICT) -#define duk_js_samevalue(tv_x,tv_y) \ - duk_js_equals_helper(NULL, (tv_x), (tv_y), DUK_EQUALS_FLAG_SAMEVALUE) +#define duk_js_equals(thr, tv_x, tv_y) duk_js_equals_helper((thr), (tv_x), (tv_y), 0) +#define duk_js_strict_equals(tv_x, tv_y) duk_js_equals_helper(NULL, (tv_x), (tv_y), DUK_EQUALS_FLAG_STRICT) +#define duk_js_samevalue(tv_x, tv_y) duk_js_equals_helper(NULL, (tv_x), (tv_y), DUK_EQUALS_FLAG_SAMEVALUE) /* E5 Sections 11.8.1, 11.8.5; x < y */ -#define duk_js_lessthan(thr,tv_x,tv_y) \ - duk_js_compare_helper((thr), (tv_x), (tv_Y), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST) +#define duk_js_lessthan(thr, tv_x, tv_y) duk_js_compare_helper((thr), (tv_x), (tv_Y), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST) /* E5 Sections 11.8.2, 11.8.5; x > y --> y < x */ -#define duk_js_greaterthan(thr,tv_x,tv_y) \ - duk_js_compare_helper((thr), (tv_y), (tv_x), 0) +#define duk_js_greaterthan(thr, tv_x, tv_y) duk_js_compare_helper((thr), (tv_y), (tv_x), 0) /* E5 Sections 11.8.3, 11.8.5; x <= y --> not (x > y) --> not (y < x) */ -#define duk_js_lessthanorequal(thr,tv_x,tv_y) \ - duk_js_compare_helper((thr), (tv_y), (tv_x), DUK_COMPARE_FLAG_NEGATE) +#define duk_js_lessthanorequal(thr, tv_x, tv_y) duk_js_compare_helper((thr), (tv_y), (tv_x), DUK_COMPARE_FLAG_NEGATE) /* E5 Sections 11.8.4, 11.8.5; x >= y --> not (x < y) */ -#define duk_js_greaterthanorequal(thr,tv_x,tv_y) \ +#define duk_js_greaterthanorequal(thr, tv_x, tv_y) \ duk_js_compare_helper((thr), (tv_x), (tv_y), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST | DUK_COMPARE_FLAG_NEGATE) /* identifiers and environment handling */ -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL duk_bool_t duk_js_hasvar_envrec(duk_hthread *thr, duk_hobject *env, duk_hstring *name); #endif DUK_INTERNAL_DECL duk_bool_t duk_js_getvar_envrec(duk_hthread *thr, duk_hobject *env, duk_hstring *name, duk_bool_t throw_flag); -DUK_INTERNAL_DECL duk_bool_t duk_js_getvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name, duk_bool_t throw_flag); -DUK_INTERNAL_DECL void duk_js_putvar_envrec(duk_hthread *thr, duk_hobject *env, duk_hstring *name, duk_tval *val, duk_bool_t strict); -DUK_INTERNAL_DECL void duk_js_putvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name, duk_tval *val, duk_bool_t strict); -#if 0 /*unused*/ +DUK_INTERNAL_DECL duk_bool_t duk_js_getvar_activation(duk_hthread *thr, + duk_activation *act, + duk_hstring *name, + duk_bool_t throw_flag); +DUK_INTERNAL_DECL void duk_js_putvar_envrec(duk_hthread *thr, + duk_hobject *env, + duk_hstring *name, + duk_tval *val, + duk_bool_t strict); +DUK_INTERNAL_DECL void duk_js_putvar_activation(duk_hthread *thr, + duk_activation *act, + duk_hstring *name, + duk_tval *val, + duk_bool_t strict); +#if 0 /*unused*/ DUK_INTERNAL_DECL duk_bool_t duk_js_delvar_envrec(duk_hthread *thr, duk_hobject *env, duk_hstring *name); #endif DUK_INTERNAL_DECL duk_bool_t duk_js_delvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name); -DUK_INTERNAL_DECL duk_bool_t duk_js_declvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name, duk_tval *val, duk_small_uint_t prop_flags, duk_bool_t is_func_decl); +DUK_INTERNAL_DECL duk_bool_t duk_js_declvar_activation(duk_hthread *thr, + duk_activation *act, + duk_hstring *name, + duk_tval *val, + duk_small_uint_t prop_flags, + duk_bool_t is_func_decl); DUK_INTERNAL_DECL void duk_js_init_activation_environment_records_delayed(duk_hthread *thr, duk_activation *act); DUK_INTERNAL_DECL void duk_js_close_environment_record(duk_hthread *thr, duk_hobject *env); -DUK_INTERNAL_DECL duk_hobject *duk_create_activation_environment_record(duk_hthread *thr, duk_hobject *func, duk_size_t bottom_byteoff); +DUK_INTERNAL_DECL duk_hobject *duk_create_activation_environment_record(duk_hthread *thr, + duk_hobject *func, + duk_size_t bottom_byteoff); DUK_INTERNAL_DECL void duk_js_push_closure(duk_hthread *thr, duk_hcompfunc *fun_temp, duk_hobject *outer_var_env, @@ -10502,7 +11216,8 @@ DUK_INTERNAL_DECL void duk_js_push_closure(duk_hthread *thr, DUK_INTERNAL_DECL void duk_native_stack_check(duk_hthread *thr); DUK_INTERNAL_DECL duk_int_t duk_handle_call_unprotected(duk_hthread *thr, duk_idx_t idx_func, duk_small_uint_t call_flags); DUK_INTERNAL_DECL duk_int_t duk_handle_call_unprotected_nargs(duk_hthread *thr, duk_idx_t nargs, duk_small_uint_t call_flags); -DUK_INTERNAL_DECL duk_int_t duk_handle_safe_call(duk_hthread *thr, duk_safe_call_function func, void *udata, duk_idx_t num_stack_args, duk_idx_t num_stack_res); +DUK_INTERNAL_DECL duk_int_t +duk_handle_safe_call(duk_hthread *thr, duk_safe_call_function func, void *udata, duk_idx_t num_stack_args, duk_idx_t num_stack_res); DUK_INTERNAL_DECL void duk_call_construct_postprocess(duk_hthread *thr, duk_small_uint_t proxy_invariant); #if defined(DUK_USE_VERBOSE_ERRORS) DUK_INTERNAL_DECL void duk_call_setup_propcall_error(duk_hthread *thr, duk_tval *tv_base, duk_tval *tv_key); @@ -10511,7 +11226,7 @@ DUK_INTERNAL_DECL void duk_call_setup_propcall_error(duk_hthread *thr, duk_tval /* bytecode execution */ DUK_INTERNAL_DECL void duk_js_execute_bytecode(duk_hthread *exec_thr); -#endif /* DUK_JS_H_INCLUDED */ +#endif /* DUK_JS_H_INCLUDED */ /* #include duk_numconv.h */ /* * Number-to-string conversion. The semantics of these is very tightly @@ -10524,23 +11239,23 @@ DUK_INTERNAL_DECL void duk_js_execute_bytecode(duk_hthread *exec_thr); /* Output a specified number of digits instead of using the shortest * form. Used for toPrecision() and toFixed(). */ -#define DUK_N2S_FLAG_FIXED_FORMAT (1U << 0) +#define DUK_N2S_FLAG_FIXED_FORMAT (1U << 0) /* Force exponential format. Used for toExponential(). */ -#define DUK_N2S_FLAG_FORCE_EXP (1U << 1) +#define DUK_N2S_FLAG_FORCE_EXP (1U << 1) /* If number would need zero padding (for whole number part), use * exponential format instead. E.g. if input number is 12300, 3 * digits are generated ("123"), output "1.23e+4" instead of "12300". * Used for toPrecision(). */ -#define DUK_N2S_FLAG_NO_ZERO_PAD (1U << 2) +#define DUK_N2S_FLAG_NO_ZERO_PAD (1U << 2) /* Digit count indicates number of fractions (i.e. an absolute * digit index instead of a relative one). Used together with * DUK_N2S_FLAG_FIXED_FORMAT for toFixed(). */ -#define DUK_N2S_FLAG_FRACTION_DIGITS (1U << 3) +#define DUK_N2S_FLAG_FRACTION_DIGITS (1U << 3) /* * String-to-number conversion @@ -10554,69 +11269,72 @@ DUK_INTERNAL_DECL void duk_js_execute_bytecode(duk_hthread *exec_thr); * radix 10, but with maximum radix (36) a safe limit is: * (10000000*36).toString(16) -> '15752a00' */ -#define DUK_S2N_MAX_EXPONENT 10000000L +#define DUK_S2N_MAX_EXPONENT 10000000L /* Trim white space (= allow leading and trailing whitespace) */ -#define DUK_S2N_FLAG_TRIM_WHITE (1U << 0) +#define DUK_S2N_FLAG_TRIM_WHITE (1U << 0) /* Allow exponent */ -#define DUK_S2N_FLAG_ALLOW_EXP (1U << 1) +#define DUK_S2N_FLAG_ALLOW_EXP (1U << 1) /* Allow trailing garbage (e.g. treat "123foo" as "123) */ -#define DUK_S2N_FLAG_ALLOW_GARBAGE (1U << 2) +#define DUK_S2N_FLAG_ALLOW_GARBAGE (1U << 2) /* Allow leading plus sign */ -#define DUK_S2N_FLAG_ALLOW_PLUS (1U << 3) +#define DUK_S2N_FLAG_ALLOW_PLUS (1U << 3) /* Allow leading minus sign */ -#define DUK_S2N_FLAG_ALLOW_MINUS (1U << 4) +#define DUK_S2N_FLAG_ALLOW_MINUS (1U << 4) /* Allow 'Infinity' */ -#define DUK_S2N_FLAG_ALLOW_INF (1U << 5) +#define DUK_S2N_FLAG_ALLOW_INF (1U << 5) /* Allow fraction part */ -#define DUK_S2N_FLAG_ALLOW_FRAC (1U << 6) +#define DUK_S2N_FLAG_ALLOW_FRAC (1U << 6) /* Allow naked fraction (e.g. ".123") */ -#define DUK_S2N_FLAG_ALLOW_NAKED_FRAC (1U << 7) +#define DUK_S2N_FLAG_ALLOW_NAKED_FRAC (1U << 7) /* Allow empty fraction (e.g. "123.") */ -#define DUK_S2N_FLAG_ALLOW_EMPTY_FRAC (1U << 8) +#define DUK_S2N_FLAG_ALLOW_EMPTY_FRAC (1U << 8) /* Allow empty string to be interpreted as 0 */ -#define DUK_S2N_FLAG_ALLOW_EMPTY_AS_ZERO (1U << 9) +#define DUK_S2N_FLAG_ALLOW_EMPTY_AS_ZERO (1U << 9) /* Allow leading zeroes (e.g. "0123" -> "123") */ -#define DUK_S2N_FLAG_ALLOW_LEADING_ZERO (1U << 10) +#define DUK_S2N_FLAG_ALLOW_LEADING_ZERO (1U << 10) /* Allow automatic detection of hex base ("0x" or "0X" prefix), * overrides radix argument and forces integer mode. */ -#define DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT (1U << 11) +#define DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT (1U << 11) /* Allow automatic detection of legacy octal base ("0n"), * overrides radix argument and forces integer mode. */ -#define DUK_S2N_FLAG_ALLOW_AUTO_LEGACY_OCT_INT (1U << 12) +#define DUK_S2N_FLAG_ALLOW_AUTO_LEGACY_OCT_INT (1U << 12) /* Allow automatic detection of ES2015 octal base ("0o123"), * overrides radix argument and forces integer mode. */ -#define DUK_S2N_FLAG_ALLOW_AUTO_OCT_INT (1U << 13) +#define DUK_S2N_FLAG_ALLOW_AUTO_OCT_INT (1U << 13) /* Allow automatic detection of ES2015 binary base ("0b10001"), * overrides radix argument and forces integer mode. */ -#define DUK_S2N_FLAG_ALLOW_AUTO_BIN_INT (1U << 14) +#define DUK_S2N_FLAG_ALLOW_AUTO_BIN_INT (1U << 14) /* * Prototypes */ -DUK_INTERNAL_DECL void duk_numconv_stringify(duk_hthread *thr, duk_small_int_t radix, duk_small_int_t digits, duk_small_uint_t flags); +DUK_INTERNAL_DECL void duk_numconv_stringify(duk_hthread *thr, + duk_small_int_t radix, + duk_small_int_t digits, + duk_small_uint_t flags); DUK_INTERNAL_DECL void duk_numconv_parse(duk_hthread *thr, duk_small_int_t radix, duk_small_uint_t flags); -#endif /* DUK_NUMCONV_H_INCLUDED */ +#endif /* DUK_NUMCONV_H_INCLUDED */ /* #include duk_bi_protos.h */ /* * Prototypes for built-in functions not automatically covered by the @@ -10632,7 +11350,7 @@ DUK_INTERNAL_DECL void duk_numconv_parse(duk_hthread *thr, duk_small_int_t radix * 32 * Include additional space to be safe. */ -#define DUK_BI_DATE_ISO8601_BUFSIZE 40 +#define DUK_BI_DATE_ISO8601_BUFSIZE 40 /* Helpers exposed for internal use */ DUK_INTERNAL_DECL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, duk_double_t *dparts, duk_small_uint_t flags); @@ -10670,7 +11388,10 @@ DUK_INTERNAL_DECL duk_bool_t duk_bi_date_parse_string_strptime(duk_hthread *thr, DUK_INTERNAL_DECL duk_bool_t duk_bi_date_parse_string_getdate(duk_hthread *thr, const char *str); #endif #if defined(DUK_USE_DATE_FMT_STRFTIME) -DUK_INTERNAL_DECL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, duk_int_t *parts, duk_int_t tzoffset, duk_small_uint_t flags); +DUK_INTERNAL_DECL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, + duk_int_t *parts, + duk_int_t tzoffset, + duk_small_uint_t flags); #endif #if defined(DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME) @@ -10681,10 +11402,7 @@ DUK_INTERNAL_DECL duk_double_t duk_bi_date_get_monotonic_time_windows_qpc(void); #endif DUK_INTERNAL_DECL -void duk_bi_json_parse_helper(duk_hthread *thr, - duk_idx_t idx_value, - duk_idx_t idx_reviver, - duk_small_uint_t flags); +void duk_bi_json_parse_helper(duk_hthread *thr, duk_idx_t idx_value, duk_idx_t idx_reviver, duk_small_uint_t flags); DUK_INTERNAL_DECL void duk_bi_json_stringify_helper(duk_hthread *thr, duk_idx_t idx_value, @@ -10698,7 +11416,7 @@ DUK_INTERNAL_DECL duk_ret_t duk_textdecoder_decode_utf8_nodejs(duk_hthread *thr) DUK_INTERNAL_DECL void duk_proxy_ownkeys_postprocess(duk_hthread *thr, duk_hobject *h_proxy_target, duk_uint_t flags); #endif -#endif /* DUK_BUILTIN_PROTOS_H_INCLUDED */ +#endif /* DUK_BUILTIN_PROTOS_H_INCLUDED */ /* #include duk_selftest.h */ /* * Selftest code @@ -10714,9 +11432,9 @@ DUK_INTERNAL_DECL duk_uint_t duk_selftest_run_tests(duk_alloc_function alloc_fun void *udata); #endif -#endif /* DUK_SELFTEST_H_INCLUDED */ +#endif /* DUK_SELFTEST_H_INCLUDED */ -#endif /* DUK_INTERNAL_H_INCLUDED */ +#endif /* DUK_INTERNAL_H_INCLUDED */ #if defined(DUK_USE_COMPUTED_NAN) DUK_INTERNAL double duk_computed_nan; @@ -10810,7 +11528,7 @@ DUK_INTERNAL int duk_repl_isinf(double x) { #error debugging enabled (DUK_USE_DEBUG) but DUK_USE_DEBUG_WRITE not defined #endif -#define DUK__DEBUG_BUFSIZE DUK_USE_DEBUG_BUFSIZE +#define DUK__DEBUG_BUFSIZE DUK_USE_DEBUG_BUFSIZE #if defined(DUK_USE_VARIADIC_MACROS) @@ -10838,7 +11556,7 @@ DUK_INTERNAL void duk_debug_log(duk_int_t level, const char *file, duk_int_t lin va_end(ap); } -#else /* DUK_USE_VARIADIC_MACROS */ +#else /* DUK_USE_VARIADIC_MACROS */ DUK_INTERNAL char duk_debug_file_stash[DUK_DEBUG_STASH_SIZE]; DUK_INTERNAL duk_int_t duk_debug_line_stash; @@ -10869,15 +11587,15 @@ DUK_INTERNAL void duk_debug_log(const char *fmt, ...) { va_end(ap); } -#endif /* DUK_USE_VARIADIC_MACROS */ +#endif /* DUK_USE_VARIADIC_MACROS */ -#else /* DUK_USE_DEBUG */ +#else /* DUK_USE_DEBUG */ /* * Debugging disabled */ -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ /* automatic undefs */ #undef DUK__DEBUG_BUFSIZE @@ -11246,7 +11964,7 @@ DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = { 137,194,70,46,142,68,165,19,236,1,64,174,187,161,95,37,134,204,23,225,35, 23,71,34,82,137,246,128,160,89,93,208,167,147,195,201,194,70,46,142,68,165, 19,238,1,64,182,187,161,71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70, -72,115,96,0,0,0,0,0,15,106,32,91,60,165,195,201,194,8,134,149,216,162,0, +72,115,96,0,0,0,0,0,27,234,32,91,60,165,195,201,194,8,134,149,216,162,0, 192,41,225,8,2,48,177,36,1,149,13,196,15,0,200,209,97,199,128,99,32,176, 195,192,113,57,143,0,167,133,32,230,80,28,202,139,175,238,2,48,189,192,20, 1,119,80,87,193,186,129,89,56,72,197,209,200,193,185,35,23,71,109,13,219, @@ -11446,7 +12164,7 @@ DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = { 137,194,70,46,142,68,165,19,236,1,64,174,187,161,95,37,134,204,23,225,35, 23,71,34,82,137,246,128,160,89,93,208,167,147,195,201,194,70,46,142,68,165, 19,238,1,64,182,187,161,71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70, -72,115,96,32,106,15,0,0,0,0,0,91,60,165,195,201,194,8,134,149,216,162,0, +72,115,96,32,106,27,128,0,0,0,0,91,60,165,195,201,194,8,134,149,216,162,0, 192,41,225,8,2,48,177,36,1,149,13,196,15,0,200,209,97,199,128,99,32,176, 195,192,113,57,143,0,167,133,32,230,80,28,202,139,175,238,2,48,189,192,20, 1,119,80,87,193,186,129,89,56,72,197,209,200,193,185,35,23,71,109,13,219, @@ -11646,7 +12364,7 @@ DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = { 137,194,70,46,142,68,165,19,236,1,64,174,187,161,95,37,134,204,23,225,35, 23,71,34,82,137,246,128,160,89,93,208,167,147,195,201,194,70,46,142,68,165, 19,238,1,64,182,187,161,71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70, -72,115,96,0,15,106,32,0,0,0,0,91,60,165,195,201,194,8,134,149,216,162,0, +72,115,96,0,27,234,32,0,0,0,0,91,60,165,195,201,194,8,134,149,216,162,0, 192,41,225,8,2,48,177,36,1,149,13,196,15,0,200,209,97,199,128,99,32,176, 195,192,113,57,143,0,167,133,32,230,80,28,202,139,175,238,2,48,189,192,20, 1,119,80,87,193,186,129,89,56,72,197,209,200,193,185,35,23,71,109,13,219, @@ -11751,31 +12469,43 @@ DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = { /* #include duk_internal.h -> already included */ -#define DUK__ERRFMT_BUFSIZE 256 /* size for formatting buffers */ +#define DUK__ERRFMT_BUFSIZE 256 /* size for formatting buffers */ #if defined(DUK_USE_VERBOSE_ERRORS) -DUK_INTERNAL DUK_COLD void duk_err_handle_error_fmt(duk_hthread *thr, const char *filename, duk_uint_t line_and_code, const char *fmt, ...) { +DUK_INTERNAL DUK_COLD void duk_err_handle_error_fmt(duk_hthread *thr, + const char *filename, + duk_uint_t line_and_code, + const char *fmt, + ...) { va_list ap; char msg[DUK__ERRFMT_BUFSIZE]; va_start(ap, fmt); (void) DUK_VSNPRINTF(msg, sizeof(msg), fmt, ap); msg[sizeof(msg) - 1] = (char) 0; - duk_err_create_and_throw(thr, (duk_errcode_t) (line_and_code >> 24), msg, filename, (duk_int_t) (line_and_code & 0x00ffffffL)); - va_end(ap); /* dead code, but ensures portability (see Linux man page notes) */ + duk_err_create_and_throw(thr, + (duk_errcode_t) (line_and_code >> 24), + msg, + filename, + (duk_int_t) (line_and_code & 0x00ffffffL)); + va_end(ap); /* dead code, but ensures portability (see Linux man page notes) */ } DUK_INTERNAL DUK_COLD void duk_err_handle_error(duk_hthread *thr, const char *filename, duk_uint_t line_and_code, const char *msg) { - duk_err_create_and_throw(thr, (duk_errcode_t) (line_and_code >> 24), msg, filename, (duk_int_t) (line_and_code & 0x00ffffffL)); + duk_err_create_and_throw(thr, + (duk_errcode_t) (line_and_code >> 24), + msg, + filename, + (duk_int_t) (line_and_code & 0x00ffffffL)); } -#else /* DUK_USE_VERBOSE_ERRORS */ +#else /* DUK_USE_VERBOSE_ERRORS */ DUK_INTERNAL DUK_COLD void duk_err_handle_error(duk_hthread *thr, duk_errcode_t code) { duk_err_create_and_throw(thr, code); } -#endif /* DUK_USE_VERBOSE_ERRORS */ +#endif /* DUK_USE_VERBOSE_ERRORS */ /* * Error throwing helpers @@ -11783,14 +12513,34 @@ DUK_INTERNAL DUK_COLD void duk_err_handle_error(duk_hthread *thr, duk_errcode_t #if defined(DUK_USE_VERBOSE_ERRORS) #if defined(DUK_USE_PARANOID_ERRORS) -DUK_INTERNAL DUK_COLD void duk_err_require_type_index(duk_hthread *thr, const char *filename, duk_int_t linenumber, duk_idx_t idx, const char *expect_name) { - DUK_ERROR_RAW_FMT3(thr, filename, linenumber, DUK_ERR_TYPE_ERROR, "%s required, found %s (stack index %ld)", - expect_name, duk_get_type_name(thr, idx), (long) idx); +DUK_INTERNAL DUK_COLD void duk_err_require_type_index(duk_hthread *thr, + const char *filename, + duk_int_t linenumber, + duk_idx_t idx, + const char *expect_name) { + DUK_ERROR_RAW_FMT3(thr, + filename, + linenumber, + DUK_ERR_TYPE_ERROR, + "%s required, found %s (stack index %ld)", + expect_name, + duk_get_type_name(thr, idx), + (long) idx); } #else -DUK_INTERNAL DUK_COLD void duk_err_require_type_index(duk_hthread *thr, const char *filename, duk_int_t linenumber, duk_idx_t idx, const char *expect_name) { - DUK_ERROR_RAW_FMT3(thr, filename, linenumber, DUK_ERR_TYPE_ERROR, "%s required, found %s (stack index %ld)", - expect_name, duk_push_string_readable(thr, idx), (long) idx); +DUK_INTERNAL DUK_COLD void duk_err_require_type_index(duk_hthread *thr, + const char *filename, + duk_int_t linenumber, + duk_idx_t idx, + const char *expect_name) { + DUK_ERROR_RAW_FMT3(thr, + filename, + linenumber, + DUK_ERR_TYPE_ERROR, + "%s required, found %s (stack index %ld)", + expect_name, + duk_push_string_readable(thr, idx), + (long) idx); } #endif DUK_INTERNAL DUK_COLD void duk_err_error_internal(duk_hthread *thr, const char *filename, duk_int_t linenumber) { @@ -11917,14 +12667,14 @@ DUK_INTERNAL const duk_int8_t duk_is_idchar_tab[128] = { * 1: IdentifierStart and IdentifierPart * -1: IdentifierPart only */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00...0x0f */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10...0x1f */ - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20...0x2f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, /* 0x30...0x3f */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40...0x4f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 0x50...0x5f */ - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60...0x6f */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 /* 0x70...0x7f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00...0x0f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10...0x1f */ + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20...0x2f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, /* 0x30...0x3f */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x40...0x4f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, /* 0x50...0x5f */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x60...0x6f */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 /* 0x70...0x7f */ }; #endif @@ -11974,15 +12724,13 @@ DUK_INTERNAL duk_small_int_t duk_unicode_get_cesu8_length(duk_ucodepoint_t cp) { /* Encoded as surrogate pair, each encoding to 3 bytes for * 6 bytes total. Codepoints above U+10FFFF encode as 6 bytes * too, see duk_unicode_encode_cesu8(). - */ + */ return 3 + 3; } } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ -DUK_INTERNAL const duk_uint8_t duk_unicode_xutf8_markers[7] = { - 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe -}; +DUK_INTERNAL const duk_uint8_t duk_unicode_xutf8_markers[7] = { 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; /* Encode to extended UTF-8; 'out' must have space for at least * DUK_UNICODE_MAX_XUTF8_LENGTH bytes. Allows encoding of any @@ -11997,7 +12745,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_encode_xutf8(duk_ucodepoint_t cp, duk_u len = duk_unicode_get_xutf8_length(cp); DUK_ASSERT(len > 0); - marker = duk_unicode_xutf8_markers[len - 1]; /* 64-bit OK because always >= 0 */ + marker = duk_unicode_xutf8_markers[len - 1]; /* 64-bit OK because always >= 0 */ i = len; DUK_ASSERT(i > 0); @@ -12082,7 +12830,11 @@ DUK_INTERNAL duk_small_int_t duk_unicode_encode_cesu8(duk_ucodepoint_t cp, duk_u } /* Decode helper. Return zero on error. */ -DUK_INTERNAL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end, duk_ucodepoint_t *out_cp) { +DUK_INTERNAL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, + const duk_uint8_t **ptr, + const duk_uint8_t *ptr_start, + const duk_uint8_t *ptr_end, + duk_ucodepoint_t *out_cp) { const duk_uint8_t *p; duk_uint32_t res; duk_uint_fast8_t ch; @@ -12144,7 +12896,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, const du goto fail; } - DUK_ASSERT(p >= ptr_start); /* verified at beginning */ + DUK_ASSERT(p >= ptr_start); /* verified at beginning */ if (p + n > ptr_end) { /* check pointer at end */ goto fail; @@ -12170,12 +12922,15 @@ DUK_INTERNAL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, const du *out_cp = res; return 1; - fail: +fail: return 0; } /* used by e.g. duk_regexp_executor.c, string built-ins */ -DUK_INTERNAL duk_ucodepoint_t duk_unicode_decode_xutf8_checked(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end) { +DUK_INTERNAL duk_ucodepoint_t duk_unicode_decode_xutf8_checked(duk_hthread *thr, + const duk_uint8_t **ptr, + const duk_uint8_t *ptr_start, + const duk_uint8_t *ptr_end) { duk_ucodepoint_t cp; if (duk_unicode_decode_xutf8(thr, ptr, ptr_start, ptr_end, &cp)) { @@ -12222,7 +12977,7 @@ DUK_INTERNAL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *d DUK_ASSERT(clen <= blen); return clen; } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ /* This seems like a good overall approach. Fast path for ASCII in 4 byte * blocks. */ @@ -12234,7 +12989,7 @@ DUK_INTERNAL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *d duk_size_t ncont; duk_size_t clen; - ncont = 0; /* number of continuation (non-initial) bytes in [0x80,0xbf] */ + ncont = 0; /* number of continuation (non-initial) bytes in [0x80,0xbf] */ p = data; p_end = data + blen; if (blen < 16) { @@ -12259,7 +13014,7 @@ DUK_INTERNAL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *d duk_uint32_t x; x = *p32++; if (DUK_LIKELY((x & 0x80808080UL) == 0)) { - ; /* ASCII fast path */ + ; /* ASCII fast path */ } else { /* Flip highest bit of each byte which changes * the bit pattern 10xxxxxx into 00xxxxxx which @@ -12283,7 +13038,7 @@ DUK_INTERNAL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *d p = (const duk_uint8_t *) p32; /* Fall through to handle the rest. */ - skip_fastpath: +skip_fastpath: while (p != p_end) { duk_uint8_t x; x = *p++; @@ -12297,7 +13052,7 @@ DUK_INTERNAL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *d DUK_ASSERT(clen <= blen); return clen; } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ /* Check whether a string is UTF-8 compatible or not. */ DUK_INTERNAL duk_bool_t duk_unicode_is_utf8_compatible(const duk_uint8_t *buf, duk_size_t len) { @@ -12346,18 +13101,18 @@ DUK_INTERNAL duk_bool_t duk_unicode_is_utf8_compatible(const duk_uint8_t *buf, d * 1111 0xxx + 3*CONT -> [0x10000, 0x10ffff] */ left = len - i; - if (t <= 0xdfU) { /* 1101 1111 = 0xdf */ - if (t <= 0xbfU) { /* 1011 1111 = 0xbf */ + if (t <= 0xdfU) { /* 1101 1111 = 0xdf */ + if (t <= 0xbfU) { /* 1011 1111 = 0xbf */ return 0; } ncont = 1; mincp = 0x80UL; cp = t & 0x1fU; - } else if (t <= 0xefU) { /* 1110 1111 = 0xef */ + } else if (t <= 0xefU) { /* 1110 1111 = 0xef */ ncont = 2; mincp = 0x800UL; cp = t & 0x0fU; - } else if (t <= 0xf7U) { /* 1111 0111 = 0xf7 */ + } else if (t <= 0xf7U) { /* 1111 0111 = 0xf7 */ ncont = 3; mincp = 0x10000UL; cp = t & 0x07U; @@ -12369,7 +13124,7 @@ DUK_INTERNAL duk_bool_t duk_unicode_is_utf8_compatible(const duk_uint8_t *buf, d } while (ncont > 0U) { t = buf[i++]; - if ((t & 0xc0U) != 0x80U) { /* 10xx xxxx */ + if ((t & 0xc0U) != 0x80U) { /* 10xx xxxx */ return 0; } cp = (cp << 6) + (t & 0x3fU); @@ -12435,7 +13190,9 @@ DUK_LOCAL duk_small_int_t duk__uni_range_match(const duk_uint8_t *unitab, duk_si /* [r1,r2] is the range */ DUK_DDD(DUK_DDDPRINT("duk__uni_range_match: cp=%06lx range=[0x%06lx,0x%06lx]", - (unsigned long) cp, (unsigned long) r1, (unsigned long) r2)); + (unsigned long) cp, + (unsigned long) r1, + (unsigned long) r2)); if (cp >= r1 && cp <= r2) { return 1; } @@ -12505,19 +13262,17 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_whitespace(duk_codepoint_t cp) { /* cp == -1 (EOF) never matches and causes return value 0 */ lo = (duk_uint_fast8_t) (cp & 0xff); - hi = (duk_uint_fast32_t) (cp >> 8); /* does not fit into an uchar */ + hi = (duk_uint_fast32_t) (cp >> 8); /* does not fit into an uchar */ if (hi == 0x0000UL) { - if (lo == 0x09U || lo == 0x0bU || lo == 0x0cU || - lo == 0x20U || lo == 0xa0U) { + if (lo == 0x09U || lo == 0x0bU || lo == 0x0cU || lo == 0x20U || lo == 0xa0U) { return 1; } } else if (hi == 0x0020UL) { if (lo <= 0x0aU || lo == 0x2fU || lo == 0x5fU) { return 1; } - } else if (cp == 0x1680L || cp == 0x180eL || cp == 0x3000L || - cp == 0xfeffL) { + } else if (cp == 0x1680L || cp == 0x180eL || cp == 0x3000L || cp == 0xfeffL) { return 1; } @@ -12536,8 +13291,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_line_terminator(duk_codepoint_t cp) * into a single line terminator. This must be handled by the caller. */ - if (cp == 0x000aL || cp == 0x000dL || cp == 0x2028L || - cp == 0x2029L) { + if (cp == 0x000aL || cp == 0x000dL || cp == 0x2028L || cp == 0x2029L) { return 1; } @@ -12588,9 +13342,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_identifier_start(duk_codepoint_t cp) #if defined(DUK_USE_IDCHAR_FASTPATH) return (cp >= 0) && (duk_is_idchar_tab[cp] > 0); #else - if ((cp >= 'a' && cp <= 'z') || - (cp >= 'A' && cp <= 'Z') || - cp == '_' || cp == '$') { + if ((cp >= 'a' && cp <= 'z') || (cp >= 'A' && cp <= 'Z') || cp == '_' || cp == '$') { return 1; } return 0; @@ -12600,17 +13352,13 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_identifier_start(duk_codepoint_t cp) /* Non-ASCII slow path (range-by-range linear comparison), very slow */ #if defined(DUK_USE_SOURCE_NONBMP) - if (duk__uni_range_match(duk_unicode_ids_noa, - (duk_size_t) sizeof(duk_unicode_ids_noa), - (duk_codepoint_t) cp)) { + if (duk__uni_range_match(duk_unicode_ids_noa, (duk_size_t) sizeof(duk_unicode_ids_noa), (duk_codepoint_t) cp)) { return 1; } return 0; #else if (cp < 0x10000L) { - if (duk__uni_range_match(duk_unicode_ids_noabmp, - sizeof(duk_unicode_ids_noabmp), - (duk_codepoint_t) cp)) { + if (duk__uni_range_match(duk_unicode_ids_noabmp, sizeof(duk_unicode_ids_noabmp), (duk_codepoint_t) cp)) { return 1; } return 0; @@ -12677,10 +13425,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_identifier_part(duk_codepoint_t cp) #if defined(DUK_USE_IDCHAR_FASTPATH) return (cp >= 0) && (duk_is_idchar_tab[cp] != 0); #else - if ((cp >= 'a' && cp <= 'z') || - (cp >= 'A' && cp <= 'Z') || - (cp >= '0' && cp <= '9') || - cp == '_' || cp == '$') { + if ((cp >= 'a' && cp <= 'z') || (cp >= 'A' && cp <= 'Z') || (cp >= '0' && cp <= '9') || cp == '_' || cp == '$') { return 1; } return 0; @@ -12690,20 +13435,14 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_identifier_part(duk_codepoint_t cp) /* Non-ASCII slow path (range-by-range linear comparison), very slow */ #if defined(DUK_USE_SOURCE_NONBMP) - if (duk__uni_range_match(duk_unicode_ids_noa, - sizeof(duk_unicode_ids_noa), - (duk_codepoint_t) cp) || - duk__uni_range_match(duk_unicode_idp_m_ids_noa, - sizeof(duk_unicode_idp_m_ids_noa), - (duk_codepoint_t) cp)) { + if (duk__uni_range_match(duk_unicode_ids_noa, sizeof(duk_unicode_ids_noa), (duk_codepoint_t) cp) || + duk__uni_range_match(duk_unicode_idp_m_ids_noa, sizeof(duk_unicode_idp_m_ids_noa), (duk_codepoint_t) cp)) { return 1; } return 0; #else if (cp < 0x10000L) { - if (duk__uni_range_match(duk_unicode_ids_noabmp, - sizeof(duk_unicode_ids_noabmp), - (duk_codepoint_t) cp) || + if (duk__uni_range_match(duk_unicode_ids_noabmp, sizeof(duk_unicode_ids_noabmp), (duk_codepoint_t) cp) || duk__uni_range_match(duk_unicode_idp_m_ids_noabmp, sizeof(duk_unicode_idp_m_ids_noabmp), (duk_codepoint_t) cp)) { @@ -12739,8 +13478,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_letter(duk_codepoint_t cp) { /* ASCII (and EOF) fast path -- quick accept and reject */ if (cp <= 0x7fL) { - if ((cp >= 'a' && cp <= 'z') || - (cp >= 'A' && cp <= 'Z')) { + if ((cp >= 'a' && cp <= 'z') || (cp >= 'A' && cp <= 'Z')) { return 1; } return 0; @@ -12749,20 +13487,14 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_letter(duk_codepoint_t cp) { /* Non-ASCII slow path (range-by-range linear comparison), very slow */ #if defined(DUK_USE_SOURCE_NONBMP) - if (duk__uni_range_match(duk_unicode_ids_noa, - sizeof(duk_unicode_ids_noa), - (duk_codepoint_t) cp) && - !duk__uni_range_match(duk_unicode_ids_m_let_noa, - sizeof(duk_unicode_ids_m_let_noa), - (duk_codepoint_t) cp)) { + if (duk__uni_range_match(duk_unicode_ids_noa, sizeof(duk_unicode_ids_noa), (duk_codepoint_t) cp) && + !duk__uni_range_match(duk_unicode_ids_m_let_noa, sizeof(duk_unicode_ids_m_let_noa), (duk_codepoint_t) cp)) { return 1; } return 0; #else if (cp < 0x10000L) { - if (duk__uni_range_match(duk_unicode_ids_noabmp, - sizeof(duk_unicode_ids_noabmp), - (duk_codepoint_t) cp) && + if (duk__uni_range_match(duk_unicode_ids_noabmp, sizeof(duk_unicode_ids_noabmp), (duk_codepoint_t) cp) && !duk__uni_range_match(duk_unicode_ids_m_let_noabmp, sizeof(duk_unicode_ids_m_let_noabmp), (duk_codepoint_t) cp)) { @@ -12799,10 +13531,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_is_letter(duk_codepoint_t cp) { */ DUK_LOCAL -duk_codepoint_t duk__slow_case_conversion(duk_hthread *thr, - duk_bufwriter_ctx *bw, - duk_codepoint_t cp, - duk_bitdecoder_ctx *bd_ctx) { +duk_codepoint_t duk__slow_case_conversion(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_codepoint_t cp, duk_bitdecoder_ctx *bd_ctx) { duk_small_int_t skip = 0; duk_small_int_t n; duk_small_int_t t; @@ -12832,10 +13561,13 @@ duk_codepoint_t duk__slow_case_conversion(duk_hthread *thr, start_o = (duk_codepoint_t) duk_bd_decode(bd_ctx, 16); count = (duk_small_int_t) duk_bd_decode(bd_ctx, 7); DUK_DDD(DUK_DDDPRINT("range: start_i=%ld, start_o=%ld, count=%ld, skip=%ld", - (long) start_i, (long) start_o, (long) count, (long) skip)); + (long) start_i, + (long) start_o, + (long) count, + (long) skip)); if (cp >= start_i) { - tmp_cp = cp - start_i; /* always >= 0 */ + tmp_cp = cp - start_i; /* always >= 0 */ if (tmp_cp < (duk_codepoint_t) count * (duk_codepoint_t) skip && (tmp_cp % (duk_codepoint_t) skip) == 0) { DUK_DDD(DUK_DDDPRINT("range matches input codepoint")); @@ -12887,7 +13619,7 @@ duk_codepoint_t duk__slow_case_conversion(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("no rule matches, output is same as input")); /* fall through */ - single: +single: if (bw != NULL) { DUK_BW_WRITE_RAW_XUTF8(thr, bw, (duk_ucodepoint_t) cp); } @@ -12949,9 +13681,9 @@ duk_codepoint_t duk__case_transform_helper(duk_hthread *thr, * The rule is not locale/language specific so it is supported. */ - if (cp == 0x03a3L && /* U+03A3 = GREEK CAPITAL LETTER SIGMA */ - duk_unicode_is_letter(prev) && /* prev exists and is not a letter */ - !duk_unicode_is_letter(next)) { /* next does not exist or next is not a letter */ + if (cp == 0x03a3L && /* U+03A3 = GREEK CAPITAL LETTER SIGMA */ + duk_unicode_is_letter(prev) && /* prev exists and is not a letter */ + !duk_unicode_is_letter(next)) { /* next does not exist or next is not a letter */ /* Capital sigma occurred at "end of word", lowercase to * U+03C2 = GREEK SMALL LETTER FINAL SIGMA. Otherwise * fall through and let the normal rules lowercase it to @@ -12977,13 +13709,13 @@ duk_codepoint_t duk__case_transform_helper(duk_hthread *thr, } return duk__slow_case_conversion(thr, bw, cp, &bd_ctx); - singlechar: +singlechar: if (bw != NULL) { DUK_BW_WRITE_RAW_XUTF8(thr, bw, (duk_ucodepoint_t) cp); } return cp; - /* unused now, not needed until Turkish/Azeri */ + /* unused now, not needed until Turkish/Azeri */ #if 0 nochar: return -1; @@ -13001,7 +13733,7 @@ DUK_INTERNAL void duk_unicode_case_convert_string(duk_hthread *thr, duk_bool_t u const duk_uint8_t *p, *p_start, *p_end; duk_codepoint_t prev, curr, next; - h_input = duk_require_hstring(thr, -1); /* Accept symbols. */ + h_input = duk_require_hstring(thr, -1); /* Accept symbols. */ DUK_ASSERT(h_input != NULL); bw = &bw_alloc; @@ -13013,7 +13745,8 @@ DUK_INTERNAL void duk_unicode_case_convert_string(duk_hthread *thr, duk_bool_t u p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_input); p = p_start; - prev = -1; DUK_UNREF(prev); + prev = -1; + DUK_UNREF(prev); curr = -1; next = -1; for (;;) { @@ -13038,17 +13771,12 @@ DUK_INTERNAL void duk_unicode_case_convert_string(duk_hthread *thr, duk_bool_t u /* Ensure space for maximum multi-character result; estimate is overkill. */ DUK_BW_ENSURE(thr, bw, 8 * DUK_UNICODE_MAX_XUTF8_LENGTH); - duk__case_transform_helper(thr, - bw, - (duk_codepoint_t) curr, - prev, - next, - uppercase); + duk__case_transform_helper(thr, bw, (duk_codepoint_t) curr, prev, next, uppercase); } } DUK_BW_COMPACT(thr, bw); - (void) duk_buffer_to_string(thr, -1); /* Safe, output is encoded. */ + (void) duk_buffer_to_string(thr, -1); /* Safe, output is encoded. */ /* invalidates h_buf pointer */ duk_remove_m2(thr); } @@ -13071,15 +13799,15 @@ DUK_INTERNAL duk_codepoint_t duk_unicode_re_canonicalize_char(duk_hthread *thr, return (duk_codepoint_t) duk_unicode_re_canon_lookup[cp]; } return cp; -#else /* DUK_USE_REGEXP_CANON_WORKAROUND */ +#else /* DUK_USE_REGEXP_CANON_WORKAROUND */ duk_codepoint_t y; y = duk__case_transform_helper(thr, - NULL, /* NULL is allowed, no output */ - cp, /* curr char */ - -1, /* prev char */ - -1, /* next char */ - 1); /* uppercase */ + NULL, /* NULL is allowed, no output */ + cp, /* curr char */ + -1, /* prev char */ + -1, /* next char */ + 1); /* uppercase */ if ((y < 0) || (cp >= 0x80 && y < 0x80)) { /* multiple codepoint conversion or non-ASCII mapped to ASCII @@ -13089,7 +13817,7 @@ DUK_INTERNAL duk_codepoint_t duk_unicode_re_canonicalize_char(duk_hthread *thr, } return y; -#endif /* DUK_USE_REGEXP_CANON_WORKAROUND */ +#endif /* DUK_USE_REGEXP_CANON_WORKAROUND */ } /* @@ -13102,10 +13830,7 @@ DUK_INTERNAL duk_small_int_t duk_unicode_re_is_wordchar(duk_codepoint_t x) { * Note: the description in E5 Section 15.10.2.6 has a typo, it * contains 'A' twice and lacks 'a'; the intent is [0-9a-zA-Z_]. */ - if ((x >= '0' && x <= '9') || - (x >= 'a' && x <= 'z') || - (x >= 'A' && x <= 'Z') || - (x == '_')) { + if ((x >= '0' && x <= '9') || (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z') || (x == '_')) { return 1; } return 0; @@ -13117,54 +13842,39 @@ DUK_INTERNAL duk_small_int_t duk_unicode_re_is_wordchar(duk_codepoint_t x) { /* exposed because lexer needs these too */ DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_digit[2] = { - (duk_uint16_t) 0x0030UL, (duk_uint16_t) 0x0039UL, + (duk_uint16_t) 0x0030UL, + (duk_uint16_t) 0x0039UL, }; DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_white[22] = { - (duk_uint16_t) 0x0009UL, (duk_uint16_t) 0x000DUL, - (duk_uint16_t) 0x0020UL, (duk_uint16_t) 0x0020UL, - (duk_uint16_t) 0x00A0UL, (duk_uint16_t) 0x00A0UL, - (duk_uint16_t) 0x1680UL, (duk_uint16_t) 0x1680UL, - (duk_uint16_t) 0x180EUL, (duk_uint16_t) 0x180EUL, - (duk_uint16_t) 0x2000UL, (duk_uint16_t) 0x200AUL, - (duk_uint16_t) 0x2028UL, (duk_uint16_t) 0x2029UL, - (duk_uint16_t) 0x202FUL, (duk_uint16_t) 0x202FUL, - (duk_uint16_t) 0x205FUL, (duk_uint16_t) 0x205FUL, - (duk_uint16_t) 0x3000UL, (duk_uint16_t) 0x3000UL, + (duk_uint16_t) 0x0009UL, (duk_uint16_t) 0x000DUL, (duk_uint16_t) 0x0020UL, (duk_uint16_t) 0x0020UL, (duk_uint16_t) 0x00A0UL, + (duk_uint16_t) 0x00A0UL, (duk_uint16_t) 0x1680UL, (duk_uint16_t) 0x1680UL, (duk_uint16_t) 0x180EUL, (duk_uint16_t) 0x180EUL, + (duk_uint16_t) 0x2000UL, (duk_uint16_t) 0x200AUL, (duk_uint16_t) 0x2028UL, (duk_uint16_t) 0x2029UL, (duk_uint16_t) 0x202FUL, + (duk_uint16_t) 0x202FUL, (duk_uint16_t) 0x205FUL, (duk_uint16_t) 0x205FUL, (duk_uint16_t) 0x3000UL, (duk_uint16_t) 0x3000UL, (duk_uint16_t) 0xFEFFUL, (duk_uint16_t) 0xFEFFUL, }; DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_wordchar[8] = { - (duk_uint16_t) 0x0030UL, (duk_uint16_t) 0x0039UL, - (duk_uint16_t) 0x0041UL, (duk_uint16_t) 0x005AUL, - (duk_uint16_t) 0x005FUL, (duk_uint16_t) 0x005FUL, - (duk_uint16_t) 0x0061UL, (duk_uint16_t) 0x007AUL, + (duk_uint16_t) 0x0030UL, (duk_uint16_t) 0x0039UL, (duk_uint16_t) 0x0041UL, (duk_uint16_t) 0x005AUL, + (duk_uint16_t) 0x005FUL, (duk_uint16_t) 0x005FUL, (duk_uint16_t) 0x0061UL, (duk_uint16_t) 0x007AUL, }; DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_not_digit[4] = { - (duk_uint16_t) 0x0000UL, (duk_uint16_t) 0x002FUL, - (duk_uint16_t) 0x003AUL, (duk_uint16_t) 0xFFFFUL, + (duk_uint16_t) 0x0000UL, + (duk_uint16_t) 0x002FUL, + (duk_uint16_t) 0x003AUL, + (duk_uint16_t) 0xFFFFUL, }; DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_not_white[24] = { - (duk_uint16_t) 0x0000UL, (duk_uint16_t) 0x0008UL, - (duk_uint16_t) 0x000EUL, (duk_uint16_t) 0x001FUL, - (duk_uint16_t) 0x0021UL, (duk_uint16_t) 0x009FUL, - (duk_uint16_t) 0x00A1UL, (duk_uint16_t) 0x167FUL, - (duk_uint16_t) 0x1681UL, (duk_uint16_t) 0x180DUL, - (duk_uint16_t) 0x180FUL, (duk_uint16_t) 0x1FFFUL, - (duk_uint16_t) 0x200BUL, (duk_uint16_t) 0x2027UL, - (duk_uint16_t) 0x202AUL, (duk_uint16_t) 0x202EUL, - (duk_uint16_t) 0x2030UL, (duk_uint16_t) 0x205EUL, - (duk_uint16_t) 0x2060UL, (duk_uint16_t) 0x2FFFUL, - (duk_uint16_t) 0x3001UL, (duk_uint16_t) 0xFEFEUL, - (duk_uint16_t) 0xFF00UL, (duk_uint16_t) 0xFFFFUL, + (duk_uint16_t) 0x0000UL, (duk_uint16_t) 0x0008UL, (duk_uint16_t) 0x000EUL, (duk_uint16_t) 0x001FUL, (duk_uint16_t) 0x0021UL, + (duk_uint16_t) 0x009FUL, (duk_uint16_t) 0x00A1UL, (duk_uint16_t) 0x167FUL, (duk_uint16_t) 0x1681UL, (duk_uint16_t) 0x180DUL, + (duk_uint16_t) 0x180FUL, (duk_uint16_t) 0x1FFFUL, (duk_uint16_t) 0x200BUL, (duk_uint16_t) 0x2027UL, (duk_uint16_t) 0x202AUL, + (duk_uint16_t) 0x202EUL, (duk_uint16_t) 0x2030UL, (duk_uint16_t) 0x205EUL, (duk_uint16_t) 0x2060UL, (duk_uint16_t) 0x2FFFUL, + (duk_uint16_t) 0x3001UL, (duk_uint16_t) 0xFEFEUL, (duk_uint16_t) 0xFF00UL, (duk_uint16_t) 0xFFFFUL, }; DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_not_wordchar[10] = { - (duk_uint16_t) 0x0000UL, (duk_uint16_t) 0x002FUL, - (duk_uint16_t) 0x003AUL, (duk_uint16_t) 0x0040UL, - (duk_uint16_t) 0x005BUL, (duk_uint16_t) 0x005EUL, - (duk_uint16_t) 0x0060UL, (duk_uint16_t) 0x0060UL, - (duk_uint16_t) 0x007BUL, (duk_uint16_t) 0xFFFFUL, + (duk_uint16_t) 0x0000UL, (duk_uint16_t) 0x002FUL, (duk_uint16_t) 0x003AUL, (duk_uint16_t) 0x0040UL, (duk_uint16_t) 0x005BUL, + (duk_uint16_t) 0x005EUL, (duk_uint16_t) 0x0060UL, (duk_uint16_t) 0x0060UL, (duk_uint16_t) 0x007BUL, (duk_uint16_t) 0xFFFFUL, }; -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* * Macro support functions for reading/writing raw data. * @@ -13325,23 +14035,17 @@ DUK_INTERNAL void duk_raw_writeinc_cesu8(duk_uint8_t **p, duk_ucodepoint_t val) */ DUK_INTERNAL const duk_uint8_t duk_lc_digits[36] = { - DUK_ASC_0, DUK_ASC_1, DUK_ASC_2, DUK_ASC_3, - DUK_ASC_4, DUK_ASC_5, DUK_ASC_6, DUK_ASC_7, - DUK_ASC_8, DUK_ASC_9, DUK_ASC_LC_A, DUK_ASC_LC_B, - DUK_ASC_LC_C, DUK_ASC_LC_D, DUK_ASC_LC_E, DUK_ASC_LC_F, - DUK_ASC_LC_G, DUK_ASC_LC_H, DUK_ASC_LC_I, DUK_ASC_LC_J, - DUK_ASC_LC_K, DUK_ASC_LC_L, DUK_ASC_LC_M, DUK_ASC_LC_N, - DUK_ASC_LC_O, DUK_ASC_LC_P, DUK_ASC_LC_Q, DUK_ASC_LC_R, - DUK_ASC_LC_S, DUK_ASC_LC_T, DUK_ASC_LC_U, DUK_ASC_LC_V, + DUK_ASC_0, DUK_ASC_1, DUK_ASC_2, DUK_ASC_3, DUK_ASC_4, DUK_ASC_5, DUK_ASC_6, DUK_ASC_7, + DUK_ASC_8, DUK_ASC_9, DUK_ASC_LC_A, DUK_ASC_LC_B, DUK_ASC_LC_C, DUK_ASC_LC_D, DUK_ASC_LC_E, DUK_ASC_LC_F, + DUK_ASC_LC_G, DUK_ASC_LC_H, DUK_ASC_LC_I, DUK_ASC_LC_J, DUK_ASC_LC_K, DUK_ASC_LC_L, DUK_ASC_LC_M, DUK_ASC_LC_N, + DUK_ASC_LC_O, DUK_ASC_LC_P, DUK_ASC_LC_Q, DUK_ASC_LC_R, DUK_ASC_LC_S, DUK_ASC_LC_T, DUK_ASC_LC_U, DUK_ASC_LC_V, DUK_ASC_LC_W, DUK_ASC_LC_X, DUK_ASC_LC_Y, DUK_ASC_LC_Z }; -DUK_INTERNAL const duk_uint8_t duk_uc_nybbles[16] = { - DUK_ASC_0, DUK_ASC_1, DUK_ASC_2, DUK_ASC_3, - DUK_ASC_4, DUK_ASC_5, DUK_ASC_6, DUK_ASC_7, - DUK_ASC_8, DUK_ASC_9, DUK_ASC_UC_A, DUK_ASC_UC_B, - DUK_ASC_UC_C, DUK_ASC_UC_D, DUK_ASC_UC_E, DUK_ASC_UC_F -}; +DUK_INTERNAL const duk_uint8_t duk_uc_nybbles[16] = { DUK_ASC_0, DUK_ASC_1, DUK_ASC_2, DUK_ASC_3, + DUK_ASC_4, DUK_ASC_5, DUK_ASC_6, DUK_ASC_7, + DUK_ASC_8, DUK_ASC_9, DUK_ASC_UC_A, DUK_ASC_UC_B, + DUK_ASC_UC_C, DUK_ASC_UC_D, DUK_ASC_UC_E, DUK_ASC_UC_F }; /* * Table for hex decoding ASCII hex digits @@ -13349,43 +14053,43 @@ DUK_INTERNAL const duk_uint8_t duk_uc_nybbles[16] = { DUK_INTERNAL const duk_int8_t duk_hex_dectab[256] = { /* -1 if invalid */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00-0x0f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10-0x1f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x20-0x2f */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /* 0x30-0x3f */ - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x40-0x4f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x50-0x5f */ - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x60-0x6f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x70-0x7f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80-0x8f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90-0x9f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xa0-0xaf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb0-0xbf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc0-0xcf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd0-0xdf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe0-0xef */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 /* 0xf0-0xff */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00-0x0f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10-0x1f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x20-0x2f */ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /* 0x30-0x3f */ + -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x40-0x4f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x50-0x5f */ + -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x60-0x6f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x70-0x7f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80-0x8f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90-0x9f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xa0-0xaf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb0-0xbf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc0-0xcf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd0-0xdf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe0-0xef */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 /* 0xf0-0xff */ }; #if defined(DUK_USE_HEX_FASTPATH) /* Preshifted << 4. Must use 16-bit entry to allow negative value signaling. */ DUK_INTERNAL const duk_int16_t duk_hex_dectab_shift4[256] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00-0x0f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10-0x1f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x20-0x2f */ - 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, -1, -1, -1, -1, -1, -1, /* 0x30-0x3f */ - -1, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x40-0x4f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x50-0x5f */ - -1, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x60-0x6f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x70-0x7f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80-0x8f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90-0x9f */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xa0-0xaf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb0-0xbf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc0-0xcf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd0-0xdf */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe0-0xef */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 /* 0xf0-0xff */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x00-0x0f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x10-0x1f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x20-0x2f */ + 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, -1, -1, -1, -1, -1, -1, /* 0x30-0x3f */ + -1, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x40-0x4f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x50-0x5f */ + -1, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x60-0x6f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x70-0x7f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x80-0x8f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0x90-0x9f */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xa0-0xaf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb0-0xbf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc0-0xcf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd0-0xdf */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe0-0xef */ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 /* 0xf0-0xff */ }; #endif @@ -13404,77 +14108,53 @@ DUK_INTERNAL const duk_int16_t duk_hex_dectab_shift4[256] = { * print('0x' + t.encode('hex') + 'U') * print('big endian'); genhextab(False) * print('little endian'); genhextab(True) -*/ + */ DUK_INTERNAL const duk_uint16_t duk_hex_enctab[256] = { #if defined(DUK_USE_INTEGER_BE) - 0x3030U, 0x3031U, 0x3032U, 0x3033U, 0x3034U, 0x3035U, 0x3036U, 0x3037U, - 0x3038U, 0x3039U, 0x3061U, 0x3062U, 0x3063U, 0x3064U, 0x3065U, 0x3066U, - 0x3130U, 0x3131U, 0x3132U, 0x3133U, 0x3134U, 0x3135U, 0x3136U, 0x3137U, - 0x3138U, 0x3139U, 0x3161U, 0x3162U, 0x3163U, 0x3164U, 0x3165U, 0x3166U, - 0x3230U, 0x3231U, 0x3232U, 0x3233U, 0x3234U, 0x3235U, 0x3236U, 0x3237U, - 0x3238U, 0x3239U, 0x3261U, 0x3262U, 0x3263U, 0x3264U, 0x3265U, 0x3266U, - 0x3330U, 0x3331U, 0x3332U, 0x3333U, 0x3334U, 0x3335U, 0x3336U, 0x3337U, - 0x3338U, 0x3339U, 0x3361U, 0x3362U, 0x3363U, 0x3364U, 0x3365U, 0x3366U, - 0x3430U, 0x3431U, 0x3432U, 0x3433U, 0x3434U, 0x3435U, 0x3436U, 0x3437U, - 0x3438U, 0x3439U, 0x3461U, 0x3462U, 0x3463U, 0x3464U, 0x3465U, 0x3466U, - 0x3530U, 0x3531U, 0x3532U, 0x3533U, 0x3534U, 0x3535U, 0x3536U, 0x3537U, - 0x3538U, 0x3539U, 0x3561U, 0x3562U, 0x3563U, 0x3564U, 0x3565U, 0x3566U, - 0x3630U, 0x3631U, 0x3632U, 0x3633U, 0x3634U, 0x3635U, 0x3636U, 0x3637U, - 0x3638U, 0x3639U, 0x3661U, 0x3662U, 0x3663U, 0x3664U, 0x3665U, 0x3666U, - 0x3730U, 0x3731U, 0x3732U, 0x3733U, 0x3734U, 0x3735U, 0x3736U, 0x3737U, - 0x3738U, 0x3739U, 0x3761U, 0x3762U, 0x3763U, 0x3764U, 0x3765U, 0x3766U, - 0x3830U, 0x3831U, 0x3832U, 0x3833U, 0x3834U, 0x3835U, 0x3836U, 0x3837U, - 0x3838U, 0x3839U, 0x3861U, 0x3862U, 0x3863U, 0x3864U, 0x3865U, 0x3866U, - 0x3930U, 0x3931U, 0x3932U, 0x3933U, 0x3934U, 0x3935U, 0x3936U, 0x3937U, - 0x3938U, 0x3939U, 0x3961U, 0x3962U, 0x3963U, 0x3964U, 0x3965U, 0x3966U, - 0x6130U, 0x6131U, 0x6132U, 0x6133U, 0x6134U, 0x6135U, 0x6136U, 0x6137U, - 0x6138U, 0x6139U, 0x6161U, 0x6162U, 0x6163U, 0x6164U, 0x6165U, 0x6166U, - 0x6230U, 0x6231U, 0x6232U, 0x6233U, 0x6234U, 0x6235U, 0x6236U, 0x6237U, - 0x6238U, 0x6239U, 0x6261U, 0x6262U, 0x6263U, 0x6264U, 0x6265U, 0x6266U, - 0x6330U, 0x6331U, 0x6332U, 0x6333U, 0x6334U, 0x6335U, 0x6336U, 0x6337U, - 0x6338U, 0x6339U, 0x6361U, 0x6362U, 0x6363U, 0x6364U, 0x6365U, 0x6366U, - 0x6430U, 0x6431U, 0x6432U, 0x6433U, 0x6434U, 0x6435U, 0x6436U, 0x6437U, - 0x6438U, 0x6439U, 0x6461U, 0x6462U, 0x6463U, 0x6464U, 0x6465U, 0x6466U, - 0x6530U, 0x6531U, 0x6532U, 0x6533U, 0x6534U, 0x6535U, 0x6536U, 0x6537U, - 0x6538U, 0x6539U, 0x6561U, 0x6562U, 0x6563U, 0x6564U, 0x6565U, 0x6566U, - 0x6630U, 0x6631U, 0x6632U, 0x6633U, 0x6634U, 0x6635U, 0x6636U, 0x6637U, - 0x6638U, 0x6639U, 0x6661U, 0x6662U, 0x6663U, 0x6664U, 0x6665U, 0x6666U -#else /* DUK_USE_INTEGER_BE */ - 0x3030U, 0x3130U, 0x3230U, 0x3330U, 0x3430U, 0x3530U, 0x3630U, 0x3730U, - 0x3830U, 0x3930U, 0x6130U, 0x6230U, 0x6330U, 0x6430U, 0x6530U, 0x6630U, - 0x3031U, 0x3131U, 0x3231U, 0x3331U, 0x3431U, 0x3531U, 0x3631U, 0x3731U, - 0x3831U, 0x3931U, 0x6131U, 0x6231U, 0x6331U, 0x6431U, 0x6531U, 0x6631U, - 0x3032U, 0x3132U, 0x3232U, 0x3332U, 0x3432U, 0x3532U, 0x3632U, 0x3732U, - 0x3832U, 0x3932U, 0x6132U, 0x6232U, 0x6332U, 0x6432U, 0x6532U, 0x6632U, - 0x3033U, 0x3133U, 0x3233U, 0x3333U, 0x3433U, 0x3533U, 0x3633U, 0x3733U, - 0x3833U, 0x3933U, 0x6133U, 0x6233U, 0x6333U, 0x6433U, 0x6533U, 0x6633U, - 0x3034U, 0x3134U, 0x3234U, 0x3334U, 0x3434U, 0x3534U, 0x3634U, 0x3734U, - 0x3834U, 0x3934U, 0x6134U, 0x6234U, 0x6334U, 0x6434U, 0x6534U, 0x6634U, - 0x3035U, 0x3135U, 0x3235U, 0x3335U, 0x3435U, 0x3535U, 0x3635U, 0x3735U, - 0x3835U, 0x3935U, 0x6135U, 0x6235U, 0x6335U, 0x6435U, 0x6535U, 0x6635U, - 0x3036U, 0x3136U, 0x3236U, 0x3336U, 0x3436U, 0x3536U, 0x3636U, 0x3736U, - 0x3836U, 0x3936U, 0x6136U, 0x6236U, 0x6336U, 0x6436U, 0x6536U, 0x6636U, - 0x3037U, 0x3137U, 0x3237U, 0x3337U, 0x3437U, 0x3537U, 0x3637U, 0x3737U, - 0x3837U, 0x3937U, 0x6137U, 0x6237U, 0x6337U, 0x6437U, 0x6537U, 0x6637U, - 0x3038U, 0x3138U, 0x3238U, 0x3338U, 0x3438U, 0x3538U, 0x3638U, 0x3738U, - 0x3838U, 0x3938U, 0x6138U, 0x6238U, 0x6338U, 0x6438U, 0x6538U, 0x6638U, - 0x3039U, 0x3139U, 0x3239U, 0x3339U, 0x3439U, 0x3539U, 0x3639U, 0x3739U, - 0x3839U, 0x3939U, 0x6139U, 0x6239U, 0x6339U, 0x6439U, 0x6539U, 0x6639U, - 0x3061U, 0x3161U, 0x3261U, 0x3361U, 0x3461U, 0x3561U, 0x3661U, 0x3761U, - 0x3861U, 0x3961U, 0x6161U, 0x6261U, 0x6361U, 0x6461U, 0x6561U, 0x6661U, - 0x3062U, 0x3162U, 0x3262U, 0x3362U, 0x3462U, 0x3562U, 0x3662U, 0x3762U, - 0x3862U, 0x3962U, 0x6162U, 0x6262U, 0x6362U, 0x6462U, 0x6562U, 0x6662U, - 0x3063U, 0x3163U, 0x3263U, 0x3363U, 0x3463U, 0x3563U, 0x3663U, 0x3763U, - 0x3863U, 0x3963U, 0x6163U, 0x6263U, 0x6363U, 0x6463U, 0x6563U, 0x6663U, - 0x3064U, 0x3164U, 0x3264U, 0x3364U, 0x3464U, 0x3564U, 0x3664U, 0x3764U, - 0x3864U, 0x3964U, 0x6164U, 0x6264U, 0x6364U, 0x6464U, 0x6564U, 0x6664U, - 0x3065U, 0x3165U, 0x3265U, 0x3365U, 0x3465U, 0x3565U, 0x3665U, 0x3765U, - 0x3865U, 0x3965U, 0x6165U, 0x6265U, 0x6365U, 0x6465U, 0x6565U, 0x6665U, - 0x3066U, 0x3166U, 0x3266U, 0x3366U, 0x3466U, 0x3566U, 0x3666U, 0x3766U, - 0x3866U, 0x3966U, 0x6166U, 0x6266U, 0x6366U, 0x6466U, 0x6566U, 0x6666U -#endif /* DUK_USE_INTEGER_BE */ + 0x3030U, 0x3031U, 0x3032U, 0x3033U, 0x3034U, 0x3035U, 0x3036U, 0x3037U, 0x3038U, 0x3039U, 0x3061U, 0x3062U, 0x3063U, + 0x3064U, 0x3065U, 0x3066U, 0x3130U, 0x3131U, 0x3132U, 0x3133U, 0x3134U, 0x3135U, 0x3136U, 0x3137U, 0x3138U, 0x3139U, + 0x3161U, 0x3162U, 0x3163U, 0x3164U, 0x3165U, 0x3166U, 0x3230U, 0x3231U, 0x3232U, 0x3233U, 0x3234U, 0x3235U, 0x3236U, + 0x3237U, 0x3238U, 0x3239U, 0x3261U, 0x3262U, 0x3263U, 0x3264U, 0x3265U, 0x3266U, 0x3330U, 0x3331U, 0x3332U, 0x3333U, + 0x3334U, 0x3335U, 0x3336U, 0x3337U, 0x3338U, 0x3339U, 0x3361U, 0x3362U, 0x3363U, 0x3364U, 0x3365U, 0x3366U, 0x3430U, + 0x3431U, 0x3432U, 0x3433U, 0x3434U, 0x3435U, 0x3436U, 0x3437U, 0x3438U, 0x3439U, 0x3461U, 0x3462U, 0x3463U, 0x3464U, + 0x3465U, 0x3466U, 0x3530U, 0x3531U, 0x3532U, 0x3533U, 0x3534U, 0x3535U, 0x3536U, 0x3537U, 0x3538U, 0x3539U, 0x3561U, + 0x3562U, 0x3563U, 0x3564U, 0x3565U, 0x3566U, 0x3630U, 0x3631U, 0x3632U, 0x3633U, 0x3634U, 0x3635U, 0x3636U, 0x3637U, + 0x3638U, 0x3639U, 0x3661U, 0x3662U, 0x3663U, 0x3664U, 0x3665U, 0x3666U, 0x3730U, 0x3731U, 0x3732U, 0x3733U, 0x3734U, + 0x3735U, 0x3736U, 0x3737U, 0x3738U, 0x3739U, 0x3761U, 0x3762U, 0x3763U, 0x3764U, 0x3765U, 0x3766U, 0x3830U, 0x3831U, + 0x3832U, 0x3833U, 0x3834U, 0x3835U, 0x3836U, 0x3837U, 0x3838U, 0x3839U, 0x3861U, 0x3862U, 0x3863U, 0x3864U, 0x3865U, + 0x3866U, 0x3930U, 0x3931U, 0x3932U, 0x3933U, 0x3934U, 0x3935U, 0x3936U, 0x3937U, 0x3938U, 0x3939U, 0x3961U, 0x3962U, + 0x3963U, 0x3964U, 0x3965U, 0x3966U, 0x6130U, 0x6131U, 0x6132U, 0x6133U, 0x6134U, 0x6135U, 0x6136U, 0x6137U, 0x6138U, + 0x6139U, 0x6161U, 0x6162U, 0x6163U, 0x6164U, 0x6165U, 0x6166U, 0x6230U, 0x6231U, 0x6232U, 0x6233U, 0x6234U, 0x6235U, + 0x6236U, 0x6237U, 0x6238U, 0x6239U, 0x6261U, 0x6262U, 0x6263U, 0x6264U, 0x6265U, 0x6266U, 0x6330U, 0x6331U, 0x6332U, + 0x6333U, 0x6334U, 0x6335U, 0x6336U, 0x6337U, 0x6338U, 0x6339U, 0x6361U, 0x6362U, 0x6363U, 0x6364U, 0x6365U, 0x6366U, + 0x6430U, 0x6431U, 0x6432U, 0x6433U, 0x6434U, 0x6435U, 0x6436U, 0x6437U, 0x6438U, 0x6439U, 0x6461U, 0x6462U, 0x6463U, + 0x6464U, 0x6465U, 0x6466U, 0x6530U, 0x6531U, 0x6532U, 0x6533U, 0x6534U, 0x6535U, 0x6536U, 0x6537U, 0x6538U, 0x6539U, + 0x6561U, 0x6562U, 0x6563U, 0x6564U, 0x6565U, 0x6566U, 0x6630U, 0x6631U, 0x6632U, 0x6633U, 0x6634U, 0x6635U, 0x6636U, + 0x6637U, 0x6638U, 0x6639U, 0x6661U, 0x6662U, 0x6663U, 0x6664U, 0x6665U, 0x6666U +#else /* DUK_USE_INTEGER_BE */ + 0x3030U, 0x3130U, 0x3230U, 0x3330U, 0x3430U, 0x3530U, 0x3630U, 0x3730U, 0x3830U, 0x3930U, 0x6130U, 0x6230U, 0x6330U, + 0x6430U, 0x6530U, 0x6630U, 0x3031U, 0x3131U, 0x3231U, 0x3331U, 0x3431U, 0x3531U, 0x3631U, 0x3731U, 0x3831U, 0x3931U, + 0x6131U, 0x6231U, 0x6331U, 0x6431U, 0x6531U, 0x6631U, 0x3032U, 0x3132U, 0x3232U, 0x3332U, 0x3432U, 0x3532U, 0x3632U, + 0x3732U, 0x3832U, 0x3932U, 0x6132U, 0x6232U, 0x6332U, 0x6432U, 0x6532U, 0x6632U, 0x3033U, 0x3133U, 0x3233U, 0x3333U, + 0x3433U, 0x3533U, 0x3633U, 0x3733U, 0x3833U, 0x3933U, 0x6133U, 0x6233U, 0x6333U, 0x6433U, 0x6533U, 0x6633U, 0x3034U, + 0x3134U, 0x3234U, 0x3334U, 0x3434U, 0x3534U, 0x3634U, 0x3734U, 0x3834U, 0x3934U, 0x6134U, 0x6234U, 0x6334U, 0x6434U, + 0x6534U, 0x6634U, 0x3035U, 0x3135U, 0x3235U, 0x3335U, 0x3435U, 0x3535U, 0x3635U, 0x3735U, 0x3835U, 0x3935U, 0x6135U, + 0x6235U, 0x6335U, 0x6435U, 0x6535U, 0x6635U, 0x3036U, 0x3136U, 0x3236U, 0x3336U, 0x3436U, 0x3536U, 0x3636U, 0x3736U, + 0x3836U, 0x3936U, 0x6136U, 0x6236U, 0x6336U, 0x6436U, 0x6536U, 0x6636U, 0x3037U, 0x3137U, 0x3237U, 0x3337U, 0x3437U, + 0x3537U, 0x3637U, 0x3737U, 0x3837U, 0x3937U, 0x6137U, 0x6237U, 0x6337U, 0x6437U, 0x6537U, 0x6637U, 0x3038U, 0x3138U, + 0x3238U, 0x3338U, 0x3438U, 0x3538U, 0x3638U, 0x3738U, 0x3838U, 0x3938U, 0x6138U, 0x6238U, 0x6338U, 0x6438U, 0x6538U, + 0x6638U, 0x3039U, 0x3139U, 0x3239U, 0x3339U, 0x3439U, 0x3539U, 0x3639U, 0x3739U, 0x3839U, 0x3939U, 0x6139U, 0x6239U, + 0x6339U, 0x6439U, 0x6539U, 0x6639U, 0x3061U, 0x3161U, 0x3261U, 0x3361U, 0x3461U, 0x3561U, 0x3661U, 0x3761U, 0x3861U, + 0x3961U, 0x6161U, 0x6261U, 0x6361U, 0x6461U, 0x6561U, 0x6661U, 0x3062U, 0x3162U, 0x3262U, 0x3362U, 0x3462U, 0x3562U, + 0x3662U, 0x3762U, 0x3862U, 0x3962U, 0x6162U, 0x6262U, 0x6362U, 0x6462U, 0x6562U, 0x6662U, 0x3063U, 0x3163U, 0x3263U, + 0x3363U, 0x3463U, 0x3563U, 0x3663U, 0x3763U, 0x3863U, 0x3963U, 0x6163U, 0x6263U, 0x6363U, 0x6463U, 0x6563U, 0x6663U, + 0x3064U, 0x3164U, 0x3264U, 0x3364U, 0x3464U, 0x3564U, 0x3664U, 0x3764U, 0x3864U, 0x3964U, 0x6164U, 0x6264U, 0x6364U, + 0x6464U, 0x6564U, 0x6664U, 0x3065U, 0x3165U, 0x3265U, 0x3365U, 0x3465U, 0x3565U, 0x3665U, 0x3765U, 0x3865U, 0x3965U, + 0x6165U, 0x6265U, 0x6365U, 0x6465U, 0x6565U, 0x6665U, 0x3066U, 0x3166U, 0x3266U, 0x3366U, 0x3466U, 0x3566U, 0x3666U, + 0x3766U, 0x3866U, 0x3966U, 0x6166U, 0x6266U, 0x6366U, 0x6466U, 0x6566U, 0x6666U +#endif /* DUK_USE_INTEGER_BE */ }; -#endif /* DUK_USE_HEX_FASTPATH */ +#endif /* DUK_USE_HEX_FASTPATH */ /* * Arbitrary byteswap for potentially unaligned values @@ -13482,7 +14162,7 @@ DUK_INTERNAL const duk_uint16_t duk_hex_enctab[256] = { * Used to byteswap pointers e.g. in debugger code. */ -#if defined(DUK_USE_DEBUGGER_SUPPORT) /* For now only needed by the debugger. */ +#if defined(DUK_USE_DEBUGGER_SUPPORT) /* For now only needed by the debugger. */ DUK_INTERNAL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len) { duk_uint8_t tmp; duk_uint8_t *q = p + len - 1; @@ -13496,6 +14176,18 @@ DUK_INTERNAL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len) { } } #endif + +/* + * Random + */ + +DUK_INTERNAL duk_double_t duk_util_get_random_double(duk_hthread *thr) { +#if defined(DUK_USE_GET_RANDOM_DOUBLE) + return DUK_USE_GET_RANDOM_DOUBLE(thr->heap->heap_udata); +#else + return duk_util_tinyrandom_get_double(thr); +#endif +} /* * Hobject ECMAScript [[Class]]. */ @@ -13592,7 +14284,7 @@ DUK_INTERNAL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len) { /* Note: assumes that these string indexes are 8-bit, genstrings.py must ensure that */ DUK_INTERNAL duk_uint8_t duk_class_number_to_stridx[32] = { - DUK_STRIDX_EMPTY_STRING, /* NONE, intentionally empty */ + DUK_STRIDX_EMPTY_STRING, /* NONE, intentionally empty */ DUK_STRIDX_UC_OBJECT, DUK_STRIDX_UC_ARRAY, DUK_STRIDX_UC_FUNCTION, @@ -13622,8 +14314,8 @@ DUK_INTERNAL duk_uint8_t duk_class_number_to_stridx[32] = { DUK_STRIDX_UINT32_ARRAY, DUK_STRIDX_FLOAT32_ARRAY, DUK_STRIDX_FLOAT64_ARRAY, - DUK_STRIDX_EMPTY_STRING, /* UNUSED, intentionally empty */ - DUK_STRIDX_EMPTY_STRING, /* UNUSED, intentionally empty */ + DUK_STRIDX_EMPTY_STRING, /* UNUSED, intentionally empty */ + DUK_STRIDX_EMPTY_STRING, /* UNUSED, intentionally empty */ }; /* * Default allocation functions. @@ -13639,8 +14331,7 @@ DUK_INTERNAL void *duk_default_alloc_function(void *udata, duk_size_t size) { void *res; DUK_UNREF(udata); res = DUK_ANSI_MALLOC(size); - DUK_DDD(DUK_DDDPRINT("default alloc function: %lu -> %p", - (unsigned long) size, (void *) res)); + DUK_DDD(DUK_DDDPRINT("default alloc function: %lu -> %p", (unsigned long) size, (void *) res)); return res; } @@ -13648,8 +14339,7 @@ DUK_INTERNAL void *duk_default_realloc_function(void *udata, void *ptr, duk_size void *res; DUK_UNREF(udata); res = DUK_ANSI_REALLOC(ptr, newsize); - DUK_DDD(DUK_DDDPRINT("default realloc function: %p %lu -> %p", - (void *) ptr, (unsigned long) newsize, (void *) res)); + DUK_DDD(DUK_DDDPRINT("default realloc function: %p %lu -> %p", (void *) ptr, (unsigned long) newsize, (void *) res)); return res; } @@ -13658,7 +14348,7 @@ DUK_INTERNAL void duk_default_free_function(void *udata, void *ptr) { DUK_UNREF(udata); DUK_ANSI_FREE(ptr); } -#endif /* DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS */ +#endif /* DUK_USE_PROVIDE_DEFAULT_ALLOC_FUNCTIONS */ /* * Buffer */ @@ -13748,11 +14438,11 @@ DUK_EXTERNAL void duk_config_buffer(duk_hthread *thr, duk_idx_t idx, void *ptr, #if defined(DUK_USE_BYTECODE_DUMP_SUPPORT) -#define DUK__SER_MARKER 0xbf -#define DUK__SER_STRING 0x00 -#define DUK__SER_NUMBER 0x01 +#define DUK__SER_MARKER 0xbf +#define DUK__SER_STRING 0x00 +#define DUK__SER_NUMBER 0x01 #define DUK__BYTECODE_INITIAL_ALLOC 256 -#define DUK__NO_FORMALS 0xffffffffUL +#define DUK__NO_FORMALS 0xffffffffUL /* * Dump/load helpers, xxx_raw() helpers do no buffer checks @@ -13786,12 +14476,10 @@ DUK_LOCAL duk_uint8_t *duk__dump_hstring_raw(duk_uint8_t *p, duk_hstring *h) { DUK_ASSERT(h != NULL); len = DUK_HSTRING_GET_BYTELEN(h); - DUK_ASSERT(len <= 0xffffffffUL); /* string limits */ + DUK_ASSERT(len <= 0xffffffffUL); /* string limits */ tmp32 = (duk_uint32_t) len; DUK_RAW_WRITEINC_U32_BE(p, tmp32); - duk_memcpy((void *) p, - (const void *) DUK_HSTRING_GET_DATA(h), - len); + duk_memcpy((void *) p, (const void *) DUK_HSTRING_GET_DATA(h), len); p += len; return p; } @@ -13805,18 +14493,20 @@ DUK_LOCAL duk_uint8_t *duk__dump_hbuffer_raw(duk_hthread *thr, duk_uint8_t *p, d DUK_UNREF(thr); len = DUK_HBUFFER_GET_SIZE(h); - DUK_ASSERT(len <= 0xffffffffUL); /* buffer limits */ + DUK_ASSERT(len <= 0xffffffffUL); /* buffer limits */ tmp32 = (duk_uint32_t) len; DUK_RAW_WRITEINC_U32_BE(p, tmp32); /* When len == 0, buffer data pointer may be NULL. */ - duk_memcpy_unsafe((void *) p, - (const void *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h), - len); + duk_memcpy_unsafe((void *) p, (const void *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h), len); p += len; return p; } -DUK_LOCAL duk_uint8_t *duk__dump_string_prop(duk_hthread *thr, duk_uint8_t *p, duk_bufwriter_ctx *bw_ctx, duk_hobject *func, duk_small_uint_t stridx) { +DUK_LOCAL duk_uint8_t *duk__dump_string_prop(duk_hthread *thr, + duk_uint8_t *p, + duk_bufwriter_ctx *bw_ctx, + duk_hobject *func, + duk_small_uint_t stridx) { duk_hstring *h_str; duk_tval *tv; @@ -13828,13 +14518,17 @@ DUK_LOCAL duk_uint8_t *duk__dump_string_prop(duk_hthread *thr, duk_uint8_t *p, d h_str = DUK_HTHREAD_STRING_EMPTY_STRING(thr); DUK_ASSERT(h_str != NULL); } - DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ + DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U + DUK_HSTRING_GET_BYTELEN(h_str), p); p = duk__dump_hstring_raw(p, h_str); return p; } -DUK_LOCAL duk_uint8_t *duk__dump_buffer_prop(duk_hthread *thr, duk_uint8_t *p, duk_bufwriter_ctx *bw_ctx, duk_hobject *func, duk_small_uint_t stridx) { +DUK_LOCAL duk_uint8_t *duk__dump_buffer_prop(duk_hthread *thr, + duk_uint8_t *p, + duk_bufwriter_ctx *bw_ctx, + duk_hobject *func, + duk_small_uint_t stridx) { duk_tval *tv; tv = duk_hobject_find_entry_tval_ptr_stridx(thr->heap, (duk_hobject *) func, stridx); @@ -13842,7 +14536,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_buffer_prop(duk_hthread *thr, duk_uint8_t *p, d duk_hbuffer *h_buf; h_buf = DUK_TVAL_GET_BUFFER(tv); DUK_ASSERT(h_buf != NULL); - DUK_ASSERT(DUK_HBUFFER_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ + DUK_ASSERT(DUK_HBUFFER_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U + DUK_HBUFFER_GET_SIZE(h_buf), p); p = duk__dump_hbuffer_raw(thr, p, h_buf); } else { @@ -13852,7 +14546,12 @@ DUK_LOCAL duk_uint8_t *duk__dump_buffer_prop(duk_hthread *thr, duk_uint8_t *p, d return p; } -DUK_LOCAL duk_uint8_t *duk__dump_uint32_prop(duk_hthread *thr, duk_uint8_t *p, duk_bufwriter_ctx *bw_ctx, duk_hobject *func, duk_small_uint_t stridx, duk_uint32_t def_value) { +DUK_LOCAL duk_uint8_t *duk__dump_uint32_prop(duk_hthread *thr, + duk_uint8_t *p, + duk_bufwriter_ctx *bw_ctx, + duk_hobject *func, + duk_small_uint_t stridx, + duk_uint32_t def_value) { duk_tval *tv; duk_uint32_t val; @@ -13885,27 +14584,28 @@ DUK_LOCAL duk_uint8_t *duk__dump_varmap(duk_hthread *thr, duk_uint8_t *p, duk_bu duk_uint32_t val; key = DUK_HOBJECT_E_GET_KEY(thr->heap, h, i); - DUK_ASSERT(key != NULL); /* _Varmap is dense */ + DUK_ASSERT(key != NULL); /* _Varmap is dense */ DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, h, i)); tv_val = DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(thr->heap, h, i); DUK_ASSERT(tv_val != NULL); - DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_val)); /* known to be number; in fact an integer */ + DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_val)); /* known to be number; in fact an integer */ #if defined(DUK_USE_FASTINT) DUK_ASSERT(DUK_TVAL_IS_FASTINT(tv_val)); - DUK_ASSERT(DUK_TVAL_GET_FASTINT(tv_val) == (duk_int64_t) DUK_TVAL_GET_FASTINT_U32(tv_val)); /* known to be 32-bit */ + DUK_ASSERT(DUK_TVAL_GET_FASTINT(tv_val) == + (duk_int64_t) DUK_TVAL_GET_FASTINT_U32(tv_val)); /* known to be 32-bit */ val = DUK_TVAL_GET_FASTINT_U32(tv_val); #else val = (duk_uint32_t) DUK_TVAL_GET_NUMBER(tv_val); #endif - DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ + DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U + DUK_HSTRING_GET_BYTELEN(key) + 4U, p); p = duk__dump_hstring_raw(p, key); DUK_RAW_WRITEINC_U32_BE(p, val); } } p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p); - DUK_RAW_WRITEINC_U32_BE(p, 0); /* end of _Varmap */ + DUK_RAW_WRITEINC_U32_BE(p, 0); /* end of _Varmap */ return p; } @@ -13923,7 +14623,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_formals(duk_hthread *thr, duk_uint8_t *p, duk_b */ p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p); - DUK_ASSERT(h->length != DUK__NO_FORMALS); /* limits */ + DUK_ASSERT(h->length != DUK__NO_FORMALS); /* limits */ DUK_RAW_WRITEINC_U32_BE(p, h->length); for (i = 0; i < h->length; i++) { @@ -13938,14 +14638,14 @@ DUK_LOCAL duk_uint8_t *duk__dump_formals(duk_hthread *thr, duk_uint8_t *p, duk_b DUK_ASSERT(varname != NULL); DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(varname) >= 1); - DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ + DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U + DUK_HSTRING_GET_BYTELEN(varname), p); p = duk__dump_hstring_raw(p, varname); } } else { DUK_DD(DUK_DDPRINT("dumping function without _Formals, emit marker to indicate missing _Formals")); p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p); - DUK_RAW_WRITEINC_U32_BE(p, DUK__NO_FORMALS); /* marker: no formals */ + DUK_RAW_WRITEINC_U32_BE(p, DUK__NO_FORMALS); /* marker: no formals */ } return p; } @@ -13979,7 +14679,7 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu (long) DUK_HCOMPFUNC_GET_CODE_SIZE(thr->heap, func), (long) DUK_HCOMPFUNC_GET_CODE_COUNT(thr->heap, func))); - DUK_ASSERT(DUK_USE_ESBC_MAX_BYTES <= 0x7fffffffUL); /* ensures no overflow */ + DUK_ASSERT(DUK_USE_ESBC_MAX_BYTES <= 0x7fffffffUL); /* ensures no overflow */ count_instr = (duk_uint32_t) DUK_HCOMPFUNC_GET_CODE_COUNT(thr->heap, func); p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 3U * 4U + 2U * 2U + 3U * 4U + count_instr * 4U, p); @@ -14003,8 +14703,8 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu DUK_RAW_WRITEINC_U32_BE(p, 0); DUK_RAW_WRITEINC_U32_BE(p, 0); #endif - tmp32 = DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) func); /* masks flags, only duk_hobject flags */ - tmp32 &= ~(DUK_HOBJECT_FLAG_HAVE_FINALIZER); /* finalizer flag is lost */ + tmp32 = DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) func); /* masks flags, only duk_hobject flags */ + tmp32 &= ~(DUK_HOBJECT_FLAG_HAVE_FINALIZER); /* finalizer flag is lost */ DUK_RAW_WRITEINC_U32_BE(p, tmp32); /* Bytecode instructions: endian conversion needed unless @@ -14014,8 +14714,9 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu ins_end = DUK_HCOMPFUNC_GET_CODE_END(thr->heap, func); DUK_ASSERT((duk_size_t) (ins_end - ins) == (duk_size_t) count_instr); #if defined(DUK_USE_INTEGER_BE) - duk_memcpy_unsafe((void *) p, (const void *) ins, (size_t) (ins_end - ins)); - p += (size_t) (ins_end - ins); + duk_memcpy_unsafe((void *) p, (const void *) ins, count_instr * sizeof(duk_instr_t)); + p += count_instr * sizeof(duk_instr_t); + DUK_UNREF(ins_end); #else while (ins != ins_end) { tmp32 = (duk_uint32_t) (*ins); @@ -14029,13 +14730,12 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu tv_end = DUK_HCOMPFUNC_GET_CONSTS_END(thr->heap, func); while (tv != tv_end) { /* constants are strings or numbers now */ - DUK_ASSERT(DUK_TVAL_IS_STRING(tv) || - DUK_TVAL_IS_NUMBER(tv)); + DUK_ASSERT(DUK_TVAL_IS_STRING(tv) || DUK_TVAL_IS_NUMBER(tv)); if (DUK_TVAL_IS_STRING(tv)) { h_str = DUK_TVAL_GET_STRING(tv); DUK_ASSERT(h_str != NULL); - DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ + DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL); /* ensures no overflow */ p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 1U + 4U + DUK_HSTRING_GET_BYTELEN(h_str), p); *p++ = DUK__SER_STRING; p = duk__dump_hstring_raw(p, h_str); @@ -14101,7 +14801,8 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu * are validated (which is quite complex, especially for indirect opcodes). */ -#define DUK__ASSERT_LEFT(n) do { \ +#define DUK__ASSERT_LEFT(n) \ + do { \ DUK_ASSERT((duk_size_t) (p_end - p) >= (duk_size_t) (n)); \ } while (0) @@ -14136,13 +14837,13 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, count_const = DUK_RAW_READINC_U32_BE(p); count_funcs = DUK_RAW_READINC_U32_BE(p); - data_size = sizeof(duk_tval) * count_const + - sizeof(duk_hobject *) * count_funcs + - sizeof(duk_instr_t) * count_instr; + data_size = sizeof(duk_tval) * count_const + sizeof(duk_hobject *) * count_funcs + sizeof(duk_instr_t) * count_instr; DUK_DD(DUK_DDPRINT("instr=%ld, const=%ld, funcs=%ld, data_size=%ld", - (long) count_instr, (long) count_const, - (long) count_const, (long) data_size)); + (long) count_instr, + (long) count_const, + (long) count_const, + (long) data_size)); /* Value stack is used to ensure reachability of constants and * inner functions being loaded. Require enough space to handle @@ -14168,12 +14869,12 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, h_fun->start_line = DUK_RAW_READINC_U32_BE(p); h_fun->end_line = DUK_RAW_READINC_U32_BE(p); #else - p += 8; /* skip line info */ + p += 8; /* skip line info */ #endif /* duk_hcompfunc flags; quite version specific */ tmp32 = DUK_RAW_READINC_U32_BE(p); - DUK_HEAPHDR_SET_FLAGS((duk_heaphdr *) h_fun, tmp32); /* masks flags to only change duk_hobject flags */ + DUK_HEAPHDR_SET_FLAGS((duk_heaphdr *) h_fun, tmp32); /* masks flags to only change duk_hobject flags */ /* standard prototype (no need to set here, already set) */ DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) h_fun) == thr->builtins[DUK_BIDX_FUNCTION_PROTOTYPE]); @@ -14201,9 +14902,7 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, DUK__ASSERT_LEFT(count_instr * sizeof(duk_instr_t)); #if defined(DUK_USE_INTEGER_BE) q = fun_data + sizeof(duk_tval) * count_const + sizeof(duk_hobject *) * count_funcs; - duk_memcpy((void *) q, - (const void *) p, - sizeof(duk_instr_t) * count_instr); + duk_memcpy((void *) q, (const void *) p, sizeof(duk_instr_t) * count_instr); p += sizeof(duk_instr_t) * count_instr; #else q = fun_data + sizeof(duk_tval) * count_const + sizeof(duk_hobject *) * count_funcs; @@ -14262,13 +14961,13 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, DUK_HCOMPFUNC_SET_DATA(thr->heap, h_fun, h_data); DUK_HBUFFER_INCREF(thr, h_data); - tv1 = duk_get_tval(thr, idx_base + 2); /* may be NULL if no constants or inner funcs */ + tv1 = duk_get_tval(thr, idx_base + 2); /* may be NULL if no constants or inner funcs */ DUK_ASSERT((count_const == 0 && count_funcs == 0) || tv1 != NULL); q = fun_data; duk_memcpy_unsafe((void *) q, (const void *) tv1, sizeof(duk_tval) * count_const); for (n = count_const; n > 0; n--) { - DUK_TVAL_INCREF_FAST(thr, (duk_tval *) (void *) q); /* no side effects */ + DUK_TVAL_INCREF_FAST(thr, (duk_tval *) (void *) q); /* no side effects */ q += sizeof(duk_tval); } tv1 += count_const; @@ -14301,7 +15000,7 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_C); #if defined(DUK_USE_FUNC_NAME_PROPERTY) - p = duk__load_string_raw(thr, p); /* -> [ func funcname ] */ + p = duk__load_string_raw(thr, p); /* -> [ func funcname ] */ func_env = thr->builtins[DUK_BIDX_GLOBAL_ENV]; DUK_ASSERT(func_env != NULL); need_pop = 0; @@ -14312,11 +15011,10 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, */ duk_hdecenv *new_env; - new_env = duk_hdecenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); + new_env = + duk_hdecenv_alloc(thr, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); DUK_ASSERT(new_env != NULL); - DUK_ASSERT(new_env->thread == NULL); /* Closed. */ + DUK_ASSERT(new_env->thread == NULL); /* Closed. */ DUK_ASSERT(new_env->varmap == NULL); DUK_ASSERT(new_env->regbase_byteoff == 0); DUK_HDECENV_ASSERT_VALID(new_env); @@ -14328,11 +15026,11 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, duk_push_hobject(thr, (duk_hobject *) new_env); - duk_dup_m2(thr); /* -> [ func funcname env funcname ] */ - duk_dup(thr, idx_base); /* -> [ func funcname env funcname func ] */ - duk_xdef_prop(thr, -3, DUK_PROPDESC_FLAGS_NONE); /* -> [ func funcname env ] */ + duk_dup_m2(thr); /* -> [ func funcname env funcname ] */ + duk_dup(thr, idx_base); /* -> [ func funcname env funcname func ] */ + duk_xdef_prop(thr, -3, DUK_PROPDESC_FLAGS_NONE); /* -> [ func funcname env ] */ - need_pop = 1; /* Need to pop env, but -after- updating h_fun and increfs. */ + need_pop = 1; /* Need to pop env, but -after- updating h_fun and increfs. */ } DUK_ASSERT(func_env != NULL); DUK_HCOMPFUNC_SET_LEXENV(thr->heap, h_fun, func_env); @@ -14343,12 +15041,12 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, duk_pop(thr); } duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_NAME, DUK_PROPDESC_FLAGS_C); -#endif /* DUK_USE_FUNC_NAME_PROPERTY */ +#endif /* DUK_USE_FUNC_NAME_PROPERTY */ #if defined(DUK_USE_FUNC_FILENAME_PROPERTY) p = duk__load_string_raw(thr, p); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_FILE_NAME, DUK_PROPDESC_FLAGS_C); -#endif /* DUK_USE_FUNC_FILENAME_PROPERTY */ +#endif /* DUK_USE_FUNC_FILENAME_PROPERTY */ if (DUK_HOBJECT_HAS_CONSTRUCTABLE((duk_hobject *) h_fun)) { /* Restore empty external .prototype only for constructable @@ -14358,7 +15056,10 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, duk_push_object(thr); DUK_ASSERT(!duk_is_bare_object(thr, -1)); duk_dup_m2(thr); - duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_CONSTRUCTOR, DUK_PROPDESC_FLAGS_WC); /* func.prototype.constructor = func */ + duk_xdef_prop_stridx_short(thr, + -2, + DUK_STRIDX_CONSTRUCTOR, + DUK_PROPDESC_FLAGS_WC); /* func.prototype.constructor = func */ duk_compact_m1(thr); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_PROTOTYPE, DUK_PROPDESC_FLAGS_W); } @@ -14366,9 +15067,9 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, #if defined(DUK_USE_PC2LINE) p = duk__load_buffer_raw(thr, p); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_PC2LINE, DUK_PROPDESC_FLAGS_WC); -#endif /* DUK_USE_PC2LINE */ +#endif /* DUK_USE_PC2LINE */ - duk_push_bare_object(thr); /* _Varmap */ + duk_push_bare_object(thr); /* _Varmap */ for (;;) { /* XXX: awkward */ p = duk__load_string_raw(thr, p); @@ -14388,7 +15089,7 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, */ arr_limit = DUK_RAW_READINC_U32_BE(p); if (arr_limit != DUK__NO_FORMALS) { - duk_push_bare_array(thr); /* _Formals */ + duk_push_bare_array(thr); /* _Formals */ for (arr_idx = 0; arr_idx < arr_limit; arr_idx++) { p = duk__load_string_raw(thr, p); duk_put_prop_index(thr, -2, arr_idx); @@ -14404,7 +15105,7 @@ static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, DUK_ASSERT_TOP(thr, idx_base + 1); return p; - format_error: +format_error: return NULL; } @@ -14436,7 +15137,7 @@ DUK_EXTERNAL void duk_dump_function(duk_hthread *thr) { DUK_DD(DUK_DDPRINT("serialized result: %!T", duk_get_tval(thr, -1))); - duk_remove_m2(thr); /* [ ... func buf ] -> [ ... buf ] */ + duk_remove_m2(thr); /* [ ... func buf ] -> [ ... buf ] */ } DUK_EXTERNAL void duk_load_function(duk_hthread *thr) { @@ -14469,15 +15170,15 @@ DUK_EXTERNAL void duk_load_function(duk_hthread *thr) { goto format_error; } - duk_remove_m2(thr); /* [ ... buf func ] -> [ ... func ] */ + duk_remove_m2(thr); /* [ ... buf func ] -> [ ... func ] */ return; - format_error: +format_error: DUK_ERROR_TYPE(thr, DUK_STR_INVALID_BYTECODE); DUK_WO_NORETURN(return;); } -#else /* DUK_USE_BYTECODE_DUMP_SUPPORT */ +#else /* DUK_USE_BYTECODE_DUMP_SUPPORT */ DUK_EXTERNAL void duk_dump_function(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); @@ -14491,7 +15192,7 @@ DUK_EXTERNAL void duk_load_function(duk_hthread *thr) { DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_BYTECODE_DUMP_SUPPORT */ +#endif /* DUK_USE_BYTECODE_DUMP_SUPPORT */ /* automatic undefs */ #undef DUK__ASSERT_LEFT @@ -14553,7 +15254,7 @@ DUK_LOCAL duk_idx_t duk__call_get_idx_func(duk_hthread *thr, duk_idx_t nargs, du DUK_ASSERT(other >= 0); idx_func = duk_get_top(thr) - nargs - other; - if (DUK_UNLIKELY((idx_func | nargs) < 0)) { /* idx_func < 0 || nargs < 0; OR sign bits */ + if (DUK_UNLIKELY((idx_func | nargs) < 0)) { /* idx_func < 0 || nargs < 0; OR sign bits */ DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return 0;); } @@ -14587,12 +15288,14 @@ DUK_LOCAL void duk__call_prop_prep_stack(duk_hthread *thr, duk_idx_t normalized_ DUK_ASSERT(nargs >= 0); DUK_DDD(DUK_DDDPRINT("duk__call_prop_prep_stack, normalized_obj_idx=%ld, nargs=%ld, stacktop=%ld", - (long) normalized_obj_idx, (long) nargs, (long) duk_get_top(thr))); + (long) normalized_obj_idx, + (long) nargs, + (long) duk_get_top(thr))); /* [... key arg1 ... argN] */ /* duplicate key */ - duk_dup(thr, -nargs - 1); /* Note: -nargs alone would fail for nargs == 0, this is OK */ + duk_dup(thr, -nargs - 1); /* Note: -nargs alone would fail for nargs == 0, this is OK */ (void) duk_get_prop(thr, normalized_obj_idx); DUK_DDD(DUK_DDDPRINT("func: %!T", (duk_tval *) duk_get_tval(thr, -1))); @@ -14635,7 +15338,7 @@ DUK_EXTERNAL void duk_call(duk_hthread *thr, duk_idx_t nargs) { duk_insert_undefined(thr, idx_func + 1); - call_flags = 0; /* not protected, respect reclimit, not constructor */ + call_flags = 0; /* not protected, respect reclimit, not constructor */ duk_handle_call_unprotected(thr, idx_func, call_flags); } @@ -14648,7 +15351,7 @@ DUK_EXTERNAL void duk_call_method(duk_hthread *thr, duk_idx_t nargs) { idx_func = duk__call_get_idx_func(thr, nargs, 2); DUK_ASSERT(duk_is_valid_index(thr, idx_func)); - call_flags = 0; /* not protected, respect reclimit, not constructor */ + call_flags = 0; /* not protected, respect reclimit, not constructor */ duk_handle_call_unprotected(thr, idx_func, call_flags); } @@ -14662,7 +15365,7 @@ DUK_EXTERNAL void duk_call_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_idx_t n DUK_ASSERT_API_ENTRY(thr); - obj_idx = duk_require_normalize_index(thr, obj_idx); /* make absolute */ + obj_idx = duk_require_normalize_index(thr, obj_idx); /* make absolute */ if (DUK_UNLIKELY(nargs < 0)) { DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return;); @@ -14760,7 +15463,7 @@ DUK_LOCAL duk_ret_t duk__pcall_prop_raw(duk_hthread *thr, void *udata) { args = (duk__pcall_prop_args *) udata; - obj_idx = duk_require_normalize_index(thr, args->obj_idx); /* make absolute */ + obj_idx = duk_require_normalize_index(thr, args->obj_idx); /* make absolute */ duk__call_prop_prep_stack(thr, obj_idx, args->nargs); ret = duk_handle_call_unprotected_nargs(thr, args->nargs, args->call_flags); @@ -14798,30 +15501,30 @@ DUK_EXTERNAL duk_int_t duk_safe_call(duk_hthread *thr, duk_safe_call_function fu */ /* XXX: check for any reserve? */ - if (DUK_UNLIKELY((nargs | nrets) < 0 || /* nargs < 0 || nrets < 0; OR sign bits */ - thr->valstack_top < thr->valstack_bottom + nargs || /* nargs too large compared to top */ - thr->valstack_end + nargs < thr->valstack_top + nrets)) { /* nrets too large compared to reserve */ + if (DUK_UNLIKELY((nargs | nrets) < 0 || /* nargs < 0 || nrets < 0; OR sign bits */ + thr->valstack_top < thr->valstack_bottom + nargs || /* nargs too large compared to top */ + thr->valstack_end + nargs < thr->valstack_top + nrets)) { /* nrets too large compared to reserve */ DUK_D(DUK_DPRINT("not enough stack reserve for safe call or invalid arguments: " "nargs=%ld < 0 (?), nrets=%ld < 0 (?), top=%ld < bottom=%ld + nargs=%ld (?), " "end=%ld + nargs=%ld < top=%ld + nrets=%ld (?)", - (long) nargs, - (long) nrets, - (long) (thr->valstack_top - thr->valstack), - (long) (thr->valstack_bottom - thr->valstack), - (long) nargs, - (long) (thr->valstack_end - thr->valstack), - (long) nargs, - (long) (thr->valstack_top - thr->valstack), - (long) nrets)); + (long) nargs, + (long) nrets, + (long) (thr->valstack_top - thr->valstack), + (long) (thr->valstack_bottom - thr->valstack), + (long) nargs, + (long) (thr->valstack_end - thr->valstack), + (long) nargs, + (long) (thr->valstack_top - thr->valstack), + (long) nrets)); DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return DUK_EXEC_ERROR;); } - rc = duk_handle_safe_call(thr, /* thread */ - func, /* func */ - udata, /* udata */ - nargs, /* num_stack_args */ - nrets); /* num_stack_res */ + rc = duk_handle_safe_call(thr, /* thread */ + func, /* func */ + udata, /* udata */ + nargs, /* num_stack_args */ + nrets); /* num_stack_res */ return rc; } @@ -14834,7 +15537,7 @@ DUK_EXTERNAL void duk_new(duk_hthread *thr, duk_idx_t nargs) { idx_func = duk__call_get_idx_func(thr, nargs, 1); DUK_ASSERT(duk_is_valid_index(thr, idx_func)); - duk_push_object(thr); /* default instance; internal proto updated by call handling */ + duk_push_object(thr); /* default instance; internal proto updated by call handling */ duk_insert(thr, idx_func + 1); duk_handle_call_unprotected(thr, idx_func, DUK_CALL_FLAG_CONSTRUCT); @@ -14962,7 +15665,7 @@ DUK_EXTERNAL duk_int_t duk_get_magic(duk_hthread *thr, duk_idx_t idx) { } /* fall through */ - type_error: +type_error: DUK_ERROR_TYPE(thr, DUK_STR_UNEXPECTED_TYPE); DUK_WO_NORETURN(return 0;); } @@ -15036,15 +15739,16 @@ DUK_INTERNAL void duk_resolve_nonbound_function(duk_hthread *thr) { * is guaranteed to be non-NULL, even for zero length input. */ DUK_LOCAL const duk_uint8_t *duk__prep_codec_arg(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_len) { - const void *def_ptr = (const void *) out_len; /* Any non-NULL pointer will do. */ + const void *def_ptr = (const void *) out_len; /* Any non-NULL pointer will do. */ const void *ptr; duk_bool_t isbuffer; DUK_ASSERT(out_len != NULL); DUK_ASSERT(def_ptr != NULL); - DUK_ASSERT(duk_is_valid_index(thr, idx)); /* checked by caller */ + DUK_ASSERT(duk_is_valid_index(thr, idx)); /* checked by caller */ - ptr = (const void *) duk_get_buffer_data_raw(thr, idx, out_len, NULL /*def_ptr*/, 0 /*def_size*/, 0 /*throw_flag*/, &isbuffer); + ptr = (const void *) + duk_get_buffer_data_raw(thr, idx, out_len, NULL /*def_ptr*/, 0 /*def_size*/, 0 /*throw_flag*/, &isbuffer); if (isbuffer) { DUK_ASSERT(ptr != NULL || *out_len == 0U); if (DUK_UNLIKELY(ptr == NULL)) { @@ -15069,21 +15773,21 @@ DUK_LOCAL const duk_uint8_t *duk__prep_codec_arg(duk_hthread *thr, duk_idx_t idx #if defined(DUK_USE_BASE64_SUPPORT) /* Bytes emitted for number of padding characters in range [0,4]. */ DUK_LOCAL const duk_int8_t duk__base64_decode_nequal_step[5] = { - 3, /* #### -> 24 bits, emit 3 bytes */ - 2, /* ###= -> 18 bits, emit 2 bytes */ - 1, /* ##== -> 12 bits, emit 1 byte */ - -1, /* #=== -> 6 bits, error */ - 0, /* ==== -> 0 bits, emit 0 bytes */ + 3, /* #### -> 24 bits, emit 3 bytes */ + 2, /* ###= -> 18 bits, emit 2 bytes */ + 1, /* ##== -> 12 bits, emit 1 byte */ + -1, /* #=== -> 6 bits, error */ + 0, /* ==== -> 0 bits, emit 0 bytes */ }; #if defined(DUK_USE_BASE64_FASTPATH) DUK_LOCAL const duk_uint8_t duk__base64_enctab_fast[64] = { - 0x41U, 0x42U, 0x43U, 0x44U, 0x45U, 0x46U, 0x47U, 0x48U, 0x49U, 0x4aU, 0x4bU, 0x4cU, 0x4dU, 0x4eU, 0x4fU, 0x50U, /* A...P */ - 0x51U, 0x52U, 0x53U, 0x54U, 0x55U, 0x56U, 0x57U, 0x58U, 0x59U, 0x5aU, 0x61U, 0x62U, 0x63U, 0x64U, 0x65U, 0x66U, /* Q...f */ - 0x67U, 0x68U, 0x69U, 0x6aU, 0x6bU, 0x6cU, 0x6dU, 0x6eU, 0x6fU, 0x70U, 0x71U, 0x72U, 0x73U, 0x74U, 0x75U, 0x76U, /* g...v */ - 0x77U, 0x78U, 0x79U, 0x7aU, 0x30U, 0x31U, 0x32U, 0x33U, 0x34U, 0x35U, 0x36U, 0x37U, 0x38U, 0x39U, 0x2bU, 0x2fU /* w.../ */ + 0x41U, 0x42U, 0x43U, 0x44U, 0x45U, 0x46U, 0x47U, 0x48U, 0x49U, 0x4aU, 0x4bU, 0x4cU, 0x4dU, 0x4eU, 0x4fU, 0x50U, /* A...P */ + 0x51U, 0x52U, 0x53U, 0x54U, 0x55U, 0x56U, 0x57U, 0x58U, 0x59U, 0x5aU, 0x61U, 0x62U, 0x63U, 0x64U, 0x65U, 0x66U, /* Q...f */ + 0x67U, 0x68U, 0x69U, 0x6aU, 0x6bU, 0x6cU, 0x6dU, 0x6eU, 0x6fU, 0x70U, 0x71U, 0x72U, 0x73U, 0x74U, 0x75U, 0x76U, /* g...v */ + 0x77U, 0x78U, 0x79U, 0x7aU, 0x30U, 0x31U, 0x32U, 0x33U, 0x34U, 0x35U, 0x36U, 0x37U, 0x38U, 0x39U, 0x2bU, 0x2fU /* w.../ */ }; -#endif /* DUK_USE_BASE64_FASTPATH */ +#endif /* DUK_USE_BASE64_FASTPATH */ #if defined(DUK_USE_BASE64_FASTPATH) /* Decode table for one byte of input: @@ -15093,24 +15797,24 @@ DUK_LOCAL const duk_uint8_t duk__base64_enctab_fast[64] = { * 0...63 decoded bytes */ DUK_LOCAL const duk_int8_t duk__base64_dectab_fast[256] = { - -3, -3, -3, -3, -3, -3, -3, -3, -3, -1, -1, -3, -3, -1, -3, -3, /* 0x00...0x0f */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0x10...0x1f */ - -1, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, 62, -3, -3, -3, 63, /* 0x20...0x2f */ - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -3, -3, -3, -2, -3, -3, /* 0x30...0x3f */ - -3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40...0x4f */ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -3, -3, -3, -3, -3, /* 0x50...0x5f */ - -3, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60...0x6f */ - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -3, -3, -3, -3, -3, /* 0x70...0x7f */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0x80...0x8f */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0x90...0x9f */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xa0...0xaf */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xb0...0xbf */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xc0...0xcf */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xd0...0xdf */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xe0...0xef */ - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3 /* 0xf0...0xff */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -1, -1, -3, -3, -1, -3, -3, /* 0x00...0x0f */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0x10...0x1f */ + -1, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, 62, -3, -3, -3, 63, /* 0x20...0x2f */ + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -3, -3, -3, -2, -3, -3, /* 0x30...0x3f */ + -3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 0x40...0x4f */ + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -3, -3, -3, -3, -3, /* 0x50...0x5f */ + -3, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /* 0x60...0x6f */ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -3, -3, -3, -3, -3, /* 0x70...0x7f */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0x80...0x8f */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0x90...0x9f */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xa0...0xaf */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xb0...0xbf */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xc0...0xcf */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xd0...0xdf */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, /* 0xe0...0xef */ + -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3 /* 0xf0...0xff */ }; -#endif /* DUK_USE_BASE64_FASTPATH */ +#endif /* DUK_USE_BASE64_FASTPATH */ #if defined(DUK_USE_BASE64_FASTPATH) DUK_LOCAL DUK_ALWAYS_INLINE void duk__base64_encode_fast_3(const duk_uint8_t *src, duk_uint8_t *dst) { @@ -15142,9 +15846,9 @@ DUK_LOCAL DUK_ALWAYS_INLINE void duk__base64_encode_fast_2(const duk_uint8_t *sr t = (duk_uint_t) src[0]; t = (t << 8) + (duk_uint_t) src[1]; - dst[0] = duk__base64_enctab_fast[t >> 10]; /* XXXXXX-- -------- */ - dst[1] = duk__base64_enctab_fast[(t >> 4) & 0x3fU]; /* ------XX XXXX---- */ - dst[2] = duk__base64_enctab_fast[(t << 2) & 0x3fU]; /* -------- ----XXXX */ + dst[0] = duk__base64_enctab_fast[t >> 10]; /* XXXXXX-- -------- */ + dst[1] = duk__base64_enctab_fast[(t >> 4) & 0x3fU]; /* ------XX XXXX---- */ + dst[2] = duk__base64_enctab_fast[(t << 2) & 0x3fU]; /* -------- ----XXXX */ dst[3] = DUK_ASC_EQUALS; } @@ -15152,8 +15856,8 @@ DUK_LOCAL DUK_ALWAYS_INLINE void duk__base64_encode_fast_1(const duk_uint8_t *sr duk_uint_t t; t = (duk_uint_t) src[0]; - dst[0] = duk__base64_enctab_fast[t >> 2]; /* XXXXXX-- */ - dst[1] = duk__base64_enctab_fast[(t << 4) & 0x3fU]; /* ------XX */ + dst[0] = duk__base64_enctab_fast[t >> 2]; /* XXXXXX-- */ + dst[1] = duk__base64_enctab_fast[(t << 4) & 0x3fU]; /* ------XX */ dst[2] = DUK_ASC_EQUALS; dst[3] = DUK_ASC_EQUALS; } @@ -15201,24 +15905,24 @@ DUK_LOCAL void duk__base64_encode_helper(const duk_uint8_t *src, duk_size_t srcl DUK_ASSERT(n == 0U || n == 1U || n == 2U); if (n == 1U) { duk__base64_encode_fast_1(p, q); -#if 0 /* Unnecessary. */ +#if 0 /* Unnecessary. */ p += 1; q += 4; n -= 1U; #endif } else if (n == 2U) { duk__base64_encode_fast_2(p, q); -#if 0 /* Unnecessary. */ +#if 0 /* Unnecessary. */ p += 2; q += 4; n -= 2U; #endif } else { - DUK_ASSERT(n == 0U); /* nothing to do */ + DUK_ASSERT(n == 0U); /* nothing to do */ ; } } -#else /* DUK_USE_BASE64_FASTPATH */ +#else /* DUK_USE_BASE64_FASTPATH */ DUK_LOCAL void duk__base64_encode_helper(const duk_uint8_t *src, duk_size_t srclen, duk_uint8_t *dst) { duk_small_uint_t i, npad; duk_uint_t t, x, y; @@ -15290,10 +15994,13 @@ DUK_LOCAL void duk__base64_encode_helper(const duk_uint8_t *src, duk_size_t srcl npad--; } } -#endif /* DUK_USE_BASE64_FASTPATH */ +#endif /* DUK_USE_BASE64_FASTPATH */ #if defined(DUK_USE_BASE64_FASTPATH) -DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_t srclen, duk_uint8_t *dst, duk_uint8_t **out_dst_final) { +DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, + duk_size_t srclen, + duk_uint8_t *dst, + duk_uint8_t **out_dst_final) { duk_int_t x; duk_uint_t t; duk_small_uint_t n_equal; @@ -15303,11 +16010,11 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ const duk_uint8_t *p_end_safe; duk_uint8_t *q; - DUK_ASSERT(src != NULL); /* Required by pointer arithmetic below, which fails for NULL. */ + DUK_ASSERT(src != NULL); /* Required by pointer arithmetic below, which fails for NULL. */ p = src; p_end = src + srclen; - p_end_safe = p_end - 8; /* If 'src <= src_end_safe', safe to read 8 bytes. */ + p_end_safe = p_end - 8; /* If 'src <= src_end_safe', safe to read 8 bytes. */ q = dst; /* Alternate between a fast path which processes clean groups with no @@ -15337,7 +16044,9 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ * bytes to minimize aliasing. */ DUK_DDD(DUK_DDDPRINT("fast loop: p=%p, p_end_safe=%p, p_end=%p", - (const void *) p, (const void *) p_end_safe, (const void *) p_end)); + (const void *) p, + (const void *) p_end_safe, + (const void *) p_end)); t1 = (duk_int_t) duk__base64_dectab_fast[p[0]]; t1 = (duk_int_t) ((duk_uint_t) t1 << 6) | (duk_int_t) duk__base64_dectab_fast[p[1]]; @@ -15362,17 +16071,19 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ p += 8; q += 6; } else if (t1 >= 0) { - DUK_DDD(DUK_DDDPRINT("fast loop first group was clean, second was not, process one slow path group")); + DUK_DDD( + DUK_DDDPRINT("fast loop first group was clean, second was not, process one slow path group")); DUK_ASSERT(t2 < 0); p += 4; q += 3; break; } else { - DUK_DDD(DUK_DDDPRINT("fast loop first group was not clean, second does not matter, process one slow path group")); + DUK_DDD(DUK_DDDPRINT( + "fast loop first group was not clean, second does not matter, process one slow path group")); DUK_ASSERT(t1 < 0); break; } - } /* fast path */ + } /* fast path */ /* Slow path step 1: try to scan a 4-character encoded group, * end-of-input, or start-of-padding. We exit with: @@ -15387,7 +16098,9 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ t = 1UL; for (;;) { DUK_DDD(DUK_DDDPRINT("slow loop: p=%p, p_end=%p, t=%lu", - (const void *) p, (const void *) p_end, (unsigned long) t)); + (const void *) p, + (const void *) p_end, + (unsigned long) t)); if (DUK_LIKELY(p < p_end)) { x = duk__base64_dectab_fast[*p++]; @@ -15398,18 +16111,18 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ break; } } else if (x == -1) { - continue; /* allowed ascii whitespace */ + continue; /* allowed ascii whitespace */ } else if (x == -2) { p--; - break; /* start of padding */ + break; /* start of padding */ } else { DUK_ASSERT(x == -3); goto decode_error; } } else { - break; /* end of input */ + break; /* end of input */ } - } /* slow path step 1 */ + } /* slow path step 1 */ /* Complete the padding by simulating pad characters, * regardless of actual input padding chars. @@ -15468,28 +16181,30 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ } x = duk__base64_dectab_fast[*p++]; if (x == -1 || x == -2) { - ; /* padding or whitespace, keep eating */ + ; /* padding or whitespace, keep eating */ } else { p--; - break; /* backtrack and go back to fast path, even for -1 */ + break; /* backtrack and go back to fast path, even for -1 */ } - } /* slow path step 3 */ - } /* outer fast+slow path loop */ + } /* slow path step 3 */ + } /* outer fast+slow path loop */ - done: - DUK_DDD(DUK_DDDPRINT("done; p=%p, p_end=%p", - (const void *) p, (const void *) p_end)); +done: + DUK_DDD(DUK_DDDPRINT("done; p=%p, p_end=%p", (const void *) p, (const void *) p_end)); DUK_ASSERT(p == p_end); *out_dst_final = q; return 1; - decode_error: +decode_error: return 0; } -#else /* DUK_USE_BASE64_FASTPATH */ -DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_t srclen, duk_uint8_t *dst, duk_uint8_t **out_dst_final) { +#else /* DUK_USE_BASE64_FASTPATH */ +DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, + duk_size_t srclen, + duk_uint8_t *dst, + duk_uint8_t **out_dst_final) { duk_uint_t t, x; duk_int_t y; duk_int8_t step; @@ -15575,7 +16290,7 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ } else { /* Valid: whitespace. */ duk_uint32_t m; - DUK_ASSERT(x < 0x20U); /* 0x00 to 0x1f */ + DUK_ASSERT(x < 0x20U); /* 0x00 to 0x1f */ m = (1U << x); if (mask_white & m) { /* Allow basic ASCII whitespace. */ @@ -15592,7 +16307,7 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ } /* fall through; no padding will be added */ - simulate_padding: + simulate_padding: n_equal = 0; while (t < 0x1000000UL) { t = (t << 6) + 0U; @@ -15624,10 +16339,10 @@ DUK_LOCAL duk_bool_t duk__base64_decode_helper(const duk_uint8_t *src, duk_size_ *out_dst_final = q; return 1; - decode_error: +decode_error: return 0; } -#endif /* DUK_USE_BASE64_FASTPATH */ +#endif /* DUK_USE_BASE64_FASTPATH */ DUK_EXTERNAL const char *duk_base64_encode(duk_hthread *thr, duk_idx_t idx) { const duk_uint8_t *src; @@ -15656,11 +16371,11 @@ DUK_EXTERNAL const char *duk_base64_encode(duk_hthread *thr, duk_idx_t idx) { duk__base64_encode_helper((const duk_uint8_t *) src, srclen, dst); - ret = duk_buffer_to_string(thr, -1); /* Safe, result is ASCII. */ + ret = duk_buffer_to_string(thr, -1); /* Safe, result is ASCII. */ duk_replace(thr, idx); return ret; - type_error: +type_error: DUK_ERROR_TYPE(thr, DUK_STR_BASE64_ENCODE_FAILED); DUK_WO_NORETURN(return NULL;); } @@ -15685,7 +16400,7 @@ DUK_EXTERNAL void duk_base64_decode(duk_hthread *thr, duk_idx_t idx) { * Similarly, 'xx' may ecause 1+3 = bytes to be emitted and then * backtracked. */ - dstlen = (srclen / 4) * 3 + 6; /* upper limit, assuming no whitespace etc */ + dstlen = (srclen / 4) * 3 + 6; /* upper limit, assuming no whitespace etc */ dst = (duk_uint8_t *) duk_push_dynamic_buffer(thr, dstlen); /* Note: for dstlen=0, dst may be NULL */ @@ -15698,11 +16413,11 @@ DUK_EXTERNAL void duk_base64_decode(duk_hthread *thr, duk_idx_t idx) { duk_replace(thr, idx); return; - type_error: +type_error: DUK_ERROR_TYPE(thr, DUK_STR_BASE64_DECODE_FAILED); DUK_WO_NORETURN(return;); } -#else /* DUK_USE_BASE64_SUPPORT */ +#else /* DUK_USE_BASE64_SUPPORT */ DUK_EXTERNAL const char *duk_base64_encode(duk_hthread *thr, duk_idx_t idx) { DUK_UNREF(idx); DUK_ERROR_UNSUPPORTED(thr); @@ -15714,7 +16429,7 @@ DUK_EXTERNAL void duk_base64_decode(duk_hthread *thr, duk_idx_t idx) { DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_BASE64_SUPPORT */ +#endif /* DUK_USE_BASE64_SUPPORT */ /* * Hex @@ -15743,7 +16458,7 @@ DUK_EXTERNAL const char *duk_hex_encode(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(buf != NULL); #if defined(DUK_USE_HEX_FASTPATH) - DUK_ASSERT((((duk_size_t) buf) & 0x01U) == 0); /* pointer is aligned, guaranteed for fixed buffer */ + DUK_ASSERT((((duk_size_t) buf) & 0x01U) == 0); /* pointer is aligned, guaranteed for fixed buffer */ p16 = (duk_uint16_t *) (void *) buf; len_safe = len & ~0x03U; for (i = 0; i < len_safe; i += 4) { @@ -15756,14 +16471,14 @@ DUK_EXTERNAL const char *duk_hex_encode(duk_hthread *thr, duk_idx_t idx) { for (; i < len; i++) { *p16++ = duk_hex_enctab[inp[i]]; } -#else /* DUK_USE_HEX_FASTPATH */ +#else /* DUK_USE_HEX_FASTPATH */ for (i = 0; i < len; i++) { duk_small_uint_t t; t = (duk_small_uint_t) inp[i]; - buf[i*2 + 0] = duk_lc_digits[t >> 4]; - buf[i*2 + 1] = duk_lc_digits[t & 0x0f]; + buf[i * 2 + 0] = duk_lc_digits[t >> 4]; + buf[i * 2 + 1] = duk_lc_digits[t & 0x0f]; } -#endif /* DUK_USE_HEX_FASTPATH */ +#endif /* DUK_USE_HEX_FASTPATH */ /* XXX: Using a string return value forces a string intern which is * not always necessary. As a rough performance measure, hex encode @@ -15772,7 +16487,7 @@ DUK_EXTERNAL const char *duk_hex_encode(duk_hthread *thr, duk_idx_t idx) { * caller coerce to string if necessary? */ - ret = duk_buffer_to_string(thr, -1); /* Safe, result is ASCII. */ + ret = duk_buffer_to_string(thr, -1); /* Safe, result is ASCII. */ duk_replace(thr, idx); return ret; } @@ -15807,20 +16522,16 @@ DUK_EXTERNAL void duk_hex_decode(duk_hthread *thr, duk_idx_t idx) { p = buf; len_safe = len & ~0x07U; for (i = 0; i < len_safe; i += 8) { - t = ((duk_int_t) duk_hex_dectab_shift4[inp[i]]) | - ((duk_int_t) duk_hex_dectab[inp[i + 1]]); + t = ((duk_int_t) duk_hex_dectab_shift4[inp[i]]) | ((duk_int_t) duk_hex_dectab[inp[i + 1]]); chk = t; p[0] = (duk_uint8_t) t; - t = ((duk_int_t) duk_hex_dectab_shift4[inp[i + 2]]) | - ((duk_int_t) duk_hex_dectab[inp[i + 3]]); + t = ((duk_int_t) duk_hex_dectab_shift4[inp[i + 2]]) | ((duk_int_t) duk_hex_dectab[inp[i + 3]]); chk |= t; p[1] = (duk_uint8_t) t; - t = ((duk_int_t) duk_hex_dectab_shift4[inp[i + 4]]) | - ((duk_int_t) duk_hex_dectab[inp[i + 5]]); + t = ((duk_int_t) duk_hex_dectab_shift4[inp[i + 4]]) | ((duk_int_t) duk_hex_dectab[inp[i + 5]]); chk |= t; p[2] = (duk_uint8_t) t; - t = ((duk_int_t) duk_hex_dectab_shift4[inp[i + 6]]) | - ((duk_int_t) duk_hex_dectab[inp[i + 7]]); + t = ((duk_int_t) duk_hex_dectab_shift4[inp[i + 6]]) | ((duk_int_t) duk_hex_dectab[inp[i + 7]]); chk |= t; p[3] = (duk_uint8_t) t; p += 4; @@ -15842,7 +16553,7 @@ DUK_EXTERNAL void duk_hex_decode(duk_hthread *thr, duk_idx_t idx) { } *p++ = (duk_uint8_t) t; } -#else /* DUK_USE_HEX_FASTPATH */ +#else /* DUK_USE_HEX_FASTPATH */ for (i = 0; i < len; i += 2) { /* For invalid characters the value -1 gets extended to * at least 16 bits. If either nybble is invalid, the @@ -15855,16 +16566,16 @@ DUK_EXTERNAL void duk_hex_decode(duk_hthread *thr, duk_idx_t idx) { } buf[i >> 1] = (duk_uint8_t) t; } -#endif /* DUK_USE_HEX_FASTPATH */ +#endif /* DUK_USE_HEX_FASTPATH */ duk_replace(thr, idx); return; - type_error: +type_error: DUK_ERROR_TYPE(thr, DUK_STR_HEX_DECODE_FAILED); DUK_WO_NORETURN(return;); } -#else /* DUK_USE_HEX_SUPPORT */ +#else /* DUK_USE_HEX_SUPPORT */ DUK_EXTERNAL const char *duk_hex_encode(duk_hthread *thr, duk_idx_t idx) { DUK_UNREF(idx); DUK_ERROR_UNSUPPORTED(thr); @@ -15875,7 +16586,7 @@ DUK_EXTERNAL void duk_hex_decode(duk_hthread *thr, duk_idx_t idx) { DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_HEX_SUPPORT */ +#endif /* DUK_USE_HEX_SUPPORT */ /* * JSON @@ -15919,15 +16630,12 @@ DUK_EXTERNAL void duk_json_decode(duk_hthread *thr, duk_idx_t idx) { #endif idx = duk_require_normalize_index(thr, idx); - duk_bi_json_parse_helper(thr, - idx /*idx_value*/, - DUK_INVALID_INDEX /*idx_reviver*/, - 0 /*flags*/); + duk_bi_json_parse_helper(thr, idx /*idx_value*/, DUK_INVALID_INDEX /*idx_reviver*/, 0 /*flags*/); duk_replace(thr, idx); DUK_ASSERT(duk_get_top(thr) == top_at_entry); } -#else /* DUK_USE_JSON_SUPPORT */ +#else /* DUK_USE_JSON_SUPPORT */ DUK_EXTERNAL const char *duk_json_encode(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); DUK_UNREF(idx); @@ -15941,7 +16649,7 @@ DUK_EXTERNAL void duk_json_decode(duk_hthread *thr, duk_idx_t idx) { DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_JSON_SUPPORT */ +#endif /* DUK_USE_JSON_SUPPORT */ /* * Compilation and evaluation */ @@ -15950,7 +16658,7 @@ DUK_EXTERNAL void duk_json_decode(duk_hthread *thr, duk_idx_t idx) { typedef struct duk__compile_raw_args duk__compile_raw_args; struct duk__compile_raw_args { - duk_size_t src_length; /* should be first on 64-bit platforms */ + duk_size_t src_length; /* should be first on 64-bit platforms */ const duk_uint8_t *src_buffer; duk_uint_t flags; }; @@ -15970,7 +16678,10 @@ DUK_EXTERNAL duk_int_t duk_eval_raw(duk_hthread *thr, const char *src_buffer, du /* [ ... source? filename? ] (depends on flags) */ - rc = duk_compile_raw(thr, src_buffer, src_length, flags | DUK_COMPILE_EVAL); /* may be safe, or non-safe depending on flags */ + rc = duk_compile_raw(thr, + src_buffer, + src_length, + flags | DUK_COMPILE_EVAL); /* may be safe, or non-safe depending on flags */ /* [ ... closure/error ] */ @@ -15979,7 +16690,7 @@ DUK_EXTERNAL duk_int_t duk_eval_raw(duk_hthread *thr, const char *src_buffer, du goto got_rc; } - duk_push_global_object(thr); /* explicit 'this' binding, see GH-164 */ + duk_push_global_object(thr); /* explicit 'this' binding, see GH-164 */ if (flags & DUK_COMPILE_SAFE) { rc = duk_pcall_method(thr, 0); @@ -15990,7 +16701,7 @@ DUK_EXTERNAL duk_int_t duk_eval_raw(duk_hthread *thr, const char *src_buffer, du /* [ ... result/error ] */ - got_rc: +got_rc: if (flags & DUK_COMPILE_NORESULT) { duk_pop(thr); } @@ -16030,8 +16741,8 @@ DUK_LOCAL duk_ret_t duk__do_compile(duk_hthread *thr, void *udata) { duk_hstring *h_sourcecode; h_sourcecode = duk_get_hstring(thr, -2); - if ((flags & DUK_COMPILE_NOSOURCE) || /* args incorrect */ - (h_sourcecode == NULL)) { /* e.g. duk_push_string_file_raw() pushed undefined */ + if ((flags & DUK_COMPILE_NOSOURCE) || /* args incorrect */ + (h_sourcecode == NULL)) { /* e.g. duk_push_string_file_raw() pushed undefined */ DUK_ERROR_TYPE(thr, DUK_STR_NO_SOURCECODE); DUK_WO_NORETURN(return 0;); } @@ -16061,11 +16772,11 @@ DUK_LOCAL duk_ret_t duk__do_compile(duk_hthread *thr, void *udata) { h_templ = (duk_hcompfunc *) duk_known_hobject(thr, -1); duk_js_push_closure(thr, - h_templ, - thr->builtins[DUK_BIDX_GLOBAL_ENV], - thr->builtins[DUK_BIDX_GLOBAL_ENV], - 1 /*add_auto_proto*/); - duk_remove_m2(thr); /* -> [ ... closure ] */ + h_templ, + thr->builtins[DUK_BIDX_GLOBAL_ENV], + thr->builtins[DUK_BIDX_GLOBAL_ENV], + 1 /*add_auto_proto*/); + duk_remove_m2(thr); /* -> [ ... closure ] */ /* [ ... closure ] */ @@ -16101,8 +16812,7 @@ DUK_EXTERNAL duk_int_t duk_compile_raw(duk_hthread *thr, const char *src_buffer, * directly into flags. */ nargs = flags & 0x07; - DUK_ASSERT(nargs == ((flags & DUK_COMPILE_NOSOURCE) ? 0 : 1) + - ((flags & DUK_COMPILE_NOFILENAME) ? 0 : 1)); + DUK_ASSERT(nargs == ((flags & DUK_COMPILE_NOSOURCE) ? 0 : 1) + ((flags & DUK_COMPILE_NOFILENAME) ? 0 : 1)); rc = duk_safe_call(thr, duk__do_compile, (void *) comp_args, nargs, nrets); /* [ ... closure ] */ @@ -16142,25 +16852,24 @@ DUK_EXTERNAL void duk_push_context_dump(duk_hthread *thr) { * Perhaps values need to be coerced individually? */ duk_bi_json_stringify_helper(thr, - duk_get_top_index(thr), /*idx_value*/ - DUK_INVALID_INDEX, /*idx_replacer*/ - DUK_INVALID_INDEX, /*idx_space*/ - DUK_JSON_FLAG_EXT_CUSTOM | - DUK_JSON_FLAG_ASCII_ONLY | - DUK_JSON_FLAG_AVOID_KEY_QUOTES /*flags*/); + duk_get_top_index(thr), /*idx_value*/ + DUK_INVALID_INDEX, /*idx_replacer*/ + DUK_INVALID_INDEX, /*idx_space*/ + DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_ASCII_ONLY | + DUK_JSON_FLAG_AVOID_KEY_QUOTES /*flags*/); duk_push_sprintf(thr, "ctx: top=%ld, stack=%s", (long) top, (const char *) duk_safe_to_string(thr, -1)); - duk_replace(thr, -3); /* [ ... arr jsonx(arr) res ] -> [ ... res jsonx(arr) ] */ + duk_replace(thr, -3); /* [ ... arr jsonx(arr) res ] -> [ ... res jsonx(arr) ] */ duk_pop(thr); DUK_ASSERT(duk_is_string(thr, -1)); } -#else /* DUK_USE_JSON_SUPPORT */ +#else /* DUK_USE_JSON_SUPPORT */ DUK_EXTERNAL void duk_push_context_dump(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_JSON_SUPPORT */ +#endif /* DUK_USE_JSON_SUPPORT */ #if defined(DUK_USE_DEBUGGER_SUPPORT) @@ -16209,12 +16918,13 @@ DUK_EXTERNAL void duk_debugger_attach(duk_hthread *thr, heap->dbg_exec_counter = 0; heap->dbg_last_counter = 0; heap->dbg_last_time = 0.0; - duk_debug_set_paused(heap); /* XXX: overlap with fields above */ + duk_debug_set_paused(heap); /* XXX: overlap with fields above */ /* Send version identification and flush right afterwards. Note that * we must write raw, unframed bytes here. */ - duk_push_sprintf(thr, "%ld %ld %s %s\n", + duk_push_sprintf(thr, + "%ld %ld %s %s\n", (long) DUK_DEBUG_PROTOCOL_VERSION, (long) DUK_VERSION, (const char *) DUK_GIT_DESCRIBE, @@ -16316,7 +17026,7 @@ DUK_EXTERNAL void duk_debugger_pause(duk_hthread *thr) { } } -#else /* DUK_USE_DEBUGGER_SUPPORT */ +#else /* DUK_USE_DEBUGGER_SUPPORT */ DUK_EXTERNAL void duk_debugger_attach(duk_hthread *thr, duk_debug_read_function read_cb, @@ -16374,7 +17084,7 @@ DUK_EXTERNAL void duk_debugger_pause(duk_hthread *thr) { DUK_UNREF(thr); } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ /* * Heap creation and destruction */ @@ -16462,7 +17172,7 @@ DUK_EXTERNAL void duk_suspend(duk_hthread *thr, duk_thread_state *state) { DUK_ASSERT_API_ENTRY(thr); DUK_ASSERT(thr->heap != NULL); - DUK_ASSERT(state != NULL); /* unvalidated */ + DUK_ASSERT(state != NULL); /* unvalidated */ /* Currently not supported when called from within a finalizer. * If that is done, the finalizer will remain running indefinitely, @@ -16506,7 +17216,7 @@ DUK_EXTERNAL void duk_resume(duk_hthread *thr, const duk_thread_state *state) { DUK_ASSERT_API_ENTRY(thr); DUK_ASSERT(thr->heap != NULL); - DUK_ASSERT(state != NULL); /* unvalidated */ + DUK_ASSERT(state != NULL); /* unvalidated */ /* Shouldn't be necessary if duk_suspend() is called before * duk_resume(), but assert in case API sequence is incorrect. @@ -16548,7 +17258,7 @@ DUK_EXTERNAL void duk_set_global_object(duk_hthread *thr) { DUK_UNREF(h_prev_glob); thr->builtins[DUK_BIDX_GLOBAL] = h_glob; DUK_HOBJECT_INCREF(thr, h_glob); - DUK_HOBJECT_DECREF_ALLOWNULL(thr, h_prev_glob); /* side effects, in theory (referenced by global env) */ + DUK_HOBJECT_DECREF_ALLOWNULL(thr, h_prev_glob); /* side effects, in theory (referenced by global env) */ /* * Replace lexical environment for global scope @@ -16559,9 +17269,7 @@ DUK_EXTERNAL void duk_set_global_object(duk_hthread *thr) { * same (initial) built-ins. */ - h_env = duk_hobjenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); + h_env = duk_hobjenv_alloc(thr, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); DUK_ASSERT(h_env != NULL); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) h_env) == NULL); @@ -16576,8 +17284,8 @@ DUK_EXTERNAL void duk_set_global_object(duk_hthread *thr) { h_prev_env = thr->builtins[DUK_BIDX_GLOBAL_ENV]; thr->builtins[DUK_BIDX_GLOBAL_ENV] = (duk_hobject *) h_env; DUK_HOBJECT_INCREF(thr, (duk_hobject *) h_env); - DUK_HOBJECT_DECREF_ALLOWNULL(thr, h_prev_env); /* side effects */ - DUK_UNREF(h_env); /* without refcounts */ + DUK_HOBJECT_DECREF_ALLOWNULL(thr, h_prev_env); /* side effects */ + DUK_UNREF(h_env); /* without refcounts */ DUK_UNREF(h_prev_env); /* [ ... new_glob ] */ @@ -16627,20 +17335,20 @@ DUK_LOCAL void duk__inspect_multiple_uint(duk_hthread *thr, const char *fmt, duk * be security implications. */ -#define DUK__IDX_TYPE 0 -#define DUK__IDX_ITAG 1 -#define DUK__IDX_REFC 2 -#define DUK__IDX_HBYTES 3 -#define DUK__IDX_CLASS 4 -#define DUK__IDX_PBYTES 5 -#define DUK__IDX_ESIZE 6 -#define DUK__IDX_ENEXT 7 -#define DUK__IDX_ASIZE 8 -#define DUK__IDX_HSIZE 9 -#define DUK__IDX_BCBYTES 10 -#define DUK__IDX_DBYTES 11 -#define DUK__IDX_TSTATE 12 -#define DUK__IDX_VARIANT 13 +#define DUK__IDX_TYPE 0 +#define DUK__IDX_ITAG 1 +#define DUK__IDX_REFC 2 +#define DUK__IDX_HBYTES 3 +#define DUK__IDX_CLASS 4 +#define DUK__IDX_PBYTES 5 +#define DUK__IDX_ESIZE 6 +#define DUK__IDX_ENEXT 7 +#define DUK__IDX_ASIZE 8 +#define DUK__IDX_HSIZE 9 +#define DUK__IDX_BCBYTES 10 +#define DUK__IDX_DBYTES 11 +#define DUK__IDX_TSTATE 12 +#define DUK__IDX_VARIANT 13 DUK_EXTERNAL void duk_inspect_value(duk_hthread *thr, duk_idx_t idx) { duk_tval *tv; @@ -16655,7 +17363,7 @@ DUK_EXTERNAL void duk_inspect_value(duk_hthread *thr, duk_idx_t idx) { /* Assume two's complement and set everything to -1. */ duk_memset((void *) &vals, (int) 0xff, sizeof(vals)); - DUK_ASSERT(vals[DUK__IDX_TYPE] == -1); /* spot check one */ + DUK_ASSERT(vals[DUK__IDX_TYPE] == -1); /* spot check one */ tv = duk_get_tval_or_unused(thr, idx); h = (DUK_TVAL_IS_HEAP_ALLOCATED(tv) ? DUK_TVAL_GET_HEAPHDR(tv) : NULL); @@ -16663,7 +17371,7 @@ DUK_EXTERNAL void duk_inspect_value(duk_hthread *thr, duk_idx_t idx) { vals[DUK__IDX_TYPE] = duk_get_type_tval(tv); vals[DUK__IDX_ITAG] = (duk_int_t) DUK_TVAL_GET_TAG(tv); - duk_push_bare_object(thr); /* Invalidates 'tv'. */ + duk_push_bare_object(thr); /* Invalidates 'tv'. */ tv = NULL; if (h == NULL) { @@ -16745,30 +17453,56 @@ DUK_EXTERNAL void duk_inspect_value(duk_hthread *thr, duk_idx_t idx) { if (DUK_HBUFFER_HAS_DYNAMIC(h_buf)) { if (DUK_HBUFFER_HAS_EXTERNAL(h_buf)) { - vals[DUK__IDX_VARIANT] = 2; /* buffer variant 2: external */ + vals[DUK__IDX_VARIANT] = 2; /* buffer variant 2: external */ vals[DUK__IDX_HBYTES] = (duk_uint_t) (sizeof(duk_hbuffer_external)); } else { /* When alloc_size == 0 the second allocation may not * actually exist. */ - vals[DUK__IDX_VARIANT] = 1; /* buffer variant 1: dynamic */ + vals[DUK__IDX_VARIANT] = 1; /* buffer variant 1: dynamic */ vals[DUK__IDX_HBYTES] = (duk_uint_t) (sizeof(duk_hbuffer_dynamic)); } vals[DUK__IDX_DBYTES] = (duk_int_t) (DUK_HBUFFER_GET_SIZE(h_buf)); } else { - DUK_ASSERT(vals[DUK__IDX_VARIANT] == 0); /* buffer variant 0: fixed */ + DUK_ASSERT(vals[DUK__IDX_VARIANT] == 0); /* buffer variant 0: fixed */ vals[DUK__IDX_HBYTES] = (duk_int_t) (sizeof(duk_hbuffer_fixed) + DUK_HBUFFER_GET_SIZE(h_buf)); } break; } } - finish: +finish: duk__inspect_multiple_uint(thr, - "type" "\x00" "itag" "\x00" "refc" "\x00" "hbytes" "\x00" "class" "\x00" - "pbytes" "\x00" "esize" "\x00" "enext" "\x00" "asize" "\x00" "hsize" "\x00" - "bcbytes" "\x00" "dbytes" "\x00" "tstate" "\x00" "variant" "\x00" "\x00", - (duk_int_t *) &vals); + "type" + "\x00" + "itag" + "\x00" + "refc" + "\x00" + "hbytes" + "\x00" + "class" + "\x00" + "pbytes" + "\x00" + "esize" + "\x00" + "enext" + "\x00" + "asize" + "\x00" + "hsize" + "\x00" + "bcbytes" + "\x00" + "dbytes" + "\x00" + "tstate" + "\x00" + "variant" + "\x00" + "\x00", + (duk_int_t *) &vals); } DUK_EXTERNAL void duk_inspect_callstack_entry(duk_hthread *thr, duk_int_t level) { @@ -16907,7 +17641,7 @@ DUK_EXTERNAL void duk_gc(duk_hthread *thr, duk_uint_t flags) { DUK_ASSERT(heap != NULL); DUK_D(DUK_DPRINT("mark-and-sweep requested by application")); - DUK_ASSERT(DUK_GC_COMPACT == DUK_MS_FLAG_EMERGENCY); /* Compact flag is 1:1 with emergency flag which forces compaction. */ + DUK_ASSERT(DUK_GC_COMPACT == DUK_MS_FLAG_EMERGENCY); /* Compact flag is 1:1 with emergency flag which forces compaction. */ ms_flags = (duk_small_uint_t) flags; duk_heap_mark_and_sweep(heap, ms_flags); } @@ -16943,9 +17677,9 @@ DUK_EXTERNAL duk_bool_t duk_get_prop(duk_hthread *thr, duk_idx_t obj_idx) { DUK_ASSERT(rc == 0 || rc == 1); /* a value is left on stack regardless of rc */ - duk_remove_m2(thr); /* remove key */ + duk_remove_m2(thr); /* remove key */ DUK_ASSERT(duk_is_undefined(thr, -1) || rc == 1); - return rc; /* 1 if property found, 0 otherwise */ + return rc; /* 1 if property found, 0 otherwise */ } DUK_EXTERNAL duk_bool_t duk_get_prop_string(duk_hthread *thr, duk_idx_t obj_idx, const char *key) { @@ -16990,7 +17724,7 @@ DUK_EXTERNAL duk_bool_t duk_get_prop_heapptr(duk_hthread *thr, duk_idx_t obj_idx DUK_ASSERT_API_ENTRY(thr); obj_idx = duk_require_normalize_index(thr, obj_idx); - (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ + (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ return duk_get_prop(thr, obj_idx); } @@ -17004,11 +17738,13 @@ DUK_INTERNAL duk_bool_t duk_get_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, } DUK_INTERNAL duk_bool_t duk_get_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args) { - return duk_get_prop_stridx(thr, (duk_idx_t) (duk_int16_t) (packed_args >> 16), - (duk_small_uint_t) (packed_args & 0xffffUL)); + return duk_get_prop_stridx(thr, (duk_idx_t) (duk_int16_t) (packed_args >> 16), (duk_small_uint_t) (packed_args & 0xffffUL)); } -DUK_INTERNAL duk_bool_t duk_get_prop_stridx_boolean(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx, duk_bool_t *out_has_prop) { +DUK_INTERNAL duk_bool_t duk_get_prop_stridx_boolean(duk_hthread *thr, + duk_idx_t obj_idx, + duk_small_uint_t stridx, + duk_bool_t *out_has_prop) { duk_bool_t rc; DUK_ASSERT_API_ENTRY(thr); @@ -17053,7 +17789,7 @@ DUK_INTERNAL duk_bool_t duk_xget_owndataprop(duk_hthread *thr, duk_idx_t obj_idx } duk_push_tval(thr, tv_val); - duk_remove_m2(thr); /* remove key */ + duk_remove_m2(thr); /* remove key */ return 1; } @@ -17068,7 +17804,8 @@ DUK_INTERNAL duk_bool_t duk_xget_owndataprop_stridx(duk_hthread *thr, duk_idx_t } DUK_INTERNAL duk_bool_t duk_xget_owndataprop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args) { - return duk_xget_owndataprop_stridx(thr, (duk_idx_t) (duk_int16_t) (packed_args >> 16), + return duk_xget_owndataprop_stridx(thr, + (duk_idx_t) (duk_int16_t) (packed_args >> 16), (duk_small_uint_t) (packed_args & 0xffffUL)); } @@ -17087,8 +17824,7 @@ DUK_LOCAL duk_bool_t duk__put_prop_shared(duk_hthread *thr, duk_idx_t obj_idx, d /* Key and value indices are either (-2, -1) or (-1, -2). Given idx_key, * idx_val is always (idx_key ^ 0x01). */ - DUK_ASSERT((idx_key == -2 && (idx_key ^ 1) == -1) || - (idx_key == -1 && (idx_key ^ 1) == -2)); + DUK_ASSERT((idx_key == -2 && (idx_key ^ 1) == -1) || (idx_key == -1 && (idx_key ^ 1) == -2)); /* XXX: Direct access; faster validation. */ tv_obj = duk_require_tval(thr, obj_idx); tv_key = duk_require_tval(thr, idx_key); @@ -17098,8 +17834,8 @@ DUK_LOCAL duk_bool_t duk__put_prop_shared(duk_hthread *thr, duk_idx_t obj_idx, d rc = duk_hobject_putprop(thr, tv_obj, tv_key, tv_val, throw_flag); DUK_ASSERT(rc == 0 || rc == 1); - duk_pop_2(thr); /* remove key and value */ - return rc; /* 1 if property found, 0 otherwise */ + duk_pop_2(thr); /* remove key and value */ + return rc; /* 1 if property found, 0 otherwise */ } DUK_EXTERNAL duk_bool_t duk_put_prop(duk_hthread *thr, duk_idx_t obj_idx) { @@ -17153,11 +17889,10 @@ DUK_EXTERNAL duk_bool_t duk_put_prop_heapptr(duk_hthread *thr, duk_idx_t obj_idx DUK_ASSERT_API_ENTRY(thr); obj_idx = duk_require_normalize_index(thr, obj_idx); - (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ + (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ return duk__put_prop_shared(thr, obj_idx, -1); } - DUK_INTERNAL duk_bool_t duk_put_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx) { DUK_ASSERT_API_ENTRY(thr); DUK_ASSERT_STRIDX_VALID(stridx); @@ -17168,8 +17903,7 @@ DUK_INTERNAL duk_bool_t duk_put_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, } DUK_INTERNAL duk_bool_t duk_put_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args) { - return duk_put_prop_stridx(thr, (duk_idx_t) (duk_int16_t) (packed_args >> 16), - (duk_small_uint_t) (packed_args & 0xffffUL)); + return duk_put_prop_stridx(thr, (duk_idx_t) (duk_int16_t) (packed_args >> 16), (duk_small_uint_t) (packed_args & 0xffffUL)); } DUK_EXTERNAL duk_bool_t duk_del_prop(duk_hthread *thr, duk_idx_t obj_idx) { @@ -17191,7 +17925,7 @@ DUK_EXTERNAL duk_bool_t duk_del_prop(duk_hthread *thr, duk_idx_t obj_idx) { rc = duk_hobject_delprop(thr, tv_obj, tv_key, throw_flag); DUK_ASSERT(rc == 0 || rc == 1); - duk_pop(thr); /* remove key */ + duk_pop(thr); /* remove key */ return rc; } @@ -17237,7 +17971,7 @@ DUK_EXTERNAL duk_bool_t duk_del_prop_heapptr(duk_hthread *thr, duk_idx_t obj_idx DUK_ASSERT_API_ENTRY(thr); obj_idx = duk_require_normalize_index(thr, obj_idx); - (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ + (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ return duk_del_prop(thr, obj_idx); } @@ -17274,8 +18008,8 @@ DUK_EXTERNAL duk_bool_t duk_has_prop(duk_hthread *thr, duk_idx_t obj_idx) { rc = duk_hobject_hasprop(thr, tv_obj, tv_key); DUK_ASSERT(rc == 0 || rc == 1); - duk_pop(thr); /* remove key */ - return rc; /* 1 if property found, 0 otherwise */ + duk_pop(thr); /* remove key */ + return rc; /* 1 if property found, 0 otherwise */ } DUK_EXTERNAL duk_bool_t duk_has_prop_string(duk_hthread *thr, duk_idx_t obj_idx, const char *key) { @@ -17320,7 +18054,7 @@ DUK_EXTERNAL duk_bool_t duk_has_prop_heapptr(duk_hthread *thr, duk_idx_t obj_idx DUK_ASSERT_API_ENTRY(thr); obj_idx = duk_require_normalize_index(thr, obj_idx); - (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ + (void) duk_push_heapptr(thr, ptr); /* NULL -> 'undefined' */ return duk_has_prop(thr, obj_idx); } @@ -17359,7 +18093,7 @@ DUK_INTERNAL void duk_xdef_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_small_u duk_hobject_define_property_internal(thr, obj, key, desc_flags); - duk_pop(thr); /* pop key */ + duk_pop(thr); /* pop key */ } DUK_INTERNAL void duk_xdef_prop_index(duk_hthread *thr, duk_idx_t obj_idx, duk_uarridx_t arr_idx, duk_small_uint_t desc_flags) { @@ -17392,12 +18126,13 @@ DUK_INTERNAL void duk_xdef_prop_stridx(duk_hthread *thr, duk_idx_t obj_idx, duk_ } DUK_INTERNAL void duk_xdef_prop_stridx_short_raw(duk_hthread *thr, duk_uint_t packed_args) { - duk_xdef_prop_stridx(thr, (duk_idx_t) (duk_int8_t) (packed_args >> 24), - (duk_small_uint_t) (packed_args >> 8) & 0xffffUL, - (duk_small_uint_t) (packed_args & 0xffL)); + duk_xdef_prop_stridx(thr, + (duk_idx_t) (duk_int8_t) (packed_args >> 24), + (duk_small_uint_t) (packed_args >> 8) & 0xffffUL, + (duk_small_uint_t) (packed_args & 0xffL)); } -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL void duk_xdef_prop_stridx_builtin(duk_hthread *thr, duk_idx_t obj_idx, duk_small_uint_t stridx, duk_small_int_t builtin_idx, duk_small_uint_t desc_flags) { duk_hobject *obj; duk_hstring *key; @@ -17429,15 +18164,15 @@ DUK_INTERNAL void duk_xdef_prop_stridx_thrower(duk_hthread *thr, duk_idx_t obj_i duk_push_hstring_stridx(thr, stridx); duk_push_hobject_bidx(thr, DUK_BIDX_TYPE_ERROR_THROWER); duk_dup_top(thr); - duk_def_prop(thr, obj_idx, DUK_DEFPROP_HAVE_SETTER | DUK_DEFPROP_HAVE_GETTER | DUK_DEFPROP_FORCE); /* attributes always 0 */ + duk_def_prop(thr, obj_idx, DUK_DEFPROP_HAVE_SETTER | DUK_DEFPROP_HAVE_GETTER | DUK_DEFPROP_FORCE); /* attributes always 0 */ } /* Object.getOwnPropertyDescriptor() equivalent C binding. */ DUK_EXTERNAL void duk_get_prop_desc(duk_hthread *thr, duk_idx_t obj_idx, duk_uint_t flags) { DUK_ASSERT_API_ENTRY(thr); - DUK_UNREF(flags); /* no flags defined yet */ + DUK_UNREF(flags); /* no flags defined yet */ - duk_hobject_object_get_own_property_descriptor(thr, obj_idx); /* [ ... key ] -> [ ... desc ] */ + duk_hobject_object_get_own_property_descriptor(thr, obj_idx); /* [ ... key ] -> [ ... desc ] */ } /* Object.defineProperty() equivalent C binding. */ @@ -17467,9 +18202,7 @@ DUK_EXTERNAL void duk_def_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_uint_t f idx_base = duk_get_top_index(thr); if (flags & DUK_DEFPROP_HAVE_SETTER) { - duk_require_type_mask(thr, idx_base, DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_LIGHTFUNC); + duk_require_type_mask(thr, idx_base, DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_LIGHTFUNC); set = duk_get_hobject_promote_lfunc(thr, idx_base); if (set != NULL && !DUK_HOBJECT_IS_CALLABLE(set)) { goto fail_not_callable; @@ -17479,9 +18212,7 @@ DUK_EXTERNAL void duk_def_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_uint_t f set = NULL; } if (flags & DUK_DEFPROP_HAVE_GETTER) { - duk_require_type_mask(thr, idx_base, DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_LIGHTFUNC); + duk_require_type_mask(thr, idx_base, DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_LIGHTFUNC); get = duk_get_hobject_promote_lfunc(thr, idx_base); if (get != NULL && !DUK_HOBJECT_IS_CALLABLE(get)) { goto fail_not_callable; @@ -17501,14 +18232,7 @@ DUK_EXTERNAL void duk_def_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_uint_t f duk_require_valid_index(thr, idx_base); - duk_hobject_define_property_helper(thr, - flags /*defprop_flags*/, - obj, - key, - idx_value, - get, - set, - 1 /*throw_flag*/); + duk_hobject_define_property_helper(thr, flags /*defprop_flags*/, obj, key, idx_value, get, set, 1 /*throw_flag*/); /* Clean up stack */ @@ -17518,11 +18242,11 @@ DUK_EXTERNAL void duk_def_prop(duk_hthread *thr, duk_idx_t obj_idx, duk_uint_t f return; - fail_invalid_desc: +fail_invalid_desc: DUK_ERROR_TYPE(thr, DUK_STR_INVALID_DESCRIPTOR); DUK_WO_NORETURN(return;); - fail_not_callable: +fail_not_callable: DUK_ERROR_TYPE(thr, DUK_STR_NOT_CALLABLE); DUK_WO_NORETURN(return;); } @@ -17556,7 +18280,7 @@ DUK_EXTERNAL void duk_enum(duk_hthread *thr, duk_idx_t obj_idx, duk_uint_t enum_ duk_dup(thr, obj_idx); duk_require_hobject_promote_mask(thr, -1, DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER); - duk_hobject_enumerator_create(thr, enum_flags); /* [target] -> [enum] */ + duk_hobject_enumerator_create(thr, enum_flags); /* [target] -> [enum] */ } DUK_EXTERNAL duk_bool_t duk_next(duk_hthread *thr, duk_idx_t enum_index, duk_bool_t get_value) { @@ -17617,8 +18341,8 @@ DUK_INTERNAL void duk_seal_freeze_raw(duk_hthread *thr, duk_idx_t obj_idx, duk_b } return; - fail_cannot_freeze: - DUK_ERROR_TYPE_INVALID_ARGS(thr); /* XXX: proper error message */ +fail_cannot_freeze: + DUK_ERROR_TYPE_INVALID_ARGS(thr); /* XXX: proper error message */ DUK_WO_NORETURN(return;); } @@ -17663,8 +18387,8 @@ DUK_EXTERNAL void duk_put_number_list(duk_hthread *thr, duk_idx_t obj_idx, const if (ent != NULL) { while (ent->key != NULL) { tv = thr->valstack_top++; - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(tv)); /* value stack init policy */ - DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, ent->value); /* no need for decref/incref */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(tv)); /* value stack init policy */ + DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(tv, ent->value); /* no need for decref/incref */ duk_put_prop_string(thr, obj_idx, ent->key); ent++; } @@ -17734,7 +18458,6 @@ DUK_EXTERNAL duk_bool_t duk_get_global_heapptr(duk_hthread *thr, void *ptr) { return ret; } - DUK_EXTERNAL duk_bool_t duk_put_global_string(duk_hthread *thr, const char *key) { duk_bool_t ret; @@ -17745,7 +18468,7 @@ DUK_EXTERNAL duk_bool_t duk_put_global_string(duk_hthread *thr, const char *key) duk_push_hobject(thr, thr->builtins[DUK_BIDX_GLOBAL]); duk_insert(thr, -2); - ret = duk_put_prop_string(thr, -2, key); /* [ ... global val ] -> [ ... global ] */ + ret = duk_put_prop_string(thr, -2, key); /* [ ... global val ] -> [ ... global ] */ duk_pop(thr); return ret; } @@ -17760,7 +18483,7 @@ DUK_EXTERNAL duk_bool_t duk_put_global_lstring(duk_hthread *thr, const char *key duk_push_hobject(thr, thr->builtins[DUK_BIDX_GLOBAL]); duk_insert(thr, -2); - ret = duk_put_prop_lstring(thr, -2, key, key_len); /* [ ... global val ] -> [ ... global ] */ + ret = duk_put_prop_lstring(thr, -2, key, key_len); /* [ ... global val ] -> [ ... global ] */ duk_pop(thr); return ret; } @@ -17777,7 +18500,7 @@ DUK_EXTERNAL duk_bool_t duk_put_global_literal_raw(duk_hthread *thr, const char duk_push_hobject(thr, thr->builtins[DUK_BIDX_GLOBAL]); duk_insert(thr, -2); - ret = duk_put_prop_literal_raw(thr, -2, key, key_len); /* [ ... global val ] -> [ ... global ] */ + ret = duk_put_prop_literal_raw(thr, -2, key, key_len); /* [ ... global val ] -> [ ... global ] */ duk_pop(thr); return ret; } @@ -17793,7 +18516,7 @@ DUK_EXTERNAL duk_bool_t duk_put_global_heapptr(duk_hthread *thr, void *ptr) { duk_push_hobject(thr, thr->builtins[DUK_BIDX_GLOBAL]); duk_insert(thr, -2); - ret = duk_put_prop_heapptr(thr, -2, ptr); /* [ ... global val ] -> [ ... global ] */ + ret = duk_put_prop_heapptr(thr, -2, ptr); /* [ ... global val ] -> [ ... global ] */ duk_pop(thr); return ret; } @@ -17845,14 +18568,13 @@ DUK_EXTERNAL void duk_set_prototype(duk_hthread *thr, duk_idx_t idx) { obj = duk_require_hobject(thr, idx); DUK_ASSERT(obj != NULL); - duk_require_type_mask(thr, -1, DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_OBJECT); + duk_require_type_mask(thr, -1, DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_OBJECT); proto = duk_get_hobject(thr, -1); /* proto can also be NULL here (allowed explicitly) */ #if defined(DUK_USE_ROM_OBJECTS) if (DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)) { - DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); /* XXX: "read only object"? */ + DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); /* XXX: "read only object"? */ DUK_WO_NORETURN(return;); } #endif @@ -17872,7 +18594,7 @@ DUK_INTERNAL void duk_clear_prototype(duk_hthread *thr, duk_idx_t idx) { #if defined(DUK_USE_ROM_OBJECTS) if (DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)) { - DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); /* XXX: "read only object"? */ + DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); /* XXX: "read only object"? */ DUK_WO_NORETURN(return;); } #endif @@ -17919,7 +18641,7 @@ DUK_EXTERNAL void duk_set_finalizer(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - h = duk_require_hobject(thr, idx); /* Get before 'put' so that 'idx' is correct. */ + h = duk_require_hobject(thr, idx); /* Get before 'put' so that 'idx' is correct. */ callable = duk_is_callable(thr, -1); /* At present finalizer is stored as a hidden Symbol, with normal @@ -17946,7 +18668,7 @@ DUK_EXTERNAL void duk_set_finalizer(duk_hthread *thr, duk_idx_t idx) { DUK_HOBJECT_CLEAR_HAVE_FINALIZER(h); } } -#else /* DUK_USE_FINALIZER_SUPPORT */ +#else /* DUK_USE_FINALIZER_SUPPORT */ DUK_EXTERNAL void duk_get_finalizer(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); DUK_UNREF(idx); @@ -17960,7 +18682,7 @@ DUK_EXTERNAL void duk_set_finalizer(duk_hthread *thr, duk_idx_t idx) { DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * Random numbers */ @@ -17968,7 +18690,7 @@ DUK_EXTERNAL void duk_set_finalizer(duk_hthread *thr, duk_idx_t idx) { /* #include duk_internal.h -> already included */ DUK_EXTERNAL duk_double_t duk_random(duk_hthread *thr) { - return (duk_double_t) DUK_UTIL_GET_RANDOM_DOUBLE(thr); + return (duk_double_t) duk_util_get_random_double(thr); } /* * API calls related to general value stack manipulation: resizing the value @@ -17988,7 +18710,8 @@ DUK_EXTERNAL duk_double_t duk_random(duk_hthread *thr) { * Forward declarations */ -DUK_LOCAL_DECL duk_idx_t duk__push_c_function_raw(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_uint_t flags, duk_small_uint_t proto_bidx); +DUK_LOCAL_DECL duk_idx_t +duk__push_c_function_raw(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_uint_t flags, duk_small_uint_t proto_bidx); /* * Global state for working around missing variadic macros @@ -18003,41 +18726,24 @@ DUK_EXTERNAL duk_int_t duk_api_global_line = 0; * Misc helpers */ -DUK_LOCAL const char * const duk__symbol_type_strings[4] = { - "hidden", "global", "local", "wellknown" -}; +DUK_LOCAL const char * const duk__symbol_type_strings[4] = { "hidden", "global", "local", "wellknown" }; #if !defined(DUK_USE_PACKED_TVAL) DUK_LOCAL const duk_uint_t duk__type_from_tag[] = { - DUK_TYPE_NUMBER, - DUK_TYPE_NUMBER, /* fastint */ - DUK_TYPE_UNDEFINED, - DUK_TYPE_NULL, - DUK_TYPE_BOOLEAN, - DUK_TYPE_POINTER, - DUK_TYPE_LIGHTFUNC, - DUK_TYPE_NONE, - DUK_TYPE_STRING, - DUK_TYPE_OBJECT, - DUK_TYPE_BUFFER, + DUK_TYPE_NUMBER, DUK_TYPE_NUMBER, /* fastint */ + DUK_TYPE_UNDEFINED, DUK_TYPE_NULL, DUK_TYPE_BOOLEAN, DUK_TYPE_POINTER, DUK_TYPE_LIGHTFUNC, + DUK_TYPE_NONE, DUK_TYPE_STRING, DUK_TYPE_OBJECT, DUK_TYPE_BUFFER, }; DUK_LOCAL const duk_uint_t duk__type_mask_from_tag[] = { - DUK_TYPE_MASK_NUMBER, - DUK_TYPE_MASK_NUMBER, /* fastint */ - DUK_TYPE_MASK_UNDEFINED, - DUK_TYPE_MASK_NULL, - DUK_TYPE_MASK_BOOLEAN, - DUK_TYPE_MASK_POINTER, - DUK_TYPE_MASK_LIGHTFUNC, - DUK_TYPE_MASK_NONE, - DUK_TYPE_MASK_STRING, - DUK_TYPE_MASK_OBJECT, - DUK_TYPE_MASK_BUFFER, + DUK_TYPE_MASK_NUMBER, DUK_TYPE_MASK_NUMBER, /* fastint */ + DUK_TYPE_MASK_UNDEFINED, DUK_TYPE_MASK_NULL, DUK_TYPE_MASK_BOOLEAN, DUK_TYPE_MASK_POINTER, DUK_TYPE_MASK_LIGHTFUNC, + DUK_TYPE_MASK_NONE, DUK_TYPE_MASK_STRING, DUK_TYPE_MASK_OBJECT, DUK_TYPE_MASK_BUFFER, }; -#endif /* !DUK_USE_PACKED_TVAL */ +#endif /* !DUK_USE_PACKED_TVAL */ /* Assert that there's room for one value. */ -#define DUK__ASSERT_SPACE() do { \ +#define DUK__ASSERT_SPACE() \ + do { \ DUK_ASSERT(!(thr->valstack_top >= thr->valstack_end)); \ } while (0) @@ -18046,7 +18752,8 @@ DUK_LOCAL const duk_uint_t duk__type_mask_from_tag[] = { /* Faster but value stack overruns are memory unsafe. */ #define DUK__CHECK_SPACE() DUK__ASSERT_SPACE() #else -#define DUK__CHECK_SPACE() do { \ +#define DUK__CHECK_SPACE() \ + do { \ if (DUK_UNLIKELY(thr->valstack_top >= thr->valstack_end)) { \ DUK_ERROR_RANGE_PUSH_BEYOND(thr); \ } \ @@ -18059,7 +18766,7 @@ DUK_LOCAL duk_small_uint_t duk__get_symbol_type(duk_hstring *h) { DUK_ASSERT(h != NULL); DUK_ASSERT(DUK_HSTRING_HAS_SYMBOL(h)); - DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(h) >= 1); /* always true, symbol prefix */ + DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(h) >= 1); /* always true, symbol prefix */ data = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h); len = DUK_HSTRING_GET_BYTELEN(h); @@ -18226,7 +18933,7 @@ DUK_EXTERNAL duk_idx_t duk_normalize_index(duk_hthread *thr, duk_idx_t idx) { /* Assume value stack sizes (in elements) fits into duk_idx_t. */ DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); vs_size = (duk_uidx_t) (thr->valstack_top - thr->valstack_bottom); - DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ if (idx < 0) { uidx = vs_size + (duk_uidx_t) idx; @@ -18254,7 +18961,7 @@ DUK_EXTERNAL duk_idx_t duk_require_normalize_index(duk_hthread *thr, duk_idx_t i DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); vs_size = (duk_uidx_t) (thr->valstack_top - thr->valstack_bottom); - DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ if (idx < 0) { uidx = vs_size + (duk_uidx_t) idx; @@ -18282,7 +18989,7 @@ DUK_INTERNAL duk_tval *duk_get_tval(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); vs_size = (duk_uidx_t) (thr->valstack_top - thr->valstack_bottom); - DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ if (idx < 0) { uidx = vs_size + (duk_uidx_t) idx; @@ -18329,7 +19036,7 @@ DUK_INTERNAL duk_tval *duk_require_tval(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); vs_size = (duk_uidx_t) (thr->valstack_top - thr->valstack_bottom); - DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(vs_size >= 0); /* unsigned */ /* Use unsigned arithmetic to optimize comparison. */ if (idx < 0) { @@ -18468,7 +19175,7 @@ DUK_EXTERNAL void duk_set_top(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(count > 0); tv = thr->valstack_top; tv_end = tv - count; - DUK_ASSERT(tv > tv_end); /* Because count > 0. */ + DUK_ASSERT(tv > tv_end); /* Because count > 0. */ do { tv--; DUK_ASSERT(tv >= thr->valstack_bottom); @@ -18476,7 +19183,7 @@ DUK_EXTERNAL void duk_set_top(duk_hthread *thr, duk_idx_t idx) { } while (tv != tv_end); thr->valstack_top = tv_end; DUK_REFZERO_CHECK_FAST(thr); -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ duk_uidx_t count; duk_tval *tv_end; @@ -18489,7 +19196,7 @@ DUK_EXTERNAL void duk_set_top(duk_hthread *thr, duk_idx_t idx) { DUK_TVAL_SET_UNDEFINED(tv); } while (tv != tv_end); thr->valstack_top = tv_end; -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ } } @@ -18500,7 +19207,7 @@ DUK_INTERNAL void duk_set_top_unsafe(duk_hthread *thr, duk_idx_t idx) { duk_set_top(thr, idx); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ DUK_INTERNAL void duk_set_top_unsafe(duk_hthread *thr, duk_idx_t idx) { duk_uidx_t uidx; duk_uidx_t vs_size; @@ -18539,7 +19246,7 @@ DUK_INTERNAL void duk_set_top_unsafe(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(count > 0); tv = thr->valstack_top; tv_end = tv - count; - DUK_ASSERT(tv > tv_end); /* Because count > 0. */ + DUK_ASSERT(tv > tv_end); /* Because count > 0. */ do { tv--; DUK_ASSERT(tv >= thr->valstack_bottom); @@ -18547,7 +19254,7 @@ DUK_INTERNAL void duk_set_top_unsafe(duk_hthread *thr, duk_idx_t idx) { } while (tv != tv_end); thr->valstack_top = tv_end; DUK_REFZERO_CHECK_FAST(thr); -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ duk_uidx_t count; duk_tval *tv_end; @@ -18560,10 +19267,10 @@ DUK_INTERNAL void duk_set_top_unsafe(duk_hthread *thr, duk_idx_t idx) { DUK_TVAL_SET_UNDEFINED(tv); } while (tv != tv_end); thr->valstack_top = tv_end; -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ } } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ /* Internal helper: set top to 'top', and set [idx_wipe_start,top[ to * 'undefined' (doing nothing if idx_wipe_start == top). Indices are @@ -18663,9 +19370,9 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE duk_bool_t duk__resize_valstack(duk_hthread *thr DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); DUK_ASSERT(thr->valstack_end >= thr->valstack_top); DUK_ASSERT(thr->valstack_alloc_end >= thr->valstack_end); - DUK_ASSERT((duk_size_t) (thr->valstack_top - thr->valstack) <= new_size); /* can't resize below 'top' */ - DUK_ASSERT(new_size <= DUK_USE_VALSTACK_LIMIT); /* valstack limit caller has check, prevents wrapping */ - DUK_ASSERT(new_size <= DUK_SIZE_MAX / sizeof(duk_tval)); /* specific assert for wrapping */ + DUK_ASSERT((duk_size_t) (thr->valstack_top - thr->valstack) <= new_size); /* can't resize below 'top' */ + DUK_ASSERT(new_size <= DUK_USE_VALSTACK_LIMIT); /* valstack limit caller has check, prevents wrapping */ + DUK_ASSERT(new_size <= DUK_SIZE_MAX / sizeof(duk_tval)); /* specific assert for wrapping */ /* Pre-realloc pointer copies for asserts and debug logs. */ pre_valstack = thr->valstack; @@ -18700,7 +19407,8 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE duk_bool_t duk__resize_valstack(duk_hthread *thr */ DUK_ASSERT(new_size != 0); DUK_D(DUK_DPRINT("failed to resize valstack to %lu entries (%lu bytes)", - (unsigned long) new_size, (unsigned long) new_alloc_size)); + (unsigned long) new_size, + (unsigned long) new_alloc_size)); return 0; } @@ -18711,23 +19419,28 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE duk_bool_t duk__resize_valstack(duk_hthread *thr #if defined(DUK_USE_DEBUG) if (thr->valstack != pre_valstack) { DUK_D(DUK_DPRINT("valstack base pointer changed during valstack resize: %p -> %p", - (void *) pre_valstack, (void *) thr->valstack)); + (void *) pre_valstack, + (void *) thr->valstack)); } if (thr->valstack_bottom != pre_bottom) { DUK_D(DUK_DPRINT("valstack bottom pointer changed during valstack resize: %p -> %p", - (void *) pre_bottom, (void *) thr->valstack_bottom)); + (void *) pre_bottom, + (void *) thr->valstack_bottom)); } if (thr->valstack_top != pre_top) { DUK_D(DUK_DPRINT("valstack top pointer changed during valstack resize: %p -> %p", - (void *) pre_top, (void *) thr->valstack_top)); + (void *) pre_top, + (void *) thr->valstack_top)); } if (thr->valstack_end != pre_end) { DUK_D(DUK_DPRINT("valstack end pointer changed during valstack resize: %p -> %p", - (void *) pre_end, (void *) thr->valstack_end)); + (void *) pre_end, + (void *) thr->valstack_end)); } if (thr->valstack_alloc_end != pre_alloc_end) { DUK_D(DUK_DPRINT("valstack alloc_end pointer changed during valstack resize: %p -> %p", - (void *) pre_alloc_end, (void *) thr->valstack_alloc_end)); + (void *) pre_alloc_end, + (void *) thr->valstack_alloc_end)); } #endif @@ -18766,12 +19479,22 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE duk_bool_t duk__resize_valstack(duk_hthread *thr (unsigned long) new_size, (unsigned long) ((duk_uint8_t *) pre_alloc_end - (duk_uint8_t *) pre_valstack), (unsigned long) new_alloc_size, - (void *) pre_valstack, (void *) thr->valstack, - (void *) pre_bottom, (void *) thr->valstack_bottom, (long) (thr->valstack_bottom - thr->valstack), - (void *) pre_top, (void *) thr->valstack_top, (long) (thr->valstack_top - thr->valstack), - (void *) pre_end, (void *) thr->valstack_end, (long) (thr->valstack_end - thr->valstack), - (void *) pre_alloc_end, (void *) thr->valstack_alloc_end, (long) (thr->valstack_alloc_end - thr->valstack), - (void *) tv_prev_alloc_end, (long) (thr->valstack_alloc_end - tv_prev_alloc_end))); + (void *) pre_valstack, + (void *) thr->valstack, + (void *) pre_bottom, + (void *) thr->valstack_bottom, + (long) (thr->valstack_bottom - thr->valstack), + (void *) pre_top, + (void *) thr->valstack_top, + (long) (thr->valstack_top - thr->valstack), + (void *) pre_end, + (void *) thr->valstack_end, + (long) (thr->valstack_end - thr->valstack), + (void *) pre_alloc_end, + (void *) thr->valstack_alloc_end, + (long) (thr->valstack_alloc_end - thr->valstack), + (void *) tv_prev_alloc_end, + (long) (thr->valstack_alloc_end - tv_prev_alloc_end))); /* If allocation grew, init any new slots to 'undefined'. */ p = tv_prev_alloc_end; @@ -18798,7 +19521,7 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE duk_bool_t duk__valstack_grow(duk_hthread *thr, duk_size_t new_size; DUK_ASSERT(min_bytes / sizeof(duk_tval) * sizeof(duk_tval) == min_bytes); - min_size = min_bytes / sizeof(duk_tval); /* from bytes to slots */ + min_size = min_bytes / sizeof(duk_tval); /* from bytes to slots */ #if defined(DUK_USE_VALSTACK_GROW_SHIFT) /* New size is minimum size plus a proportional slack, e.g. shift of @@ -18915,17 +19638,18 @@ DUK_INTERNAL void duk_valstack_shrink_check_nothrow(duk_hthread *thr, duk_bool_t #else slack = 0; #endif - shrink_bytes = reserve_bytes + - slack / sizeof(duk_tval) * sizeof(duk_tval); /* multiple of duk_tval */ + shrink_bytes = reserve_bytes + slack / sizeof(duk_tval) * sizeof(duk_tval); /* multiple of duk_tval */ } -#else /* DUK_USE_VALSTACK_SHRINK_CHECK_SHIFT */ +#else /* DUK_USE_VALSTACK_SHRINK_CHECK_SHIFT */ /* Always snug, useful in some low memory environments. */ DUK_UNREF(snug); shrink_bytes = reserve_bytes; -#endif /* DUK_USE_VALSTACK_SHRINK_CHECK_SHIFT */ +#endif /* DUK_USE_VALSTACK_SHRINK_CHECK_SHIFT */ DUK_D(DUK_DPRINT("valstack shrink check: alloc_bytes=%ld, reserve_bytes=%ld, shrink_bytes=%ld (unvalidated)", - (long) alloc_bytes, (long) reserve_bytes, (long) shrink_bytes)); + (long) alloc_bytes, + (long) reserve_bytes, + (long) shrink_bytes)); DUK_ASSERT(shrink_bytes >= reserve_bytes); if (shrink_bytes >= alloc_bytes) { /* Skip if shrink target is same as current one (or higher, @@ -19072,7 +19796,7 @@ DUK_EXTERNAL void duk_dup(duk_hthread *thr, duk_idx_t from_idx) { DUK_ASSERT(tv_from != NULL); DUK_ASSERT(tv_to != NULL); DUK_TVAL_SET_TVAL(tv_to, tv_from); - DUK_TVAL_INCREF(thr, tv_to); /* no side effects */ + DUK_TVAL_INCREF(thr, tv_to); /* no side effects */ } DUK_EXTERNAL void duk_dup_top(duk_hthread *thr) { @@ -19094,7 +19818,7 @@ DUK_EXTERNAL void duk_dup_top(duk_hthread *thr) { DUK_ASSERT(tv_from != NULL); DUK_ASSERT(tv_to != NULL); DUK_TVAL_SET_TVAL(tv_to, tv_from); - DUK_TVAL_INCREF(thr, tv_to); /* no side effects */ + DUK_TVAL_INCREF(thr, tv_to); /* no side effects */ #endif } @@ -19147,7 +19871,10 @@ DUK_EXTERNAL void duk_insert(duk_hthread *thr, duk_idx_t to_idx) { nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p)); DUK_DDD(DUK_DDDPRINT("duk_insert: to_idx=%ld, p=%p, q=%p, nbytes=%lu", - (long) to_idx, (void *) p, (void *) q, (unsigned long) nbytes)); + (long) to_idx, + (void *) p, + (void *) q, + (unsigned long) nbytes)); /* No net refcount changes. No need to special case nbytes == 0 * (p == q). @@ -19159,7 +19886,7 @@ DUK_EXTERNAL void duk_insert(duk_hthread *thr, duk_idx_t to_idx) { DUK_INTERNAL void duk_insert_undefined(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(idx >= 0); /* Doesn't support negative indices. */ + DUK_ASSERT(idx >= 0); /* Doesn't support negative indices. */ duk_push_undefined(thr); duk_insert(thr, idx); @@ -19169,7 +19896,7 @@ DUK_INTERNAL void duk_insert_undefined_n(duk_hthread *thr, duk_idx_t idx, duk_id duk_tval *tv, *tv_end; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(idx >= 0); /* Doesn't support negative indices or count. */ + DUK_ASSERT(idx >= 0); /* Doesn't support negative indices or count. */ DUK_ASSERT(count >= 0); tv = duk_reserve_gap(thr, idx, count); @@ -19204,7 +19931,10 @@ DUK_EXTERNAL void duk_pull(duk_hthread *thr, duk_idx_t from_idx) { nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p)); DUK_DDD(DUK_DDDPRINT("duk_pull: from_idx=%ld, p=%p, q=%p, nbytes=%lu", - (long) from_idx, (void *) p, (void *) q, (unsigned long) nbytes)); + (long) from_idx, + (void *) p, + (void *) q, + (unsigned long) nbytes)); /* No net refcount changes. No need to special case nbytes == 0 * (p == q). @@ -19233,7 +19963,7 @@ DUK_EXTERNAL void duk_replace(duk_hthread *thr, duk_idx_t to_idx) { DUK_TVAL_SET_TVAL(tv2, tv1); DUK_TVAL_SET_UNDEFINED(tv1); thr->valstack_top--; - DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */ + DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */ } DUK_EXTERNAL void duk_copy(duk_hthread *thr, duk_idx_t from_idx, duk_idx_t to_idx) { @@ -19248,7 +19978,7 @@ DUK_EXTERNAL void duk_copy(duk_hthread *thr, duk_idx_t from_idx, duk_idx_t to_id DUK_ASSERT(tv2 != NULL); /* For tv1 == tv2, this is a no-op (no explicit check needed). */ - DUK_TVAL_SET_TVAL_UPDREF(thr, tv2, tv1); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv2, tv1); /* side effects */ } DUK_EXTERNAL void duk_remove(duk_hthread *thr, duk_idx_t idx) { @@ -19279,21 +20009,21 @@ DUK_EXTERNAL void duk_remove(duk_hthread *thr, duk_idx_t idx) { DUK_TVAL_SET_TVAL(&tv_tmp, p); #endif - nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p)); /* Note: 'q' is top-1 */ + nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p)); /* Note: 'q' is top-1 */ duk_memmove((void *) p, (const void *) (p + 1), (size_t) nbytes); DUK_TVAL_SET_UNDEFINED(q); thr->valstack_top--; #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */ + DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */ #endif } DUK_INTERNAL void duk_remove_unsafe(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - duk_remove(thr, idx); /* XXX: no optimization for now */ + duk_remove(thr, idx); /* XXX: no optimization for now */ } DUK_INTERNAL void duk_remove_m2(duk_hthread *thr) { @@ -19312,7 +20042,7 @@ DUK_INTERNAL void duk_remove_n(duk_hthread *thr, duk_idx_t idx, duk_idx_t count) while (count-- > 0) { duk_remove(thr, idx); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ duk_tval *tv_src; duk_tval *tv_dst; duk_tval *tv_newtop; @@ -19344,13 +20074,13 @@ DUK_INTERNAL void duk_remove_n(duk_hthread *thr, duk_idx_t idx, duk_idx_t count) /* When not preferring size, only NORZ macros are used; caller * is expected to DUK_REFZERO_CHECK(). */ -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ } DUK_INTERNAL void duk_remove_n_unsafe(duk_hthread *thr, duk_idx_t idx, duk_idx_t count) { DUK_ASSERT_API_ENTRY(thr); - duk_remove_n(thr, idx, count); /* XXX: no optimization for now */ + duk_remove_n(thr, idx, count); /* XXX: no optimization for now */ } /* @@ -19411,7 +20141,7 @@ DUK_EXTERNAL void duk_xcopymove_raw(duk_hthread *to_thr, duk_hthread *from_thr, /* Incref copies, keep originals. */ q = to_thr->valstack_top; while (p < q) { - DUK_TVAL_INCREF(to_thr, p); /* no side effects */ + DUK_TVAL_INCREF(to_thr, p); /* no side effects */ p++; } } else { @@ -19511,7 +20241,7 @@ DUK_LOCAL DUK_ALWAYS_INLINE duk_bool_t duk__get_boolean_raw(duk_hthread *thr, du DUK_EXTERNAL duk_bool_t duk_get_boolean(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - return duk__get_boolean_raw(thr, idx, 0); /* default: false */ + return duk__get_boolean_raw(thr, idx, 0); /* default: false */ } DUK_EXTERNAL duk_bool_t duk_get_boolean_default(duk_hthread *thr, duk_idx_t idx, duk_bool_t def_value) { @@ -19557,11 +20287,10 @@ DUK_LOCAL DUK_ALWAYS_INLINE duk_double_t duk__get_number_raw(duk_hthread *thr, d DUK_ASSERT(tv != NULL); #if defined(DUK_USE_FASTINT) if (DUK_TVAL_IS_FASTINT(tv)) { - ret.d = (duk_double_t) DUK_TVAL_GET_FASTINT(tv); /* XXX: cast trick */ - } - else + ret.d = (duk_double_t) DUK_TVAL_GET_FASTINT(tv); /* XXX: cast trick */ + } else #endif - if (DUK_TVAL_IS_DOUBLE(tv)) { + if (DUK_TVAL_IS_DOUBLE(tv)) { /* When using packed duk_tval, number must be in NaN-normalized form * for it to be a duk_tval, so no need to normalize. NOP for unpacked * duk_tval. @@ -19578,7 +20307,7 @@ DUK_LOCAL DUK_ALWAYS_INLINE duk_double_t duk__get_number_raw(duk_hthread *thr, d DUK_EXTERNAL duk_double_t duk_get_number(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - return duk__get_number_raw(thr, idx, DUK_DOUBLE_NAN); /* default: NaN */ + return duk__get_number_raw(thr, idx, DUK_DOUBLE_NAN); /* default: NaN */ } DUK_EXTERNAL duk_double_t duk_get_number_default(duk_hthread *thr, duk_idx_t idx, duk_double_t def_value) { @@ -19734,7 +20463,11 @@ DUK_EXTERNAL const char *duk_get_string(duk_hthread *thr, duk_idx_t idx) { } } -DUK_EXTERNAL const char *duk_opt_lstring(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_len, const char *def_ptr, duk_size_t def_len) { +DUK_EXTERNAL const char *duk_opt_lstring(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_len, + const char *def_ptr, + duk_size_t def_len) { DUK_ASSERT_API_ENTRY(thr); if (duk_check_type_mask(thr, idx, DUK_TYPE_MASK_NONE | DUK_TYPE_MASK_UNDEFINED)) { @@ -19755,7 +20488,11 @@ DUK_EXTERNAL const char *duk_opt_string(duk_hthread *thr, duk_idx_t idx, const c return duk_require_string(thr, idx); } -DUK_EXTERNAL const char *duk_get_lstring_default(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_len, const char *def_ptr, duk_size_t def_len) { +DUK_EXTERNAL const char *duk_get_lstring_default(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_len, + const char *def_ptr, + duk_size_t def_len) { duk_hstring *h; const char *ret; duk_size_t len; @@ -19844,7 +20581,7 @@ DUK_LOCAL void *duk__get_pointer_raw(duk_hthread *thr, duk_idx_t idx, void *def_ return def_value; } - p = DUK_TVAL_GET_POINTER(tv); /* may be NULL */ + p = DUK_TVAL_GET_POINTER(tv); /* may be NULL */ return p; } @@ -19882,11 +20619,11 @@ DUK_EXTERNAL void *duk_require_pointer(duk_hthread *thr, duk_idx_t idx) { DUK_ERROR_REQUIRE_TYPE_INDEX(thr, idx, "pointer", DUK_STR_NOT_POINTER); DUK_WO_NORETURN(return NULL;); } - p = DUK_TVAL_GET_POINTER(tv); /* may be NULL */ + p = DUK_TVAL_GET_POINTER(tv); /* may be NULL */ return p; } -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL void *duk_get_voidptr(duk_hthread *thr, duk_idx_t idx) { duk_tval *tv; duk_heaphdr *h; @@ -19905,7 +20642,12 @@ DUK_INTERNAL void *duk_get_voidptr(duk_hthread *thr, duk_idx_t idx) { } #endif -DUK_LOCAL void *duk__get_buffer_helper(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_size, void *def_ptr, duk_size_t def_size, duk_bool_t throw_flag) { +DUK_LOCAL void *duk__get_buffer_helper(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_size, + void *def_ptr, + duk_size_t def_size, + duk_bool_t throw_flag) { duk_hbuffer *h; void *ret; duk_size_t len; @@ -19958,7 +20700,11 @@ DUK_EXTERNAL void *duk_opt_buffer(duk_hthread *thr, duk_idx_t idx, duk_size_t *o return duk_require_buffer(thr, idx, out_size); } -DUK_EXTERNAL void *duk_get_buffer_default(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_size, void *def_ptr, duk_size_t def_len) { +DUK_EXTERNAL void *duk_get_buffer_default(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_size, + void *def_ptr, + duk_size_t def_len) { DUK_ASSERT_API_ENTRY(thr); return duk__get_buffer_helper(thr, idx, out_size, def_ptr, def_len, 0 /*throw_flag*/); @@ -19975,7 +20721,13 @@ DUK_EXTERNAL void *duk_require_buffer(duk_hthread *thr, duk_idx_t idx, duk_size_ * have a NULL data pointer when its size is zero, the optional 'out_isbuffer' * argument allows caller to detect this reliably. */ -DUK_INTERNAL void *duk_get_buffer_data_raw(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_size, void *def_ptr, duk_size_t def_size, duk_bool_t throw_flag, duk_bool_t *out_isbuffer) { +DUK_INTERNAL void *duk_get_buffer_data_raw(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_size, + void *def_ptr, + duk_size_t def_size, + duk_bool_t throw_flag, + duk_bool_t *out_isbuffer) { duk_tval *tv; DUK_ASSERT_API_ENTRY(thr); @@ -19999,7 +20751,7 @@ DUK_INTERNAL void *duk_get_buffer_data_raw(duk_hthread *thr, duk_idx_t idx, duk_ if (out_isbuffer != NULL) { *out_isbuffer = 1; } - return (void *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h); /* may be NULL (but only if size is 0) */ + return (void *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h); /* may be NULL (but only if size is 0) */ } #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) else if (DUK_TVAL_IS_OBJECT(tv)) { @@ -20012,8 +20764,7 @@ DUK_INTERNAL void *duk_get_buffer_data_raw(duk_hthread *thr, duk_idx_t idx, duk_ duk_hbufobj *h_bufobj = (duk_hbufobj *) h; DUK_HBUFOBJ_ASSERT_VALID(h_bufobj); - if (h_bufobj->buf != NULL && - DUK_HBUFOBJ_VALID_SLICE(h_bufobj)) { + if (h_bufobj->buf != NULL && DUK_HBUFOBJ_VALID_SLICE(h_bufobj)) { duk_uint8_t *p; p = (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufobj->buf); @@ -20028,7 +20779,7 @@ DUK_INTERNAL void *duk_get_buffer_data_raw(duk_hthread *thr, duk_idx_t idx, duk_ /* if slice not fully valid, treat as error */ } } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ if (throw_flag) { DUK_ERROR_REQUIRE_TYPE_INDEX(thr, idx, "buffer", DUK_STR_NOT_BUFFER); @@ -20042,7 +20793,11 @@ DUK_EXTERNAL void *duk_get_buffer_data(duk_hthread *thr, duk_idx_t idx, duk_size return duk_get_buffer_data_raw(thr, idx, out_size, NULL /*def_ptr*/, 0 /*def_size*/, 0 /*throw_flag*/, NULL); } -DUK_EXTERNAL void *duk_get_buffer_data_default(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_size, void *def_ptr, duk_size_t def_size) { +DUK_EXTERNAL void *duk_get_buffer_data_default(duk_hthread *thr, + duk_idx_t idx, + duk_size_t *out_size, + void *def_ptr, + duk_size_t def_size) { DUK_ASSERT_API_ENTRY(thr); return duk_get_buffer_data_raw(thr, idx, out_size, def_ptr, def_size, 0 /*throw_flag*/, NULL); } @@ -20082,9 +20837,8 @@ DUK_LOCAL duk_heaphdr *duk__get_tagged_heaphdr_raw(duk_hthread *thr, duk_idx_t i } ret = DUK_TVAL_GET_HEAPHDR(tv); - DUK_ASSERT(ret != NULL); /* tagged null pointers should never occur */ + DUK_ASSERT(ret != NULL); /* tagged null pointers should never occur */ return ret; - } DUK_INTERNAL duk_hstring *duk_get_hstring(duk_hthread *thr, duk_idx_t idx) { @@ -20419,7 +21173,7 @@ DUK_LOCAL duk_hobject *duk__get_hobject_promote_mask_raw(duk_hthread *thr, duk_i DUK_CTX_ASSERT_VALID(thr); - res = duk_get_hobject(thr, idx); /* common case, not promoted */ + res = duk_get_hobject(thr, idx); /* common case, not promoted */ if (DUK_LIKELY(res != NULL)) { DUK_ASSERT(res != NULL); return res; @@ -20432,7 +21186,7 @@ DUK_LOCAL duk_hobject *duk__get_hobject_promote_mask_raw(duk_hthread *thr, duk_i DUK_ASSERT(res != NULL); return res; } else { - return NULL; /* accept without promoting */ + return NULL; /* accept without promoting */ } } @@ -20475,7 +21229,7 @@ DUK_INTERNAL duk_hobject *duk_get_hobject_with_class(duk_hthread *thr, duk_idx_t duk_hobject *h; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT_DISABLE(classnum >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(classnum >= 0); /* unsigned */ DUK_ASSERT(classnum <= DUK_HOBJECT_CLASS_MAX); h = (duk_hobject *) duk__get_tagged_heaphdr_raw(thr, idx, DUK_TAG_OBJECT); @@ -20489,7 +21243,7 @@ DUK_INTERNAL duk_hobject *duk_require_hobject_with_class(duk_hthread *thr, duk_i duk_hobject *h; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT_DISABLE(classnum >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(classnum >= 0); /* unsigned */ DUK_ASSERT(classnum <= DUK_HOBJECT_CLASS_MAX); h = (duk_hobject *) duk__get_tagged_heaphdr_raw(thr, idx, DUK_TAG_OBJECT); @@ -20535,7 +21289,7 @@ DUK_EXTERNAL duk_size_t duk_get_length(duk_hthread *thr, duk_idx_t idx) { duk_pop_unsafe(thr); return ret; } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ case DUK_TAG_STRING: { duk_hstring *h = DUK_TVAL_GET_STRING(tv); DUK_ASSERT(h != NULL); @@ -20561,7 +21315,7 @@ DUK_EXTERNAL duk_size_t duk_get_length(duk_hthread *thr, duk_idx_t idx) { duk_pop_unsafe(thr); return ret; } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ case DUK_TAG_OBJECT: { duk_hobject *h = DUK_TVAL_GET_OBJECT(tv); DUK_ASSERT(h != NULL); @@ -20658,8 +21412,8 @@ DUK_LOCAL duk_bool_t duk__defaultvalue_coerce_attempt(duk_hthread *thr, duk_idx_ if (duk_get_prop_stridx(thr, idx, func_stridx)) { /* [ ... func ] */ if (duk_is_callable(thr, -1)) { - duk_dup(thr, idx); /* -> [ ... func this ] */ - duk_call_method(thr, 0); /* -> [ ... retval ] */ + duk_dup(thr, idx); /* -> [ ... func this ] */ + duk_call_method(thr, 0); /* -> [ ... retval ] */ if (duk_is_primitive(thr, -1)) { duk_replace(thr, idx); return 1; @@ -20667,7 +21421,7 @@ DUK_LOCAL duk_bool_t duk__defaultvalue_coerce_attempt(duk_hthread *thr, duk_idx_ /* [ ... retval ]; popped below */ } } - duk_pop_unsafe(thr); /* [ ... func/retval ] -> [ ... ] */ + duk_pop_unsafe(thr); /* [ ... func/retval ] -> [ ... ] */ return 0; } @@ -20678,7 +21432,7 @@ DUK_EXTERNAL void duk_to_undefined(duk_hthread *thr, duk_idx_t idx) { tv = duk_require_tval(thr, idx); DUK_ASSERT(tv != NULL); - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ } DUK_EXTERNAL void duk_to_null(duk_hthread *thr, duk_idx_t idx) { @@ -20688,13 +21442,11 @@ DUK_EXTERNAL void duk_to_null(duk_hthread *thr, duk_idx_t idx) { tv = duk_require_tval(thr, idx); DUK_ASSERT(tv != NULL); - DUK_TVAL_SET_NULL_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_NULL_UPDREF(thr, tv); /* side effects */ } /* E5 Section 9.1 */ -DUK_LOCAL const char * const duk__toprim_hint_strings[3] = { - "default", "string", "number" -}; +DUK_LOCAL const char * const duk__toprim_hint_strings[3] = { "default", "string", "number" }; DUK_LOCAL void duk__to_primitive_helper(duk_hthread *thr, duk_idx_t idx, duk_int_t hint, duk_bool_t check_symbol) { /* Inline initializer for coercers[] is not allowed by old compilers like BCC. */ duk_small_uint_t coercers[2]; @@ -20705,10 +21457,8 @@ DUK_LOCAL void duk__to_primitive_helper(duk_hthread *thr, duk_idx_t idx, duk_int idx = duk_require_normalize_index(thr, idx); /* If already primitive, return as is. */ - if (!duk_check_type_mask(thr, idx, DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_LIGHTFUNC | - DUK_TYPE_MASK_BUFFER)) { - DUK_ASSERT(!duk_is_buffer(thr, idx)); /* duk_to_string() relies on this behavior */ + if (!duk_check_type_mask(thr, idx, DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER)) { + DUK_ASSERT(!duk_is_buffer(thr, idx)); /* duk_to_string() relies on this behavior */ return; } @@ -20719,10 +21469,8 @@ DUK_LOCAL void duk__to_primitive_helper(duk_hthread *thr, duk_idx_t idx, duk_int DUK_ASSERT(hint >= 0 && (duk_size_t) hint < sizeof(duk__toprim_hint_strings) / sizeof(const char *)); duk_dup(thr, idx); duk_push_string(thr, duk__toprim_hint_strings[hint]); - duk_call_method(thr, 1); /* [ ... method value hint ] -> [ ... res] */ - if (duk_check_type_mask(thr, -1, DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_LIGHTFUNC | - DUK_TYPE_MASK_BUFFER)) { + duk_call_method(thr, 1); /* [ ... method value hint ] -> [ ... res] */ + if (duk_check_type_mask(thr, -1, DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER)) { goto fail; } duk_replace(thr, idx); @@ -20744,7 +21492,7 @@ DUK_LOCAL void duk__to_primitive_helper(duk_hthread *thr, duk_idx_t idx, duk_int if (hint == DUK_HINT_NONE) { hint = DUK_HINT_NUMBER; } -#else /* DUK_USE_SYMBOL_BUILTIN */ +#else /* DUK_USE_SYMBOL_BUILTIN */ if (hint == DUK_HINT_NONE) { duk_small_uint_t class_number; @@ -20755,7 +21503,7 @@ DUK_LOCAL void duk__to_primitive_helper(duk_hthread *thr, duk_idx_t idx, duk_int hint = DUK_HINT_NUMBER; } } -#endif /* DUK_USE_SYMBOL_BUILTIN */ +#endif /* DUK_USE_SYMBOL_BUILTIN */ coercers[0] = DUK_STRIDX_VALUE_OF; coercers[1] = DUK_STRIDX_TO_STRING; @@ -20765,16 +21513,16 @@ DUK_LOCAL void duk__to_primitive_helper(duk_hthread *thr, duk_idx_t idx, duk_int } if (duk__defaultvalue_coerce_attempt(thr, idx, coercers[0])) { - DUK_ASSERT(!duk_is_buffer(thr, idx)); /* duk_to_string() relies on this behavior */ + DUK_ASSERT(!duk_is_buffer(thr, idx)); /* duk_to_string() relies on this behavior */ return; } if (duk__defaultvalue_coerce_attempt(thr, idx, coercers[1])) { - DUK_ASSERT(!duk_is_buffer(thr, idx)); /* duk_to_string() relies on this behavior */ + DUK_ASSERT(!duk_is_buffer(thr, idx)); /* duk_to_string() relies on this behavior */ return; } - fail: +fail: DUK_ERROR_TYPE(thr, DUK_STR_TOPRIMITIVE_FAILED); DUK_WO_NORETURN(return;); } @@ -20805,7 +21553,7 @@ DUK_EXTERNAL duk_bool_t duk_to_boolean(duk_hthread *thr, duk_idx_t idx) { /* Note: no need to re-lookup tv, conversion is side effect free. */ DUK_ASSERT(tv != NULL); - DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv, val); /* side effects */ + DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv, val); /* side effects */ return val; } @@ -20837,11 +21585,11 @@ DUK_EXTERNAL duk_double_t duk_to_number(duk_hthread *thr, duk_idx_t idx) { idx = duk_require_normalize_index(thr, idx); tv = DUK_GET_TVAL_POSIDX(thr, idx); DUK_ASSERT(tv != NULL); - d = duk_js_tonumber(thr, tv); /* XXX: fastint coercion? now result will always be a non-fastint */ + d = duk_js_tonumber(thr, tv); /* XXX: fastint coercion? now result will always be a non-fastint */ /* ToNumber() may have side effects so must relookup 'tv'. */ tv = DUK_GET_TVAL_POSIDX(thr, idx); - DUK_TVAL_SET_NUMBER_UPDREF(thr, tv, d); /* side effects */ + DUK_TVAL_SET_NUMBER_UPDREF(thr, tv, d); /* side effects */ return d; } @@ -20873,13 +21621,13 @@ DUK_INTERNAL duk_double_t duk_to_number_tval(duk_hthread *thr, duk_tval *tv) { tv_dst = thr->valstack_top++; DUK_TVAL_SET_TVAL(tv_dst, tv); - DUK_TVAL_INCREF(thr, tv_dst); /* decref not necessary */ - res = duk_to_number_m1(thr); /* invalidates tv_dst */ + DUK_TVAL_INCREF(thr, tv_dst); /* decref not necessary */ + res = duk_to_number_m1(thr); /* invalidates tv_dst */ tv_dst = --thr->valstack_top; DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_dst)); - DUK_ASSERT(!DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv_dst)); /* plain number */ - DUK_TVAL_SET_UNDEFINED(tv_dst); /* valstack init policy */ + DUK_ASSERT(!DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv_dst)); /* plain number */ + DUK_TVAL_SET_UNDEFINED(tv_dst); /* valstack init policy */ return res; #endif @@ -20915,7 +21663,7 @@ DUK_LOCAL duk_double_t duk__to_int_uint_helper(duk_hthread *thr, duk_idx_t idx, /* Relookup in case coerce_func() has side effects, e.g. ends up coercing an object */ tv = duk_require_tval(thr, idx); - DUK_TVAL_SET_NUMBER_UPDREF(thr, tv, d); /* side effects */ + DUK_TVAL_SET_NUMBER_UPDREF(thr, tv, d); /* side effects */ return d; } @@ -20949,7 +21697,7 @@ DUK_EXTERNAL duk_int32_t duk_to_int32(duk_hthread *thr, duk_idx_t idx) { /* Relookup in case coerce_func() has side effects, e.g. ends up coercing an object */ tv = duk_require_tval(thr, idx); - DUK_TVAL_SET_I32_UPDREF(thr, tv, ret); /* side effects */ + DUK_TVAL_SET_I32_UPDREF(thr, tv, ret); /* side effects */ return ret; } @@ -20965,7 +21713,7 @@ DUK_EXTERNAL duk_uint32_t duk_to_uint32(duk_hthread *thr, duk_idx_t idx) { /* Relookup in case coerce_func() has side effects, e.g. ends up coercing an object */ tv = duk_require_tval(thr, idx); - DUK_TVAL_SET_U32_UPDREF(thr, tv, ret); /* side effects */ + DUK_TVAL_SET_U32_UPDREF(thr, tv, ret); /* side effects */ return ret; } @@ -20981,7 +21729,7 @@ DUK_EXTERNAL duk_uint16_t duk_to_uint16(duk_hthread *thr, duk_idx_t idx) { /* Relookup in case coerce_func() has side effects, e.g. ends up coercing an object */ tv = duk_require_tval(thr, idx); - DUK_TVAL_SET_U32_UPDREF(thr, tv, ret); /* side effects */ + DUK_TVAL_SET_U32_UPDREF(thr, tv, ret); /* side effects */ return ret; } @@ -21013,16 +21761,16 @@ DUK_INTERNAL duk_uint8_t duk_to_uint8clamped(duk_hthread *thr, duk_idx_t idx) { if (duk_double_equals(t, 0.5)) { /* Exact halfway, round to even. */ ret = (duk_uint8_t) d; - ret = (ret + 1) & 0xfe; /* Example: d=3.5, t=0.5 -> ret = (3 + 1) & 0xfe = 4 & 0xfe = 4 - * Example: d=4.5, t=0.5 -> ret = (4 + 1) & 0xfe = 5 & 0xfe = 4 - */ + ret = (ret + 1) & 0xfe; /* Example: d=3.5, t=0.5 -> ret = (3 + 1) & 0xfe = 4 & 0xfe = 4 + * Example: d=4.5, t=0.5 -> ret = (4 + 1) & 0xfe = 5 & 0xfe = 4 + */ } else { /* Not halfway, round to nearest. */ ret = (duk_uint8_t) (d + 0.5); } return ret; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ DUK_EXTERNAL const char *duk_to_lstring(duk_hthread *thr, duk_idx_t idx, duk_size_t *out_len) { DUK_ASSERT_API_ENTRY(thr); @@ -21132,7 +21880,7 @@ DUK_INTERNAL duk_hstring *duk_to_property_key_hstring(duk_hthread *thr, duk_idx_ DUK_ASSERT_API_ENTRY(thr); - duk_to_primitive(thr, idx, DUK_HINT_STRING); /* needed for e.g. Symbol objects */ + duk_to_primitive(thr, idx, DUK_HINT_STRING); /* needed for e.g. Symbol objects */ h = duk_get_hstring(thr, idx); if (h == NULL) { /* The "is string?" check may seem unnecessary, but as things @@ -21146,7 +21894,7 @@ DUK_INTERNAL duk_hstring *duk_to_property_key_hstring(duk_hthread *thr, duk_idx_ return h; } -#if defined(DUK_USE_DEBUGGER_SUPPORT) /* only needed by debugger for now */ +#if defined(DUK_USE_DEBUGGER_SUPPORT) /* only needed by debugger for now */ DUK_INTERNAL duk_hstring *duk_safe_to_hstring(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); @@ -21188,10 +21936,10 @@ DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk * Object.prototype.toString() is usually not performance critical. */ - duk_push_literal(thr, "[object "); /* -> [ ... "[object" ] */ + duk_push_literal(thr, "[object "); /* -> [ ... "[object" ] */ switch (DUK_TVAL_GET_TAG(tv)) { - case DUK_TAG_UNUSED: /* Treat like 'undefined', shouldn't happen. */ + case DUK_TAG_UNUSED: /* Treat like 'undefined', shouldn't happen. */ case DUK_TAG_UNDEFINED: { duk_push_hstring_stridx(thr, DUK_STRIDX_UC_UNDEFINED); goto finish; @@ -21203,7 +21951,7 @@ DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk } duk_push_tval(thr, tv); - tv = NULL; /* Invalidated by ToObject(). */ + tv = NULL; /* Invalidated by ToObject(). */ h_obj = duk_to_hobject(thr, -1); DUK_ASSERT(h_obj != NULL); if (duk_js_isarray_hobject(h_obj)) { @@ -21234,14 +21982,15 @@ DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk duk_pop_unsafe(thr); duk_push_hstring_stridx(thr, stridx); - finish: +finish: /* [ ... "[object" tag ] */ duk_push_literal(thr, "]"); - duk_concat(thr, 3); /* [ ... "[object" tag "]" ] -> [ ... res ] */ + duk_concat(thr, 3); /* [ ... "[object" tag "]" ] -> [ ... res ] */ } /* XXX: other variants like uint, u32 etc */ -DUK_INTERNAL duk_int_t duk_to_int_clamped_raw(duk_hthread *thr, duk_idx_t idx, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped) { +DUK_INTERNAL duk_int_t +duk_to_int_clamped_raw(duk_hthread *thr, duk_idx_t idx, duk_int_t minval, duk_int_t maxval, duk_bool_t *out_clamped) { duk_tval *tv; duk_tval tv_tmp; duk_double_t d, dmin, dmax; @@ -21252,7 +22001,7 @@ DUK_INTERNAL duk_int_t duk_to_int_clamped_raw(duk_hthread *thr, duk_idx_t idx, d tv = duk_require_tval(thr, idx); DUK_ASSERT(tv != NULL); - d = duk_js_tointeger(thr, tv); /* E5 Section 9.4, ToInteger() */ + d = duk_js_tointeger(thr, tv); /* E5 Section 9.4, ToInteger() */ dmin = (duk_double_t) minval; dmax = (duk_double_t) maxval; @@ -21268,12 +22017,12 @@ DUK_INTERNAL duk_int_t duk_to_int_clamped_raw(duk_hthread *thr, duk_idx_t idx, d } else { res = (duk_int_t) d; } - DUK_UNREF(d); /* SCANBUILD: with suitable dmin/dmax limits 'd' is unused */ + DUK_UNREF(d); /* SCANBUILD: with suitable dmin/dmax limits 'd' is unused */ /* 'd' and 'res' agree here */ /* Relookup in case duk_js_tointeger() ends up e.g. coercing an object. */ tv = duk_get_tval(thr, idx); - DUK_ASSERT(tv != NULL); /* not popped by side effect */ + DUK_ASSERT(tv != NULL); /* not popped by side effect */ DUK_TVAL_SET_TVAL(&tv_tmp, tv); #if defined(DUK_USE_FASTINT) #if (DUK_INT_MAX <= 0x7fffffffL) @@ -21287,9 +22036,9 @@ DUK_INTERNAL duk_int_t duk_to_int_clamped_raw(duk_hthread *thr, duk_idx_t idx, d } #endif #else - DUK_TVAL_SET_NUMBER(tv, d); /* no need to incref */ + DUK_TVAL_SET_NUMBER(tv, d); /* no need to incref */ #endif - DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */ + DUK_TVAL_DECREF(thr, &tv_tmp); /* side effects */ if (out_clamped) { *out_clamped = clamped; @@ -21314,7 +22063,7 @@ DUK_INTERNAL duk_int_t duk_to_int_clamped(duk_hthread *thr, duk_idx_t idx, duk_i DUK_INTERNAL duk_int_t duk_to_int_check_range(duk_hthread *thr, duk_idx_t idx, duk_int_t minval, duk_int_t maxval) { DUK_ASSERT_API_ENTRY(thr); - return duk_to_int_clamped_raw(thr, idx, minval, maxval, NULL); /* out_clamped==NULL -> RangeError if outside range */ + return duk_to_int_clamped_raw(thr, idx, minval, maxval, NULL); /* out_clamped==NULL -> RangeError if outside range */ } DUK_EXTERNAL const char *duk_to_string(duk_hthread *thr, duk_idx_t idx) { @@ -21373,9 +22122,9 @@ DUK_EXTERNAL const char *duk_to_string(duk_hthread *thr, duk_idx_t idx) { * value, and duk_to_string() then causes a TypeError. */ duk_to_primitive(thr, idx, DUK_HINT_STRING); - DUK_ASSERT(!duk_is_buffer(thr, idx)); /* ToPrimitive() must guarantee */ + DUK_ASSERT(!duk_is_buffer(thr, idx)); /* ToPrimitive() must guarantee */ DUK_ASSERT(!duk_is_object(thr, idx)); - return duk_to_string(thr, idx); /* Note: recursive call */ + return duk_to_string(thr, idx); /* Note: recursive call */ } case DUK_TAG_POINTER: { void *ptr = DUK_TVAL_GET_POINTER(tv); @@ -21403,17 +22152,14 @@ DUK_EXTERNAL const char *duk_to_string(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv)); DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv)); duk_push_tval(thr, tv); - duk_numconv_stringify(thr, - 10 /*radix*/, - 0 /*precision:shortest*/, - 0 /*force_exponential*/); + duk_numconv_stringify(thr, 10 /*radix*/, 0 /*precision:shortest*/, 0 /*force_exponential*/); break; } } duk_replace(thr, idx); - skip_replace: +skip_replace: DUK_ASSERT(duk_is_string(thr, idx)); return duk_require_string(thr, idx); } @@ -21495,8 +22241,7 @@ DUK_EXTERNAL void *duk_to_buffer_raw(duk_hthread *thr, duk_idx_t idx, duk_size_t src_size = DUK_HBUFFER_GET_SIZE(h_buf); tmp = (DUK_HBUFFER_HAS_DYNAMIC(h_buf) ? DUK_BUF_MODE_DYNAMIC : DUK_BUF_MODE_FIXED); - if ((tmp == mode && !DUK_HBUFFER_HAS_EXTERNAL(h_buf)) || - mode == DUK_BUF_MODE_DONTCARE) { + if ((tmp == mode && !DUK_HBUFFER_HAS_EXTERNAL(h_buf)) || mode == DUK_BUF_MODE_DONTCARE) { /* Note: src_data may be NULL if input is a zero-size * dynamic buffer. */ @@ -21517,7 +22262,7 @@ DUK_EXTERNAL void *duk_to_buffer_raw(duk_hthread *thr, duk_idx_t idx, duk_size_t duk_memcpy_unsafe((void *) dst_data, (const void *) src_data, (size_t) src_size); duk_replace(thr, idx); - skip_copy: +skip_copy: if (out_size) { *out_size = src_size; @@ -21577,7 +22322,7 @@ DUK_EXTERNAL void *duk_to_pointer(duk_hthread *thr, duk_idx_t idx) { DUK_LOCAL void duk__push_func_from_lightfunc(duk_hthread *thr, duk_c_function func, duk_small_uint_t lf_flags) { duk_idx_t nargs; - duk_uint_t flags = 0; /* shared flags for a subset of types */ + duk_uint_t flags = 0; /* shared flags for a subset of types */ duk_small_uint_t lf_len; duk_hnatfunc *nf; @@ -21586,15 +22331,9 @@ DUK_LOCAL void duk__push_func_from_lightfunc(duk_hthread *thr, duk_c_function fu nargs = (duk_idx_t) DUK_VARARGS; } - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_CONSTRUCTABLE | - DUK_HOBJECT_FLAG_CALLABLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_NATFUNC | - DUK_HOBJECT_FLAG_NEWENV | - DUK_HOBJECT_FLAG_STRICT | - DUK_HOBJECT_FLAG_NOTAIL | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_CONSTRUCTABLE | DUK_HOBJECT_FLAG_CALLABLE | + DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_NATFUNC | DUK_HOBJECT_FLAG_NEWENV | DUK_HOBJECT_FLAG_STRICT | + DUK_HOBJECT_FLAG_NOTAIL | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); (void) duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_NATIVE_FUNCTION_PROTOTYPE); lf_len = DUK_LFUNC_FLAGS_GET_LENGTH(lf_flags); @@ -21615,7 +22354,7 @@ DUK_LOCAL void duk__push_func_from_lightfunc(duk_hthread *thr, duk_c_function fu DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { duk_tval *tv; - duk_uint_t flags = 0; /* shared flags for a subset of types */ + duk_uint_t flags = 0; /* shared flags for a subset of types */ duk_small_int_t proto = 0; DUK_ASSERT_API_ENTRY(thr); @@ -21626,7 +22365,7 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { switch (DUK_TVAL_GET_TAG(tv)) { #if !defined(DUK_USE_BUFFEROBJECT_SUPPORT) - case DUK_TAG_BUFFER: /* With no bufferobject support, don't object coerce. */ + case DUK_TAG_BUFFER: /* With no bufferobject support, don't object coerce. */ #endif case DUK_TAG_UNDEFINED: case DUK_TAG_NULL: { @@ -21635,9 +22374,8 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { break; } case DUK_TAG_BOOLEAN: { - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_BOOLEAN); + flags = + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_BOOLEAN); proto = DUK_BIDX_BOOLEAN_PROTOTYPE; goto create_object; } @@ -21646,14 +22384,11 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { h = DUK_TVAL_GET_STRING(tv); DUK_ASSERT(h != NULL); if (DUK_UNLIKELY(DUK_HSTRING_HAS_SYMBOL(h))) { - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_SYMBOL); proto = DUK_BIDX_SYMBOL_PROTOTYPE; } else { - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_STRING); proto = DUK_BIDX_STRING_PROTOTYPE; } @@ -21679,11 +22414,10 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { duk_hbufobj_push_uint8array_from_plain(thr, h_buf); goto replace_value; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ case DUK_TAG_POINTER: { - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_POINTER); + flags = + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_POINTER); proto = DUK_BIDX_POINTER_PROTOTYPE; goto create_object; } @@ -21710,9 +22444,8 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { default: { DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv)); DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv)); - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_NUMBER); + flags = + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_NUMBER); proto = DUK_BIDX_NUMBER_PROTOTYPE; goto create_object; } @@ -21720,7 +22453,7 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(duk_is_object(thr, idx)); return; - create_object: +create_object: (void) duk_push_object_helper(thr, flags, proto); /* Note: Boolean prototype's internal value property is not writable, @@ -21733,7 +22466,7 @@ DUK_EXTERNAL void duk_to_object(duk_hthread *thr, duk_idx_t idx) { duk_dup(thr, idx); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_VALUE, DUK_PROPDESC_FLAGS_NONE); - replace_value: +replace_value: duk_replace(thr, idx); DUK_ASSERT(duk_is_object(thr, idx)); } @@ -21804,11 +22537,11 @@ DUK_INTERNAL duk_int_t duk_get_type_tval(duk_tval *tv) { DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv)); return DUK_TYPE_NUMBER; } -#else /* DUK_USE_PACKED_TVAL */ +#else /* DUK_USE_PACKED_TVAL */ DUK_ASSERT(DUK_TVAL_IS_VALID_TAG(tv)); DUK_ASSERT(sizeof(duk__type_from_tag) / sizeof(duk_uint_t) == DUK_TAG_MAX - DUK_TAG_MIN + 1); return (duk_int_t) duk__type_from_tag[DUK_TVAL_GET_TAG(tv) - DUK_TAG_MIN]; -#endif /* DUK_USE_PACKED_TVAL */ +#endif /* DUK_USE_PACKED_TVAL */ } DUK_EXTERNAL duk_int_t duk_get_type(duk_hthread *thr, duk_idx_t idx) { @@ -21823,18 +22556,8 @@ DUK_EXTERNAL duk_int_t duk_get_type(duk_hthread *thr, duk_idx_t idx) { } #if defined(DUK_USE_VERBOSE_ERRORS) && defined(DUK_USE_PARANOID_ERRORS) -DUK_LOCAL const char * const duk__type_names[] = { - "none", - "undefined", - "null", - "boolean", - "number", - "string", - "object", - "buffer", - "pointer", - "lightfunc" -}; +DUK_LOCAL const char * const duk__type_names[] = { "none", "undefined", "null", "boolean", "number", + "string", "object", "buffer", "pointer", "lightfunc" }; DUK_INTERNAL const char *duk_get_type_name(duk_hthread *thr, duk_idx_t idx) { duk_int_t type_tag; @@ -21847,7 +22570,7 @@ DUK_INTERNAL const char *duk_get_type_name(duk_hthread *thr, duk_idx_t idx) { return duk__type_names[type_tag]; } -#endif /* DUK_USE_VERBOSE_ERRORS && DUK_USE_PARANOID_ERRORS */ +#endif /* DUK_USE_VERBOSE_ERRORS && DUK_USE_PARANOID_ERRORS */ DUK_INTERNAL duk_small_uint_t duk_get_class_number(duk_hthread *thr, duk_idx_t idx) { duk_tval *tv; @@ -21913,11 +22636,11 @@ DUK_INTERNAL duk_uint_t duk_get_type_mask_tval(duk_tval *tv) { DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv)); return DUK_TYPE_MASK_NUMBER; } -#else /* DUK_USE_PACKED_TVAL */ +#else /* DUK_USE_PACKED_TVAL */ DUK_ASSERT(DUK_TVAL_IS_VALID_TAG(tv)); DUK_ASSERT(sizeof(duk__type_mask_from_tag) / sizeof(duk_uint_t) == DUK_TAG_MAX - DUK_TAG_MIN + 1); return duk__type_mask_from_tag[DUK_TVAL_GET_TAG(tv) - DUK_TAG_MIN]; -#endif /* DUK_USE_PACKED_TVAL */ +#endif /* DUK_USE_PACKED_TVAL */ } DUK_EXTERNAL duk_uint_t duk_get_type_mask(duk_hthread *thr, duk_idx_t idx) { @@ -22036,14 +22759,14 @@ DUK_EXTERNAL duk_bool_t duk_is_buffer_data(duk_hthread *thr, duk_idx_t idx) { } return 0; } -#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ DUK_EXTERNAL duk_bool_t duk_is_buffer_data(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); return duk_is_buffer(thr, idx); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ DUK_EXTERNAL duk_bool_t duk_is_pointer(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); @@ -22137,23 +22860,17 @@ DUK_EXTERNAL duk_bool_t duk_is_constructable(duk_hthread *thr, duk_idx_t idx) { DUK_EXTERNAL duk_bool_t duk_is_c_function(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - return duk__obj_flag_any_default_false(thr, - idx, - DUK_HOBJECT_FLAG_NATFUNC); + return duk__obj_flag_any_default_false(thr, idx, DUK_HOBJECT_FLAG_NATFUNC); } DUK_EXTERNAL duk_bool_t duk_is_ecmascript_function(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - return duk__obj_flag_any_default_false(thr, - idx, - DUK_HOBJECT_FLAG_COMPFUNC); + return duk__obj_flag_any_default_false(thr, idx, DUK_HOBJECT_FLAG_COMPFUNC); } DUK_EXTERNAL duk_bool_t duk_is_bound_function(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT_API_ENTRY(thr); - return duk__obj_flag_any_default_false(thr, - idx, - DUK_HOBJECT_FLAG_BOUNDFUNC); + return duk__obj_flag_any_default_false(thr, idx, DUK_HOBJECT_FLAG_BOUNDFUNC); } DUK_EXTERNAL duk_bool_t duk_is_thread(duk_hthread *thr, duk_idx_t idx) { @@ -22270,7 +22987,7 @@ DUK_INTERNAL void duk_push_tval(duk_hthread *thr, duk_tval *tv) { DUK__CHECK_SPACE(); tv_slot = thr->valstack_top++; DUK_TVAL_SET_TVAL(tv_slot, tv); - DUK_TVAL_INCREF(thr, tv); /* no side effects */ + DUK_TVAL_INCREF(thr, tv); /* no side effects */ } DUK_EXTERNAL void duk_push_undefined(duk_hthread *thr) { @@ -22300,7 +23017,7 @@ DUK_EXTERNAL void duk_push_boolean(duk_hthread *thr, duk_bool_t val) { DUK_ASSERT_API_ENTRY(thr); DUK__CHECK_SPACE(); - b = (val ? 1 : 0); /* ensure value is 1 or 0 (not other non-zero) */ + b = (val ? 1 : 0); /* ensure value is 1 or 0 (not other non-zero) */ tv_slot = thr->valstack_top++; DUK_TVAL_SET_BOOLEAN(tv_slot, b); } @@ -22353,7 +23070,7 @@ DUK_EXTERNAL void duk_push_int(duk_hthread *thr, duk_int_t val) { DUK_TVAL_SET_NUMBER(tv_slot, d); } #endif -#else /* DUK_USE_FASTINT */ +#else /* DUK_USE_FASTINT */ duk_tval *tv_slot; duk_double_t d; @@ -22362,7 +23079,7 @@ DUK_EXTERNAL void duk_push_int(duk_hthread *thr, duk_int_t val) { d = (duk_double_t) val; tv_slot = thr->valstack_top++; DUK_TVAL_SET_NUMBER(tv_slot, d); -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ } DUK_EXTERNAL void duk_push_uint(duk_hthread *thr, duk_uint_t val) { @@ -22375,7 +23092,7 @@ DUK_EXTERNAL void duk_push_uint(duk_hthread *thr, duk_uint_t val) { #if DUK_UINT_MAX <= 0xffffffffUL DUK_TVAL_SET_U32(tv_slot, (duk_uint32_t) val); #else - if (val <= DUK_FASTINT_MAX) { /* val is unsigned so >= 0 */ + if (val <= DUK_FASTINT_MAX) { /* val is unsigned so >= 0 */ /* XXX: take advantage of val being unsigned, no need to mask */ DUK_TVAL_SET_FASTINT(tv_slot, (duk_int64_t) val); } else { @@ -22383,7 +23100,7 @@ DUK_EXTERNAL void duk_push_uint(duk_hthread *thr, duk_uint_t val) { DUK_TVAL_SET_NUMBER(tv_slot, d); } #endif -#else /* DUK_USE_FASTINT */ +#else /* DUK_USE_FASTINT */ duk_tval *tv_slot; duk_double_t d; @@ -22392,7 +23109,7 @@ DUK_EXTERNAL void duk_push_uint(duk_hthread *thr, duk_uint_t val) { d = (duk_double_t) val; tv_slot = thr->valstack_top++; DUK_TVAL_SET_NUMBER(tv_slot, d); -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ } DUK_EXTERNAL void duk_push_nan(duk_hthread *thr) { @@ -22436,7 +23153,7 @@ DUK_EXTERNAL const char *duk_push_lstring(duk_hthread *thr, const char *str, duk tv_slot = thr->valstack_top++; DUK_TVAL_SET_STRING(tv_slot, h); - DUK_HSTRING_INCREF(thr, h); /* no side effects */ + DUK_HSTRING_INCREF(thr, h); /* no side effects */ return (const char *) DUK_HSTRING_GET_DATA(h); } @@ -22473,11 +23190,11 @@ DUK_EXTERNAL const char *duk_push_literal_raw(duk_hthread *thr, const char *str, tv_slot = thr->valstack_top++; DUK_TVAL_SET_STRING(tv_slot, h); - DUK_HSTRING_INCREF(thr, h); /* no side effects */ + DUK_HSTRING_INCREF(thr, h); /* no side effects */ return (const char *) DUK_HSTRING_GET_DATA(h); } -#else /* DUK_USE_LITCACHE_SIZE */ +#else /* DUK_USE_LITCACHE_SIZE */ DUK_EXTERNAL const char *duk_push_literal_raw(duk_hthread *thr, const char *str, duk_size_t len) { DUK_ASSERT_API_ENTRY(thr); DUK_ASSERT(str != NULL); @@ -22485,8 +23202,8 @@ DUK_EXTERNAL const char *duk_push_literal_raw(duk_hthread *thr, const char *str, return duk_push_lstring(thr, str, len); } -#endif /* DUK_USE_LITCACHE_SIZE */ -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_LITCACHE_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ DUK_EXTERNAL void duk_push_pointer(duk_hthread *thr, void *val) { duk_tval *tv_slot; @@ -22514,7 +23231,7 @@ DUK_LOCAL void duk__push_this_helper(duk_hthread *thr, duk_small_uint_t check_ob DUK__CHECK_SPACE(); - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* because of valstack init policy */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* because of valstack init policy */ tv_slot = thr->valstack_top++; if (DUK_UNLIKELY(thr->callstack_curr == NULL)) { @@ -22528,8 +23245,7 @@ DUK_LOCAL void duk__push_this_helper(duk_hthread *thr, duk_small_uint_t check_ob /* 'this' binding is just before current activation's bottom */ DUK_ASSERT(thr->valstack_bottom > thr->valstack); tv = thr->valstack_bottom - 1; - if (check_object_coercible && - (DUK_TVAL_IS_UNDEFINED(tv) || DUK_TVAL_IS_NULL(tv))) { + if (check_object_coercible && (DUK_TVAL_IS_UNDEFINED(tv) || DUK_TVAL_IS_NULL(tv))) { /* XXX: better macro for DUK_TVAL_IS_UNDEFINED_OR_NULL(tv) */ goto type_error; } @@ -22539,7 +23255,7 @@ DUK_LOCAL void duk__push_this_helper(duk_hthread *thr, duk_small_uint_t check_ob } return; - type_error: +type_error: DUK_ERROR_TYPE(thr, DUK_STR_NOT_OBJECT_COERCIBLE); DUK_WO_NORETURN(return;); } @@ -22571,16 +23287,16 @@ DUK_INTERNAL duk_hstring *duk_push_this_coercible_to_string(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); duk__push_this_helper(thr, 1 /*check_object_coercible*/); - return duk_to_hstring_m1(thr); /* This will reject all Symbol values; accepts Symbol objects. */ + return duk_to_hstring_m1(thr); /* This will reject all Symbol values; accepts Symbol objects. */ } DUK_INTERNAL duk_tval *duk_get_borrowed_this_tval(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(thr->callstack_top > 0); /* caller required to know */ - DUK_ASSERT(thr->callstack_curr != NULL); /* caller required to know */ - DUK_ASSERT(thr->valstack_bottom > thr->valstack); /* consequence of above */ - DUK_ASSERT(thr->valstack_bottom - 1 >= thr->valstack); /* 'this' binding exists */ + DUK_ASSERT(thr->callstack_top > 0); /* caller required to know */ + DUK_ASSERT(thr->callstack_curr != NULL); /* caller required to know */ + DUK_ASSERT(thr->valstack_bottom > thr->valstack); /* consequence of above */ + DUK_ASSERT(thr->valstack_bottom - 1 >= thr->valstack); /* 'this' binding exists */ return thr->valstack_bottom - 1; } @@ -22661,7 +23377,10 @@ DUK_LOCAL void duk__push_stash(duk_hthread *thr) { duk_pop_unsafe(thr); duk_push_bare_object(thr); duk_dup_top(thr); - duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_INT_VALUE, DUK_PROPDESC_FLAGS_C); /* [ ... parent stash stash ] -> [ ... parent stash ] */ + duk_xdef_prop_stridx_short(thr, + -3, + DUK_STRIDX_INT_VALUE, + DUK_PROPDESC_FLAGS_C); /* [ ... parent stash stash ] -> [ ... parent stash ] */ } duk_remove_m2(thr); } @@ -22714,7 +23433,7 @@ DUK_EXTERNAL const char *duk_push_vsprintf(duk_hthread *thr, const char *fmt, va duk_size_t sz = DUK_PUSH_SPRINTF_INITIAL_SIZE; duk_bool_t pushed_buf = 0; void *buf; - duk_int_t len; /* XXX: duk_ssize_t */ + duk_int_t len; /* XXX: duk_ssize_t */ const char *res; DUK_ASSERT_API_ENTRY(thr); @@ -22728,7 +23447,7 @@ DUK_EXTERNAL const char *duk_push_vsprintf(duk_hthread *thr, const char *fmt, va } /* initial estimate based on format string */ - sz = DUK_STRLEN(fmt) + 16; /* format plus something to avoid just missing */ + sz = DUK_STRLEN(fmt) + 16; /* format plus something to avoid just missing */ if (sz < DUK_PUSH_SPRINTF_INITIAL_SIZE) { sz = DUK_PUSH_SPRINTF_INITIAL_SIZE; } @@ -22738,7 +23457,7 @@ DUK_EXTERNAL const char *duk_push_vsprintf(duk_hthread *thr, const char *fmt, va * This works 99% of the time which is quite nice. */ for (;;) { - va_list ap_copy; /* copied so that 'ap' can be reused */ + va_list ap_copy; /* copied so that 'ap' can be reused */ if (sz <= sizeof(stack_buf)) { buf = stack_buf; @@ -22768,7 +23487,7 @@ DUK_EXTERNAL const char *duk_push_vsprintf(duk_hthread *thr, const char *fmt, va /* Cannot use duk_buffer_to_string() on the buffer because it is * usually larger than 'len'; 'buf' is also usually a stack buffer. */ - res = duk_push_lstring(thr, (const char *) buf, (duk_size_t) len); /* [ buf? res ] */ + res = duk_push_lstring(thr, (const char *) buf, (duk_size_t) len); /* [ buf? res ] */ if (pushed_buf) { duk_remove_m2(thr); } @@ -22789,13 +23508,14 @@ DUK_EXTERNAL const char *duk_push_sprintf(duk_hthread *thr, const char *fmt, ... return ret; } -DUK_INTERNAL duk_hobject *duk_push_object_helper(duk_hthread *thr, duk_uint_t hobject_flags_and_class, duk_small_int_t prototype_bidx) { +DUK_INTERNAL duk_hobject *duk_push_object_helper(duk_hthread *thr, + duk_uint_t hobject_flags_and_class, + duk_small_int_t prototype_bidx) { duk_tval *tv_slot; duk_hobject *h; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(prototype_bidx == -1 || - (prototype_bidx >= 0 && prototype_bidx < DUK_NUM_BUILTINS)); + DUK_ASSERT(prototype_bidx == -1 || (prototype_bidx >= 0 && prototype_bidx < DUK_NUM_BUILTINS)); DUK__CHECK_SPACE(); @@ -22806,7 +23526,7 @@ DUK_INTERNAL duk_hobject *duk_push_object_helper(duk_hthread *thr, duk_uint_t ho tv_slot = thr->valstack_top; DUK_TVAL_SET_OBJECT(tv_slot, h); - DUK_HOBJECT_INCREF(thr, h); /* no side effects */ + DUK_HOBJECT_INCREF(thr, h); /* no side effects */ thr->valstack_top++; /* object is now reachable */ @@ -22836,9 +23556,8 @@ DUK_EXTERNAL duk_idx_t duk_push_object(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), DUK_BIDX_OBJECT_PROTOTYPE); return duk_get_top_index_unsafe(thr); } @@ -22851,11 +23570,8 @@ DUK_EXTERNAL duk_idx_t duk_push_array(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_ARRAY_PART | - DUK_HOBJECT_FLAG_EXOTIC_ARRAY | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAY); + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_ARRAY_PART | + DUK_HOBJECT_FLAG_EXOTIC_ARRAY | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAY); obj = duk_harray_alloc(thr, flags); DUK_ASSERT(obj != NULL); @@ -22864,11 +23580,11 @@ DUK_EXTERNAL duk_idx_t duk_push_array(duk_hthread *thr) { tv_slot = thr->valstack_top; DUK_TVAL_SET_OBJECT(tv_slot, (duk_hobject *) obj); - DUK_HOBJECT_INCREF(thr, obj); /* XXX: could preallocate with refcount = 1 */ + DUK_HOBJECT_INCREF(thr, obj); /* XXX: could preallocate with refcount = 1 */ ret = (duk_idx_t) (thr->valstack_top - thr->valstack_bottom); thr->valstack_top++; - DUK_ASSERT(obj->length == 0); /* Array .length starts at zero. */ + DUK_ASSERT(obj->length == 0); /* Array .length starts at zero. */ return ret; } @@ -22880,22 +23596,19 @@ DUK_EXTERNAL duk_idx_t duk_push_bare_array(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_ARRAY_PART | - DUK_HOBJECT_FLAG_EXOTIC_ARRAY | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAY); + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_ARRAY_PART | + DUK_HOBJECT_FLAG_EXOTIC_ARRAY | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAY); obj = duk_harray_alloc(thr, flags); DUK_ASSERT(obj != NULL); tv_slot = thr->valstack_top; DUK_TVAL_SET_OBJECT(tv_slot, (duk_hobject *) obj); - DUK_HOBJECT_INCREF(thr, obj); /* XXX: could preallocate with refcount = 1 */ + DUK_HOBJECT_INCREF(thr, obj); /* XXX: could preallocate with refcount = 1 */ ret = (duk_idx_t) (thr->valstack_top - thr->valstack_bottom); thr->valstack_top++; - DUK_ASSERT(obj->length == 0); /* Array .length starts at zero. */ + DUK_ASSERT(obj->length == 0); /* Array .length starts at zero. */ return ret; } @@ -22922,12 +23635,7 @@ DUK_INTERNAL duk_harray *duk_push_harray_with_size(duk_hthread *thr, duk_uint32_ a = duk_push_harray(thr); - duk_hobject_realloc_props(thr, - (duk_hobject *) a, - 0, - size, - 0, - 0); + duk_hobject_realloc_props(thr, (duk_hobject *) a, 0, size, 0, 0); a->length = size; return a; } @@ -22951,9 +23659,7 @@ DUK_EXTERNAL duk_idx_t duk_push_thread_raw(duk_hthread *thr, duk_uint_t flags) { DUK__CHECK_SPACE(); - obj = duk_hthread_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_THREAD)); + obj = duk_hthread_alloc(thr, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_THREAD)); DUK_ASSERT(obj != NULL); obj->state = DUK_HTHREAD_STATE_INACTIVE; #if defined(DUK_USE_ROM_STRINGS) @@ -22993,8 +23699,7 @@ DUK_EXTERNAL duk_idx_t duk_push_thread_raw(duk_hthread *thr, duk_uint_t flags) { /* Initial stack size satisfies the stack slack constraints so there * is no need to require stack here. */ - DUK_ASSERT(DUK_VALSTACK_INITIAL_SIZE >= - DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); + DUK_ASSERT(DUK_VALSTACK_INITIAL_SIZE >= DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); return ret; } @@ -23013,10 +23718,8 @@ DUK_INTERNAL duk_hcompfunc *duk_push_hcompfunc(duk_hthread *thr) { */ obj = duk_hcompfunc_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_CALLABLE | - DUK_HOBJECT_FLAG_COMPFUNC | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION)); + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_CALLABLE | DUK_HOBJECT_FLAG_COMPFUNC | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION)); if (DUK_UNLIKELY(obj == NULL)) { DUK_ERROR_ALLOC_FAILED(thr); DUK_WO_NORETURN(return NULL;); @@ -23044,11 +23747,8 @@ DUK_INTERNAL duk_hboundfunc *duk_push_hboundfunc(duk_hthread *thr) { DUK__CHECK_SPACE(); obj = duk_hboundfunc_alloc(thr->heap, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BOUNDFUNC | - DUK_HOBJECT_FLAG_CONSTRUCTABLE | - DUK_HOBJECT_FLAG_CALLABLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION)); + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BOUNDFUNC | DUK_HOBJECT_FLAG_CONSTRUCTABLE | + DUK_HOBJECT_FLAG_CALLABLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION)); if (!obj) { DUK_ERROR_ALLOC_FAILED(thr); DUK_WO_NORETURN(return NULL;); @@ -23066,7 +23766,8 @@ DUK_INTERNAL duk_hboundfunc *duk_push_hboundfunc(duk_hthread *thr) { return obj; } -DUK_LOCAL duk_idx_t duk__push_c_function_raw(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_uint_t flags, duk_small_uint_t proto_bidx) { +DUK_LOCAL duk_idx_t +duk__push_c_function_raw(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_uint_t flags, duk_small_uint_t proto_bidx) { duk_hnatfunc *obj; duk_idx_t ret; duk_tval *tv_slot; @@ -23094,7 +23795,8 @@ DUK_LOCAL duk_idx_t duk__push_c_function_raw(duk_hthread *thr, duk_c_function fu obj->nargs = func_nargs; DUK_DDD(DUK_DDDPRINT("created native function object with flags: 0x%08lx, nargs=%ld", - (unsigned long) obj->obj.hdr.h_flags, (long) obj->nargs)); + (unsigned long) obj->obj.hdr.h_flags, + (long) obj->nargs)); tv_slot = thr->valstack_top; DUK_TVAL_SET_OBJECT(tv_slot, (duk_hobject *) obj); @@ -23106,7 +23808,7 @@ DUK_LOCAL duk_idx_t duk__push_c_function_raw(duk_hthread *thr, duk_c_function fu DUK_HOBJECT_SET_PROTOTYPE_INIT_INCREF(thr, (duk_hobject *) obj, thr->builtins[proto_bidx]); return ret; - api_error: +api_error: DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return 0;); } @@ -23116,15 +23818,9 @@ DUK_EXTERNAL duk_idx_t duk_push_c_function(duk_hthread *thr, duk_c_function func DUK_ASSERT_API_ENTRY(thr); - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_CONSTRUCTABLE | - DUK_HOBJECT_FLAG_CALLABLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_NATFUNC | - DUK_HOBJECT_FLAG_NEWENV | - DUK_HOBJECT_FLAG_STRICT | - DUK_HOBJECT_FLAG_NOTAIL | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_CONSTRUCTABLE | DUK_HOBJECT_FLAG_CALLABLE | + DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_NATFUNC | DUK_HOBJECT_FLAG_NEWENV | DUK_HOBJECT_FLAG_STRICT | + DUK_HOBJECT_FLAG_NOTAIL | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); /* Default prototype is a Duktape specific %NativeFunctionPrototype% * which provides .length and .name getters. @@ -23137,15 +23833,9 @@ DUK_INTERNAL void duk_push_c_function_builtin(duk_hthread *thr, duk_c_function f DUK_ASSERT_API_ENTRY(thr); - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_CONSTRUCTABLE | - DUK_HOBJECT_FLAG_CALLABLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_NATFUNC | - DUK_HOBJECT_FLAG_NEWENV | - DUK_HOBJECT_FLAG_STRICT | - DUK_HOBJECT_FLAG_NOTAIL | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_CONSTRUCTABLE | DUK_HOBJECT_FLAG_CALLABLE | + DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_NATFUNC | DUK_HOBJECT_FLAG_NEWENV | DUK_HOBJECT_FLAG_STRICT | + DUK_HOBJECT_FLAG_NOTAIL | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); /* Must use Function.prototype for standard built-in functions. */ (void) duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_FUNCTION_PROTOTYPE); @@ -23156,20 +23846,16 @@ DUK_INTERNAL void duk_push_c_function_builtin_noconstruct(duk_hthread *thr, duk_ DUK_ASSERT_API_ENTRY(thr); - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_CALLABLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_NATFUNC | - DUK_HOBJECT_FLAG_NEWENV | - DUK_HOBJECT_FLAG_STRICT | - DUK_HOBJECT_FLAG_NOTAIL | + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_CALLABLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_NATFUNC | + DUK_HOBJECT_FLAG_NEWENV | DUK_HOBJECT_FLAG_STRICT | DUK_HOBJECT_FLAG_NOTAIL | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION); /* Must use Function.prototype for standard built-in functions. */ (void) duk__push_c_function_raw(thr, func, nargs, flags, DUK_BIDX_FUNCTION_PROTOTYPE); } -DUK_EXTERNAL duk_idx_t duk_push_c_lightfunc(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_idx_t length, duk_int_t magic) { +DUK_EXTERNAL duk_idx_t +duk_push_c_lightfunc(duk_hthread *thr, duk_c_function func, duk_idx_t nargs, duk_idx_t length, duk_int_t magic) { duk_small_uint_t lf_flags; duk_tval *tv_slot; @@ -23198,13 +23884,15 @@ DUK_EXTERNAL duk_idx_t duk_push_c_lightfunc(duk_hthread *thr, duk_c_function fun DUK_ASSERT(tv_slot >= thr->valstack_bottom); return (duk_idx_t) (tv_slot - thr->valstack_bottom); - api_error: +api_error: DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return 0;); } #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -DUK_INTERNAL duk_hbufobj *duk_push_bufobj_raw(duk_hthread *thr, duk_uint_t hobject_flags_and_class, duk_small_int_t prototype_bidx) { +DUK_INTERNAL duk_hbufobj *duk_push_bufobj_raw(duk_hthread *thr, + duk_uint_t hobject_flags_and_class, + duk_small_int_t prototype_bidx) { duk_hbufobj *obj; duk_tval *tv_slot; @@ -23226,34 +23914,86 @@ DUK_INTERNAL duk_hbufobj *duk_push_bufobj_raw(duk_hthread *thr, duk_uint_t hobje return obj; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* XXX: There's quite a bit of overlap with buffer creation handling in * duk_bi_buffer.c. Look for overlap and refactor. */ #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -#define DUK__PACK_ARGS(classnum,protobidx,elemtype,elemshift,istypedarray) \ +#define DUK__PACK_ARGS(classnum, protobidx, elemtype, elemshift, istypedarray) \ (((classnum) << 24) | ((protobidx) << 16) | ((elemtype) << 8) | ((elemshift) << 4) | (istypedarray)) static const duk_uint32_t duk__bufobj_flags_lookup[] = { /* Node.js Buffers are Uint8Array instances which inherit from Buffer.prototype. */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_ARRAYBUFFER, DUK_BIDX_ARRAYBUFFER_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT8, 0, 0), /* DUK_BUFOBJ_ARRAYBUFFER */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT8ARRAY, DUK_BIDX_NODEJS_BUFFER_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT8, 0, 1), /* DUK_BUFOBJ_NODEJS_BUFFER */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_DATAVIEW, DUK_BIDX_DATAVIEW_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT8, 0, 0), /* DUK_BUFOBJ_DATAVIEW */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_INT8ARRAY, DUK_BIDX_INT8ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_INT8, 0, 1), /* DUK_BUFOBJ_INT8ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT8ARRAY, DUK_BIDX_UINT8ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT8, 0, 1), /* DUK_BUFOBJ_UINT8ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY, DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT8CLAMPED, 0, 1), /* DUK_BUFOBJ_UINT8CLAMPEDARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_INT16ARRAY, DUK_BIDX_INT16ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_INT16, 1, 1), /* DUK_BUFOBJ_INT16ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT16ARRAY, DUK_BIDX_UINT16ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT16, 1, 1), /* DUK_BUFOBJ_UINT16ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_INT32ARRAY, DUK_BIDX_INT32ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_INT32, 2, 1), /* DUK_BUFOBJ_INT32ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT32ARRAY, DUK_BIDX_UINT32ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_UINT32, 2, 1), /* DUK_BUFOBJ_UINT32ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_FLOAT32ARRAY, DUK_BIDX_FLOAT32ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_FLOAT32, 2, 1), /* DUK_BUFOBJ_FLOAT32ARRAY */ - DUK__PACK_ARGS(DUK_HOBJECT_CLASS_FLOAT64ARRAY, DUK_BIDX_FLOAT64ARRAY_PROTOTYPE, DUK_HBUFOBJ_ELEM_FLOAT64, 3, 1) /* DUK_BUFOBJ_FLOAT64ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_ARRAYBUFFER, + DUK_BIDX_ARRAYBUFFER_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT8, + 0, + 0), /* DUK_BUFOBJ_ARRAYBUFFER */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT8ARRAY, + DUK_BIDX_NODEJS_BUFFER_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT8, + 0, + 1), /* DUK_BUFOBJ_NODEJS_BUFFER */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_DATAVIEW, + DUK_BIDX_DATAVIEW_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT8, + 0, + 0), /* DUK_BUFOBJ_DATAVIEW */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_INT8ARRAY, + DUK_BIDX_INT8ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_INT8, + 0, + 1), /* DUK_BUFOBJ_INT8ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT8ARRAY, + DUK_BIDX_UINT8ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT8, + 0, + 1), /* DUK_BUFOBJ_UINT8ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY, + DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT8CLAMPED, + 0, + 1), /* DUK_BUFOBJ_UINT8CLAMPEDARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_INT16ARRAY, + DUK_BIDX_INT16ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_INT16, + 1, + 1), /* DUK_BUFOBJ_INT16ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT16ARRAY, + DUK_BIDX_UINT16ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT16, + 1, + 1), /* DUK_BUFOBJ_UINT16ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_INT32ARRAY, + DUK_BIDX_INT32ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_INT32, + 2, + 1), /* DUK_BUFOBJ_INT32ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_UINT32ARRAY, + DUK_BIDX_UINT32ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_UINT32, + 2, + 1), /* DUK_BUFOBJ_UINT32ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_FLOAT32ARRAY, + DUK_BIDX_FLOAT32ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_FLOAT32, + 2, + 1), /* DUK_BUFOBJ_FLOAT32ARRAY */ + DUK__PACK_ARGS(DUK_HOBJECT_CLASS_FLOAT64ARRAY, + DUK_BIDX_FLOAT64ARRAY_PROTOTYPE, + DUK_HBUFOBJ_ELEM_FLOAT64, + 3, + 1) /* DUK_BUFOBJ_FLOAT64ARRAY */ }; -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) -DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, duk_size_t byte_offset, duk_size_t byte_length, duk_uint_t flags) { +DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, + duk_idx_t idx_buffer, + duk_size_t byte_offset, + duk_size_t byte_length, + duk_uint_t flags) { duk_hbufobj *h_bufobj; duk_hbuffer *h_val; duk_hobject *h_arraybuf; @@ -23276,7 +24016,7 @@ DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, } } - DUK_ASSERT_DISABLE(flags >= 0); /* flags is unsigned */ + DUK_ASSERT_DISABLE(flags >= 0); /* flags is unsigned */ lookupidx = flags; if (DUK_UNLIKELY(lookupidx >= sizeof(duk__bufobj_flags_lookup) / sizeof(duk_uint32_t))) { goto arg_error; @@ -23286,9 +24026,9 @@ DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, protobidx = (tmp >> 16) & 0xff; h_arraybuf = duk_get_hobject(thr, idx_buffer); - if (h_arraybuf != NULL && /* argument is an object */ - flags != DUK_BUFOBJ_ARRAYBUFFER && /* creating a view */ - DUK_HOBJECT_GET_CLASS_NUMBER(h_arraybuf) == DUK_HOBJECT_CLASS_ARRAYBUFFER /* argument is ArrayBuffer */) { + if (h_arraybuf != NULL && /* argument is an object */ + flags != DUK_BUFOBJ_ARRAYBUFFER && /* creating a view */ + DUK_HOBJECT_GET_CLASS_NUMBER(h_arraybuf) == DUK_HOBJECT_CLASS_ARRAYBUFFER /* argument is ArrayBuffer */) { duk_uint_t tmp_offset; DUK_HBUFOBJ_ASSERT_VALID((duk_hbufobj *) h_arraybuf); @@ -23325,9 +24065,7 @@ DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, DUK_ASSERT(h_val != NULL); h_bufobj = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(classnum), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | DUK_HOBJECT_CLASS_AS_FLAGS(classnum), (duk_small_int_t) protobidx); DUK_ASSERT(h_bufobj != NULL); @@ -23350,16 +24088,20 @@ DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, */ return; - range_error: +range_error: DUK_ERROR_RANGE(thr, DUK_STR_INVALID_ARGS); DUK_WO_NORETURN(return;); - arg_error: +arg_error: DUK_ERROR_TYPE(thr, DUK_STR_INVALID_ARGS); DUK_WO_NORETURN(return;); } -#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ -DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, duk_size_t byte_offset, duk_size_t byte_length, duk_uint_t flags) { +#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ +DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, + duk_idx_t idx_buffer, + duk_size_t byte_offset, + duk_size_t byte_length, + duk_uint_t flags) { DUK_ASSERT_API_ENTRY(thr); DUK_UNREF(idx_buffer); DUK_UNREF(byte_offset); @@ -23368,9 +24110,14 @@ DUK_EXTERNAL void duk_push_buffer_object(duk_hthread *thr, duk_idx_t idx_buffer, DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ -DUK_EXTERNAL duk_idx_t duk_push_error_object_va_raw(duk_hthread *thr, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap) { +DUK_EXTERNAL duk_idx_t duk_push_error_object_va_raw(duk_hthread *thr, + duk_errcode_t err_code, + const char *filename, + duk_int_t line, + const char *fmt, + va_list ap) { duk_hobject *proto; #if defined(DUK_USE_AUGMENT_ERROR_CREATE) duk_small_uint_t augment_flags; @@ -23393,9 +24140,8 @@ DUK_EXTERNAL duk_idx_t duk_push_error_object_va_raw(duk_hthread *thr, duk_errcod /* error gets its 'name' from the prototype */ proto = duk_error_prototype_from_code(thr, err_code); (void) duk_push_object_helper_proto(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ERROR), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ERROR), proto); /* ... and its 'message' from an instance property */ @@ -23418,13 +24164,14 @@ DUK_EXTERNAL duk_idx_t duk_push_error_object_va_raw(duk_hthread *thr, duk_errcod /* Creation time error augmentation */ #if defined(DUK_USE_AUGMENT_ERROR_CREATE) /* filename may be NULL in which case file/line is not recorded */ - duk_err_augment_error_create(thr, thr, filename, line, augment_flags); /* may throw an error */ + duk_err_augment_error_create(thr, thr, filename, line, augment_flags); /* may throw an error */ #endif return duk_get_top_index_unsafe(thr); } -DUK_EXTERNAL duk_idx_t duk_push_error_object_raw(duk_hthread *thr, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...) { +DUK_EXTERNAL duk_idx_t +duk_push_error_object_raw(duk_hthread *thr, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...) { va_list ap; duk_idx_t ret; @@ -23452,7 +24199,7 @@ DUK_EXTERNAL duk_idx_t duk_push_error_object_stash(duk_hthread *thr, duk_errcode va_end(ap); return ret; } -#endif /* DUK_USE_VARIADIC_MACROS */ +#endif /* DUK_USE_VARIADIC_MACROS */ DUK_EXTERNAL void *duk_push_buffer_raw(duk_hthread *thr, duk_size_t size, duk_small_uint_t flags) { duk_tval *tv_slot; @@ -23555,13 +24302,10 @@ DUK_EXTERNAL duk_idx_t duk_push_proxy(duk_hthread *thr, duk_uint_t proxy_flags) /* CALLABLE and CONSTRUCTABLE flags are copied from the (initial) * target, see ES2015 Sections 9.5.15 and 9.5.13. */ - flags = DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) h_target) & - (DUK_HOBJECT_FLAG_CALLABLE | DUK_HOBJECT_FLAG_CONSTRUCTABLE); - flags |= DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ; + flags = DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) h_target) & (DUK_HOBJECT_FLAG_CALLABLE | DUK_HOBJECT_FLAG_CONSTRUCTABLE); + flags |= DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ; if (flags & DUK_HOBJECT_FLAG_CALLABLE) { - flags |= DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION) | - DUK_HOBJECT_FLAG_SPECIAL_CALL; + flags |= DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_FUNCTION) | DUK_HOBJECT_FLAG_SPECIAL_CALL; } else { flags |= DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT); } @@ -23587,25 +24331,25 @@ DUK_EXTERNAL duk_idx_t duk_push_proxy(duk_hthread *thr, duk_uint_t proxy_flags) DUK_TVAL_SET_OBJECT(tv_slot, (duk_hobject *) h_proxy); DUK_HOBJECT_INCREF(thr, (duk_hobject *) h_proxy); tv_slot++; - DUK_TVAL_SET_UNDEFINED(tv_slot); /* [ ... target handler ] -> [ ... proxy undefined ] */ - thr->valstack_top = tv_slot; /* -> [ ... proxy ] */ + DUK_TVAL_SET_UNDEFINED(tv_slot); /* [ ... target handler ] -> [ ... proxy undefined ] */ + thr->valstack_top = tv_slot; /* -> [ ... proxy ] */ DUK_DD(DUK_DDPRINT("created Proxy: %!iT", duk_get_tval(thr, -1))); return (duk_idx_t) (thr->valstack_top - thr->valstack_bottom - 1); - fail_args: +fail_args: DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return 0;); } -#else /* DUK_USE_ES6_PROXY */ +#else /* DUK_USE_ES6_PROXY */ DUK_EXTERNAL duk_idx_t duk_push_proxy(duk_hthread *thr, duk_uint_t proxy_flags) { DUK_ASSERT_API_ENTRY(thr); DUK_UNREF(proxy_flags); DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return 0;); } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ #if defined(DUK_USE_ASSERTIONS) DUK_LOCAL void duk__validate_push_heapptr(duk_hthread *thr, void *ptr) { @@ -23632,9 +24376,7 @@ DUK_LOCAL void duk__validate_push_heapptr(duk_hthread *thr, void *ptr) { * the finalizer starts executing). */ #if defined(DUK_USE_FINALIZER_SUPPORT) - for (curr = thr->heap->finalize_list; - curr != NULL; - curr = DUK_HEAPHDR_GET_NEXT(thr->heap, curr)) { + for (curr = thr->heap->finalize_list; curr != NULL; curr = DUK_HEAPHDR_GET_NEXT(thr->heap, curr)) { /* FINALIZABLE is set for all objects on finalize_list * except for an object being finalized right now. So * can't assert here. @@ -23646,18 +24388,18 @@ DUK_LOCAL void duk__validate_push_heapptr(duk_hthread *thr, void *ptr) { if (curr == h) { if (DUK_HEAPHDR_HAS_FINALIZED((duk_heaphdr *) h)) { /* Object is currently being finalized. */ - DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ + DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ found = 1; } else { /* Not being finalized but on finalize_list, * allowed since Duktape 2.1. */ - DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ + DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ found = 1; } } } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ #if defined(DUK_USE_REFERENCE_COUNTING) /* Because refzero_list is now processed to completion inline with @@ -23683,7 +24425,7 @@ DUK_LOCAL void duk__validate_push_heapptr(duk_hthread *thr, void *ptr) { #endif while (str != NULL) { if (str == (duk_hstring *) h) { - DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ + DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ found = 1; break; } @@ -23692,18 +24434,16 @@ DUK_LOCAL void duk__validate_push_heapptr(duk_hthread *thr, void *ptr) { } DUK_ASSERT(found != 0); } else { - for (curr = thr->heap->heap_allocated; - curr != NULL; - curr = DUK_HEAPHDR_GET_NEXT(thr->heap, curr)) { + for (curr = thr->heap->heap_allocated; curr != NULL; curr = DUK_HEAPHDR_GET_NEXT(thr->heap, curr)) { if (curr == h) { - DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ + DUK_ASSERT(found == 0); /* Would indicate corrupted lists. */ found = 1; } } DUK_ASSERT(found != 0); } } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ DUK_EXTERNAL duk_idx_t duk_push_heapptr(duk_hthread *thr, void *ptr) { duk_idx_t ret; @@ -23769,7 +24509,7 @@ DUK_EXTERNAL duk_idx_t duk_push_heapptr(duk_hthread *thr, void *ptr) { * heap_allocated. */ #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(curr) >= 1); /* Preincremented on finalize_list insert. */ + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(curr) >= 1); /* Preincremented on finalize_list insert. */ DUK_HEAPHDR_PREDEC_REFCOUNT(curr); #endif DUK_HEAP_REMOVE_FROM_FINALIZE_LIST(thr->heap, curr); @@ -23801,10 +24541,9 @@ DUK_EXTERNAL duk_idx_t duk_push_bare_object(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), - -1); /* no prototype */ + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), + -1); /* no prototype */ return duk_get_top_index_unsafe(thr); } @@ -23913,12 +24652,12 @@ DUK_INTERNAL void duk_pop_n_unsafe(duk_hthread *thr, duk_idx_t count) { DUK_ASSERT_API_ENTRY(thr); duk_pop_n(thr, count); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ DUK_INTERNAL void duk_pop_n_unsafe(duk_hthread *thr, duk_idx_t count) { DUK_ASSERT_API_ENTRY(thr); duk__pop_n_unsafe_raw(thr, count); } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ /* Pop N elements without DECREF (in effect "stealing" any actual refcounts). */ #if defined(DUK_USE_REFERENCE_COUNTING) @@ -23941,12 +24680,12 @@ DUK_INTERNAL void duk_pop_n_nodecref_unsafe(duk_hthread *thr, duk_idx_t count) { DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); } -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ DUK_INTERNAL void duk_pop_n_nodecref_unsafe(duk_hthread *thr, duk_idx_t count) { DUK_ASSERT_API_ENTRY(thr); duk_pop_n_unsafe(thr, count); } -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ /* Popping one element is called so often that when footprint is not an issue, * compile a specialized function for it. @@ -23964,7 +24703,7 @@ DUK_INTERNAL void duk_pop_nodecref_unsafe(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); duk_pop_n_nodecref_unsafe(thr, 1); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ DUK_LOCAL DUK_ALWAYS_INLINE void duk__pop_unsafe_raw(duk_hthread *thr) { duk_tval *tv; @@ -23976,7 +24715,7 @@ DUK_LOCAL DUK_ALWAYS_INLINE void duk__pop_unsafe_raw(duk_hthread *thr) { tv = --thr->valstack_top; DUK_ASSERT(tv >= thr->valstack_bottom); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ #else DUK_TVAL_SET_UNDEFINED(tv); #endif @@ -24012,14 +24751,14 @@ DUK_INTERNAL void duk_pop_nodecref_unsafe(duk_hthread *thr) { DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); } -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ #if defined(DUK_USE_PREFER_SIZE) DUK_INTERNAL void duk_pop_undefined(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); duk_pop_nodecref_unsafe(thr); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ DUK_INTERNAL void duk_pop_undefined(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); DUK_ASSERT(thr->valstack_top != thr->valstack_bottom); @@ -24031,7 +24770,7 @@ DUK_INTERNAL void duk_pop_undefined(duk_hthread *thr) { DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); } -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ #if defined(DUK_USE_PREFER_SIZE) DUK_EXTERNAL void duk_pop_2(duk_hthread *thr) { @@ -24058,14 +24797,14 @@ DUK_LOCAL DUK_ALWAYS_INLINE void duk__pop_2_unsafe_raw(duk_hthread *thr) { tv = --thr->valstack_top; DUK_ASSERT(tv >= thr->valstack_bottom); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ #else DUK_TVAL_SET_UNDEFINED(tv); #endif tv = --thr->valstack_top; DUK_ASSERT(tv >= thr->valstack_bottom); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv); /* side effects */ #else DUK_TVAL_SET_UNDEFINED(tv); #endif @@ -24099,7 +24838,7 @@ DUK_INTERNAL void duk_pop_2_nodecref_unsafe(duk_hthread *thr) { DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); } -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ DUK_EXTERNAL void duk_pop_3(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); @@ -24146,9 +24885,9 @@ DUK_INTERNAL void duk_pack(duk_hthread *thr, duk_idx_t count) { * multiplying with sizeof(duk_tval) won't wrap. */ DUK_ASSERT(count >= 0 && count <= (duk_idx_t) DUK_USE_VALSTACK_LIMIT); - DUK_ASSERT((duk_size_t) count <= DUK_SIZE_MAX / sizeof(duk_tval)); /* no wrapping */ + DUK_ASSERT((duk_size_t) count <= DUK_SIZE_MAX / sizeof(duk_tval)); /* no wrapping */ - tv_dst = duk_push_harray_with_size_outptr(thr, (duk_uint32_t) count); /* XXX: uninitialized would be OK */ + tv_dst = duk_push_harray_with_size_outptr(thr, (duk_uint32_t) count); /* XXX: uninitialized would be OK */ DUK_ASSERT(count == 0 || tv_dst != NULL); DUK_ASSERT(!duk_is_bare_object(thr, -1)); @@ -24162,7 +24901,7 @@ DUK_INTERNAL void duk_pack(duk_hthread *thr, duk_idx_t count) { * the rest; no refcount operations needed. */ - tv_dst = tv_src; /* when count == 0, same as tv_src (OK) */ + tv_dst = tv_src; /* when count == 0, same as tv_src (OK) */ tv_src = thr->valstack_top - 1; DUK_TVAL_SET_TVAL(tv_dst, tv_src); @@ -24192,9 +24931,8 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(h != NULL); DUK_UNREF(h); -#if defined(DUK_USE_ARRAY_FASTPATH) /* close enough */ - if (DUK_LIKELY(DUK_HOBJECT_IS_ARRAY(h) && - ((duk_harray *) h)->length <= DUK_HOBJECT_GET_ASIZE(h))) { +#if defined(DUK_USE_ARRAY_FASTPATH) /* close enough */ + if (DUK_LIKELY(DUK_HOBJECT_IS_ARRAY(h) && ((duk_harray *) h)->length <= DUK_HOBJECT_GET_ASIZE(h))) { duk_harray *h_arr; duk_tval *tv_src; duk_tval *tv_dst; @@ -24215,8 +24953,7 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) { * XXX: alternatively, could prevent finalizers for the * duration. */ - if (DUK_UNLIKELY(len != h_arr->length || - h_arr->length > DUK_HOBJECT_GET_ASIZE((duk_hobject *) h_arr))) { + if (DUK_UNLIKELY(len != h_arr->length || h_arr->length > DUK_HOBJECT_GET_ASIZE((duk_hobject *) h_arr))) { goto skip_fast; } @@ -24235,7 +24972,7 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) { * without an ancestor lookup (technically * not compliant). */ - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(tv_dst)); /* valstack policy */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(tv_dst)); /* valstack policy */ } else { DUK_TVAL_SET_TVAL(tv_dst, tv_src); DUK_TVAL_INCREF(thr, tv_dst); @@ -24247,8 +24984,8 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) { thr->valstack_top = tv_dst; return (duk_idx_t) h_arr->length; } - skip_fast: -#endif /* DUK_USE_ARRAY_FASTPATH */ + skip_fast: +#endif /* DUK_USE_ARRAY_FASTPATH */ /* Slow path: actual lookups. The initial 'length' lookup * decides the output length, regardless of side effects that @@ -24257,7 +24994,7 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) { */ idx = duk_normalize_index(thr, idx); duk_get_prop_stridx(thr, idx, DUK_STRIDX_LENGTH); - len = duk_to_uint32(thr, -1); /* ToUint32() coercion required */ + len = duk_to_uint32(thr, -1); /* ToUint32() coercion required */ if (DUK_UNLIKELY(len >= 0x80000000UL)) { goto fail_over_2g; } @@ -24276,7 +25013,7 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) { DUK_ERROR_TYPE_INVALID_ARGS(thr); DUK_WO_NORETURN(return 0;); - fail_over_2g: +fail_over_2g: DUK_ERROR_RANGE_INVALID_LENGTH(thr); DUK_WO_NORETURN(return 0;); } @@ -24361,7 +25098,12 @@ DUK_EXTERNAL void duk_fatal_raw(duk_hthread *thr, const char *err_msg) { } } -DUK_EXTERNAL void duk_error_va_raw(duk_hthread *thr, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap) { +DUK_EXTERNAL void duk_error_va_raw(duk_hthread *thr, + duk_errcode_t err_code, + const char *filename, + duk_int_t line, + const char *fmt, + va_list ap) { DUK_ASSERT_API_ENTRY(thr); duk_push_error_object_va_raw(thr, err_code, filename, line, fmt, ap); @@ -24369,7 +25111,12 @@ DUK_EXTERNAL void duk_error_va_raw(duk_hthread *thr, duk_errcode_t err_code, con DUK_WO_NORETURN(return;); } -DUK_EXTERNAL void duk_error_raw(duk_hthread *thr, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...) { +DUK_EXTERNAL void duk_error_raw(duk_hthread *thr, + duk_errcode_t err_code, + const char *filename, + duk_int_t line, + const char *fmt, + ...) { va_list ap; DUK_ASSERT_API_ENTRY(thr); @@ -24388,7 +25135,8 @@ DUK_EXTERNAL void duk_error_raw(duk_hthread *thr, duk_errcode_t err_code, const #endif #if !defined(DUK_USE_VARIADIC_MACROS) -DUK_NORETURN(DUK_LOCAL_DECL void duk__throw_error_from_stash(duk_hthread *thr, duk_errcode_t err_code, const char *fmt, va_list ap)); +DUK_NORETURN( + DUK_LOCAL_DECL void duk__throw_error_from_stash(duk_hthread *thr, duk_errcode_t err_code, const char *fmt, va_list ap)); DUK_LOCAL void duk__throw_error_from_stash(duk_hthread *thr, duk_errcode_t err_code, const char *fmt, va_list ap) { const char *filename; @@ -24406,7 +25154,8 @@ DUK_LOCAL void duk__throw_error_from_stash(duk_hthread *thr, duk_errcode_t err_c DUK_WO_NORETURN(return;); } -#define DUK__ERROR_STASH_SHARED(code) do { \ +#define DUK__ERROR_STASH_SHARED(code) \ + do { \ va_list ap; \ va_start(ap, fmt); \ duk__throw_error_from_stash(thr, (code), fmt, ap); \ @@ -24446,7 +25195,7 @@ DUK_EXTERNAL duk_ret_t duk_uri_error_stash(duk_hthread *thr, const char *fmt, .. DUK_ASSERT_API_ENTRY(thr); DUK__ERROR_STASH_SHARED(DUK_ERR_URI_ERROR); } -#endif /* DUK_USE_VARIADIC_MACROS */ +#endif /* DUK_USE_VARIADIC_MACROS */ /* * Comparison @@ -24565,7 +25314,7 @@ DUK_INTERNAL void duk_push_lightfunc_tostring(duk_hthread *thr, duk_tval *tv) { DUK_ASSERT_API_ENTRY(thr); DUK_ASSERT(DUK_TVAL_IS_LIGHTFUNC(tv)); - DUK_TVAL_GET_LIGHTFUNC(tv, func, lf_flags); /* read before 'tv' potentially invalidated */ + DUK_TVAL_GET_LIGHTFUNC(tv, func, lf_flags); /* read before 'tv' potentially invalidated */ duk_push_literal(thr, "function "); duk_push_lightfunc_name_raw(thr, func, lf_flags); duk_push_literal(thr, "() { [lightfunc code] }"); @@ -24586,7 +25335,7 @@ DUK_INTERNAL void duk_push_string_funcptr(duk_hthread *thr, duk_uint8_t *ptr, du duk_small_uint_t t; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(sz <= 32); /* sanity limit for function pointer size */ + DUK_ASSERT(sz <= 32); /* sanity limit for function pointer size */ p = buf; #if defined(DUK_USE_INTEGER_LE) @@ -24615,9 +25364,9 @@ DUK_INTERNAL void duk_push_string_funcptr(duk_hthread *thr, duk_uint8_t *ptr, du */ /* String limits for summary strings. */ -#define DUK__READABLE_SUMMARY_MAXCHARS 96 /* maximum supported by helper */ -#define DUK__READABLE_STRING_MAXCHARS 32 /* for strings/symbols */ -#define DUK__READABLE_ERRMSG_MAXCHARS 96 /* for error messages */ +#define DUK__READABLE_SUMMARY_MAXCHARS 96 /* maximum supported by helper */ +#define DUK__READABLE_STRING_MAXCHARS 32 /* for strings/symbols */ +#define DUK__READABLE_ERRMSG_MAXCHARS 96 /* for error messages */ /* String sanitizer which escapes ASCII control characters and a few other * ASCII characters, passes Unicode as is, and replaces invalid UTF-8 with @@ -24626,8 +25375,7 @@ DUK_INTERNAL void duk_push_string_funcptr(duk_hthread *thr, duk_uint8_t *ptr, du */ DUK_LOCAL void duk__push_hstring_readable_unicode(duk_hthread *thr, duk_hstring *h_input, duk_small_uint_t maxchars) { const duk_uint8_t *p, *p_start, *p_end; - duk_uint8_t buf[DUK_UNICODE_MAX_XUTF8_LENGTH * DUK__READABLE_SUMMARY_MAXCHARS + - 2 /*quotes*/ + 3 /*periods*/]; + duk_uint8_t buf[DUK_UNICODE_MAX_XUTF8_LENGTH * DUK__READABLE_SUMMARY_MAXCHARS + 2 /*quotes*/ + 3 /*periods*/]; duk_uint8_t *q; duk_ucodepoint_t cp; duk_small_uint_t nchars; @@ -24655,7 +25403,7 @@ DUK_LOCAL void duk__push_hstring_readable_unicode(duk_hthread *thr, duk_hstring } if (duk_unicode_decode_xutf8(thr, &p, p_start, p_end, &cp)) { if (cp < 0x20 || cp == 0x7f || cp == DUK_ASC_SINGLEQUOTE || cp == DUK_ASC_BACKSLASH) { - DUK_ASSERT(DUK_UNICODE_MAX_XUTF8_LENGTH >= 4); /* estimate is valid */ + DUK_ASSERT(DUK_UNICODE_MAX_XUTF8_LENGTH >= 4); /* estimate is valid */ DUK_ASSERT((cp >> 4) <= 0x0f); *q++ = (duk_uint8_t) DUK_ASC_BACKSLASH; *q++ = (duk_uint8_t) DUK_ASC_LC_X; @@ -24665,7 +25413,7 @@ DUK_LOCAL void duk__push_hstring_readable_unicode(duk_hthread *thr, duk_hstring q += duk_unicode_encode_xutf8(cp, q); } } else { - p++; /* advance manually */ + p++; /* advance manually */ *q++ = (duk_uint8_t) DUK_ASC_QUESTION; } nchars++; @@ -24704,8 +25452,10 @@ DUK_LOCAL const char *duk__push_string_tval_readable(duk_hthread *thr, duk_tval duk_hobject *h = DUK_TVAL_GET_OBJECT(tv); DUK_ASSERT(h != NULL); - if (error_aware && - duk_hobject_prototype_chain_contains(thr, h, thr->builtins[DUK_BIDX_ERROR_PROTOTYPE], 1 /*ignore_loop*/)) { + if (error_aware && duk_hobject_prototype_chain_contains(thr, + h, + thr->builtins[DUK_BIDX_ERROR_PROTOTYPE], + 1 /*ignore_loop*/)) { /* Get error message in a side effect free way if * possible; if not, summarize as a generic object. * Error message currently gets quoted. @@ -24719,7 +25469,9 @@ DUK_LOCAL const char *duk__push_string_tval_readable(duk_hthread *thr, duk_tval /* It's critical to avoid recursion so * only summarize a string .message. */ - duk__push_hstring_readable_unicode(thr, DUK_TVAL_GET_STRING(tv_msg), DUK__READABLE_ERRMSG_MAXCHARS); + duk__push_hstring_readable_unicode(thr, + DUK_TVAL_GET_STRING(tv_msg), + DUK__READABLE_ERRMSG_MAXCHARS); break; } } @@ -24802,7 +25554,7 @@ DUK_INTERNAL void duk_push_symbol_descriptive_string(duk_hthread *thr, duk_hstri * Functions */ -#if 0 /* not used yet */ +#if 0 /* not used yet */ DUK_INTERNAL void duk_push_hnatfunc_name(duk_hthread *thr, duk_hnatfunc *h) { duk_c_function func; @@ -24829,7 +25581,7 @@ DUK_INTERNAL void duk_copy_tvals_incref(duk_hthread *thr, duk_tval *tv_dst, duk_ DUK_ASSERT_API_ENTRY(thr); DUK_UNREF(thr); - DUK_ASSERT(count * sizeof(duk_tval) >= count); /* no wrap */ + DUK_ASSERT(count * sizeof(duk_tval) >= count); /* no wrap */ duk_memcpy_unsafe((void *) tv_dst, (const void *) tv_src, count * sizeof(duk_tval)); @@ -24901,15 +25653,14 @@ DUK_LOCAL void duk__concat_and_join_helper(duk_hthread *thr, duk_idx_t count_in, /* Impose a string maximum length, need to handle overflow * correctly. */ - if (new_len < len || /* wrapped */ + if (new_len < len || /* wrapped */ new_len > (duk_size_t) DUK_HSTRING_MAX_BYTELEN) { goto error_overflow; } len = new_len; } - DUK_DDD(DUK_DDDPRINT("join/concat %lu strings, total length %lu bytes", - (unsigned long) count, (unsigned long) len)); + DUK_DDD(DUK_DDDPRINT("join/concat %lu strings, total length %lu bytes", (unsigned long) count, (unsigned long) len)); /* Use stack allocated buffer to ensure reachability in errors * (e.g. intern error). @@ -24922,11 +25673,11 @@ DUK_LOCAL void duk__concat_and_join_helper(duk_hthread *thr, duk_idx_t count_in, idx = 0; for (i = count; i >= 1; i--) { if (is_join && i != count) { - h = duk_require_hstring(thr, -((duk_idx_t) count) - 2); /* extra -1 for buffer */ + h = duk_require_hstring(thr, -((duk_idx_t) count) - 2); /* extra -1 for buffer */ duk_memcpy(buf + idx, DUK_HSTRING_GET_DATA(h), DUK_HSTRING_GET_BYTELEN(h)); idx += DUK_HSTRING_GET_BYTELEN(h); } - h = duk_require_hstring(thr, -((duk_idx_t) i) - 1); /* extra -1 for buffer */ + h = duk_require_hstring(thr, -((duk_idx_t) i) - 1); /* extra -1 for buffer */ duk_memcpy(buf + idx, DUK_HSTRING_GET_DATA(h), DUK_HSTRING_GET_BYTELEN(h)); idx += DUK_HSTRING_GET_BYTELEN(h); } @@ -24938,21 +25689,21 @@ DUK_LOCAL void duk__concat_and_join_helper(duk_hthread *thr, duk_idx_t count_in, /* Get rid of the strings early to minimize memory use before intern. */ if (is_join) { - duk_replace(thr, -((duk_idx_t) count) - 2); /* overwrite sep */ + duk_replace(thr, -((duk_idx_t) count) - 2); /* overwrite sep */ duk_pop_n(thr, (duk_idx_t) count); } else { - duk_replace(thr, -((duk_idx_t) count) - 1); /* overwrite str1 */ + duk_replace(thr, -((duk_idx_t) count) - 1); /* overwrite str1 */ duk_pop_n(thr, (duk_idx_t) (count - 1)); } /* [ ... buf ] */ - (void) duk_buffer_to_string(thr, -1); /* Safe if inputs are safe. */ + (void) duk_buffer_to_string(thr, -1); /* Safe if inputs are safe. */ /* [ ... res ] */ return; - error_overflow: +error_overflow: DUK_ERROR_RANGE(thr, DUK_STR_RESULT_TOO_LONG); DUK_WO_NORETURN(return;); } @@ -24968,7 +25719,7 @@ DUK_INTERNAL void duk_concat_2(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); duk_concat(thr, 2); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ DUK_INTERNAL void duk_concat_2(duk_hthread *thr) { duk_hstring *h1; duk_hstring *h2; @@ -24978,14 +25729,14 @@ DUK_INTERNAL void duk_concat_2(duk_hthread *thr) { duk_size_t len; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(duk_get_top(thr) >= 2); /* Trusted caller. */ + DUK_ASSERT(duk_get_top(thr) >= 2); /* Trusted caller. */ h1 = duk_to_hstring(thr, -2); h2 = duk_to_hstring(thr, -1); len1 = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h1); len2 = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h2); len = len1 + len2; - if (DUK_UNLIKELY(len < len1 || /* wrapped */ + if (DUK_UNLIKELY(len < len1 || /* wrapped */ len > (duk_size_t) DUK_HSTRING_MAX_BYTELEN)) { goto error_overflow; } @@ -24994,7 +25745,7 @@ DUK_INTERNAL void duk_concat_2(duk_hthread *thr) { duk_memcpy((void *) buf, (const void *) DUK_HSTRING_GET_DATA(h1), (size_t) len1); duk_memcpy((void *) (buf + len1), (const void *) DUK_HSTRING_GET_DATA(h2), (size_t) len2); - (void) duk_buffer_to_string(thr, -1); /* Safe if inputs are safe. */ + (void) duk_buffer_to_string(thr, -1); /* Safe if inputs are safe. */ /* [ ... str1 str2 buf ] */ @@ -25002,11 +25753,11 @@ DUK_INTERNAL void duk_concat_2(duk_hthread *thr) { duk_pop_unsafe(thr); return; - error_overflow: +error_overflow: DUK_ERROR_RANGE(thr, DUK_STR_RESULT_TOO_LONG); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ DUK_EXTERNAL void duk_join(duk_hthread *thr, duk_idx_t count) { DUK_ASSERT_API_ENTRY(thr); @@ -25025,7 +25776,7 @@ DUK_EXTERNAL void duk_decode_string(duk_hthread *thr, duk_idx_t idx, duk_decode_ DUK_ASSERT_API_ENTRY(thr); - h_input = duk_require_hstring(thr, idx); /* Accept symbols. */ + h_input = duk_require_hstring(thr, idx); /* Accept symbols. */ DUK_ASSERT(h_input != NULL); p_start = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_input); @@ -25052,11 +25803,11 @@ DUK_EXTERNAL void duk_map_string(duk_hthread *thr, duk_idx_t idx, duk_map_char_f idx = duk_normalize_index(thr, idx); - h_input = duk_require_hstring(thr, idx); /* Accept symbols. */ + h_input = duk_require_hstring(thr, idx); /* Accept symbols. */ DUK_ASSERT(h_input != NULL); bw = &bw_alloc; - DUK_BW_INIT_PUSHBUF(thr, bw, DUK_HSTRING_GET_BYTELEN(h_input)); /* Reasonable output estimate. */ + DUK_BW_INIT_PUSHBUF(thr, bw, DUK_HSTRING_GET_BYTELEN(h_input)); /* Reasonable output estimate. */ p_start = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_input); p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_input); @@ -25077,7 +25828,7 @@ DUK_EXTERNAL void duk_map_string(duk_hthread *thr, duk_idx_t idx, duk_map_char_f } DUK_BW_COMPACT(thr, bw); - (void) duk_buffer_to_string(thr, -1); /* Safe, extended UTF-8 encoded. */ + (void) duk_buffer_to_string(thr, -1); /* Safe, extended UTF-8 encoded. */ duk_replace(thr, idx); } @@ -25090,7 +25841,7 @@ DUK_EXTERNAL void duk_substring(duk_hthread *thr, duk_idx_t idx, duk_size_t star DUK_ASSERT_API_ENTRY(thr); - idx = duk_require_normalize_index(thr, idx); /* Accept symbols. */ + idx = duk_require_normalize_index(thr, idx); /* Accept symbols. */ h = duk_require_hstring(thr, idx); DUK_ASSERT(h != NULL); @@ -25115,7 +25866,7 @@ DUK_EXTERNAL void duk_substring(duk_hthread *thr, duk_idx_t idx, duk_size_t star end_byte_offset = (duk_size_t) duk_heap_strcache_offset_char2byte(thr, h, (duk_uint_fast32_t) end_offset); DUK_ASSERT(end_byte_offset >= start_byte_offset); - DUK_ASSERT(end_byte_offset - start_byte_offset <= DUK_UINT32_MAX); /* Guaranteed by string limits. */ + DUK_ASSERT(end_byte_offset - start_byte_offset <= DUK_UINT32_MAX); /* Guaranteed by string limits. */ /* No size check is necessary. */ res = duk_heap_strtable_intern_checked(thr, @@ -25131,13 +25882,13 @@ DUK_EXTERNAL void duk_substring(duk_hthread *thr, duk_idx_t idx, duk_size_t star */ DUK_EXTERNAL void duk_trim(duk_hthread *thr, duk_idx_t idx) { duk_hstring *h; - const duk_uint8_t *p, *p_start, *p_end, *p_tmp1, *p_tmp2; /* pointers for scanning */ - const duk_uint8_t *q_start, *q_end; /* start (incl) and end (excl) of trimmed part */ + const duk_uint8_t *p, *p_start, *p_end, *p_tmp1, *p_tmp2; /* pointers for scanning */ + const duk_uint8_t *q_start, *q_end; /* start (incl) and end (excl) of trimmed part */ duk_codepoint_t cp; DUK_ASSERT_API_ENTRY(thr); - idx = duk_require_normalize_index(thr, idx); /* Accept symbols. */ + idx = duk_require_normalize_index(thr, idx); /* Accept symbols. */ h = duk_require_hstring(thr, idx); DUK_ASSERT(h != NULL); @@ -25179,7 +25930,7 @@ DUK_EXTERNAL void duk_trim(duk_hthread *thr, duk_idx_t idx) { } q_end = p; - scan_done: +scan_done: /* This may happen when forward and backward scanning disagree * (possible for non-extended-UTF-8 strings). */ @@ -25192,8 +25943,10 @@ DUK_EXTERNAL void duk_trim(duk_hthread *thr, duk_idx_t idx) { DUK_ASSERT(q_end >= q_start); DUK_DDD(DUK_DDDPRINT("trim: p_start=%p, p_end=%p, q_start=%p, q_end=%p", - (const void *) p_start, (const void *) p_end, - (const void *) q_start, (const void *) q_end)); + (const void *) p_start, + (const void *) p_end, + (const void *) q_start, + (const void *) q_end)); if (q_start == p_start && q_end == p_end) { DUK_DDD(DUK_DDDPRINT("nothing was trimmed: avoid interning (hashing etc)")); @@ -25214,15 +25967,15 @@ DUK_EXTERNAL duk_codepoint_t duk_char_code_at(duk_hthread *thr, duk_idx_t idx, d * is handling of clamped offsets. */ - h = duk_require_hstring(thr, idx); /* Accept symbols. */ + h = duk_require_hstring(thr, idx); /* Accept symbols. */ DUK_ASSERT(h != NULL); - DUK_ASSERT_DISABLE(char_offset >= 0); /* Always true, arg is unsigned. */ + DUK_ASSERT_DISABLE(char_offset >= 0); /* Always true, arg is unsigned. */ if (char_offset >= DUK_HSTRING_GET_CHARLEN(h)) { return 0; } - DUK_ASSERT(char_offset <= DUK_UINT_MAX); /* Guaranteed by string limits. */ + DUK_ASSERT(char_offset <= DUK_UINT_MAX); /* Guaranteed by string limits. */ cp = duk_hstring_char_code_at_raw(thr, h, (duk_uint_t) char_offset, 0 /*surrogate_aware*/); return (duk_codepoint_t) cp; } @@ -25265,7 +26018,7 @@ DUK_EXTERNAL duk_double_t duk_get_now(duk_hthread *thr) { return duk_time_get_ecmascript_time(thr); } -#if 0 /* XXX: worth exposing? */ +#if 0 /* XXX: worth exposing? */ DUK_EXTERNAL duk_double_t duk_get_monotonic_time(duk_hthread *thr) { DUK_ASSERT_API_ENTRY(thr); DUK_UNREF(thr); @@ -25280,7 +26033,7 @@ DUK_EXTERNAL void duk_time_to_components(duk_hthread *thr, duk_double_t timeval, duk_uint_t flags; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(comp != NULL); /* XXX: or check? */ + DUK_ASSERT(comp != NULL); /* XXX: or check? */ DUK_UNREF(thr); /* Convert as one-based, but change month to zero-based to match the @@ -25309,7 +26062,7 @@ DUK_EXTERNAL duk_double_t duk_components_to_time(duk_hthread *thr, duk_time_comp duk_uint_t flags; DUK_ASSERT_API_ENTRY(thr); - DUK_ASSERT(comp != NULL); /* XXX: or check? */ + DUK_ASSERT(comp != NULL); /* XXX: or check? */ DUK_UNREF(thr); /* Match Date constructor behavior (with UTC time). Month is given @@ -25330,7 +26083,7 @@ DUK_EXTERNAL duk_double_t duk_components_to_time(duk_hthread *thr, duk_time_comp dparts[DUK_DATE_IDX_MINUTE] = comp->minutes; dparts[DUK_DATE_IDX_SECOND] = comp->seconds; dparts[DUK_DATE_IDX_MILLISECOND] = comp->milliseconds; - dparts[DUK_DATE_IDX_WEEKDAY] = 0; /* ignored */ + dparts[DUK_DATE_IDX_WEEKDAY] = 0; /* ignored */ d = duk_bi_date_get_timeval_from_dparts(dparts, flags); @@ -25381,7 +26134,7 @@ DUK_EXTERNAL duk_double_t duk_components_to_time(duk_hthread *thr, duk_time_comp /* Perform an intermediate join when this many elements have been pushed * on the value stack. */ -#define DUK__ARRAY_MID_JOIN_LIMIT 4096 +#define DUK__ARRAY_MID_JOIN_LIMIT 4096 #if defined(DUK_USE_ARRAY_BUILTIN) @@ -25432,7 +26185,7 @@ DUK_LOCAL duk_harray *duk__arraypart_fastpath_this(duk_hthread *thr) { duk_hobject *h; duk_uint_t flags_mask, flags_bits, flags_value; - DUK_ASSERT(thr->valstack_bottom > thr->valstack); /* because call in progress */ + DUK_ASSERT(thr->valstack_bottom > thr->valstack); /* because call in progress */ tv = DUK_GET_THIS_TVAL_PTR(thr); /* Fast path requires that 'this' is a duk_harray. Read only arrays @@ -25444,11 +26197,8 @@ DUK_LOCAL duk_harray *duk__arraypart_fastpath_this(duk_hthread *thr) { } h = DUK_TVAL_GET_OBJECT(tv); DUK_ASSERT(h != NULL); - flags_mask = DUK_HOBJECT_FLAG_ARRAY_PART | \ - DUK_HOBJECT_FLAG_EXOTIC_ARRAY | \ - DUK_HEAPHDR_FLAG_READONLY; - flags_bits = DUK_HOBJECT_FLAG_ARRAY_PART | \ - DUK_HOBJECT_FLAG_EXOTIC_ARRAY; + flags_mask = DUK_HOBJECT_FLAG_ARRAY_PART | DUK_HOBJECT_FLAG_EXOTIC_ARRAY | DUK_HEAPHDR_FLAG_READONLY; + flags_bits = DUK_HOBJECT_FLAG_ARRAY_PART | DUK_HOBJECT_FLAG_EXOTIC_ARRAY; flags_value = DUK_HEAPHDR_GET_FLAGS_RAW((duk_heaphdr *) h); if ((flags_value & flags_mask) != flags_bits) { DUK_DD(DUK_DDPRINT("reject array fast path: object flag check failed")); @@ -25474,7 +26224,7 @@ DUK_LOCAL duk_harray *duk__arraypart_fastpath_this(duk_hthread *thr) { DUK_DD(DUK_DDPRINT("array fast path allowed for: %!O", (duk_heaphdr *) h)); return (duk_harray *) h; } -#endif /* DUK_USE_ARRAY_FASTPATH */ +#endif /* DUK_USE_ARRAY_FASTPATH */ /* * Constructor @@ -25544,7 +26294,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_to_string(duk_hthread *thr) { */ DUK_DDD(DUK_DDDPRINT("this.join is not callable, fall back to (original) Object.toString")); duk_set_top(thr, 0); - return duk_bi_object_prototype_to_string(thr); /* has access to 'this' binding */ + return duk_bi_object_prototype_to_string(thr); /* has access to 'this' binding */ } /* [ ... this func ] */ @@ -25553,9 +26303,8 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_to_string(duk_hthread *thr) { /* [ ... func this ] */ - DUK_DDD(DUK_DDDPRINT("calling: func=%!iT, this=%!iT", - (duk_tval *) duk_get_tval(thr, -2), - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD( + DUK_DDDPRINT("calling: func=%!iT, this=%!iT", (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); duk_call_method(thr, 0); return 1; @@ -25585,7 +26334,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_concat(duk_hthread *thr) { (void) duk_push_this_coercible_to_object(thr); duk_insert(thr, 0); n = duk_get_top(thr); - duk_push_array(thr); /* -> [ ToObject(this) item1 ... itemN arr ] */ + duk_push_array(thr); /* -> [ ToObject(this) item1 ... itemN arr ] */ /* NOTE: The Array special behaviors are NOT invoked by duk_xdef_prop_index() * (which differs from the official algorithm). If no error is thrown, this @@ -25636,7 +26385,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_concat(duk_hthread *thr) { } DUK_ASSERT(duk_is_object(thr, i)); - need_has_check = (DUK_HOBJECT_IS_PROXY(h) != 0); /* Always 0 w/o Proxy support. */ + need_has_check = (DUK_HOBJECT_IS_PROXY(h) != 0); /* Always 0 w/o Proxy support. */ /* [ ToObject(this) item1 ... itemN arr ] */ @@ -25668,7 +26417,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_concat(duk_hthread *thr) { } } idx++; - DUK_ASSERT(idx != 0U); /* Wrap check above. */ + DUK_ASSERT(idx != 0U); /* Wrap check above. */ } } @@ -25683,7 +26432,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_concat(duk_hthread *thr) { DUK_ASSERT_TOP(thr, n + 1); return 1; - fail_wrap: +fail_wrap: DUK_ERROR_RANGE_INVALID_LENGTH(thr); DUK_WO_NORETURN(return 0;); } @@ -25729,8 +26478,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_join_shared(duk_hthread *thr) { (unsigned long) len)); /* The extra (+4) is tight. */ - valstack_required = (duk_idx_t) ((len >= DUK__ARRAY_MID_JOIN_LIMIT ? - DUK__ARRAY_MID_JOIN_LIMIT : len) + 4); + valstack_required = (duk_idx_t) ((len >= DUK__ARRAY_MID_JOIN_LIMIT ? DUK__ARRAY_MID_JOIN_LIMIT : len) + 4); duk_require_stack(thr, valstack_required); duk_dup_0(thr); @@ -25741,14 +26489,13 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_join_shared(duk_hthread *thr) { idx = 0; for (;;) { DUK_DDD(DUK_DDDPRINT("join idx=%ld", (long) idx)); - if (count >= DUK__ARRAY_MID_JOIN_LIMIT || /* intermediate join to avoid valstack overflow */ + if (count >= DUK__ARRAY_MID_JOIN_LIMIT || /* intermediate join to avoid valstack overflow */ idx >= len) { /* end of loop (careful with len==0) */ /* [ sep ToObject(this) len sep str0 ... str(count-1) ] */ - DUK_DDD(DUK_DDDPRINT("mid/final join, count=%ld, idx=%ld, len=%ld", - (long) count, (long) idx, (long) len)); - duk_join(thr, (duk_idx_t) count); /* -> [ sep ToObject(this) len str ] */ - duk_dup_0(thr); /* -> [ sep ToObject(this) len str sep ] */ - duk_insert(thr, -2); /* -> [ sep ToObject(this) len sep str ] */ + DUK_DDD(DUK_DDDPRINT("mid/final join, count=%ld, idx=%ld, len=%ld", (long) count, (long) idx, (long) len)); + duk_join(thr, (duk_idx_t) count); /* -> [ sep ToObject(this) len str ] */ + duk_dup_0(thr); /* -> [ sep ToObject(this) len str sep ] */ + duk_insert(thr, -2); /* -> [ sep ToObject(this) len sep str ] */ count = 1; } if (idx >= len) { @@ -25764,7 +26511,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_join_shared(duk_hthread *thr) { if (to_locale_string) { duk_to_object(thr, -1); duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_TO_LOCALE_STRING); - duk_insert(thr, -2); /* -> [ ... toLocaleString ToObject(val) ] */ + duk_insert(thr, -2); /* -> [ ... toLocaleString ToObject(val) ] */ duk_call_method(thr, 0); } duk_to_string(thr, -1); @@ -25822,7 +26569,7 @@ DUK_LOCAL duk_ret_t duk__array_pop_fastpath(duk_hthread *thr, duk_harray *h_arr) return 1; } -#endif /* DUK_USE_ARRAY_FASTPATH */ +#endif /* DUK_USE_ARRAY_FASTPATH */ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_pop(duk_hthread *thr) { duk_uint32_t len; @@ -25873,7 +26620,7 @@ DUK_LOCAL duk_ret_t duk__array_push_fastpath(duk_hthread *thr, duk_harray *h_arr DUK_ASSERT((duk_uint32_t) n <= DUK_UINT32_MAX); if (DUK_UNLIKELY(len + (duk_uint32_t) n < len)) { DUK_D(DUK_DPRINT("Array.prototype.push() would go beyond 32-bit length, throw")); - DUK_DCERROR_RANGE_INVALID_LENGTH(thr); /* != 0 return value returned as is by caller */ + DUK_DCERROR_RANGE_INVALID_LENGTH(thr); /* != 0 return value returned as is by caller */ } if (len + (duk_uint32_t) n > DUK_HOBJECT_GET_ASIZE((duk_hobject *) h_arr)) { /* Array part would need to be extended. Rely on slow path @@ -25903,7 +26650,7 @@ DUK_LOCAL duk_ret_t duk__array_push_fastpath(duk_hthread *thr, duk_harray *h_arr duk_push_uint(thr, (duk_uint_t) len); return 1; } -#endif /* DUK_USE_ARRAY_FASTPATH */ +#endif /* DUK_USE_ARRAY_FASTPATH */ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_push(duk_hthread *thr) { /* Note: 'this' is not necessarily an Array object. The push() @@ -25978,7 +26725,7 @@ DUK_LOCAL duk_small_int_t duk__array_sort_compare(duk_hthread *thr, duk_int_t id duk_bool_t have1, have2; duk_bool_t undef1, undef2; duk_small_int_t ret; - duk_idx_t idx_obj = 1; /* fixed offsets in valstack */ + duk_idx_t idx_obj = 1; /* fixed offsets in valstack */ duk_idx_t idx_fn = 0; duk_hstring *h1, *h2; @@ -25999,7 +26746,8 @@ DUK_LOCAL duk_small_int_t duk__array_sort_compare(duk_hthread *thr, duk_int_t id if (idx1 == idx2) { DUK_DDD(DUK_DDDPRINT("duk__array_sort_compare: idx1=%ld, idx2=%ld -> indices identical, quick exit", - (long) idx1, (long) idx2)); + (long) idx1, + (long) idx2)); return 0; } @@ -26007,8 +26755,12 @@ DUK_LOCAL duk_small_int_t duk__array_sort_compare(duk_hthread *thr, duk_int_t id have2 = duk_get_prop_index(thr, idx_obj, (duk_uarridx_t) idx2); DUK_DDD(DUK_DDDPRINT("duk__array_sort_compare: idx1=%ld, idx2=%ld, have1=%ld, have2=%ld, val1=%!T, val2=%!T", - (long) idx1, (long) idx2, (long) have1, (long) have2, - (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); + (long) idx1, + (long) idx2, + (long) have1, + (long) have2, + (duk_tval *) duk_get_tval(thr, -2), + (duk_tval *) duk_get_tval(thr, -1))); if (have1) { if (have2) { @@ -26050,9 +26802,9 @@ DUK_LOCAL duk_small_int_t duk__array_sort_compare(duk_hthread *thr, duk_int_t id duk_double_t d; /* No need to check callable; duk_call() will do that. */ - duk_dup(thr, idx_fn); /* -> [ ... x y fn ] */ - duk_insert(thr, -3); /* -> [ ... fn x y ] */ - duk_call(thr, 2); /* -> [ ... res ] */ + duk_dup(thr, idx_fn); /* -> [ ... x y fn ] */ + duk_insert(thr, -3); /* -> [ ... fn x y ] */ + duk_call(thr, 2); /* -> [ ... res ] */ /* ES5 is a bit vague about what to do if the return value is * not a number. ES2015 provides a concrete description: @@ -26084,10 +26836,10 @@ DUK_LOCAL duk_small_int_t duk__array_sort_compare(duk_hthread *thr, duk_int_t id DUK_ASSERT(h1 != NULL); DUK_ASSERT(h2 != NULL); - ret = duk_js_string_compare(h1, h2); /* retval is directly usable */ + ret = duk_js_string_compare(h1, h2); /* retval is directly usable */ goto pop_ret; - pop_ret: +pop_ret: duk_pop_2_unsafe(thr); DUK_DDD(DUK_DDDPRINT("-> result %ld", (long) ret)); return ret; @@ -26095,7 +26847,7 @@ DUK_LOCAL duk_small_int_t duk__array_sort_compare(duk_hthread *thr, duk_int_t id DUK_LOCAL void duk__array_sort_swap(duk_hthread *thr, duk_int_t l, duk_int_t r) { duk_bool_t have_l, have_r; - duk_idx_t idx_obj = 1; /* fixed offset in valstack */ + duk_idx_t idx_obj = 1; /* fixed offset in valstack */ if (l == r) { return; @@ -26148,8 +26900,7 @@ DUK_LOCAL void duk__debuglog_qsort_state(duk_hthread *thr, duk_int_t lo, duk_int *ptr++ = ']'; *ptr++ = '\0'; - DUK_DDD(DUK_DDDPRINT("%s (lo=%ld, hi=%ld, pivot=%ld)", - (const char *) buf, (long) lo, (long) hi, (long) pivot)); + DUK_DDD(DUK_DDDPRINT("%s (lo=%ld, hi=%ld, pivot=%ld)", (const char *) buf, (long) lo, (long) hi, (long) pivot)); } #endif @@ -26158,8 +26909,7 @@ DUK_LOCAL void duk__array_qsort(duk_hthread *thr, duk_int_t lo, duk_int_t hi) { /* The lo/hi indices may be crossed and hi < 0 is possible at entry. */ - DUK_DDD(DUK_DDDPRINT("duk__array_qsort: lo=%ld, hi=%ld, obj=%!T", - (long) lo, (long) hi, (duk_tval *) duk_get_tval(thr, 1))); + DUK_DDD(DUK_DDDPRINT("duk__array_qsort: lo=%ld, hi=%ld, obj=%!T", (long) lo, (long) hi, (duk_tval *) duk_get_tval(thr, 1))); DUK_ASSERT_TOP(thr, 3); @@ -26177,7 +26927,7 @@ DUK_LOCAL void duk__array_qsort(duk_hthread *thr, duk_int_t lo, duk_int_t hi) { DUK_ASSERT(hi - lo + 1 >= 2); /* randomized pivot selection */ - p = lo + (duk_int_t) (DUK_UTIL_GET_RANDOM_DOUBLE(thr) * (duk_double_t) (hi - lo + 1)); + p = lo + (duk_int_t) (duk_util_get_random_double(thr) * (duk_double_t) (hi - lo + 1)); DUK_ASSERT(p >= lo && p <= hi); DUK_DDD(DUK_DDDPRINT("lo=%ld, hi=%ld, chose pivot p=%ld", (long) lo, (long) hi, (long) p)); @@ -26191,23 +26941,21 @@ DUK_LOCAL void duk__array_qsort(duk_hthread *thr, duk_int_t lo, duk_int_t hi) { for (;;) { /* find elements to swap */ for (;;) { - DUK_DDD(DUK_DDDPRINT("left scan: l=%ld, r=%ld, p=%ld", - (long) l, (long) r, (long) p)); + DUK_DDD(DUK_DDDPRINT("left scan: l=%ld, r=%ld, p=%ld", (long) l, (long) r, (long) p)); if (l >= hi) { break; } - if (duk__array_sort_compare(thr, l, p) >= 0) { /* !(l < p) */ + if (duk__array_sort_compare(thr, l, p) >= 0) { /* !(l < p) */ break; } l++; } for (;;) { - DUK_DDD(DUK_DDDPRINT("right scan: l=%ld, r=%ld, p=%ld", - (long) l, (long) r, (long) p)); + DUK_DDD(DUK_DDDPRINT("right scan: l=%ld, r=%ld, p=%ld", (long) l, (long) r, (long) p)); if (r <= lo) { break; } - if (duk__array_sort_compare(thr, p, r) >= 0) { /* !(p < r) */ + if (duk__array_sort_compare(thr, p, r) >= 0) { /* !(p < r) */ break; } r--; @@ -26225,7 +26973,7 @@ DUK_LOCAL void duk__array_qsort(duk_hthread *thr, duk_int_t lo, duk_int_t hi) { l++; r--; } - done: +done: /* Note that 'l' and 'r' may cross, i.e. r < l */ DUK_ASSERT(l >= lo && l <= hi); DUK_ASSERT(r >= lo && r <= hi); @@ -26269,7 +27017,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_sort(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 3); duk_pop_nodecref_unsafe(thr); - return 1; /* return ToObject(this) */ + return 1; /* return ToObject(this) */ } /* @@ -26362,7 +27110,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_splice(duk_hthread *thr) { for (i = 0; i < del_count; i++) { if (duk_get_prop_index(thr, -3, (duk_uarridx_t) (act_start + i))) { - duk_xdef_prop_index_wec(thr, -2, (duk_uarridx_t) i); /* throw flag irrelevant (false in std alg) */ + duk_xdef_prop_index_wec(thr, -2, (duk_uarridx_t) i); /* throw flag irrelevant (false in std alg) */ } else { duk_pop_undefined(thr); } @@ -26432,7 +27180,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_splice(duk_hthread *thr) { /* Step 15: insert itemCount elements into the hole made above */ for (i = 0; i < item_count; i++) { - duk_dup(thr, i + 2); /* args start at index 2 */ + duk_dup(thr, i + 2); /* args start at index 2 */ duk_put_prop_index(thr, -4, (duk_uarridx_t) (act_start + i)); } @@ -26495,7 +27243,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_reverse(duk_hthread *thr) { } DUK_ASSERT_TOP(thr, 2); - duk_pop_unsafe(thr); /* -> [ ToObject(this) ] */ + duk_pop_unsafe(thr); /* -> [ ToObject(this) ] */ return 1; } @@ -26645,26 +27393,32 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_unshift(duk_hthread *thr) { if (duk_get_prop_index(thr, -2, (duk_uarridx_t) i)) { /* fromPresent = true */ /* [ ... ToObject(this) ToUint32(length) val ] */ - duk_put_prop_index(thr, -3, (duk_uarridx_t) (i + (duk_uint32_t) nargs)); /* -> [ ... ToObject(this) ToUint32(length) ] */ + duk_put_prop_index( + thr, + -3, + (duk_uarridx_t) (i + (duk_uint32_t) nargs)); /* -> [ ... ToObject(this) ToUint32(length) ] */ } else { /* fromPresent = false */ /* [ ... ToObject(this) ToUint32(length) val ] */ duk_pop_undefined(thr); - duk_del_prop_index(thr, -2, (duk_uarridx_t) (i + (duk_uint32_t) nargs)); /* -> [ ... ToObject(this) ToUint32(length) ] */ + duk_del_prop_index( + thr, + -2, + (duk_uarridx_t) (i + (duk_uint32_t) nargs)); /* -> [ ... ToObject(this) ToUint32(length) ] */ } DUK_ASSERT_TOP(thr, nargs + 2); } for (i = 0; i < (duk_uint32_t) nargs; i++) { DUK_ASSERT_TOP(thr, nargs + 2); - duk_dup(thr, (duk_idx_t) i); /* -> [ ... ToObject(this) ToUint32(length) arg[i] ] */ + duk_dup(thr, (duk_idx_t) i); /* -> [ ... ToObject(this) ToUint32(length) arg[i] ] */ duk_put_prop_index(thr, -3, (duk_uarridx_t) i); DUK_ASSERT_TOP(thr, nargs + 2); } DUK_ASSERT_TOP(thr, nargs + 2); duk_push_u32(thr, len + (duk_uint32_t) nargs); - duk_dup_top(thr); /* -> [ ... ToObject(this) ToUint32(length) final_len final_len ] */ + duk_dup_top(thr); /* -> [ ... ToObject(this) ToUint32(length) final_len final_len ] */ duk_put_prop_stridx_short(thr, -4, DUK_STRIDX_LENGTH); return 1; } @@ -26677,7 +27431,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_indexof_shared(duk_hthread *thr) { duk_idx_t nargs; duk_int_t i, len; duk_int_t from_idx; - duk_small_int_t idx_step = duk_get_current_magic(thr); /* idx_step is +1 for indexOf, -1 for lastIndexOf */ + duk_small_int_t idx_step = duk_get_current_magic(thr); /* idx_step is +1 for indexOf, -1 for lastIndexOf */ /* lastIndexOf() needs to be a vararg function because we must distinguish * between an undefined fromIndex and a "not given" fromIndex; indexOf() is @@ -26715,10 +27469,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_indexof_shared(duk_hthread *thr) { * lastIndexOf: clamp fromIndex to [-len - 1, len - 1] * (if clamped to -len-1 -> fromIndex becomes -1, terminates for-loop directly) */ - from_idx = duk_to_int_clamped(thr, - 1, - (idx_step > 0 ? -len : -len - 1), - (idx_step > 0 ? len : len - 1)); + from_idx = duk_to_int_clamped(thr, 1, (idx_step > 0 ? -len : -len - 1), (idx_step > 0 ? len : len - 1)); if (from_idx < 0) { /* for lastIndexOf, result may be -1 (mark immediate termination) */ from_idx = len + from_idx; @@ -26754,7 +27505,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_indexof_shared(duk_hthread *thr) { duk_pop_unsafe(thr); } - not_found: +not_found: duk_push_int(thr, -1); return 1; } @@ -26763,11 +27514,11 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_indexof_shared(duk_hthread *thr) { * every(), some(), forEach(), map(), filter() */ -#define DUK__ITER_EVERY 0 -#define DUK__ITER_SOME 1 -#define DUK__ITER_FOREACH 2 -#define DUK__ITER_MAP 3 -#define DUK__ITER_FILTER 4 +#define DUK__ITER_EVERY 0 +#define DUK__ITER_SOME 1 +#define DUK__ITER_FOREACH 2 +#define DUK__ITER_MAP 3 +#define DUK__ITER_FILTER 4 /* XXX: This helper is a bit awkward because the handling for the different iteration * callers is quite different. This now compiles to a bit less than 500 bytes, so with @@ -26802,7 +27553,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_iter_shared(duk_hthread *thr) { * stack[4] = result array (or undefined) */ - k = 0; /* result index for filter() */ + k = 0; /* result index for filter() */ for (i = 0; i < len; i++) { DUK_ASSERT_TOP(thr, 5); @@ -26826,7 +27577,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_iter_shared(duk_hthread *thr) { duk_dup_1(thr); duk_dup_m3(thr); duk_push_u32(thr, i); - duk_dup_2(thr); /* [ ... val callback thisArg val i obj ] */ + duk_dup_2(thr); /* [ ... val callback thisArg val i obj ] */ duk_call_method(thr, 3); /* -> [ ... val retval ] */ switch (iter_type) { @@ -26849,13 +27600,13 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_iter_shared(duk_hthread *thr) { break; case DUK__ITER_MAP: duk_dup_top(thr); - duk_xdef_prop_index_wec(thr, 4, (duk_uarridx_t) i); /* retval to result[i] */ + duk_xdef_prop_index_wec(thr, 4, (duk_uarridx_t) i); /* retval to result[i] */ res_length = i + 1; break; case DUK__ITER_FILTER: bval = duk_to_boolean(thr, -1); if (bval) { - duk_dup_m2(thr); /* orig value */ + duk_dup_m2(thr); /* orig value */ duk_xdef_prop_index_wec(thr, 4, (duk_uarridx_t) k); k++; res_length = k; @@ -26883,7 +27634,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_iter_shared(duk_hthread *thr) { case DUK__ITER_MAP: case DUK__ITER_FILTER: DUK_ASSERT_TOP(thr, 5); - DUK_ASSERT(duk_is_array(thr, -1)); /* topmost element is the result array already */ + DUK_ASSERT(duk_is_array(thr, -1)); /* topmost element is the result array already */ duk_push_u32(thr, res_length); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_W); break; @@ -26903,7 +27654,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_reduce_shared(duk_hthread *thr) { duk_idx_t nargs; duk_bool_t have_acc; duk_uint32_t i, len; - duk_small_int_t idx_step = duk_get_current_magic(thr); /* idx_step is +1 for reduce, -1 for reduceRight */ + duk_small_int_t idx_step = duk_get_current_magic(thr); /* idx_step is +1 for reduce, -1 for reduceRight */ /* We're a varargs function because we need to detect whether * initialValue was given or not. @@ -26927,8 +27678,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_reduce_shared(duk_hthread *thr) { duk_dup_1(thr); have_acc = 1; } - DUK_DDD(DUK_DDDPRINT("have_acc=%ld, acc=%!T", - (long) have_acc, (duk_tval *) duk_get_tval(thr, 3))); + DUK_DDD(DUK_DDDPRINT("have_acc=%ld, acc=%!T", (long) have_acc, (duk_tval *) duk_get_tval(thr, 3))); /* For len == 0, i is initialized to len - 1 which underflows. * The condition (i < len) will then exit the for-loop on the @@ -26936,16 +27686,16 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_reduce_shared(duk_hthread *thr) { * happens by i underflowing. */ - for (i = (idx_step >= 0 ? 0 : len - 1); - i < len; /* i >= 0 would always be true */ + for (i = (idx_step >= 0 ? 0 : len - 1); i < len; /* i >= 0 would always be true */ i += (duk_uint32_t) idx_step) { DUK_DDD(DUK_DDDPRINT("i=%ld, len=%ld, have_acc=%ld, top=%ld, acc=%!T", - (long) i, (long) len, (long) have_acc, + (long) i, + (long) len, + (long) have_acc, (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, 4))); - DUK_ASSERT((have_acc && duk_get_top(thr) == 5) || - (!have_acc && duk_get_top(thr) == 4)); + DUK_ASSERT((have_acc && duk_get_top(thr) == 5) || (!have_acc && duk_get_top(thr) == 4)); if (!duk_has_prop_index(thr, 2, (duk_uarridx_t) i)) { continue; @@ -26964,8 +27714,10 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_reduce_shared(duk_hthread *thr) { duk_push_u32(thr, i); duk_dup_2(thr); DUK_DDD(DUK_DDDPRINT("calling reduce function: func=%!T, prev=%!T, curr=%!T, idx=%!T, obj=%!T", - (duk_tval *) duk_get_tval(thr, -5), (duk_tval *) duk_get_tval(thr, -4), - (duk_tval *) duk_get_tval(thr, -3), (duk_tval *) duk_get_tval(thr, -2), + (duk_tval *) duk_get_tval(thr, -5), + (duk_tval *) duk_get_tval(thr, -4), + (duk_tval *) duk_get_tval(thr, -3), + (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); duk_call(thr, 4); DUK_DDD(DUK_DDDPRINT("-> result: %!T", (duk_tval *) duk_get_tval(thr, -1))); @@ -26982,7 +27734,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_reduce_shared(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_ARRAY_BUILTIN */ +#endif /* DUK_USE_ARRAY_BUILTIN */ /* automatic undefs */ #undef DUK__ARRAY_MID_JOIN_LIMIT @@ -27032,7 +27784,7 @@ DUK_INTERNAL duk_ret_t duk_bi_boolean_prototype_tostring_shared(duk_hthread *thr DUK_DCERROR_TYPE_INVALID_ARGS(thr); /* never here */ - type_ok: +type_ok: if (coerce_tostring) { duk_to_string(thr, -1); } @@ -27052,14 +27804,14 @@ DUK_INTERNAL duk_ret_t duk_bi_boolean_constructor(duk_hthread *thr) { DUK_HOBJECT_SET_CLASS_NUMBER(h_this, DUK_HOBJECT_CLASS_BOOLEAN); - duk_dup_0(thr); /* -> [ val obj val ] */ - duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_VALUE, DUK_PROPDESC_FLAGS_NONE); /* XXX: proper flags? */ - } /* unbalanced stack */ + duk_dup_0(thr); /* -> [ val obj val ] */ + duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_VALUE, DUK_PROPDESC_FLAGS_NONE); /* XXX: proper flags? */ + } /* unbalanced stack */ return 1; } -#endif /* DUK_USE_BOOLEAN_BUILTIN */ +#endif /* DUK_USE_BOOLEAN_BUILTIN */ /* * ES2015 TypedArray and Node.js Buffer built-ins */ @@ -27075,57 +27827,38 @@ DUK_INTERNAL duk_ret_t duk_bi_boolean_constructor(duk_hthread *thr) { * default internal prototype. */ static const duk_uint8_t duk__buffer_proto_from_classnum[] = { - DUK_BIDX_ARRAYBUFFER_PROTOTYPE, - DUK_BIDX_DATAVIEW_PROTOTYPE, - DUK_BIDX_INT8ARRAY_PROTOTYPE, - DUK_BIDX_UINT8ARRAY_PROTOTYPE, - DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE, - DUK_BIDX_INT16ARRAY_PROTOTYPE, - DUK_BIDX_UINT16ARRAY_PROTOTYPE, - DUK_BIDX_INT32ARRAY_PROTOTYPE, - DUK_BIDX_UINT32ARRAY_PROTOTYPE, - DUK_BIDX_FLOAT32ARRAY_PROTOTYPE, - DUK_BIDX_FLOAT64ARRAY_PROTOTYPE + DUK_BIDX_ARRAYBUFFER_PROTOTYPE, DUK_BIDX_DATAVIEW_PROTOTYPE, DUK_BIDX_INT8ARRAY_PROTOTYPE, + DUK_BIDX_UINT8ARRAY_PROTOTYPE, DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE, DUK_BIDX_INT16ARRAY_PROTOTYPE, + DUK_BIDX_UINT16ARRAY_PROTOTYPE, DUK_BIDX_INT32ARRAY_PROTOTYPE, DUK_BIDX_UINT32ARRAY_PROTOTYPE, + DUK_BIDX_FLOAT32ARRAY_PROTOTYPE, DUK_BIDX_FLOAT64ARRAY_PROTOTYPE }; /* Map DUK_HBUFOBJ_ELEM_xxx to duk_hobject class number. * Sync with duk_hbufobj.h and duk_hobject.h. */ -static const duk_uint8_t duk__buffer_class_from_elemtype[9] = { - DUK_HOBJECT_CLASS_UINT8ARRAY, - DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY, - DUK_HOBJECT_CLASS_INT8ARRAY, - DUK_HOBJECT_CLASS_UINT16ARRAY, - DUK_HOBJECT_CLASS_INT16ARRAY, - DUK_HOBJECT_CLASS_UINT32ARRAY, - DUK_HOBJECT_CLASS_INT32ARRAY, - DUK_HOBJECT_CLASS_FLOAT32ARRAY, - DUK_HOBJECT_CLASS_FLOAT64ARRAY -}; +static const duk_uint8_t duk__buffer_class_from_elemtype[9] = { DUK_HOBJECT_CLASS_UINT8ARRAY, DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY, + DUK_HOBJECT_CLASS_INT8ARRAY, DUK_HOBJECT_CLASS_UINT16ARRAY, + DUK_HOBJECT_CLASS_INT16ARRAY, DUK_HOBJECT_CLASS_UINT32ARRAY, + DUK_HOBJECT_CLASS_INT32ARRAY, DUK_HOBJECT_CLASS_FLOAT32ARRAY, + DUK_HOBJECT_CLASS_FLOAT64ARRAY }; /* Map DUK_HBUFOBJ_ELEM_xxx to prototype object built-in index. * Sync with duk_hbufobj.h. */ static const duk_uint8_t duk__buffer_proto_from_elemtype[9] = { - DUK_BIDX_UINT8ARRAY_PROTOTYPE, - DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE, - DUK_BIDX_INT8ARRAY_PROTOTYPE, - DUK_BIDX_UINT16ARRAY_PROTOTYPE, - DUK_BIDX_INT16ARRAY_PROTOTYPE, - DUK_BIDX_UINT32ARRAY_PROTOTYPE, - DUK_BIDX_INT32ARRAY_PROTOTYPE, - DUK_BIDX_FLOAT32ARRAY_PROTOTYPE, - DUK_BIDX_FLOAT64ARRAY_PROTOTYPE + DUK_BIDX_UINT8ARRAY_PROTOTYPE, DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE, DUK_BIDX_INT8ARRAY_PROTOTYPE, + DUK_BIDX_UINT16ARRAY_PROTOTYPE, DUK_BIDX_INT16ARRAY_PROTOTYPE, DUK_BIDX_UINT32ARRAY_PROTOTYPE, + DUK_BIDX_INT32ARRAY_PROTOTYPE, DUK_BIDX_FLOAT32ARRAY_PROTOTYPE, DUK_BIDX_FLOAT64ARRAY_PROTOTYPE }; /* Map DUK__FLD_xxx to byte size. */ static const duk_uint8_t duk__buffer_nbytes_from_fldtype[6] = { - 1, /* DUK__FLD_8BIT */ - 2, /* DUK__FLD_16BIT */ - 4, /* DUK__FLD_32BIT */ - 4, /* DUK__FLD_FLOAT */ - 8, /* DUK__FLD_DOUBLE */ - 0 /* DUK__FLD_VARINT; not relevant here */ + 1, /* DUK__FLD_8BIT */ + 2, /* DUK__FLD_16BIT */ + 4, /* DUK__FLD_32BIT */ + 4, /* DUK__FLD_FLOAT */ + 8, /* DUK__FLD_DOUBLE */ + 0 /* DUK__FLD_VARINT; not relevant here */ }; /* Bitfield for each DUK_HBUFOBJ_ELEM_xxx indicating which element types @@ -27137,36 +27870,27 @@ static const duk_uint8_t duk__buffer_nbytes_from_fldtype[6] = { #if !defined(DUK_USE_PREFER_SIZE) static duk_uint16_t duk__buffer_elemtype_copy_compatible[9] = { /* xxx -> DUK_HBUFOBJ_ELEM_UINT8 */ - (1U << DUK_HBUFOBJ_ELEM_UINT8) | - (1U << DUK_HBUFOBJ_ELEM_UINT8CLAMPED) | - (1U << DUK_HBUFOBJ_ELEM_INT8), + (1U << DUK_HBUFOBJ_ELEM_UINT8) | (1U << DUK_HBUFOBJ_ELEM_UINT8CLAMPED) | (1U << DUK_HBUFOBJ_ELEM_INT8), /* xxx -> DUK_HBUFOBJ_ELEM_UINT8CLAMPED * Note: INT8 is -not- copy compatible, e.g. -1 would coerce to 0x00. */ - (1U << DUK_HBUFOBJ_ELEM_UINT8) | - (1U << DUK_HBUFOBJ_ELEM_UINT8CLAMPED), + (1U << DUK_HBUFOBJ_ELEM_UINT8) | (1U << DUK_HBUFOBJ_ELEM_UINT8CLAMPED), /* xxx -> DUK_HBUFOBJ_ELEM_INT8 */ - (1U << DUK_HBUFOBJ_ELEM_UINT8) | - (1U << DUK_HBUFOBJ_ELEM_UINT8CLAMPED) | - (1U << DUK_HBUFOBJ_ELEM_INT8), + (1U << DUK_HBUFOBJ_ELEM_UINT8) | (1U << DUK_HBUFOBJ_ELEM_UINT8CLAMPED) | (1U << DUK_HBUFOBJ_ELEM_INT8), /* xxx -> DUK_HBUFOBJ_ELEM_UINT16 */ - (1U << DUK_HBUFOBJ_ELEM_UINT16) | - (1U << DUK_HBUFOBJ_ELEM_INT16), + (1U << DUK_HBUFOBJ_ELEM_UINT16) | (1U << DUK_HBUFOBJ_ELEM_INT16), /* xxx -> DUK_HBUFOBJ_ELEM_INT16 */ - (1U << DUK_HBUFOBJ_ELEM_UINT16) | - (1U << DUK_HBUFOBJ_ELEM_INT16), + (1U << DUK_HBUFOBJ_ELEM_UINT16) | (1U << DUK_HBUFOBJ_ELEM_INT16), /* xxx -> DUK_HBUFOBJ_ELEM_UINT32 */ - (1U << DUK_HBUFOBJ_ELEM_UINT32) | - (1U << DUK_HBUFOBJ_ELEM_INT32), + (1U << DUK_HBUFOBJ_ELEM_UINT32) | (1U << DUK_HBUFOBJ_ELEM_INT32), /* xxx -> DUK_HBUFOBJ_ELEM_INT32 */ - (1U << DUK_HBUFOBJ_ELEM_UINT32) | - (1U << DUK_HBUFOBJ_ELEM_INT32), + (1U << DUK_HBUFOBJ_ELEM_UINT32) | (1U << DUK_HBUFOBJ_ELEM_INT32), /* xxx -> DUK_HBUFOBJ_ELEM_FLOAT32 */ (1U << DUK_HBUFOBJ_ELEM_FLOAT32), @@ -27174,7 +27898,7 @@ static duk_uint16_t duk__buffer_elemtype_copy_compatible[9] = { /* xxx -> DUK_HBUFOBJ_ELEM_FLOAT64 */ (1U << DUK_HBUFOBJ_ELEM_FLOAT64) }; -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ DUK_LOCAL duk_hbufobj *duk__hbufobj_promote_this(duk_hthread *thr) { duk_tval *tv_dst; @@ -27193,8 +27917,8 @@ DUK_LOCAL duk_hbufobj *duk__hbufobj_promote_this(duk_hthread *thr) { return res; } -#define DUK__BUFOBJ_FLAG_THROW (1 << 0) -#define DUK__BUFOBJ_FLAG_PROMOTE (1 << 1) +#define DUK__BUFOBJ_FLAG_THROW (1 << 0) +#define DUK__BUFOBJ_FLAG_PROMOTE (1 << 1) /* Shared helper. When DUK__BUFOBJ_FLAG_PROMOTE is given, the return value is * always a duk_hbufobj *. Without the flag the return value can also be a @@ -27285,7 +28009,7 @@ DUK_LOCAL duk_hbufobj *duk__require_bufobj_value(duk_hthread *thr, duk_idx_t idx DUK_LOCAL void duk__set_bufobj_buffer(duk_hthread *thr, duk_hbufobj *h_bufobj, duk_hbuffer *h_val) { DUK_ASSERT(thr != NULL); DUK_ASSERT(h_bufobj != NULL); - DUK_ASSERT(h_bufobj->buf == NULL); /* no need to decref */ + DUK_ASSERT(h_bufobj->buf == NULL); /* no need to decref */ DUK_ASSERT(h_val != NULL); DUK_HBUFOBJ_ASSERT_VALID(h_bufobj); DUK_UNREF(thr); @@ -27321,12 +28045,12 @@ DUK_LOCAL void duk__resolve_offset_opt_length(duk_hthread *thr, if (offset > h_bufarg->length) { goto fail_range; } - DUK_ASSERT_DISABLE(offset >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(offset >= 0); /* unsigned */ DUK_ASSERT(offset <= h_bufarg->length); if (duk_is_undefined(thr, idx_length)) { DUK_ASSERT(h_bufarg->length >= offset); - length = h_bufarg->length - offset; /* >= 0 */ + length = h_bufarg->length - offset; /* >= 0 */ } else { length_signed = duk_to_int(thr, idx_length); if (length_signed < 0) { @@ -27345,14 +28069,14 @@ DUK_LOCAL void duk__resolve_offset_opt_length(duk_hthread *thr, } } } - DUK_ASSERT_DISABLE(length >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(length >= 0); /* unsigned */ DUK_ASSERT(offset + length <= h_bufarg->length); *out_offset = offset; *out_length = length; return; - fail_range: +fail_range: DUK_ERROR_RANGE(thr, DUK_STR_INVALID_ARGS); DUK_WO_NORETURN(return;); } @@ -27410,7 +28134,7 @@ DUK_LOCAL void duk__clamp_startend_negidx_shifted(duk_hthread *thr, DUK_ASSERT(out_start_offset != NULL); DUK_ASSERT(out_end_offset != NULL); - buffer_length >>= buffer_shift; /* as (full) elements */ + buffer_length >>= buffer_shift; /* as (full) elements */ /* Resolve start/end offset as element indices first; arguments * at idx_start/idx_end are element offsets. Working with element @@ -27502,7 +28226,10 @@ DUK_INTERNAL void duk_hbufobj_push_uint8array_from_plain(duk_hthread *thr, duk_h } /* Indexed read helper for buffer objects, also called from outside this file. */ -DUK_INTERNAL void duk_hbufobj_push_validated_read(duk_hthread *thr, duk_hbufobj *h_bufobj, duk_uint8_t *p, duk_small_uint_t elem_size) { +DUK_INTERNAL void duk_hbufobj_push_validated_read(duk_hthread *thr, + duk_hbufobj *h_bufobj, + duk_uint8_t *p, + duk_small_uint_t elem_size) { duk_double_union du; DUK_ASSERT(elem_size > 0); @@ -27650,17 +28377,17 @@ DUK_LOCAL duk_hbuffer *duk__hbufobj_fixed_from_argvalue(duk_hthread *thr) { DUK_WO_NORETURN(return NULL;); } - done: +done: DUK_ASSERT(duk_is_buffer(thr, -1)); return duk_known_hbuffer(thr, -1); - slow_copy: +slow_copy: /* XXX: fast path for typed arrays and other buffer objects? */ (void) duk_get_prop_stridx_short(thr, 0, DUK_STRIDX_LENGTH); len = duk_to_int_clamped(thr, -1, 0, DUK_INT_MAX); duk_pop(thr); - buf = (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, (duk_size_t) len); /* no zeroing, all indices get initialized */ + buf = (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, (duk_size_t) len); /* no zeroing, all indices get initialized */ for (i = 0; i < len; i++) { /* XXX: fast path for array or buffer arguments? */ duk_get_prop_index(thr, 0, (duk_uarridx_t) i); @@ -27669,7 +28396,7 @@ DUK_LOCAL duk_hbuffer *duk__hbufobj_fixed_from_argvalue(duk_hthread *thr) { } goto done; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer constructor @@ -27686,11 +28413,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_constructor(duk_hthread *thr) { h_buf = duk__hbufobj_fixed_from_argvalue(thr); DUK_ASSERT(h_buf != NULL); - duk_push_buffer_object(thr, - -1, - 0, - DUK_HBUFFER_FIXED_GET_SIZE((duk_hbuffer_fixed *) (void *) h_buf), - DUK_BUFOBJ_UINT8ARRAY); + duk_push_buffer_object(thr, -1, 0, DUK_HBUFFER_FIXED_GET_SIZE((duk_hbuffer_fixed *) (void *) h_buf), DUK_BUFOBJ_UINT8ARRAY); duk_push_hobject_bidx(thr, DUK_BIDX_NODEJS_BUFFER_PROTOTYPE); duk_set_prototype(thr, -2); @@ -27698,7 +28421,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_constructor(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * ArrayBuffer, DataView, and TypedArray constructors @@ -27722,9 +28445,8 @@ DUK_INTERNAL duk_ret_t duk_bi_arraybuffer_constructor(duk_hthread *thr) { h_val = (duk_hbuffer *) duk_known_hbuffer(thr, -1); h_bufobj = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAYBUFFER), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAYBUFFER), DUK_BIDX_ARRAYBUFFER_PROTOTYPE); DUK_ASSERT(h_bufobj != NULL); @@ -27733,11 +28455,10 @@ DUK_INTERNAL duk_ret_t duk_bi_arraybuffer_constructor(duk_hthread *thr) { return 1; - fail_length: +fail_length: DUK_DCERROR_RANGE_INVALID_LENGTH(thr); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ - +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* Format of magic, bits: * 0...1: elem size shift (0-3) @@ -27777,8 +28498,8 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { * element type. */ magic = (duk_small_uint_t) duk_get_current_magic(thr); - shift = magic & 0x03U; /* bits 0...1: shift */ - elem_type = (magic >> 2) & 0x0fU; /* bits 2...5: type */ + shift = magic & 0x03U; /* bits 0...1: shift */ + elem_type = (magic >> 2) & 0x0fU; /* bits 2...5: type */ elem_size = 1U << shift; align_mask = elem_size - 1; DUK_ASSERT(elem_type < sizeof(duk__buffer_proto_from_elemtype) / sizeof(duk_uint8_t)); @@ -27789,8 +28510,12 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { DUK_DD(DUK_DDPRINT("typedarray constructor, magic=%d, shift=%d, elem_type=%d, " "elem_size=%d, proto_bidx=%d, class_num=%d", - (int) magic, (int) shift, (int) elem_type, (int) elem_size, - (int) proto_bidx, (int) class_num)); + (int) magic, + (int) shift, + (int) elem_type, + (int) elem_size, + (int) proto_bidx, + (int) class_num)); /* Argument variants. When the argument is an ArrayBuffer a view to * the same buffer is created; otherwise a new ArrayBuffer is always @@ -27804,7 +28529,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { duk_hbufobj_promote_plain(thr, 0); tv = duk_get_tval(thr, 0); - DUK_ASSERT(tv != NULL); /* arg count */ + DUK_ASSERT(tv != NULL); /* arg count */ if (DUK_TVAL_IS_OBJECT(tv)) { h_obj = DUK_TVAL_GET_OBJECT(tv); DUK_ASSERT(h_obj != NULL); @@ -27824,8 +28549,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { goto fail_arguments; } byte_offset = (duk_uint_t) byte_offset_signed; - if (byte_offset > h_bufarg->length || - (byte_offset & align_mask) != 0) { + if (byte_offset > h_bufarg->length || (byte_offset & align_mask) != 0) { /* Must be >= 0 and multiple of element size. */ goto fail_arguments; } @@ -27865,9 +28589,8 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { DUK_ASSERT((elem_length << shift) == byte_length); h_bufobj = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(class_num), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | + DUK_HOBJECT_CLASS_AS_FLAGS(class_num), (duk_small_int_t) proto_bidx); h_val = h_bufarg->buf; if (h_val == NULL) { @@ -27910,11 +28633,13 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { "src byte_length=%ld, src shift=%d, " "src/dst elem_length=%ld; " "dst shift=%d -> dst byte_length=%ld", - (long) h_bufarg->length, (int) h_bufarg->shift, - (long) elem_length_signed, (int) shift, + (long) h_bufarg->length, + (int) h_bufarg->shift, + (long) elem_length_signed, + (int) shift, (long) (elem_length_signed << shift))); - copy_mode = 2; /* default is explicit index read/write copy */ + copy_mode = 2; /* default is explicit index read/write copy */ #if !defined(DUK_USE_PREFER_SIZE) /* With a size optimized build copy_mode 2 is enough. * Modes 0 and 1 are faster but conceptually the same. @@ -27923,14 +28648,14 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { if (DUK_HBUFOBJ_VALID_SLICE(h_bufarg)) { if ((duk__buffer_elemtype_copy_compatible[elem_type] & (1 << h_bufarg->elem_type)) != 0) { DUK_DDD(DUK_DDDPRINT("source/target are copy compatible, memcpy")); - DUK_ASSERT(shift == h_bufarg->shift); /* byte sizes will match */ + DUK_ASSERT(shift == h_bufarg->shift); /* byte sizes will match */ copy_mode = 0; } else { DUK_DDD(DUK_DDDPRINT("source/target not copy compatible but valid, fast copy")); copy_mode = 1; } } -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ } else { /* Array or Array-like */ elem_length_signed = (duk_int_t) duk_get_length(thr, 0); @@ -27955,8 +28680,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { goto fail_arguments; } - DUK_DDD(DUK_DDDPRINT("elem_length=%ld, byte_length=%ld", - (long) elem_length, (long) byte_length)); + DUK_DDD(DUK_DDDPRINT("elem_length=%ld, byte_length=%ld", (long) elem_length, (long) byte_length)); /* ArrayBuffer argument is handled specially above; the rest of the * argument variants are handled by shared code below. @@ -27971,11 +28695,10 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { h_val = duk_known_hbuffer(thr, -1); DUK_ASSERT(h_val != NULL); - h_bufobj = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(class_num), - (duk_small_int_t) proto_bidx); + h_bufobj = + duk_push_bufobj_raw(thr, + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | DUK_HOBJECT_CLASS_AS_FLAGS(class_num), + (duk_small_int_t) proto_bidx); h_bufobj->buf = h_val; DUK_HBUFFER_INCREF(thr, h_val); @@ -28015,7 +28738,9 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { p_src = DUK_HBUFOBJ_GET_SLICE_BASE(thr->heap, h_bufarg); DUK_DDD(DUK_DDDPRINT("using memcpy: p_src=%p, p_dst=%p, byte_length=%ld", - (void *) p_src, (void *) p_dst, (long) byte_length)); + (void *) p_src, + (void *) p_dst, + (long) byte_length)); duk_memcpy_unsafe((void *) p_dst, (const void *) p_src, (size_t) byte_length); break; @@ -28045,13 +28770,18 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("using fast copy: p_src=%p, p_src_end=%p, p_dst=%p, " "src_elem_size=%d, dst_elem_size=%d", - (void *) p_src, (void *) p_src_end, (void *) p_dst, - (int) src_elem_size, (int) dst_elem_size)); + (void *) p_src, + (void *) p_src_end, + (void *) p_dst, + (int) src_elem_size, + (int) dst_elem_size)); while (p_src != p_src_end) { DUK_DDD(DUK_DDDPRINT("fast path per element copy loop: " "p_src=%p, p_src_end=%p, p_dst=%p", - (void *) p_src, (void *) p_src_end, (void *) p_dst)); + (void *) p_src, + (void *) p_src_end, + (void *) p_dst)); /* A validated read() is always a number, so it's write coercion * is always side effect free an won't invalidate pointers etc. */ @@ -28063,7 +28793,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { } break; } -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ case 2: { /* Copy values by index reads and writes. Let virtual * property handling take care of coercion. @@ -28092,10 +28822,10 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { return 1; - fail_arguments: +fail_arguments: DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* When bufferobject support is disabled, new Uint8Array() could still be * supported to create a plain fixed buffer. Disabled for now. */ @@ -28122,8 +28852,8 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_constructor(duk_hthread *thr) { fail_arguments: DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#endif /* 0 */ -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* 0 */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) DUK_INTERNAL duk_ret_t duk_bi_dataview_constructor(duk_hthread *thr) { @@ -28146,9 +28876,8 @@ DUK_INTERNAL duk_ret_t duk_bi_dataview_constructor(duk_hthread *thr) { DUK_ASSERT(offset + length <= h_bufarg->length); h_bufobj = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DATAVIEW), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DATAVIEW), DUK_BIDX_DATAVIEW_PROTOTYPE); h_val = h_bufarg->buf; @@ -28171,7 +28900,7 @@ DUK_INTERNAL duk_ret_t duk_bi_dataview_constructor(duk_hthread *thr) { DUK_HBUFOBJ_ASSERT_VALID(h_bufobj); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * ArrayBuffer.isView() @@ -28197,7 +28926,7 @@ DUK_INTERNAL duk_ret_t duk_bi_arraybuffer_isview(duk_hthread *thr) { duk_push_boolean(thr, ret); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Uint8Array.allocPlain() @@ -28208,7 +28937,7 @@ DUK_INTERNAL duk_ret_t duk_bi_uint8array_allocplain(duk_hthread *thr) { duk__hbufobj_fixed_from_argvalue(thr); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Uint8Array.plainOf() @@ -28237,7 +28966,7 @@ DUK_INTERNAL duk_ret_t duk_bi_uint8array_plainof(duk_hthread *thr) { } return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer: toString([encoding], [start], [end]) @@ -28268,12 +28997,11 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_tostring(duk_hthread *thr) { &end_offset); slice_length = (duk_size_t) (end_offset - start_offset); - buf_slice = (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, slice_length); /* all bytes initialized below */ + buf_slice = (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, slice_length); /* all bytes initialized below */ DUK_ASSERT(buf_slice != NULL); /* Neutered or uncovered, TypeError. */ - if (h_this->buf == NULL || - !DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_this, (duk_size_t) start_offset + slice_length)) { + if (h_this->buf == NULL || !DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_this, (duk_size_t) start_offset + slice_length)) { DUK_DCERROR_TYPE_INVALID_ARGS(thr); } @@ -28296,7 +29024,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_tostring(duk_hthread *thr) { duk_set_top(thr, 1); return duk_textdecoder_decode_utf8_nodejs(thr); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.prototype: toJSON() @@ -28326,19 +29054,19 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_tojson(duk_hthread *thr) { /* XXX: uninitialized would be OK */ DUK_ASSERT_DISABLE((duk_size_t) h_this->length <= (duk_size_t) DUK_UINT32_MAX); - tv = duk_push_harray_with_size_outptr(thr, (duk_uint32_t) h_this->length); /* XXX: needs revision with >4G buffers */ + tv = duk_push_harray_with_size_outptr(thr, (duk_uint32_t) h_this->length); /* XXX: needs revision with >4G buffers */ DUK_ASSERT(!duk_is_bare_object(thr, -1)); DUK_ASSERT(h_this->buf != NULL); buf = DUK_HBUFOBJ_GET_SLICE_BASE(thr->heap, h_this); for (i = 0, n = h_this->length; i < n; i++) { - DUK_TVAL_SET_U32(tv + i, (duk_uint32_t) buf[i]); /* no need for decref or incref */ + DUK_TVAL_SET_U32(tv + i, (duk_uint32_t) buf[i]); /* no need for decref or incref */ } duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_DATA); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.prototype.equals() @@ -28373,14 +29101,14 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_compare_shared(duk_hthread *thr) { * matters is to be memory safe. */ - if (DUK_HBUFOBJ_VALID_SLICE(h_bufarg1) && - DUK_HBUFOBJ_VALID_SLICE(h_bufarg2)) { - comp_res = duk_js_data_compare((const duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufarg1->buf) + h_bufarg1->offset, - (const duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufarg2->buf) + h_bufarg2->offset, - (duk_size_t) h_bufarg1->length, - (duk_size_t) h_bufarg2->length); + if (DUK_HBUFOBJ_VALID_SLICE(h_bufarg1) && DUK_HBUFOBJ_VALID_SLICE(h_bufarg2)) { + comp_res = duk_js_data_compare( + (const duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufarg1->buf) + h_bufarg1->offset, + (const duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufarg2->buf) + h_bufarg2->offset, + (duk_size_t) h_bufarg1->length, + (duk_size_t) h_bufarg2->length); } else { - comp_res = -1; /* either nonzero value is ok */ + comp_res = -1; /* either nonzero value is ok */ } if (magic & 0x01U) { @@ -28393,7 +29121,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_compare_shared(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.prototype.fill() @@ -28438,7 +29166,10 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_fill(duk_hthread *thr) { &fill_end); DUK_DDD(DUK_DDDPRINT("fill: fill_value=%02x, fill_offset=%ld, fill_end=%ld, view length=%ld", - (unsigned int) fill_value, (long) fill_offset, (long) fill_end, (long) h_this->length)); + (unsigned int) fill_value, + (long) fill_offset, + (long) fill_end, + (long) h_this->length)); DUK_ASSERT(fill_end - fill_offset >= 0); DUK_ASSERT(h_this->buf != NULL); @@ -28467,7 +29198,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_fill(duk_hthread *thr) { duk_push_this(thr); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.prototype.write(string, [offset], [length], [encoding]) @@ -28510,7 +29241,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_write(duk_hthread *thr) { duk_push_uint(thr, length); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.prototype.copy() @@ -28545,8 +29276,11 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_copy(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("checking copy args: target_start=%ld, target_length=%ld, " "source_start=%ld, source_end=%ld, source_length=%ld", - (long) target_start, (long) h_bufarg->length, - (long) source_start, (long) source_end, (long) source_length)); + (long) target_start, + (long) h_bufarg->length, + (long) source_start, + (long) source_end, + (long) source_length)); /* This behavior mostly mimics Node.js now. */ @@ -28557,9 +29291,9 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_copy(duk_hthread *thr) { source_ustart = (duk_uint_t) source_start; source_uend = (duk_uint_t) source_end; target_ustart = (duk_uint_t) target_start; - if (source_ustart >= source_uend || /* crossed offsets or zero size */ - source_ustart >= (duk_uint_t) source_length || /* source out-of-bounds (but positive) */ - target_ustart >= (duk_uint_t) target_length) { /* target out-of-bounds (but positive) */ + if (source_ustart >= source_uend || /* crossed offsets or zero size */ + source_ustart >= (duk_uint_t) source_length || /* source out-of-bounds (but positive) */ + target_ustart >= (duk_uint_t) target_length) { /* target out-of-bounds (but positive) */ goto silent_ignore; } if (source_uend >= (duk_uint_t) source_length) { @@ -28575,13 +29309,14 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_copy(duk_hthread *thr) { * values in duk_int_t range. Adding them as duk_uint_t * values is then guaranteed not to overflow. */ - DUK_ASSERT(target_ustart + copy_size >= target_ustart); /* no overflow */ - DUK_ASSERT(target_ustart + copy_size >= copy_size); /* no overflow */ + DUK_ASSERT(target_ustart + copy_size >= target_ustart); /* no overflow */ + DUK_ASSERT(target_ustart + copy_size >= copy_size); /* no overflow */ copy_size = (duk_uint_t) target_length - target_ustart; } DUK_DDD(DUK_DDDPRINT("making copy: target_ustart=%lu source_ustart=%lu copy_size=%lu", - (unsigned long) target_ustart, (unsigned long) source_ustart, + (unsigned long) target_ustart, + (unsigned long) source_ustart, (unsigned long) copy_size)); DUK_ASSERT(copy_size >= 1); @@ -28591,8 +29326,8 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_copy(duk_hthread *thr) { DUK_ASSERT(target_ustart + copy_size <= (duk_uint_t) target_length); /* Ensure copy is covered by underlying buffers. */ - DUK_ASSERT(h_bufarg->buf != NULL); /* length check */ - DUK_ASSERT(h_this->buf != NULL); /* length check */ + DUK_ASSERT(h_bufarg->buf != NULL); /* length check */ + DUK_ASSERT(h_this->buf != NULL); /* length check */ if (DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_bufarg, target_ustart + copy_size) && DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_this, source_ustart + copy_size)) { /* Must use memmove() because copy area may overlap (source and target @@ -28605,18 +29340,18 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_copy(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("buffer copy not covered by underlying buffer(s), ignoring")); } - silent_ignore: +silent_ignore: /* Return value is like write(), number of bytes written. * The return value matters because of code like: * "off += buf.copy(...)". - */ + */ duk_push_uint(thr, copy_size); return 1; - fail_bounds: +fail_bounds: DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * TypedArray.prototype.set() @@ -28728,16 +29463,15 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { } /* Nominal size check. */ - src_length = h_bufarg->length; /* bytes in source */ - dst_length_elems = (src_length >> h_bufarg->shift); /* elems in source and dest */ - dst_length = dst_length_elems << h_this->shift; /* bytes in dest */ + src_length = h_bufarg->length; /* bytes in source */ + dst_length_elems = (src_length >> h_bufarg->shift); /* elems in source and dest */ + dst_length = dst_length_elems << h_this->shift; /* bytes in dest */ if ((dst_length >> h_this->shift) != dst_length_elems) { /* Byte length would overflow. */ /* XXX: easier check with less code? */ goto fail_args; } - DUK_DDD(DUK_DDDPRINT("nominal size check: src_length=%ld, dst_length=%ld", - (long) src_length, (long) dst_length)); + DUK_DDD(DUK_DDDPRINT("nominal size check: src_length=%ld, dst_length=%ld", (long) src_length, (long) dst_length)); DUK_ASSERT(offset_bytes <= h_this->length); if (dst_length > h_this->length - offset_bytes) { /* Overflow not an issue because subtraction is used on the right @@ -28758,8 +29492,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { * cover the copy. No side effects are allowed after the check * so that the validity status doesn't change. */ - if (!DUK_HBUFOBJ_VALID_SLICE(h_this) || - !DUK_HBUFOBJ_VALID_SLICE(h_bufarg)) { + if (!DUK_HBUFOBJ_VALID_SLICE(h_this) || !DUK_HBUFOBJ_VALID_SLICE(h_bufarg)) { /* The condition could be more narrow and check for the * copy area only, but there's no need for fine grained * behavior when the underlying buffer is misconfigured. @@ -28790,7 +29523,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { return 0; } DUK_DDD(DUK_DDDPRINT("fast path: views are not compatible with a byte copy, copy by item")); -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ /* We want to avoid making a copy to process set() but that's * not always possible: the source and the target may overlap @@ -28810,11 +29543,13 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("overlap check: p_src_base=%p, src_length=%ld, " "p_dst_base=%p, dst_length=%ld", - (void *) p_src_base, (long) src_length, - (void *) p_dst_base, (long) dst_length)); + (void *) p_src_base, + (long) src_length, + (void *) p_dst_base, + (long) dst_length)); - if (p_src_base >= p_dst_base + dst_length || /* source starts after dest ends */ - p_src_base + src_length <= p_dst_base) { /* source ends before dest starts */ + if (p_src_base >= p_dst_base + dst_length || /* source starts after dest ends */ + p_src_base + src_length <= p_dst_base) { /* source ends before dest starts */ no_overlap = 1; } @@ -28831,14 +29566,16 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { DUK_ASSERT(p_src_copy != NULL); duk_memcpy_unsafe((void *) p_src_copy, (const void *) p_src_base, (size_t) src_length); - p_src_base = p_src_copy; /* use p_src_base from now on */ + p_src_base = p_src_copy; /* use p_src_base from now on */ } /* Value stack intentionally mixed size here. */ DUK_DDD(DUK_DDDPRINT("after overlap check: p_src_base=%p, src_length=%ld, " "p_dst_base=%p, dst_length=%ld, valstack top=%ld", - (void *) p_src_base, (long) src_length, - (void *) p_dst_base, (long) dst_length, + (void *) p_src_base, + (long) src_length, + (void *) p_dst_base, + (long) dst_length, (long) duk_get_top(thr))); /* Ready to make the copy. We must proceed element by element @@ -28858,7 +29595,9 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { while (p_src != p_src_end) { DUK_DDD(DUK_DDDPRINT("fast path per element copy loop: " "p_src=%p, p_src_end=%p, p_dst=%p", - (void *) p_src, (void *) p_src_end, (void *) p_dst)); + (void *) p_src, + (void *) p_src_end, + (void *) p_dst)); /* A validated read() is always a number, so it's write coercion * is always side effect free an won't invalidate pointers etc. */ @@ -28908,10 +29647,10 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_hthread *thr) { return 0; - fail_args: +fail_args: DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.prototype.slice([start], [end]) @@ -29006,7 +29745,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) { /* fall through */ } } - tv = NULL; /* No longer valid nor needed. */ + tv = NULL; /* No longer valid nor needed. */ h_this = duk__require_bufobj_this(thr); @@ -29044,22 +29783,21 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) { * be an Uint8Array but inherit from Buffer.prototype. */ res_class_num = DUK_HOBJECT_GET_CLASS_NUMBER((duk_hobject *) h_this); - DUK_ASSERT(res_class_num >= DUK_HOBJECT_CLASS_BUFOBJ_MIN); /* type check guarantees */ + DUK_ASSERT(res_class_num >= DUK_HOBJECT_CLASS_BUFOBJ_MIN); /* type check guarantees */ DUK_ASSERT(res_class_num <= DUK_HOBJECT_CLASS_BUFOBJ_MAX); res_proto_bidx = duk__buffer_proto_from_classnum[res_class_num - DUK_HOBJECT_CLASS_BUFOBJ_MIN]; if (magic & 0x04) { res_proto_bidx = DUK_BIDX_NODEJS_BUFFER_PROTOTYPE; } - h_bufobj = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(res_class_num), - res_proto_bidx); + h_bufobj = + duk_push_bufobj_raw(thr, + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | DUK_HOBJECT_CLASS_AS_FLAGS(res_class_num), + res_proto_bidx); DUK_ASSERT(h_bufobj != NULL); DUK_ASSERT(h_bufobj->length == 0); - h_bufobj->shift = h_this->shift; /* inherit */ - h_bufobj->elem_type = h_this->elem_type; /* inherit */ + h_bufobj->shift = h_this->shift; /* inherit */ + h_bufobj->elem_type = h_this->elem_type; /* inherit */ h_bufobj->is_typedarray = magic & 0x01; DUK_ASSERT(h_bufobj->is_typedarray == 0 || h_bufobj->is_typedarray == 1); @@ -29073,7 +29811,9 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) { duk_uint8_t *p_copy; duk_size_t copy_length; - p_copy = (duk_uint8_t *) duk_push_fixed_buffer_zero(thr, (duk_size_t) slice_length); /* must be zeroed, not all bytes always copied */ + p_copy = (duk_uint8_t *) duk_push_fixed_buffer_zero( + thr, + (duk_size_t) slice_length); /* must be zeroed, not all bytes always copied */ DUK_ASSERT(p_copy != NULL); /* Copy slice, respecting underlying buffer limits; remainder @@ -29091,7 +29831,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) { h_bufobj->length = slice_length; DUK_ASSERT(h_bufobj->offset == 0); - duk_pop(thr); /* reachable so pop OK */ + duk_pop(thr); /* reachable so pop OK */ } else { h_bufobj->buf = h_val; DUK_HBUFFER_INCREF(thr, h_val); @@ -29104,7 +29844,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) { */ DUK_ASSERT(h_bufobj->buf_prop == NULL); - h_bufobj->buf_prop = h_this->buf_prop; /* may be NULL */ + h_bufobj->buf_prop = h_this->buf_prop; /* may be NULL */ DUK_HOBJECT_INCREF_ALLOWNULL(thr, (duk_hobject *) h_bufobj->buf_prop); } /* unbalanced stack on purpose */ @@ -29112,7 +29852,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_slice_shared(duk_hthread *thr) { DUK_HBUFOBJ_ASSERT_VALID(h_bufobj); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.isEncoding() @@ -29125,11 +29865,11 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_is_encoding(duk_hthread *thr) { /* only accept lowercase 'utf8' now. */ encoding = duk_to_string(thr, 0); - DUK_ASSERT(duk_is_string(thr, 0)); /* guaranteed by duk_to_string() */ + DUK_ASSERT(duk_is_string(thr, 0)); /* guaranteed by duk_to_string() */ duk_push_boolean(thr, DUK_STRCMP(encoding, "utf8") == 0); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.isBuffer() @@ -29141,7 +29881,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_is_buffer(duk_hthread *thr) { duk_hobject *h_proto; duk_bool_t ret = 0; - DUK_ASSERT(duk_get_top(thr) >= 1); /* nargs */ + DUK_ASSERT(duk_get_top(thr) >= 1); /* nargs */ h = duk_get_hobject(thr, 0); if (h != NULL) { h_proto = thr->builtins[DUK_BIDX_NODEJS_BUFFER_PROTOTYPE]; @@ -29156,7 +29896,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_is_buffer(duk_hthread *thr) { duk_push_boolean(thr, ret); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.byteLength() @@ -29187,7 +29927,7 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_byte_length(duk_hthread *thr) { duk_push_size_t(thr, len); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Node.js Buffer.concat() @@ -29218,13 +29958,13 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) { /* Neutered checks not necessary here: neutered buffers have * zero 'length' so we'll effectively skip them. */ - DUK_ASSERT_TOP(thr, 2); /* [ array totalLength ] */ - duk_get_prop_index(thr, 0, (duk_uarridx_t) i); /* -> [ array totalLength buf ] */ + DUK_ASSERT_TOP(thr, 2); /* [ array totalLength ] */ + duk_get_prop_index(thr, 0, (duk_uarridx_t) i); /* -> [ array totalLength buf ] */ h_bufobj = duk__require_bufobj_value(thr, 2); DUK_ASSERT(h_bufobj != NULL); total_length += h_bufobj->length; if (DUK_UNLIKELY(total_length < h_bufobj->length)) { - DUK_DCERROR_RANGE_INVALID_ARGS(thr); /* Wrapped. */ + DUK_DCERROR_RANGE_INVALID_ARGS(thr); /* Wrapped. */ } duk_pop(thr); } @@ -29250,18 +29990,18 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) { } h_bufres = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_UINT8ARRAY), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_UINT8ARRAY), DUK_BIDX_NODEJS_BUFFER_PROTOTYPE); DUK_ASSERT(h_bufres != NULL); - p = (duk_uint8_t *) duk_push_fixed_buffer_zero(thr, total_length); /* must be zeroed, all bytes not necessarily written over */ + p = (duk_uint8_t *) duk_push_fixed_buffer_zero(thr, + total_length); /* must be zeroed, all bytes not necessarily written over */ DUK_ASSERT(p != NULL); space_left = (duk_size_t) total_length; for (i = 0; i < n; i++) { - DUK_ASSERT_TOP(thr, 4); /* [ array totalLength bufres buf ] */ + DUK_ASSERT_TOP(thr, 4); /* [ array totalLength bufres buf ] */ duk_get_prop_index(thr, 0, (duk_uarridx_t) i); h_bufobj = duk__require_bufobj_value(thr, 4); @@ -29272,11 +30012,8 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) { copy_size = space_left; } - if (h_bufobj->buf != NULL && - DUK_HBUFOBJ_VALID_SLICE(h_bufobj)) { - duk_memcpy_unsafe((void *) p, - (const void *) DUK_HBUFOBJ_GET_SLICE_BASE(thr->heap, h_bufobj), - copy_size); + if (h_bufobj->buf != NULL && DUK_HBUFOBJ_VALID_SLICE(h_bufobj)) { + duk_memcpy_unsafe((void *) p, (const void *) DUK_HBUFOBJ_GET_SLICE_BASE(thr->heap, h_bufobj), copy_size); } else { /* Just skip, leaving zeroes in the result. */ ; @@ -29293,11 +30030,11 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) { h_bufres->is_typedarray = 1; DUK_HBUFOBJ_ASSERT_VALID(h_bufres); - duk_pop(thr); /* pop plain buffer, now reachable through h_bufres */ + duk_pop(thr); /* pop plain buffer, now reachable through h_bufres */ - return 1; /* return h_bufres */ + return 1; /* return h_bufres */ } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Shared readfield and writefield methods @@ -29313,15 +30050,15 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) { * 4: signed: 1=yes, 0=no * 5: typedarray: 1=yes, 0=no */ -#define DUK__FLD_8BIT 0 -#define DUK__FLD_16BIT 1 -#define DUK__FLD_32BIT 2 -#define DUK__FLD_FLOAT 3 -#define DUK__FLD_DOUBLE 4 -#define DUK__FLD_VARINT 5 -#define DUK__FLD_BIGENDIAN (1 << 3) -#define DUK__FLD_SIGNED (1 << 4) -#define DUK__FLD_TYPEDARRAY (1 << 5) +#define DUK__FLD_8BIT 0 +#define DUK__FLD_16BIT 1 +#define DUK__FLD_32BIT 2 +#define DUK__FLD_FLOAT 3 +#define DUK__FLD_DOUBLE 4 +#define DUK__FLD_VARINT 5 +#define DUK__FLD_BIGENDIAN (1 << 3) +#define DUK__FLD_SIGNED (1 << 4) +#define DUK__FLD_TYPEDARRAY (1 << 5) /* XXX: split into separate functions for each field type? */ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { @@ -29345,7 +30082,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { magic_signed = magic & 0x0010U; magic_typedarray = magic & 0x0020U; - h_this = duk__require_bufobj_this(thr); /* XXX: very inefficient for plain buffers */ + h_this = duk__require_bufobj_this(thr); /* XXX: very inefficient for plain buffers */ DUK_ASSERT(h_this != NULL); buffer_length = h_this->length; @@ -29357,9 +30094,9 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { if (magic_typedarray) { no_assert = 0; #if defined(DUK_USE_INTEGER_LE) - endswap = !duk_to_boolean(thr, 1); /* 1=little endian */ + endswap = !duk_to_boolean(thr, 1); /* 1=little endian */ #else - endswap = duk_to_boolean(thr, 1); /* 1=little endian */ + endswap = duk_to_boolean(thr, 1); /* 1=little endian */ #endif } else { no_assert = duk_to_boolean(thr, (magic_ftype == DUK__FLD_VARINT) ? 2 : 1); @@ -29383,17 +30120,21 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("readfield, buffer_length=%ld, offset=%ld, no_assert=%d, " "magic=%04x, magic_fieldtype=%d, magic_bigendian=%d, magic_signed=%d, " "endswap=%u", - (long) buffer_length, (long) offset, (int) no_assert, - (unsigned int) magic, (int) magic_ftype, (int) (magic_bigendian >> 3), - (int) (magic_signed >> 4), (int) endswap)); + (long) buffer_length, + (long) offset, + (int) no_assert, + (unsigned int) magic, + (int) magic_ftype, + (int) (magic_bigendian >> 3), + (int) (magic_signed >> 4), + (int) endswap)); /* Update 'buffer_length' to be the effective, safe limit which * takes into account the underlying buffer. This value will be * potentially invalidated by any side effect. */ check_length = DUK_HBUFOBJ_CLAMP_BYTELENGTH(h_this, buffer_length); - DUK_DDD(DUK_DDDPRINT("buffer_length=%ld, check_length=%ld", - (long) buffer_length, (long) check_length)); + DUK_DDD(DUK_DDDPRINT("buffer_length=%ld, check_length=%ld", (long) buffer_length, (long) check_length)); if (h_this->buf) { buf = DUK_HBUFOBJ_GET_SLICE_BASE(thr->heap, h_this); @@ -29495,7 +30236,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { #endif const duk_uint8_t *p; - field_bytelen = duk_get_int(thr, 1); /* avoid side effects! */ + field_bytelen = duk_get_int(thr, 1); /* avoid side effects! */ if (field_bytelen < 1 || field_bytelen > 6) { goto fail_field_length; } @@ -29513,12 +30254,12 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { /* Gather in big endian */ i = 0; i_step = 1; - i_end = field_bytelen; /* one i_step over */ + i_end = field_bytelen; /* one i_step over */ } else { /* Gather in little endian */ i = field_bytelen - 1; i_step = -1; - i_end = -1; /* one i_step over */ + i_end = -1; /* one i_step over */ } #if defined(DUK_USE_64BIT_OPS) @@ -29560,16 +30301,16 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { #endif break; } - default: { /* should never happen but default here */ + default: { /* should never happen but default here */ goto fail_bounds; } } return 1; - fail_neutered: - fail_field_length: - fail_bounds: +fail_neutered: +fail_field_length: +fail_bounds: if (no_assert) { /* Node.js return value for noAssert out-of-bounds reads is * usually (but not always) NaN. Return NaN consistently. @@ -29579,7 +30320,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) { } DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) /* XXX: split into separate functions for each field type? */ @@ -29606,7 +30347,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { magic_typedarray = magic & 0x0020U; DUK_UNREF(magic_signed); - h_this = duk__require_bufobj_this(thr); /* XXX: very inefficient for plain buffers */ + h_this = duk__require_bufobj_this(thr); /* XXX: very inefficient for plain buffers */ DUK_ASSERT(h_this != NULL); buffer_length = h_this->length; @@ -29618,11 +30359,11 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { if (magic_typedarray) { no_assert = 0; #if defined(DUK_USE_INTEGER_LE) - endswap = !duk_to_boolean(thr, 2); /* 1=little endian */ + endswap = !duk_to_boolean(thr, 2); /* 1=little endian */ #else - endswap = duk_to_boolean(thr, 2); /* 1=little endian */ + endswap = duk_to_boolean(thr, 2); /* 1=little endian */ #endif - duk_swap(thr, 0, 1); /* offset/value order different from Node.js */ + duk_swap(thr, 0, 1); /* offset/value order different from Node.js */ } else { no_assert = duk_to_boolean(thr, (magic_ftype == DUK__FLD_VARINT) ? 3 : 2); #if defined(DUK_USE_INTEGER_LE) @@ -29661,9 +30402,15 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("writefield, value=%!T, buffer_length=%ld, offset=%ld, no_assert=%d, " "magic=%04x, magic_fieldtype=%d, magic_bigendian=%d, magic_signed=%d, " "endswap=%u", - duk_get_tval(thr, 0), (long) buffer_length, (long) offset, (int) no_assert, - (unsigned int) magic, (int) magic_ftype, (int) (magic_bigendian >> 3), - (int) (magic_signed >> 4), (int) endswap)); + duk_get_tval(thr, 0), + (long) buffer_length, + (long) offset, + (int) no_assert, + (unsigned int) magic, + (int) magic_ftype, + (int) (magic_bigendian >> 3), + (int) (magic_signed >> 4), + (int) endswap)); /* Coerce value to a number before computing check_length, so that * the field type specific coercion below can't have side effects @@ -29676,8 +30423,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { * potentially invalidated by any side effect. */ check_length = DUK_HBUFOBJ_CLAMP_BYTELENGTH(h_this, buffer_length); - DUK_DDD(DUK_DDDPRINT("buffer_length=%ld, check_length=%ld", - (long) buffer_length, (long) check_length)); + DUK_DDD(DUK_DDDPRINT("buffer_length=%ld, check_length=%ld", (long) buffer_length, (long) check_length)); if (h_this->buf) { buf = DUK_HBUFOBJ_GET_SLICE_BASE(thr->heap, h_this); @@ -29780,12 +30526,12 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { if (magic_bigendian) { /* Write in big endian */ - i = field_bytelen; /* one i_step added at top of loop */ + i = field_bytelen; /* one i_step added at top of loop */ i_step = -1; i_end = 0; } else { /* Write in little endian */ - i = -1; /* one i_step added at top of loop */ + i = -1; /* one i_step added at top of loop */ i_step = 1; i_end = field_bytelen - 1; } @@ -29803,7 +30549,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { i += i_step; DUK_ASSERT(i >= 0 && i < field_bytelen); p[i] = (duk_uint8_t) (tmp & 0xff); - tmp = tmp >> 8; /* unnecessary shift for last byte */ + tmp = tmp >> 8; /* unnecessary shift for last byte */ } while (i != i_end); #else tmp = duk_to_number(thr, 0); @@ -29813,12 +30559,12 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { tmp = DUK_FLOOR(tmp); DUK_ASSERT(i >= 0 && i < field_bytelen); p[i] = (duk_uint8_t) (DUK_FMOD(tmp, 256.0)); - tmp = tmp / 256.0; /* unnecessary div for last byte */ + tmp = tmp / 256.0; /* unnecessary div for last byte */ } while (i != i_end); #endif break; } - default: { /* should never happen but default here */ + default: { /* should never happen but default here */ goto fail_bounds; } } @@ -29835,9 +30581,9 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { duk_push_uint(thr, offset + (duk_uint_t) nbytes); return 1; - fail_neutered: - fail_field_length: - fail_bounds: +fail_neutered: +fail_field_length: +fail_bounds: if (no_assert) { /* Node.js return value for failed writes is offset + #bytes * that would have been written. @@ -29853,7 +30599,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) { } DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * Accessors for .buffer, .byteLength, .byteOffset @@ -29864,9 +30610,8 @@ DUK_LOCAL duk_hbufobj *duk__autospawn_arraybuffer(duk_hthread *thr, duk_hbuffer duk_hbufobj *h_res; h_res = duk_push_bufobj_raw(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_BUFOBJ | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAYBUFFER), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_BUFOBJ | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARRAYBUFFER), DUK_BIDX_ARRAYBUFFER_PROTOTYPE); DUK_ASSERT(h_res != NULL); DUK_UNREF(h_res); @@ -29906,13 +30651,13 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_buffer_getter(duk_hthread *thr) { * matches view[0]. */ h_arrbuf->offset = 0; - DUK_ASSERT(h_bufobj->offset + h_bufobj->length >= h_bufobj->offset); /* Wrap check on creation. */ + DUK_ASSERT(h_bufobj->offset + h_bufobj->length >= h_bufobj->offset); /* Wrap check on creation. */ h_arrbuf->length = h_bufobj->offset + h_bufobj->length; DUK_ASSERT(h_arrbuf->buf_prop == NULL); DUK_ASSERT(h_bufobj->buf_prop == NULL); h_bufobj->buf_prop = (duk_hobject *) h_arrbuf; - DUK_HBUFOBJ_INCREF(thr, h_arrbuf); /* Now reachable and accounted for. */ + DUK_HBUFOBJ_INCREF(thr, h_arrbuf); /* Now reachable and accounted for. */ } /* Left on stack; pushed for the second time below (OK). */ @@ -29950,7 +30695,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_bytelength_getter(duk_hthread *thr) { duk_hbuffer *h_buf; h_buf = (duk_hbuffer *) h_bufobj; - DUK_ASSERT(DUK_HBUFFER_GET_SIZE(h_buf) <= DUK_UINT_MAX); /* Buffer limits. */ + DUK_ASSERT(DUK_HBUFFER_GET_SIZE(h_buf) <= DUK_UINT_MAX); /* Buffer limits. */ duk_push_uint(thr, (duk_uint_t) DUK_HBUFFER_GET_SIZE(h_buf)); } else { /* If neutered must return 0; length is zeroed during @@ -29960,7 +30705,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_bytelength_getter(duk_hthread *thr) { } return 1; } -#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#else /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* No .buffer getter without ArrayBuffer support. */ #if 0 DUK_INTERNAL duk_ret_t duk_bi_typedarray_buffer_getter(duk_hthread *thr) { @@ -29982,7 +30727,7 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_bytelength_getter(duk_hthread *thr) { duk_push_uint(thr, DUK_HBUFFER_GET_SIZE(h_buf)); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* automatic undefs */ #undef DUK__BUFOBJ_FLAG_PROMOTE @@ -30192,7 +30937,7 @@ DUK_LOCAL void duk__cbor_encode_double(duk_cbor_encode_context *enc_ctx, double p += 8; enc_ctx->ptr = p; } -#else /* DUK_CBOR_DOUBLE_AS_IS */ +#else /* DUK_CBOR_DOUBLE_AS_IS */ DUK_LOCAL void duk__cbor_encode_double_fp(duk_cbor_encode_context *enc_ctx, double d) { duk_double_union u; duk_uint16_t u16; @@ -30227,8 +30972,7 @@ DUK_LOCAL void duk__cbor_encode_double_fp(duk_cbor_encode_context *enc_ctx, doub duk_bool_t use_half_float; use_half_float = - (u.uc[0] == 0 && u.uc[1] == 0 && u.uc[2] == 0 && u.uc[3] == 0 && - u.uc[4] == 0 && (u.uc[5] & 0x03U) == 0); + (u.uc[0] == 0 && u.uc[1] == 0 && u.uc[2] == 0 && u.uc[3] == 0 && u.uc[4] == 0 && (u.uc[5] & 0x03U) == 0); if (use_half_float) { duk_uint32_t t; @@ -30380,9 +31124,9 @@ DUK_LOCAL void duk__cbor_encode_double(duk_cbor_encode_context *enc_ctx, double /* Most important path is integers. The floor() test will be true * for Inf too (but not NaN). */ - d_floor = DUK_FLOOR(d); /* identity if d is +/- 0.0, NaN, or +/- Infinity */ + d_floor = DUK_FLOOR(d); /* identity if d is +/- 0.0, NaN, or +/- Infinity */ if (DUK_LIKELY(duk_double_equals(d_floor, d) != 0)) { - DUK_ASSERT(!DUK_ISNAN(d)); /* NaN == NaN compares false. */ + DUK_ASSERT(!DUK_ISNAN(d)); /* NaN == NaN compares false. */ if (DUK_SIGNBIT(d)) { if (d >= -4294967296.0) { d = -1.0 - d; @@ -30421,7 +31165,7 @@ DUK_LOCAL void duk__cbor_encode_double(duk_cbor_encode_context *enc_ctx, double DUK_ASSERT(DUK_FPCLASSIFY(d) != DUK_FP_ZERO); duk__cbor_encode_double_fp(enc_ctx, d); } -#endif /* DUK_CBOR_DOUBLE_AS_IS */ +#endif /* DUK_CBOR_DOUBLE_AS_IS */ DUK_LOCAL void duk__cbor_encode_string_top(duk_cbor_encode_context *enc_ctx) { const duk_uint8_t *str; @@ -30472,7 +31216,8 @@ DUK_LOCAL void duk__cbor_encode_string_top(duk_cbor_encode_context *enc_ctx) { #elif defined(DUK_CBOR_BYTE_STRINGS) duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, 0x40U); #else - duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, + duk__cbor_encode_uint32(enc_ctx, + (duk_uint32_t) len, (DUK_LIKELY(duk_unicode_is_utf8_compatible(str, len) != 0) ? 0x60U : 0x40U)); #endif duk__cbor_encode_ensure(enc_ctx, len); @@ -30532,14 +31277,14 @@ DUK_LOCAL void duk__cbor_encode_object(duk_cbor_encode_context *enc_ctx) { * indefinite length. This works well up to 23 * properties which is practical and good enough. */ - off_ib = (duk_size_t) (enc_ctx->ptr - enc_ctx->buf); /* XXX: get_offset? */ + off_ib = (duk_size_t) (enc_ctx->ptr - enc_ctx->buf); /* XXX: get_offset? */ count = 0U; p = enc_ctx->ptr; - *p++ = 0xa0U + 0x1fU; /* indefinite length */ + *p++ = 0xa0U + 0x1fU; /* indefinite length */ enc_ctx->ptr = p; duk_enum(enc_ctx->thr, -1, DUK_ENUM_OWN_PROPERTIES_ONLY); while (duk_next(enc_ctx->thr, -1, 1 /*get_value*/)) { - duk_insert(enc_ctx->thr, -2); /* [ ... key value ] -> [ ... value key ] */ + duk_insert(enc_ctx->thr, -2); /* [ ... key value ] -> [ ... value key ] */ duk__cbor_encode_value(enc_ctx); duk__cbor_encode_value(enc_ctx); count++; @@ -30554,7 +31299,7 @@ DUK_LOCAL void duk__cbor_encode_object(duk_cbor_encode_context *enc_ctx) { } else { duk__cbor_encode_ensure(enc_ctx, 1); p = enc_ctx->ptr; - *p++ = 0xffU; /* break */ + *p++ = 0xffU; /* break */ enc_ctx->ptr = p; } } @@ -30682,7 +31427,7 @@ DUK_LOCAL void duk__cbor_encode_value(duk_cbor_encode_context *enc_ctx) { duk_pop(enc_ctx->thr); return; - fail: +fail: duk__cbor_encode_error(enc_ctx); } @@ -30759,7 +31504,7 @@ DUK_LOCAL duk_uint8_t duk__cbor_decode_peekbyte(duk_cbor_decode_context *dec_ctx } DUK_LOCAL void duk__cbor_decode_rewind(duk_cbor_decode_context *dec_ctx, duk_size_t len) { - DUK_ASSERT(len <= dec_ctx->off); /* Caller must ensure. */ + DUK_ASSERT(len <= dec_ctx->off); /* Caller must ensure. */ dec_ctx->off -= len; } @@ -30779,7 +31524,7 @@ DUK_LOCAL const duk_uint8_t *duk__cbor_decode_consume(duk_cbor_decode_context *d return res; } - duk__cbor_decode_error(dec_ctx); /* Not enough input. */ + duk__cbor_decode_error(dec_ctx); /* Not enough input. */ return NULL; } @@ -30811,16 +31556,16 @@ DUK_LOCAL void duk__cbor_decode_push_aival_int(duk_cbor_decode_context *dec_ctx, } switch (ai) { - case 0x18U: /* 1 byte */ + case 0x18U: /* 1 byte */ t = (duk_uint32_t) duk__cbor_decode_readbyte(dec_ctx); goto shared_exit; - case 0x19U: /* 2 byte */ + case 0x19U: /* 2 byte */ t = (duk_uint32_t) duk__cbor_decode_read_u16(dec_ctx); goto shared_exit; - case 0x1aU: /* 4 byte */ + case 0x1aU: /* 4 byte */ t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx); goto shared_exit; - case 0x1bU: /* 8 byte */ + case 0x1bU: /* 8 byte */ /* For uint64 it's important to handle the -1.0 part before * casting to double: otherwise the adjustment might be lost * in the cast. Uses: -1.0 - d <=> -(d + 1.0). @@ -30877,7 +31622,7 @@ DUK_LOCAL void duk__cbor_decode_push_aival_int(duk_cbor_decode_context *dec_ctx, * * No fastint check for this path at present. */ - d1 = (duk_double_t) t1; /* XXX: cast helpers */ + d1 = (duk_double_t) t1; /* XXX: cast helpers */ d2 = (duk_double_t) t2 * 4294967296.0; if (negative) { d1 += 1.0; @@ -30895,10 +31640,10 @@ DUK_LOCAL void duk__cbor_decode_push_aival_int(duk_cbor_decode_context *dec_ctx, duk__cbor_decode_error(dec_ctx); return; - shared_exit: +shared_exit: if (negative) { /* XXX: a push and check for fastint API would be nice */ - if ((duk_uint_t) t <= (duk_uint_t) -(DUK_INT_MIN + 1)) { + if ((duk_uint_t) t <= (duk_uint_t) - (DUK_INT_MIN + 1)) { duk_push_int(dec_ctx->thr, -1 - ((duk_int_t) t)); } else { duk_push_number(dec_ctx->thr, -1.0 - (duk_double_t) t); @@ -30909,10 +31654,8 @@ DUK_LOCAL void duk__cbor_decode_push_aival_int(duk_cbor_decode_context *dec_ctx, } DUK_LOCAL void duk__cbor_decode_skip_aival_int(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib) { - const duk_int8_t skips[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, 1, 2, 4, 8, -1, -1, -1, -1 - }; + const duk_int8_t skips[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, 1, 2, 4, 8, -1, -1, -1, -1 }; duk_uint8_t ai; duk_int8_t skip; @@ -30935,16 +31678,16 @@ DUK_LOCAL duk_uint32_t duk__cbor_decode_aival_uint32(duk_cbor_decode_context *de } switch (ai) { - case 0x18U: /* 1 byte */ + case 0x18U: /* 1 byte */ t = (duk_uint32_t) duk__cbor_decode_readbyte(dec_ctx); return t; - case 0x19U: /* 2 byte */ + case 0x19U: /* 2 byte */ t = (duk_uint32_t) duk__cbor_decode_read_u16(dec_ctx); return t; - case 0x1aU: /* 4 byte */ + case 0x1aU: /* 4 byte */ t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx); return t; - case 0x1bU: /* 8 byte */ + case 0x1bU: /* 8 byte */ t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx); if (t != 0U) { break; @@ -30978,7 +31721,7 @@ DUK_LOCAL void duk__cbor_decode_buffer(duk_cbor_decode_context *dec_ctx, duk_uin DUK_LOCAL void duk__cbor_decode_join_buffers(duk_cbor_decode_context *dec_ctx, duk_idx_t count) { duk_size_t total_size = 0; duk_idx_t top = duk_get_top(dec_ctx->thr); - duk_idx_t base = top - count; /* count is >= 1 */ + duk_idx_t base = top - count; /* count is >= 1 */ duk_idx_t idx; duk_uint8_t *p = NULL; @@ -30999,7 +31742,7 @@ DUK_LOCAL void duk__cbor_decode_join_buffers(duk_cbor_decode_context *dec_ctx, d p += buf_size; } else { total_size += buf_size; - if (DUK_UNLIKELY(total_size < buf_size)) { /* Wrap check. */ + if (DUK_UNLIKELY(total_size < buf_size)) { /* Wrap check. */ duk__cbor_decode_error(dec_ctx); } } @@ -31026,7 +31769,7 @@ DUK_LOCAL void duk__cbor_decode_and_join_strbuf(duk_cbor_decode_context *dec_ctx duk_require_stack(dec_ctx->thr, 1); duk__cbor_decode_buffer(dec_ctx, expected_base); count++; - if (DUK_UNLIKELY(count <= 0)) { /* Wrap check. */ + if (DUK_UNLIKELY(count <= 0)) { /* Wrap check. */ duk__cbor_decode_error(dec_ctx); } } @@ -31074,10 +31817,10 @@ DUK_LOCAL duk_double_t duk__cbor_decode_half_float(duk_cbor_decode_context *dec_ */ u.uc[7] = 0x3fU; u.uc[6] = 0x10U + (duk_uint8_t) ((u16 >> 6) & 0x0fU); - u.uc[5] = (duk_uint8_t) ((u16 << 2) & 0xffU); /* Mask is really 0xfcU */ + u.uc[5] = (duk_uint8_t) ((u16 << 2) & 0xffU); /* Mask is really 0xfcU */ duk_dblunion_little_to_host(&u); - res = u.d - 0.00006103515625; /* 2^(-14) */ + res = u.d - 0.00006103515625; /* 2^(-14) */ if (u16 & 0x8000U) { res = -res; } @@ -31176,7 +31919,7 @@ DUK_LOCAL duk_bool_t duk__cbor_decode_array(duk_cbor_decode_context *dec_ctx, du /* XXX: use bare array? */ duk_push_array(dec_ctx->thr); - for (idx = 0U; ;) { + for (idx = 0U;;) { if (len == 0xffffffffUL && duk__cbor_decode_checkbreak(dec_ctx)) { break; } @@ -31190,7 +31933,7 @@ DUK_LOCAL duk_bool_t duk__cbor_decode_array(duk_cbor_decode_context *dec_ctx, du duk_put_prop_index(dec_ctx->thr, -2, (duk_uarridx_t) idx); idx++; if (idx == 0U) { - goto failure; /* wrapped */ + goto failure; /* wrapped */ } } @@ -31200,7 +31943,7 @@ DUK_LOCAL duk_bool_t duk__cbor_decode_array(duk_cbor_decode_context *dec_ctx, du duk__cbor_decode_objarr_exit(dec_ctx); return 1; - failure: +failure: /* No need to unwind recursion checks, caller will throw. */ return 0; } @@ -31252,7 +31995,7 @@ DUK_LOCAL duk_bool_t duk__cbor_decode_map(duk_cbor_decode_context *dec_ctx, duk_ duk__cbor_decode_objarr_exit(dec_ctx); return 1; - failure: +failure: /* No need to unwind recursion checks, caller will throw. */ return 0; } @@ -31276,7 +32019,7 @@ DUK_LOCAL duk_double_t duk__cbor_decode_double(duk_cbor_decode_context *dec_ctx) } #if defined(DUK_CBOR_DECODE_FASTPATH) -#define DUK__CBOR_AI (ib & 0x1fU) +#define DUK__CBOR_AI (ib & 0x1fU) DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { duk_uint8_t ib; @@ -31286,7 +32029,7 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { * here for simple paths like primitive values. */ - reread_initial_byte: +reread_initial_byte: DUK_DDD(DUK_DDDPRINT("cbor decode off=%ld len=%ld", (long) dec_ctx->off, (long) dec_ctx->len)); ib = duk__cbor_decode_readbyte(dec_ctx); @@ -31295,107 +32038,292 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { /* XXX: Force full switch with no range check. */ switch (ib) { - case 0x00U: case 0x01U: case 0x02U: case 0x03U: case 0x04U: case 0x05U: case 0x06U: case 0x07U: - case 0x08U: case 0x09U: case 0x0aU: case 0x0bU: case 0x0cU: case 0x0dU: case 0x0eU: case 0x0fU: - case 0x10U: case 0x11U: case 0x12U: case 0x13U: case 0x14U: case 0x15U: case 0x16U: case 0x17U: + case 0x00U: + case 0x01U: + case 0x02U: + case 0x03U: + case 0x04U: + case 0x05U: + case 0x06U: + case 0x07U: + case 0x08U: + case 0x09U: + case 0x0aU: + case 0x0bU: + case 0x0cU: + case 0x0dU: + case 0x0eU: + case 0x0fU: + case 0x10U: + case 0x11U: + case 0x12U: + case 0x13U: + case 0x14U: + case 0x15U: + case 0x16U: + case 0x17U: duk_push_uint(dec_ctx->thr, ib); break; - case 0x18U: case 0x19U: case 0x1aU: case 0x1bU: + case 0x18U: + case 0x19U: + case 0x1aU: + case 0x1bU: duk__cbor_decode_push_aival_int(dec_ctx, ib, 0 /*negative*/); break; - case 0x1cU: case 0x1dU: case 0x1eU: case 0x1fU: + case 0x1cU: + case 0x1dU: + case 0x1eU: + case 0x1fU: goto format_error; - case 0x20U: case 0x21U: case 0x22U: case 0x23U: case 0x24U: case 0x25U: case 0x26U: case 0x27U: - case 0x28U: case 0x29U: case 0x2aU: case 0x2bU: case 0x2cU: case 0x2dU: case 0x2eU: case 0x2fU: - case 0x30U: case 0x31U: case 0x32U: case 0x33U: case 0x34U: case 0x35U: case 0x36U: case 0x37U: + case 0x20U: + case 0x21U: + case 0x22U: + case 0x23U: + case 0x24U: + case 0x25U: + case 0x26U: + case 0x27U: + case 0x28U: + case 0x29U: + case 0x2aU: + case 0x2bU: + case 0x2cU: + case 0x2dU: + case 0x2eU: + case 0x2fU: + case 0x30U: + case 0x31U: + case 0x32U: + case 0x33U: + case 0x34U: + case 0x35U: + case 0x36U: + case 0x37U: duk_push_int(dec_ctx->thr, -((duk_int_t) ((ib - 0x20U) + 1U))); break; - case 0x38U: case 0x39U: case 0x3aU: case 0x3bU: + case 0x38U: + case 0x39U: + case 0x3aU: + case 0x3bU: duk__cbor_decode_push_aival_int(dec_ctx, ib, 1 /*negative*/); break; - case 0x3cU: case 0x3dU: case 0x3eU: case 0x3fU: + case 0x3cU: + case 0x3dU: + case 0x3eU: + case 0x3fU: goto format_error; - case 0x40U: case 0x41U: case 0x42U: case 0x43U: case 0x44U: case 0x45U: case 0x46U: case 0x47U: - case 0x48U: case 0x49U: case 0x4aU: case 0x4bU: case 0x4cU: case 0x4dU: case 0x4eU: case 0x4fU: - case 0x50U: case 0x51U: case 0x52U: case 0x53U: case 0x54U: case 0x55U: case 0x56U: case 0x57U: + case 0x40U: + case 0x41U: + case 0x42U: + case 0x43U: + case 0x44U: + case 0x45U: + case 0x46U: + case 0x47U: + case 0x48U: + case 0x49U: + case 0x4aU: + case 0x4bU: + case 0x4cU: + case 0x4dU: + case 0x4eU: + case 0x4fU: + case 0x50U: + case 0x51U: + case 0x52U: + case 0x53U: + case 0x54U: + case 0x55U: + case 0x56U: + case 0x57U: /* XXX: Avoid rewind, we know the length already. */ DUK_ASSERT(dec_ctx->off > 0U); dec_ctx->off--; duk__cbor_decode_buffer(dec_ctx, 0x40U); break; - case 0x58U: case 0x59U: case 0x5aU: case 0x5bU: + case 0x58U: + case 0x59U: + case 0x5aU: + case 0x5bU: /* XXX: Avoid rewind, decode length inline. */ DUK_ASSERT(dec_ctx->off > 0U); dec_ctx->off--; duk__cbor_decode_buffer(dec_ctx, 0x40U); break; - case 0x5cU: case 0x5dU: case 0x5eU: + case 0x5cU: + case 0x5dU: + case 0x5eU: goto format_error; case 0x5fU: duk__cbor_decode_and_join_strbuf(dec_ctx, 0x40U); break; - case 0x60U: case 0x61U: case 0x62U: case 0x63U: case 0x64U: case 0x65U: case 0x66U: case 0x67U: - case 0x68U: case 0x69U: case 0x6aU: case 0x6bU: case 0x6cU: case 0x6dU: case 0x6eU: case 0x6fU: - case 0x70U: case 0x71U: case 0x72U: case 0x73U: case 0x74U: case 0x75U: case 0x76U: case 0x77U: + case 0x60U: + case 0x61U: + case 0x62U: + case 0x63U: + case 0x64U: + case 0x65U: + case 0x66U: + case 0x67U: + case 0x68U: + case 0x69U: + case 0x6aU: + case 0x6bU: + case 0x6cU: + case 0x6dU: + case 0x6eU: + case 0x6fU: + case 0x70U: + case 0x71U: + case 0x72U: + case 0x73U: + case 0x74U: + case 0x75U: + case 0x76U: + case 0x77U: /* XXX: Avoid double decode of length. */ duk__cbor_decode_string(dec_ctx, ib, DUK__CBOR_AI); break; - case 0x78U: case 0x79U: case 0x7aU: case 0x7bU: + case 0x78U: + case 0x79U: + case 0x7aU: + case 0x7bU: /* XXX: Avoid double decode of length. */ duk__cbor_decode_string(dec_ctx, ib, DUK__CBOR_AI); break; - case 0x7cU: case 0x7dU: case 0x7eU: + case 0x7cU: + case 0x7dU: + case 0x7eU: goto format_error; case 0x7fU: duk__cbor_decode_string(dec_ctx, ib, DUK__CBOR_AI); break; - case 0x80U: case 0x81U: case 0x82U: case 0x83U: case 0x84U: case 0x85U: case 0x86U: case 0x87U: - case 0x88U: case 0x89U: case 0x8aU: case 0x8bU: case 0x8cU: case 0x8dU: case 0x8eU: case 0x8fU: - case 0x90U: case 0x91U: case 0x92U: case 0x93U: case 0x94U: case 0x95U: case 0x96U: case 0x97U: + case 0x80U: + case 0x81U: + case 0x82U: + case 0x83U: + case 0x84U: + case 0x85U: + case 0x86U: + case 0x87U: + case 0x88U: + case 0x89U: + case 0x8aU: + case 0x8bU: + case 0x8cU: + case 0x8dU: + case 0x8eU: + case 0x8fU: + case 0x90U: + case 0x91U: + case 0x92U: + case 0x93U: + case 0x94U: + case 0x95U: + case 0x96U: + case 0x97U: if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, DUK__CBOR_AI) == 0)) { goto format_error; } break; - case 0x98U: case 0x99U: case 0x9aU: case 0x9bU: + case 0x98U: + case 0x99U: + case 0x9aU: + case 0x9bU: if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, DUK__CBOR_AI) == 0)) { goto format_error; } break; - case 0x9cU: case 0x9dU: case 0x9eU: + case 0x9cU: + case 0x9dU: + case 0x9eU: goto format_error; case 0x9fU: if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, DUK__CBOR_AI) == 0)) { goto format_error; } break; - case 0xa0U: case 0xa1U: case 0xa2U: case 0xa3U: case 0xa4U: case 0xa5U: case 0xa6U: case 0xa7U: - case 0xa8U: case 0xa9U: case 0xaaU: case 0xabU: case 0xacU: case 0xadU: case 0xaeU: case 0xafU: - case 0xb0U: case 0xb1U: case 0xb2U: case 0xb3U: case 0xb4U: case 0xb5U: case 0xb6U: case 0xb7U: + case 0xa0U: + case 0xa1U: + case 0xa2U: + case 0xa3U: + case 0xa4U: + case 0xa5U: + case 0xa6U: + case 0xa7U: + case 0xa8U: + case 0xa9U: + case 0xaaU: + case 0xabU: + case 0xacU: + case 0xadU: + case 0xaeU: + case 0xafU: + case 0xb0U: + case 0xb1U: + case 0xb2U: + case 0xb3U: + case 0xb4U: + case 0xb5U: + case 0xb6U: + case 0xb7U: if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, DUK__CBOR_AI) == 0)) { goto format_error; } break; - case 0xb8U: case 0xb9U: case 0xbaU: case 0xbbU: + case 0xb8U: + case 0xb9U: + case 0xbaU: + case 0xbbU: if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, DUK__CBOR_AI) == 0)) { goto format_error; } break; - case 0xbcU: case 0xbdU: case 0xbeU: + case 0xbcU: + case 0xbdU: + case 0xbeU: goto format_error; case 0xbfU: if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, DUK__CBOR_AI) == 0)) { goto format_error; } break; - case 0xc0U: case 0xc1U: case 0xc2U: case 0xc3U: case 0xc4U: case 0xc5U: case 0xc6U: case 0xc7U: - case 0xc8U: case 0xc9U: case 0xcaU: case 0xcbU: case 0xccU: case 0xcdU: case 0xceU: case 0xcfU: - case 0xd0U: case 0xd1U: case 0xd2U: case 0xd3U: case 0xd4U: case 0xd5U: case 0xd6U: case 0xd7U: + case 0xc0U: + case 0xc1U: + case 0xc2U: + case 0xc3U: + case 0xc4U: + case 0xc5U: + case 0xc6U: + case 0xc7U: + case 0xc8U: + case 0xc9U: + case 0xcaU: + case 0xcbU: + case 0xccU: + case 0xcdU: + case 0xceU: + case 0xcfU: + case 0xd0U: + case 0xd1U: + case 0xd2U: + case 0xd3U: + case 0xd4U: + case 0xd5U: + case 0xd6U: + case 0xd7U: /* Tag 0-23: drop. */ goto reread_initial_byte; - case 0xd8U: case 0xd9U: case 0xdaU: case 0xdbU: + case 0xd8U: + case 0xd9U: + case 0xdaU: + case 0xdbU: duk__cbor_decode_skip_aival_int(dec_ctx, ib); goto reread_initial_byte; - case 0xdcU: case 0xddU: case 0xdeU: case 0xdfU: + case 0xdcU: + case 0xddU: + case 0xdeU: + case 0xdfU: goto format_error; case 0xe0U: goto format_error; @@ -31475,14 +32403,14 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { case 0xfeU: case 0xffU: goto format_error; - } /* end switch */ + } /* end switch */ return; - format_error: +format_error: duk__cbor_decode_error(dec_ctx); } -#else /* DUK_CBOR_DECODE_FASTPATH */ +#else /* DUK_CBOR_DECODE_FASTPATH */ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { duk_uint8_t ib, mt, ai; @@ -31491,7 +32419,7 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { * here for simple paths like primitive values. */ - reread_initial_byte: +reread_initial_byte: DUK_DDD(DUK_DDDPRINT("cbor decode off=%ld len=%ld", (long) dec_ctx->off, (long) dec_ctx->len)); ib = duk__cbor_decode_readbyte(dec_ctx); @@ -31507,15 +32435,15 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { */ switch (mt) { - case 0U: { /* unsigned integer */ + case 0U: { /* unsigned integer */ duk__cbor_decode_push_aival_int(dec_ctx, ib, 0 /*negative*/); break; } - case 1U: { /* negative integer */ + case 1U: { /* negative integer */ duk__cbor_decode_push_aival_int(dec_ctx, ib, 1 /*negative*/); break; } - case 2U: { /* byte string */ + case 2U: { /* byte string */ if (ai == 0x1fU) { duk__cbor_decode_and_join_strbuf(dec_ctx, 0x40U); } else { @@ -31524,23 +32452,23 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { } break; } - case 3U: { /* text string */ + case 3U: { /* text string */ duk__cbor_decode_string(dec_ctx, ib, ai); break; } - case 4U: { /* array of data items */ + case 4U: { /* array of data items */ if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, ai) == 0)) { goto format_error; } break; } - case 5U: { /* map of pairs of data items */ + case 5U: { /* map of pairs of data items */ if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, ai) == 0)) { goto format_error; } break; } - case 6U: { /* semantic tagging */ + case 6U: { /* semantic tagging */ /* Tags are ignored now, re-read initial byte. A tagged * value may itself be tagged (an unlimited number of times) * so keep on peeling away tags. @@ -31548,7 +32476,7 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { duk__cbor_decode_skip_aival_int(dec_ctx, ib); goto reread_initial_byte; } - case 7U: { /* floating point numbers, simple data types, break; other */ + case 7U: { /* floating point numbers, simple data types, break; other */ switch (ai) { case 0x14U: { duk_push_false(dec_ctx->thr); @@ -31566,7 +32494,7 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { duk_push_undefined(dec_ctx->thr); break; } - case 0x18U: { /* more simple values (1 byte) */ + case 0x18U: { /* more simple values (1 byte) */ /* Simple value encoded in additional byte (none * are defined so far). RFC 7049 states that the * follow-up byte must be 32-255 to minimize @@ -31577,42 +32505,42 @@ DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) { */ goto format_error; } - case 0x19U: { /* half-float (2 bytes) */ + case 0x19U: { /* half-float (2 bytes) */ duk_double_t d; d = duk__cbor_decode_half_float(dec_ctx); duk_push_number(dec_ctx->thr, d); break; } - case 0x1aU: { /* float (4 bytes) */ + case 0x1aU: { /* float (4 bytes) */ duk_double_t d; d = duk__cbor_decode_float(dec_ctx); duk_push_number(dec_ctx->thr, d); break; } - case 0x1bU: { /* double (8 bytes) */ + case 0x1bU: { /* double (8 bytes) */ duk_double_t d; d = duk__cbor_decode_double(dec_ctx); duk_push_number(dec_ctx->thr, d); break; } - case 0xffU: /* unexpected break */ + case 0xffU: /* unexpected break */ default: { goto format_error; } - } /* end switch */ + } /* end switch */ break; } default: { - goto format_error; /* will never actually occur */ + goto format_error; /* will never actually occur */ } - } /* end switch */ + } /* end switch */ return; - format_error: +format_error: duk__cbor_decode_error(dec_ctx); } -#endif /* DUK_CBOR_DECODE_FASTPATH */ +#endif /* DUK_CBOR_DECODE_FASTPATH */ DUK_LOCAL void duk__cbor_encode(duk_hthread *thr, duk_idx_t idx, duk_uint_t encode_flags) { duk_cbor_encode_context enc_ctx; @@ -31672,7 +32600,7 @@ DUK_LOCAL void duk__cbor_decode(duk_hthread *thr, duk_idx_t idx, duk_uint_t deco duk_replace(thr, idx); } -#else /* DUK_USE_CBOR_SUPPORT */ +#else /* DUK_USE_CBOR_SUPPORT */ DUK_LOCAL void duk__cbor_encode(duk_hthread *thr, duk_idx_t idx, duk_uint_t encode_flags) { DUK_UNREF(idx); @@ -31686,7 +32614,7 @@ DUK_LOCAL void duk__cbor_decode(duk_hthread *thr, duk_idx_t idx, duk_uint_t deco DUK_ERROR_UNSUPPORTED(thr); } -#endif /* DUK_USE_CBOR_SUPPORT */ +#endif /* DUK_USE_CBOR_SUPPORT */ /* * Public APIs @@ -31722,7 +32650,7 @@ DUK_INTERNAL duk_ret_t duk_bi_cbor_decode(duk_hthread *thr) { duk__cbor_decode(thr, -1, 0 /*flags*/); return 1; } -#else /* DUK_USE_CBOR_SUPPORT */ +#else /* DUK_USE_CBOR_SUPPORT */ DUK_INTERNAL duk_ret_t duk_bi_cbor_encode(duk_hthread *thr) { DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return 0;); @@ -31731,8 +32659,8 @@ DUK_INTERNAL duk_ret_t duk_bi_cbor_decode(duk_hthread *thr) { DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return 0;); } -#endif /* DUK_USE_CBOR_SUPPORT */ -#endif /* DUK_USE_CBOR_BUILTIN */ +#endif /* DUK_USE_CBOR_SUPPORT */ +#endif /* DUK_USE_CBOR_BUILTIN */ /* automatic undefs */ #undef DUK__CBOR_AI @@ -31767,30 +32695,49 @@ DUK_LOCAL_DECL duk_ret_t duk__set_this_timeval_from_dparts(duk_hthread *thr, duk */ /* Debug macro to print all parts and dparts (used manually because of debug level). */ -#define DUK__DPRINT_PARTS_AND_DPARTS(parts,dparts) do { \ +#define DUK__DPRINT_PARTS_AND_DPARTS(parts, dparts) \ + do { \ DUK_D(DUK_DPRINT("parts: %ld %ld %ld %ld %ld %ld %ld %ld, dparts: %lf %lf %lf %lf %lf %lf %lf %lf", \ - (long) (parts)[0], (long) (parts)[1], \ - (long) (parts)[2], (long) (parts)[3], \ - (long) (parts)[4], (long) (parts)[5], \ - (long) (parts)[6], (long) (parts)[7], \ - (double) (dparts)[0], (double) (dparts)[1], \ - (double) (dparts)[2], (double) (dparts)[3], \ - (double) (dparts)[4], (double) (dparts)[5], \ - (double) (dparts)[6], (double) (dparts)[7])); \ + (long) (parts)[0], \ + (long) (parts)[1], \ + (long) (parts)[2], \ + (long) (parts)[3], \ + (long) (parts)[4], \ + (long) (parts)[5], \ + (long) (parts)[6], \ + (long) (parts)[7], \ + (double) (dparts)[0], \ + (double) (dparts)[1], \ + (double) (dparts)[2], \ + (double) (dparts)[3], \ + (double) (dparts)[4], \ + (double) (dparts)[5], \ + (double) (dparts)[6], \ + (double) (dparts)[7])); \ } while (0) -#define DUK__DPRINT_PARTS(parts) do { \ +#define DUK__DPRINT_PARTS(parts) \ + do { \ DUK_D(DUK_DPRINT("parts: %ld %ld %ld %ld %ld %ld %ld %ld", \ - (long) (parts)[0], (long) (parts)[1], \ - (long) (parts)[2], (long) (parts)[3], \ - (long) (parts)[4], (long) (parts)[5], \ - (long) (parts)[6], (long) (parts)[7])); \ + (long) (parts)[0], \ + (long) (parts)[1], \ + (long) (parts)[2], \ + (long) (parts)[3], \ + (long) (parts)[4], \ + (long) (parts)[5], \ + (long) (parts)[6], \ + (long) (parts)[7])); \ } while (0) -#define DUK__DPRINT_DPARTS(dparts) do { \ +#define DUK__DPRINT_DPARTS(dparts) \ + do { \ DUK_D(DUK_DPRINT("dparts: %lf %lf %lf %lf %lf %lf %lf %lf", \ - (double) (dparts)[0], (double) (dparts)[1], \ - (double) (dparts)[2], (double) (dparts)[3], \ - (double) (dparts)[4], (double) (dparts)[5], \ - (double) (dparts)[6], (double) (dparts)[7])); \ + (double) (dparts)[0], \ + (double) (dparts)[1], \ + (double) (dparts)[2], \ + (double) (dparts)[3], \ + (double) (dparts)[4], \ + (double) (dparts)[5], \ + (double) (dparts)[6], \ + (double) (dparts)[7])); \ } while (0) /* Equivalent year for DST calculations outside [1970,2038[ range, see @@ -31798,7 +32745,7 @@ DUK_LOCAL_DECL duk_ret_t duk__set_this_timeval_from_dparts(duk_hthread *thr, duk * starts with the same weekday on Jan 1. * https://bugzilla.mozilla.org/show_bug.cgi?id=351066 */ -#define DUK__YEAR(x) ((duk_uint8_t) ((x) - 1970)) +#define DUK__YEAR(x) ((duk_uint8_t) ((x) -1970)) DUK_LOCAL duk_uint8_t duk__date_equivyear[14] = { #if 1 /* This is based on V8 EquivalentYear() algorithm (see util/genequivyear.py): @@ -31806,12 +32753,22 @@ DUK_LOCAL duk_uint8_t duk__date_equivyear[14] = { */ /* non-leap year: sunday, monday, ... */ - DUK__YEAR(2023), DUK__YEAR(2035), DUK__YEAR(2019), DUK__YEAR(2031), - DUK__YEAR(2015), DUK__YEAR(2027), DUK__YEAR(2011), + DUK__YEAR(2023), + DUK__YEAR(2035), + DUK__YEAR(2019), + DUK__YEAR(2031), + DUK__YEAR(2015), + DUK__YEAR(2027), + DUK__YEAR(2011), /* leap year: sunday, monday, ... */ - DUK__YEAR(2012), DUK__YEAR(2024), DUK__YEAR(2008), DUK__YEAR(2020), - DUK__YEAR(2032), DUK__YEAR(2016), DUK__YEAR(2028) + DUK__YEAR(2012), + DUK__YEAR(2024), + DUK__YEAR(2008), + DUK__YEAR(2020), + DUK__YEAR(2032), + DUK__YEAR(2016), + DUK__YEAR(2028) #endif #if 0 @@ -31834,71 +32791,70 @@ DUK_LOCAL duk_uint8_t duk__date_equivyear[14] = { */ /* Parser part count. */ -#define DUK__NUM_ISO8601_PARSER_PARTS 9 +#define DUK__NUM_ISO8601_PARSER_PARTS 9 /* Parser part indices. */ -#define DUK__PI_YEAR 0 -#define DUK__PI_MONTH 1 -#define DUK__PI_DAY 2 -#define DUK__PI_HOUR 3 -#define DUK__PI_MINUTE 4 -#define DUK__PI_SECOND 5 -#define DUK__PI_MILLISECOND 6 -#define DUK__PI_TZHOUR 7 -#define DUK__PI_TZMINUTE 8 +#define DUK__PI_YEAR 0 +#define DUK__PI_MONTH 1 +#define DUK__PI_DAY 2 +#define DUK__PI_HOUR 3 +#define DUK__PI_MINUTE 4 +#define DUK__PI_SECOND 5 +#define DUK__PI_MILLISECOND 6 +#define DUK__PI_TZHOUR 7 +#define DUK__PI_TZMINUTE 8 /* Parser part masks. */ -#define DUK__PM_YEAR (1 << DUK__PI_YEAR) -#define DUK__PM_MONTH (1 << DUK__PI_MONTH) -#define DUK__PM_DAY (1 << DUK__PI_DAY) -#define DUK__PM_HOUR (1 << DUK__PI_HOUR) -#define DUK__PM_MINUTE (1 << DUK__PI_MINUTE) -#define DUK__PM_SECOND (1 << DUK__PI_SECOND) -#define DUK__PM_MILLISECOND (1 << DUK__PI_MILLISECOND) -#define DUK__PM_TZHOUR (1 << DUK__PI_TZHOUR) -#define DUK__PM_TZMINUTE (1 << DUK__PI_TZMINUTE) +#define DUK__PM_YEAR (1 << DUK__PI_YEAR) +#define DUK__PM_MONTH (1 << DUK__PI_MONTH) +#define DUK__PM_DAY (1 << DUK__PI_DAY) +#define DUK__PM_HOUR (1 << DUK__PI_HOUR) +#define DUK__PM_MINUTE (1 << DUK__PI_MINUTE) +#define DUK__PM_SECOND (1 << DUK__PI_SECOND) +#define DUK__PM_MILLISECOND (1 << DUK__PI_MILLISECOND) +#define DUK__PM_TZHOUR (1 << DUK__PI_TZHOUR) +#define DUK__PM_TZMINUTE (1 << DUK__PI_TZMINUTE) /* Parser separator indices. */ -#define DUK__SI_PLUS 0 -#define DUK__SI_MINUS 1 -#define DUK__SI_T 2 -#define DUK__SI_SPACE 3 -#define DUK__SI_COLON 4 -#define DUK__SI_PERIOD 5 -#define DUK__SI_Z 6 -#define DUK__SI_NUL 7 +#define DUK__SI_PLUS 0 +#define DUK__SI_MINUS 1 +#define DUK__SI_T 2 +#define DUK__SI_SPACE 3 +#define DUK__SI_COLON 4 +#define DUK__SI_PERIOD 5 +#define DUK__SI_Z 6 +#define DUK__SI_NUL 7 /* Parser separator masks. */ -#define DUK__SM_PLUS (1 << DUK__SI_PLUS) -#define DUK__SM_MINUS (1 << DUK__SI_MINUS) -#define DUK__SM_T (1 << DUK__SI_T) -#define DUK__SM_SPACE (1 << DUK__SI_SPACE) -#define DUK__SM_COLON (1 << DUK__SI_COLON) -#define DUK__SM_PERIOD (1 << DUK__SI_PERIOD) -#define DUK__SM_Z (1 << DUK__SI_Z) -#define DUK__SM_NUL (1 << DUK__SI_NUL) +#define DUK__SM_PLUS (1 << DUK__SI_PLUS) +#define DUK__SM_MINUS (1 << DUK__SI_MINUS) +#define DUK__SM_T (1 << DUK__SI_T) +#define DUK__SM_SPACE (1 << DUK__SI_SPACE) +#define DUK__SM_COLON (1 << DUK__SI_COLON) +#define DUK__SM_PERIOD (1 << DUK__SI_PERIOD) +#define DUK__SM_Z (1 << DUK__SI_Z) +#define DUK__SM_NUL (1 << DUK__SI_NUL) /* Rule control flags. */ -#define DUK__CF_NEG (1 << 0) /* continue matching, set neg_tzoffset flag */ -#define DUK__CF_ACCEPT (1 << 1) /* accept string */ -#define DUK__CF_ACCEPT_NUL (1 << 2) /* accept string if next char is NUL (otherwise reject) */ +#define DUK__CF_NEG (1 << 0) /* continue matching, set neg_tzoffset flag */ +#define DUK__CF_ACCEPT (1 << 1) /* accept string */ +#define DUK__CF_ACCEPT_NUL (1 << 2) /* accept string if next char is NUL (otherwise reject) */ -#define DUK__PACK_RULE(partmask,sepmask,nextpart,flags) \ - ((duk_uint32_t) (partmask) + \ - (((duk_uint32_t) (sepmask)) << 9) + \ - (((duk_uint32_t) (nextpart)) << 17) + \ +#define DUK__PACK_RULE(partmask, sepmask, nextpart, flags) \ + ((duk_uint32_t) (partmask) + (((duk_uint32_t) (sepmask)) << 9) + (((duk_uint32_t) (nextpart)) << 17) + \ (((duk_uint32_t) (flags)) << 21)) -#define DUK__UNPACK_RULE(rule,var_nextidx,var_flags) do { \ +#define DUK__UNPACK_RULE(rule, var_nextidx, var_flags) \ + do { \ (var_nextidx) = (duk_small_uint_t) (((rule) >> 17) & 0x0f); \ (var_flags) = (duk_small_uint_t) ((rule) >> 21); \ } while (0) -#define DUK__RULE_MASK_PART_SEP 0x1ffffUL +#define DUK__RULE_MASK_PART_SEP 0x1ffffUL /* Matching separator index is used in the control table */ DUK_LOCAL const duk_uint8_t duk__parse_iso8601_seps[] = { - DUK_ASC_PLUS /*0*/, DUK_ASC_MINUS /*1*/, DUK_ASC_UC_T /*2*/, DUK_ASC_SPACE /*3*/, + DUK_ASC_PLUS /*0*/, DUK_ASC_MINUS /*1*/, DUK_ASC_UC_T /*2*/, DUK_ASC_SPACE /*3*/, DUK_ASC_COLON /*4*/, DUK_ASC_PERIOD /*5*/, DUK_ASC_UC_Z /*6*/, DUK_ASC_NUL /*7*/ }; @@ -31911,10 +32867,26 @@ DUK_LOCAL const duk_uint32_t duk__parse_iso8601_control[] = { DUK__PACK_RULE(DUK__PM_MINUTE, DUK__SM_COLON, DUK__PI_SECOND, 0), DUK__PACK_RULE(DUK__PM_SECOND, DUK__SM_PERIOD, DUK__PI_MILLISECOND, 0), DUK__PACK_RULE(DUK__PM_TZHOUR, DUK__SM_COLON, DUK__PI_TZMINUTE, 0), - DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | DUK__PM_MILLISECOND, DUK__SM_PLUS, DUK__PI_TZHOUR, 0), - DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | DUK__PM_MILLISECOND, DUK__SM_MINUS, DUK__PI_TZHOUR, DUK__CF_NEG), - DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | DUK__PM_MILLISECOND, DUK__SM_Z, 0, DUK__CF_ACCEPT_NUL), - DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | DUK__PM_MILLISECOND | DUK__PM_TZHOUR /*Note2*/ | DUK__PM_TZMINUTE, DUK__SM_NUL, 0, DUK__CF_ACCEPT) + DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | + DUK__PM_MILLISECOND, + DUK__SM_PLUS, + DUK__PI_TZHOUR, + 0), + DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | + DUK__PM_MILLISECOND, + DUK__SM_MINUS, + DUK__PI_TZHOUR, + DUK__CF_NEG), + DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | + DUK__PM_MILLISECOND, + DUK__SM_Z, + 0, + DUK__CF_ACCEPT_NUL), + DUK__PACK_RULE(DUK__PM_YEAR | DUK__PM_MONTH | DUK__PM_DAY | DUK__PM_HOUR /*Note1*/ | DUK__PM_MINUTE | DUK__PM_SECOND | + DUK__PM_MILLISECOND | DUK__PM_TZHOUR /*Note2*/ | DUK__PM_TZMINUTE, + DUK__SM_NUL, + 0, + DUK__CF_ACCEPT) /* Note1: the specification doesn't require matching a time form with * just hours ("HH"), but we accept it here, e.g. "2012-01-02T12Z". @@ -31939,7 +32911,7 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch /* During parsing, month and day are one-based; set defaults here. */ duk_memzero(parts, sizeof(parts)); - DUK_ASSERT(parts[DUK_DATE_IDX_YEAR] == 0); /* don't care value, year is mandatory */ + DUK_ASSERT(parts[DUK_DATE_IDX_YEAR] == 0); /* don't care value, year is mandatory */ parts[DUK_DATE_IDX_MONTH] = 1; parts[DUK_DATE_IDX_DAY] = 1; @@ -31956,7 +32928,8 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch for (;;) { ch = *p++; DUK_DDD(DUK_DDDPRINT("parsing, part_idx=%ld, char=%ld ('%c')", - (long) part_idx, (long) ch, + (long) part_idx, + (long) ch, (int) ((ch >= 0x20 && ch <= 0x7e) ? ch : DUK_ASC_QUESTION))); if (ch >= DUK_ASC_0 && ch <= DUK_ASC_9) { @@ -32001,7 +32974,7 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch } sep_idx = i; - match_val = (1UL << part_idx) + (1UL << (sep_idx + 9)); /* match against rule part/sep bits */ + match_val = (1UL << part_idx) + (1UL << (sep_idx + 9)); /* match against rule part/sep bits */ for (i = 0; i < (duk_small_uint_t) (sizeof(duk__parse_iso8601_control) / sizeof(duk_uint32_t)); i++) { duk_uint_fast32_t rule = duk__parse_iso8601_control[i]; @@ -32009,8 +32982,10 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch duk_small_uint_t cflags; DUK_DDD(DUK_DDDPRINT("part_idx=%ld, sep_idx=%ld, match_val=0x%08lx, considering rule=0x%08lx", - (long) part_idx, (long) sep_idx, - (unsigned long) match_val, (unsigned long) rule)); + (long) part_idx, + (long) sep_idx, + (unsigned long) match_val, + (unsigned long) rule)); if ((rule & match_val) != match_val) { continue; @@ -32020,9 +32995,12 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch DUK_DDD(DUK_DDDPRINT("rule match -> part_idx=%ld, sep_idx=%ld, match_val=0x%08lx, " "rule=0x%08lx -> nextpart=%ld, cflags=0x%02lx", - (long) part_idx, (long) sep_idx, - (unsigned long) match_val, (unsigned long) rule, - (long) nextpart, (unsigned long) cflags)); + (long) part_idx, + (long) sep_idx, + (unsigned long) match_val, + (unsigned long) rule, + (long) nextpart, + (unsigned long) cflags)); if (cflags & DUK__CF_NEG) { neg_tzoffset = 1; @@ -32042,7 +33020,7 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch part_idx = nextpart; break; - } /* rule match */ + } /* rule match */ if (i == (duk_small_uint_t) (sizeof(duk__parse_iso8601_control) / sizeof(duk_uint32_t))) { DUK_DDD(DUK_DDDPRINT("no rule matches -> reject")); @@ -32056,17 +33034,17 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch DUK_DDD(DUK_DDDPRINT("NUL after rule matching (should not happen) -> reject")); goto reject; } - } /* if-digit-else-ctrl */ - } /* char loop */ + } /* if-digit-else-ctrl */ + } /* char loop */ /* We should never exit the loop above. */ DUK_UNREACHABLE(); - reject: +reject: DUK_DDD(DUK_DDDPRINT("reject")); return 0; - accept: +accept: DUK_DDD(DUK_DDDPRINT("accept")); /* Apply timezone offset to get the main parts in UTC */ @@ -32080,8 +33058,8 @@ DUK_LOCAL duk_bool_t duk__parse_string_iso8601_subset(duk_hthread *thr, const ch parts[DUK__PI_HOUR] -= parts[DUK__PI_TZHOUR]; parts[DUK__PI_MINUTE] -= parts[DUK__PI_TZMINUTE]; } - parts[DUK__PI_MONTH] -= 1; /* zero-based month */ - parts[DUK__PI_DAY] -= 1; /* zero-based day */ + parts[DUK__PI_MONTH] -= 1; /* zero-based month */ + parts[DUK__PI_DAY] -= 1; /* zero-based day */ /* Use double parts, they tolerate unnormalized time. * @@ -32158,16 +33136,14 @@ DUK_LOCAL duk_ret_t duk__parse_string(duk_hthread *thr, const char *str) { * out for non-finite numbers etc. */ -DUK_LOCAL duk_uint8_t duk__days_in_month[12] = { - (duk_uint8_t) 31, (duk_uint8_t) 28, (duk_uint8_t) 31, (duk_uint8_t) 30, - (duk_uint8_t) 31, (duk_uint8_t) 30, (duk_uint8_t) 31, (duk_uint8_t) 31, - (duk_uint8_t) 30, (duk_uint8_t) 31, (duk_uint8_t) 30, (duk_uint8_t) 31 -}; +DUK_LOCAL duk_uint8_t duk__days_in_month[12] = { (duk_uint8_t) 31, (duk_uint8_t) 28, (duk_uint8_t) 31, (duk_uint8_t) 30, + (duk_uint8_t) 31, (duk_uint8_t) 30, (duk_uint8_t) 31, (duk_uint8_t) 31, + (duk_uint8_t) 30, (duk_uint8_t) 31, (duk_uint8_t) 30, (duk_uint8_t) 31 }; /* Maximum iteration count for computing UTC-to-local time offset when * creating an ECMAScript time value from local parts. */ -#define DUK__LOCAL_TZOFFSET_MAXITER 4 +#define DUK__LOCAL_TZOFFSET_MAXITER 4 /* Because 'day since epoch' can be negative and is used to compute weekday * using a modulo operation, add this multiple of 7 to avoid negative values @@ -32175,7 +33151,7 @@ DUK_LOCAL duk_uint8_t duk__days_in_month[12] = { * +/- 100 million days from epoch, so this adder fits nicely into 32 bits. * Round to a multiple of 7 (= floor(100000000 / 7) * 7) and add margin. */ -#define DUK__WEEKDAY_MOD_ADDER (20000000 * 7) /* 0x08583b00 */ +#define DUK__WEEKDAY_MOD_ADDER (20000000 * 7) /* 0x08583b00 */ DUK_INTERNAL duk_bool_t duk_bi_date_is_leap_year(duk_int_t year) { if ((year % 4) != 0) { @@ -32236,10 +33212,8 @@ DUK_LOCAL duk_int_t duk__day_from_year(duk_int_t year) { /* Note: in integer arithmetic, (x / 4) is same as floor(x / 4) for non-negative * values, but is incorrect for negative ones. */ - return 365 * (year - 1970) - + duk__div_floor(year - 1969, 4) - - duk__div_floor(year - 1901, 100) - + duk__div_floor(year - 1601, 400); + return 365 * (year - 1970) + duk__div_floor(year - 1969, 4) - duk__div_floor(year - 1901, 100) + + duk__div_floor(year - 1601, 400); } /* Given a day number, determine year and day-within-year. */ @@ -32261,10 +33235,9 @@ DUK_LOCAL duk_int_t duk__year_from_day(duk_int_t day, duk_small_int_t *out_day_w diff_days = duk__day_from_year(year) - day; DUK_DDD(DUK_DDDPRINT("year=%ld day=%ld, diff_days=%ld", (long) year, (long) day, (long) diff_days)); if (diff_days <= 0) { - DUK_ASSERT(-diff_days < 366); /* fits into duk_small_int_t */ + DUK_ASSERT(-diff_days < 366); /* fits into duk_small_int_t */ *out_day_within_year = -diff_days; - DUK_DDD(DUK_DDDPRINT("--> year=%ld, day-within-year=%ld", - (long) year, (long) *out_day_within_year)); + DUK_DDD(DUK_DDDPRINT("--> year=%ld, day-within-year=%ld", (long) year, (long) *out_day_within_year)); DUK_ASSERT(*out_day_within_year >= 0); DUK_ASSERT(*out_day_within_year < (duk_bi_date_is_leap_year(year) ? 366 : 365)); return year; @@ -32273,7 +33246,7 @@ DUK_LOCAL duk_int_t duk__year_from_day(duk_int_t day, duk_small_int_t *out_day_w /* Note: this is very tricky; we must never 'overshoot' the * correction downwards. */ - year -= 1 + (diff_days - 1) / 366; /* conservative */ + year -= 1 + (diff_days - 1) / 366; /* conservative */ } } @@ -32346,7 +33319,7 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, duk_double_t d1, d2; duk_int_t t1, t2; duk_int_t day_since_epoch; - duk_int_t year; /* does not fit into 16 bits */ + duk_int_t year; /* does not fit into 16 bits */ duk_small_int_t day_in_year; duk_small_int_t month; duk_small_int_t day; @@ -32358,8 +33331,8 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, duk_bool_t is_leap; duk_small_int_t arridx; - DUK_ASSERT(DUK_ISFINITE(d)); /* caller checks */ - d = DUK_FLOOR(d); /* remove fractions if present */ + DUK_ASSERT(DUK_ISFINITE(d)); /* caller checks */ + d = DUK_FLOOR(d); /* remove fractions if present */ DUK_ASSERT(duk_double_equals(DUK_FLOOR(d), d)); /* The timevalue must be in valid ECMAScript range, but since a local @@ -32391,9 +33364,12 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, * t2 = day number from epoch (fits 32 bit, may be negative) */ - parts[DUK_DATE_IDX_MILLISECOND] = t1 % 1000; t1 /= 1000; - parts[DUK_DATE_IDX_SECOND] = t1 % 60; t1 /= 60; - parts[DUK_DATE_IDX_MINUTE] = t1 % 60; t1 /= 60; + parts[DUK_DATE_IDX_MILLISECOND] = t1 % 1000; + t1 /= 1000; + parts[DUK_DATE_IDX_SECOND] = t1 % 60; + t1 /= 60; + parts[DUK_DATE_IDX_MINUTE] = t1 % 60; + t1 /= 60; parts[DUK_DATE_IDX_HOUR] = t1; DUK_ASSERT(parts[DUK_DATE_IDX_MILLISECOND] >= 0 && parts[DUK_DATE_IDX_MILLISECOND] <= 999); DUK_ASSERT(parts[DUK_DATE_IDX_SECOND] >= 0 && parts[DUK_DATE_IDX_SECOND] <= 59); @@ -32401,7 +33377,11 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, DUK_ASSERT(parts[DUK_DATE_IDX_HOUR] >= 0 && parts[DUK_DATE_IDX_HOUR] <= 23); DUK_DDD(DUK_DDDPRINT("d=%lf, d1=%lf, d2=%lf, t1=%ld, t2=%ld, parts: hour=%ld min=%ld sec=%ld msec=%ld", - (double) d, (double) d1, (double) d2, (long) t1, (long) t2, + (double) d, + (double) d1, + (double) d2, + (long) t1, + (long) t2, (long) parts[DUK_DATE_IDX_HOUR], (long) parts[DUK_DATE_IDX_MINUTE], (long) parts[DUK_DATE_IDX_SECOND], @@ -32411,7 +33391,7 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, * the ECMAScript range. */ DUK_ASSERT(t2 + DUK__WEEKDAY_MOD_ADDER >= 0); - parts[DUK_DATE_IDX_WEEKDAY] = (t2 + 4 + DUK__WEEKDAY_MOD_ADDER) % 7; /* E5.1 Section 15.9.1.6 */ + parts[DUK_DATE_IDX_WEEKDAY] = (t2 + 4 + DUK__WEEKDAY_MOD_ADDER) % 7; /* E5.1 Section 15.9.1.6 */ DUK_ASSERT(parts[DUK_DATE_IDX_WEEKDAY] >= 0 && parts[DUK_DATE_IDX_WEEKDAY] <= 6); year = duk__year_from_day(t2, &day_in_year); @@ -32422,8 +33402,7 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, if (month == 1 && is_leap) { dim++; } - DUK_DDD(DUK_DDDPRINT("month=%ld, dim=%ld, day=%ld", - (long) month, (long) dim, (long) day)); + DUK_DDD(DUK_DDDPRINT("month=%ld, dim=%ld, day=%ld", (long) month, (long) dim, (long) day)); if (day < dim) { break; } @@ -32448,9 +33427,9 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, if ((flags & DUK_DATE_FLAG_EQUIVYEAR) && (year < 1971 || year > 2037)) { DUK_ASSERT(is_leap == 0 || is_leap == 1); - jan1_since_epoch = day_since_epoch - day_in_year; /* day number for Jan 1 since epoch */ + jan1_since_epoch = day_since_epoch - day_in_year; /* day number for Jan 1 since epoch */ DUK_ASSERT(jan1_since_epoch + DUK__WEEKDAY_MOD_ADDER >= 0); - jan1_weekday = (jan1_since_epoch + 4 + DUK__WEEKDAY_MOD_ADDER) % 7; /* E5.1 Section 15.9.1.6 */ + jan1_weekday = (jan1_since_epoch + 4 + DUK__WEEKDAY_MOD_ADDER) % 7; /* E5.1 Section 15.9.1.6 */ DUK_ASSERT(jan1_weekday >= 0 && jan1_weekday <= 6); arridx = jan1_weekday; if (is_leap) { @@ -32462,8 +33441,12 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, year = equiv_year; DUK_DDD(DUK_DDDPRINT("equiv year mapping, year=%ld, day_in_year=%ld, day_since_epoch=%ld, " "jan1_since_epoch=%ld, jan1_weekday=%ld -> equiv year %ld", - (long) year, (long) day_in_year, (long) day_since_epoch, - (long) jan1_since_epoch, (long) jan1_weekday, (long) equiv_year)); + (long) year, + (long) day_in_year, + (long) day_since_epoch, + (long) jan1_since_epoch, + (long) jan1_weekday, + (long) equiv_year)); } parts[DUK_DATE_IDX_YEAR] = year; @@ -32471,8 +33454,8 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, parts[DUK_DATE_IDX_DAY] = day; if (flags & DUK_DATE_FLAG_ONEBASED) { - parts[DUK_DATE_IDX_MONTH]++; /* zero-based -> one-based */ - parts[DUK_DATE_IDX_DAY]++; /* -""- */ + parts[DUK_DATE_IDX_MONTH]++; /* zero-based -> one-based */ + parts[DUK_DATE_IDX_DAY]++; /* -""- */ } if (dparts != NULL) { @@ -32552,8 +33535,7 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_timeval_from_dparts(duk_double_t *dpar /* MakeDate */ d = tmp_day * ((duk_double_t) DUK_DATE_MSEC_DAY) + tmp_time; - DUK_DDD(DUK_DDDPRINT("time=%lf day=%lf --> timeval=%lf", - (double) tmp_time, (double) tmp_day, (double) d)); + DUK_DDD(DUK_DDDPRINT("time=%lf day=%lf --> timeval=%lf", (double) tmp_time, (double) tmp_day, (double) d)); /* Optional UTC conversion. */ if (flags & DUK_DATE_FLAG_LOCALTIME) { @@ -32583,16 +33565,22 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_timeval_from_dparts(duk_double_t *dpar /* Iteration solution */ tzoff = 0; - tzoffprev1 = 999999999L; /* invalid value which never matches */ + tzoffprev1 = 999999999L; /* invalid value which never matches */ for (i = 0; i < DUK__LOCAL_TZOFFSET_MAXITER; i++) { tzoffprev2 = tzoffprev1; tzoffprev1 = tzoff; tzoff = DUK_USE_DATE_GET_LOCAL_TZOFFSET(d - tzoff * 1000L); DUK_DDD(DUK_DDDPRINT("tzoffset iteration, i=%d, tzoff=%ld, tzoffprev1=%ld tzoffprev2=%ld", - (int) i, (long) tzoff, (long) tzoffprev1, (long) tzoffprev2)); + (int) i, + (long) tzoff, + (long) tzoffprev1, + (long) tzoffprev2)); if (tzoff == tzoffprev1) { DUK_DDD(DUK_DDDPRINT("tzoffset iteration finished, i=%d, tzoff=%ld, tzoffprev1=%ld, tzoffprev2=%ld", - (int) i, (long) tzoff, (long) tzoffprev1, (long) tzoffprev2)); + (int) i, + (long) tzoff, + (long) tzoffprev1, + (long) tzoffprev2)); break; } else if (tzoff == tzoffprev2) { /* Two value cycle, see e.g. test-bi-date-tzoffset-basic-fi.js. @@ -32600,8 +33588,12 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_timeval_from_dparts(duk_double_t *dpar * result which is independent of iteration count. Not sure if * this is a generically correct solution. */ - DUK_DDD(DUK_DDDPRINT("tzoffset iteration two-value cycle, i=%d, tzoff=%ld, tzoffprev1=%ld, tzoffprev2=%ld", - (int) i, (long) tzoff, (long) tzoffprev1, (long) tzoffprev2)); + DUK_DDD(DUK_DDDPRINT( + "tzoffset iteration two-value cycle, i=%d, tzoff=%ld, tzoffprev1=%ld, tzoffprev2=%ld", + (int) i, + (long) tzoff, + (long) tzoffprev1, + (long) tzoffprev2)); if (tzoffprev1 > tzoff) { tzoff = tzoffprev1; } @@ -32632,7 +33624,7 @@ DUK_LOCAL duk_double_t duk__push_this_get_timeval_tzoffset(duk_hthread *thr, duk duk_int_t tzoffset = 0; duk_push_this(thr); - h = duk_get_hobject(thr, -1); /* XXX: getter with class check, useful in built-ins */ + h = duk_get_hobject(thr, -1); /* XXX: getter with class check, useful in built-ins */ if (h == NULL || DUK_HOBJECT_GET_CLASS_NUMBER(h) != DUK_HOBJECT_CLASS_DATE) { DUK_ERROR_TYPE(thr, "expected Date"); DUK_WO_NORETURN(return 0.0;); @@ -32658,7 +33650,7 @@ DUK_LOCAL duk_double_t duk__push_this_get_timeval_tzoffset(duk_hthread *thr, duk /* Note: DST adjustment is determined using UTC time. * If 'd' is NaN, tzoffset will be 0. */ - tzoffset = DUK_USE_DATE_GET_LOCAL_TZOFFSET(d); /* seconds */ + tzoffset = DUK_USE_DATE_GET_LOCAL_TZOFFSET(d); /* seconds */ d += tzoffset * 1000L; } if (out_tzoffset) { @@ -32683,8 +33675,8 @@ DUK_LOCAL duk_ret_t duk__set_this_timeval_from_dparts(duk_hthread *thr, duk_doub /* [ ... this ] */ d = duk_bi_date_get_timeval_from_dparts(dparts, flags); - duk_push_number(thr, d); /* -> [ ... this timeval_new ] */ - duk_dup_top(thr); /* -> [ ... this timeval_new timeval_new ] */ + duk_push_number(thr, d); /* -> [ ... this timeval_new ] */ + duk_dup_top(thr); /* -> [ ... this timeval_new timeval_new ] */ /* Must force write because e.g. .setYear() must work even when * the Date instance is frozen. @@ -32697,8 +33689,8 @@ DUK_LOCAL duk_ret_t duk__set_this_timeval_from_dparts(duk_hthread *thr, duk_doub /* 'out_buf' must be at least DUK_BI_DATE_ISO8601_BUFSIZE long. */ DUK_LOCAL void duk__format_parts_iso8601(duk_int_t *parts, duk_int_t tzoffset, duk_small_uint_t flags, duk_uint8_t *out_buf) { - char yearstr[8]; /* "-123456\0" */ - char tzstr[8]; /* "+11:22\0" */ + char yearstr[8]; /* "-123456\0" */ + char tzstr[8]; /* "+11:22\0" */ char sep = (flags & DUK_DATE_FLAG_SEP_T) ? DUK_ASC_UC_T : DUK_ASC_SPACE; DUK_ASSERT(parts[DUK_DATE_IDX_MONTH] >= 1 && parts[DUK_DATE_IDX_MONTH] <= 12); @@ -32710,8 +33702,9 @@ DUK_LOCAL void duk__format_parts_iso8601(duk_int_t *parts, duk_int_t tzoffset, d */ DUK_SNPRINTF(yearstr, sizeof(yearstr), - (parts[DUK_DATE_IDX_YEAR] >= 0 && parts[DUK_DATE_IDX_YEAR] <= 9999) ? "%04ld" : - ((parts[DUK_DATE_IDX_YEAR] >= 0) ? "+%06ld" : "%07ld"), + (parts[DUK_DATE_IDX_YEAR] >= 0 && parts[DUK_DATE_IDX_YEAR] <= 9999) ? + "%04ld" : + ((parts[DUK_DATE_IDX_YEAR] >= 0) ? "+%06ld" : "%07ld"), (long) parts[DUK_DATE_IDX_YEAR]); yearstr[sizeof(yearstr) - 1] = (char) 0; @@ -32732,8 +33725,9 @@ DUK_LOCAL void duk__format_parts_iso8601(duk_int_t *parts, duk_int_t tzoffset, d tmp = tmp / 60; arg_hours = tmp / 60; arg_minutes = tmp % 60; - DUK_ASSERT(arg_hours <= 24); /* Even less is actually guaranteed for a valid tzoffset. */ - arg_hours = arg_hours & 0x3f; /* For [0,24] this is a no-op, but fixes GCC 7 warning, see https://github.com/svaarala/duktape/issues/1602. */ + DUK_ASSERT(arg_hours <= 24); /* Even less is actually guaranteed for a valid tzoffset. */ + arg_hours = arg_hours & 0x3f; /* For [0,24] this is a no-op, but fixes GCC 7 warning, see + https://github.com/svaarala/duktape/issues/1602. */ DUK_SNPRINTF(tzstr, sizeof(tzstr), fmt, (int) arg_hours, (int) arg_minutes); tzstr[sizeof(tzstr) - 1] = (char) 0; @@ -32746,18 +33740,31 @@ DUK_LOCAL void duk__format_parts_iso8601(duk_int_t *parts, duk_int_t tzoffset, d * is portable. */ if ((flags & DUK_DATE_FLAG_TOSTRING_DATE) && (flags & DUK_DATE_FLAG_TOSTRING_TIME)) { - DUK_SPRINTF((char *) out_buf, "%s-%02d-%02d%c%02d:%02d:%02d.%03d%s", - (const char *) yearstr, (int) parts[DUK_DATE_IDX_MONTH], (int) parts[DUK_DATE_IDX_DAY], (int) sep, - (int) parts[DUK_DATE_IDX_HOUR], (int) parts[DUK_DATE_IDX_MINUTE], - (int) parts[DUK_DATE_IDX_SECOND], (int) parts[DUK_DATE_IDX_MILLISECOND], (const char *) tzstr); + DUK_SPRINTF((char *) out_buf, + "%s-%02d-%02d%c%02d:%02d:%02d.%03d%s", + (const char *) yearstr, + (int) parts[DUK_DATE_IDX_MONTH], + (int) parts[DUK_DATE_IDX_DAY], + (int) sep, + (int) parts[DUK_DATE_IDX_HOUR], + (int) parts[DUK_DATE_IDX_MINUTE], + (int) parts[DUK_DATE_IDX_SECOND], + (int) parts[DUK_DATE_IDX_MILLISECOND], + (const char *) tzstr); } else if (flags & DUK_DATE_FLAG_TOSTRING_DATE) { - DUK_SPRINTF((char *) out_buf, "%s-%02d-%02d", - (const char *) yearstr, (int) parts[DUK_DATE_IDX_MONTH], (int) parts[DUK_DATE_IDX_DAY]); + DUK_SPRINTF((char *) out_buf, + "%s-%02d-%02d", + (const char *) yearstr, + (int) parts[DUK_DATE_IDX_MONTH], + (int) parts[DUK_DATE_IDX_DAY]); } else { DUK_ASSERT(flags & DUK_DATE_FLAG_TOSTRING_TIME); - DUK_SPRINTF((char *) out_buf, "%02d:%02d:%02d.%03d%s", - (int) parts[DUK_DATE_IDX_HOUR], (int) parts[DUK_DATE_IDX_MINUTE], - (int) parts[DUK_DATE_IDX_SECOND], (int) parts[DUK_DATE_IDX_MILLISECOND], + DUK_SPRINTF((char *) out_buf, + "%02d:%02d:%02d.%03d%s", + (int) parts[DUK_DATE_IDX_HOUR], + (int) parts[DUK_DATE_IDX_MINUTE], + (int) parts[DUK_DATE_IDX_SECOND], + (int) parts[DUK_DATE_IDX_MILLISECOND], (const char *) tzstr); } } @@ -32769,11 +33776,11 @@ DUK_LOCAL void duk__format_parts_iso8601(duk_int_t *parts, duk_int_t tzoffset, d DUK_LOCAL duk_ret_t duk__to_string_helper(duk_hthread *thr, duk_small_uint_t flags) { duk_double_t d; duk_int_t parts[DUK_DATE_IDX_NUM_PARTS]; - duk_int_t tzoffset; /* seconds, doesn't fit into 16 bits */ + duk_int_t tzoffset; /* seconds, doesn't fit into 16 bits */ duk_bool_t rc; duk_uint8_t buf[DUK_BI_DATE_ISO8601_BUFSIZE]; - DUK_UNREF(rc); /* unreferenced with some options */ + DUK_UNREF(rc); /* unreferenced with some options */ d = duk__push_this_get_timeval_tzoffset(thr, flags, &tzoffset); if (DUK_ISNAN(d)) { @@ -32825,9 +33832,9 @@ DUK_LOCAL duk_ret_t duk__to_string_helper(duk_hthread *thr, duk_small_uint_t fla DUK_LOCAL duk_ret_t duk__get_part_helper(duk_hthread *thr, duk_small_uint_t flags_and_idx) { duk_double_t d; duk_int_t parts[DUK_DATE_IDX_NUM_PARTS]; - duk_small_uint_t idx_part = (duk_small_uint_t) (flags_and_idx >> DUK_DATE_FLAG_VALUE_SHIFT); /* unpack args */ + duk_small_uint_t idx_part = (duk_small_uint_t) (flags_and_idx >> DUK_DATE_FLAG_VALUE_SHIFT); /* unpack args */ - DUK_ASSERT_DISABLE(idx_part >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(idx_part >= 0); /* unsigned */ DUK_ASSERT(idx_part < DUK_DATE_IDX_NUM_PARTS); d = duk__push_this_get_timeval(thr, flags_and_idx); @@ -32837,7 +33844,7 @@ DUK_LOCAL duk_ret_t duk__get_part_helper(duk_hthread *thr, duk_small_uint_t flag } DUK_ASSERT(DUK_ISFINITE(d)); - duk_bi_date_timeval_to_parts(d, parts, NULL, flags_and_idx); /* no need to mask idx portion */ + duk_bi_date_timeval_to_parts(d, parts, NULL, flags_and_idx); /* no need to mask idx portion */ /* Setter APIs detect special year numbers (0...99) and apply a +1900 * only in certain cases. The legacy getYear() getter applies -1900 @@ -32859,7 +33866,7 @@ DUK_LOCAL duk_ret_t duk__set_part_helper(duk_hthread *thr, duk_small_uint_t flag duk_int_t parts[DUK_DATE_IDX_NUM_PARTS]; duk_double_t dparts[DUK_DATE_IDX_NUM_PARTS]; duk_idx_t nargs; - duk_small_uint_t maxnargs = (duk_small_uint_t) (flags_and_maxnargs >> DUK_DATE_FLAG_VALUE_SHIFT); /* unpack args */ + duk_small_uint_t maxnargs = (duk_small_uint_t) (flags_and_maxnargs >> DUK_DATE_FLAG_VALUE_SHIFT); /* unpack args */ duk_small_uint_t idx_first, idx; duk_small_uint_t i; @@ -32906,7 +33913,7 @@ DUK_LOCAL duk_ret_t duk__set_part_helper(duk_hthread *thr, duk_small_uint_t flag DUK_ASSERT(maxnargs >= 1 && maxnargs <= 3); idx_first = DUK_DATE_IDX_DAY - (maxnargs - 1); } - DUK_ASSERT_DISABLE(idx_first >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(idx_first >= 0); /* unsigned */ DUK_ASSERT(idx_first < DUK_DATE_IDX_NUM_PARTS); for (i = 0; i < maxnargs; i++) { @@ -32915,7 +33922,7 @@ DUK_LOCAL duk_ret_t duk__set_part_helper(duk_hthread *thr, duk_small_uint_t flag break; } idx = idx_first + i; - DUK_ASSERT_DISABLE(idx >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(idx >= 0); /* unsigned */ DUK_ASSERT(idx < DUK_DATE_IDX_NUM_PARTS); if (idx == DUK_DATE_IDX_YEAR && (flags_and_maxnargs & DUK_DATE_FLAG_YEAR_FIXUP)) { @@ -32967,7 +33974,7 @@ DUK_LOCAL void duk__twodigit_year_fixup(duk_hthread *thr, duk_idx_t idx_val) { } duk_dup(thr, idx_val); duk_to_int(thr, -1); - d = duk_get_number(thr, -1); /* get as double to handle huge numbers correctly */ + d = duk_get_number(thr, -1); /* get as double to handle huge numbers correctly */ if (d >= 0.0 && d <= 99.0) { d += 1900.0; duk_push_number(thr, d); @@ -33015,10 +34022,14 @@ DUK_LOCAL void duk__set_parts_from_args(duk_hthread *thr, duk_double_t *dparts, } DUK_DDD(DUK_DDDPRINT("parts from args -> %lf %lf %lf %lf %lf %lf %lf %lf", - (double) dparts[0], (double) dparts[1], - (double) dparts[2], (double) dparts[3], - (double) dparts[4], (double) dparts[5], - (double) dparts[6], (double) dparts[7])); + (double) dparts[0], + (double) dparts[1], + (double) dparts[2], + (double) dparts[3], + (double) dparts[4], + (double) dparts[5], + (double) dparts[6], + (double) dparts[7])); } /* @@ -33174,9 +34185,8 @@ DUK_INTERNAL duk_ret_t duk_bi_date_constructor(duk_hthread *thr) { DUK_DDD(DUK_DDDPRINT("Date constructor, nargs=%ld, is_cons=%ld", (long) nargs, (long) is_cons)); (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DATE), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DATE), DUK_BIDX_DATE_PROTOTYPE); /* Unlike most built-ins, the internal [[PrimitiveValue]] of a Date @@ -33198,9 +34208,9 @@ DUK_INTERNAL duk_ret_t duk_bi_date_constructor(duk_hthread *thr) { str = duk_get_string_notsymbol(thr, 0); if (str) { duk__parse_string(thr, str); - duk_replace(thr, 0); /* may be NaN */ + duk_replace(thr, 0); /* may be NaN */ } - d = duk__timeclip(duk_to_number(thr, 0)); /* symbols fail here */ + d = duk__timeclip(duk_to_number(thr, 0)); /* symbols fail here */ duk_push_number(thr, d); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_VALUE, DUK_PROPDESC_FLAGS_W); return 1; @@ -33210,8 +34220,8 @@ DUK_INTERNAL duk_ret_t duk_bi_date_constructor(duk_hthread *thr) { /* Parts are in local time, convert when setting. */ - (void) duk__set_this_timeval_from_dparts(thr, dparts, DUK_DATE_FLAG_LOCALTIME /*flags*/); /* -> [ ... this timeval ] */ - duk_pop(thr); /* -> [ ... this ] */ + (void) duk__set_this_timeval_from_dparts(thr, dparts, DUK_DATE_FLAG_LOCALTIME /*flags*/); /* -> [ ... this timeval ] */ + duk_pop(thr); /* -> [ ... this ] */ return 1; } @@ -33242,7 +34252,7 @@ DUK_INTERNAL duk_ret_t duk_bi_date_constructor_now(duk_hthread *thr) { duk_double_t d; d = duk_time_get_ecmascript_time_nofrac(thr); - DUK_ASSERT(duk_double_equals(duk__timeclip(d), d)); /* TimeClip() should never be necessary */ + DUK_ASSERT(duk_double_equals(duk__timeclip(d), d)); /* TimeClip() should never be necessary */ duk_push_number(thr, d); return 1; } @@ -33291,7 +34301,7 @@ DUK_INTERNAL duk_ret_t duk_bi_date_prototype_value_of(duk_hthread *thr) { * as their behavior is identical. */ - duk_double_t d = duk__push_this_get_timeval(thr, 0 /*flags*/); /* -> [ this ] */ + duk_double_t d = duk__push_this_get_timeval(thr, 0 /*flags*/); /* -> [ this ] */ DUK_ASSERT(DUK_ISFINITE(d) || DUK_ISNAN(d)); duk_push_number(thr, d); return 1; @@ -33317,7 +34327,7 @@ DUK_INTERNAL duk_ret_t duk_bi_date_prototype_to_json(duk_hthread *thr) { duk_pop(thr); duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_TO_ISO_STRING); - duk_dup_m2(thr); /* -> [ O toIsoString O ] */ + duk_dup_m2(thr); /* -> [ O toIsoString O ] */ duk_call_method(thr, 0); return 1; } @@ -33490,8 +34500,7 @@ DUK_INTERNAL duk_ret_t duk_bi_date_prototype_toprimitive(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 2); hintstr = duk_require_lstring(thr, 0, &hintlen); - if ((hintlen == 6 && DUK_STRCMP(hintstr, "string") == 0) || - (hintlen == 7 && DUK_STRCMP(hintstr, "default") == 0)) { + if ((hintlen == 6 && DUK_STRCMP(hintstr, "string") == 0) || (hintlen == 7 && DUK_STRCMP(hintstr, "default") == 0)) { hint = DUK_HINT_STRING; } else if (hintlen == 6 && DUK_STRCMP(hintstr, "number") == 0) { hint = DUK_HINT_NUMBER; @@ -33502,9 +34511,9 @@ DUK_INTERNAL duk_ret_t duk_bi_date_prototype_toprimitive(duk_hthread *thr) { duk_to_primitive_ordinary(thr, -1, hint); return 1; } -#endif /* DUK_USE_SYMBOL_BUILTIN */ +#endif /* DUK_USE_SYMBOL_BUILTIN */ -#endif /* DUK_USE_DATE_BUILTIN */ +#endif /* DUK_USE_DATE_BUILTIN */ /* automatic undefs */ #undef DUK__CF_ACCEPT @@ -33567,8 +34576,8 @@ DUK_INTERNAL duk_ret_t duk_bi_date_prototype_toprimitive(duk_hthread *thr) { /* Buffer sizes for some UNIX calls. Larger than strictly necessary * to avoid Valgrind errors. */ -#define DUK__STRPTIME_BUF_SIZE 64 -#define DUK__STRFTIME_BUF_SIZE 64 +#define DUK__STRPTIME_BUF_SIZE 64 +#define DUK__STRFTIME_BUF_SIZE 64 #if defined(DUK_USE_DATE_NOW_GETTIMEOFDAY) /* Get current ECMAScript time (= UNIX/Posix time, but in milliseconds). */ @@ -33582,12 +34591,11 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_now_gettimeofday(void) { } /* As of Duktape 2.2.0 allow fractions. */ - d = ((duk_double_t) tv.tv_sec) * 1000.0 + - ((duk_double_t) tv.tv_usec) / 1000.0; + d = ((duk_double_t) tv.tv_sec) * 1000.0 + ((duk_double_t) tv.tv_usec) / 1000.0; return d; } -#endif /* DUK_USE_DATE_NOW_GETTIMEOFDAY */ +#endif /* DUK_USE_DATE_NOW_GETTIMEOFDAY */ #if defined(DUK_USE_DATE_NOW_TIME) /* Not a very good provider: only full seconds are available. */ @@ -33601,7 +34609,7 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_now_time(void) { } return ((duk_double_t) t) * 1000.0; } -#endif /* DUK_USE_DATE_NOW_TIME */ +#endif /* DUK_USE_DATE_NOW_TIME */ #if defined(DUK_USE_DATE_TZO_GMTIME) || defined(DUK_USE_DATE_TZO_GMTIME_R) || defined(DUK_USE_DATE_TZO_GMTIME_S) /* Get local time offset (in seconds) for a certain (UTC) instant 'd'. */ @@ -33684,7 +34692,7 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_gmtime(duk_double_t d) { DUK_ASSERT(parts[DUK_DATE_IDX_YEAR] >= 1970 && parts[DUK_DATE_IDX_YEAR] <= 2038); d = duk_bi_date_get_timeval_from_dparts(dparts, 0 /*flags*/); - DUK_ASSERT(d >= 0 && d < 2147483648.0 * 1000.0); /* unsigned 31-bit range */ + DUK_ASSERT(d >= 0 && d < 2147483648.0 * 1000.0); /* unsigned 31-bit range */ t = (time_t) (d / 1000.0); DUK_DDD(DUK_DDDPRINT("timeval: %lf -> time_t %ld", (double) d, (long) t)); @@ -33706,14 +34714,26 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_gmtime(duk_double_t d) { #endif DUK_DDD(DUK_DDDPRINT("gmtime result: tm={sec:%ld,min:%ld,hour:%ld,mday:%ld,mon:%ld,year:%ld," "wday:%ld,yday:%ld,isdst:%ld}", - (long) tms[0].tm_sec, (long) tms[0].tm_min, (long) tms[0].tm_hour, - (long) tms[0].tm_mday, (long) tms[0].tm_mon, (long) tms[0].tm_year, - (long) tms[0].tm_wday, (long) tms[0].tm_yday, (long) tms[0].tm_isdst)); + (long) tms[0].tm_sec, + (long) tms[0].tm_min, + (long) tms[0].tm_hour, + (long) tms[0].tm_mday, + (long) tms[0].tm_mon, + (long) tms[0].tm_year, + (long) tms[0].tm_wday, + (long) tms[0].tm_yday, + (long) tms[0].tm_isdst)); DUK_DDD(DUK_DDDPRINT("localtime result: tm={sec:%ld,min:%ld,hour:%ld,mday:%ld,mon:%ld,year:%ld," "wday:%ld,yday:%ld,isdst:%ld}", - (long) tms[1].tm_sec, (long) tms[1].tm_min, (long) tms[1].tm_hour, - (long) tms[1].tm_mday, (long) tms[1].tm_mon, (long) tms[1].tm_year, - (long) tms[1].tm_wday, (long) tms[1].tm_yday, (long) tms[1].tm_isdst)); + (long) tms[1].tm_sec, + (long) tms[1].tm_min, + (long) tms[1].tm_hour, + (long) tms[1].tm_mday, + (long) tms[1].tm_mon, + (long) tms[1].tm_year, + (long) tms[1].tm_wday, + (long) tms[1].tm_yday, + (long) tms[1].tm_isdst)); /* tm_isdst is both an input and an output to mktime(), use 0 to * avoid DST handling in mktime(): @@ -33722,8 +34742,8 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_gmtime(duk_double_t d) { */ tms[0].tm_isdst = 0; tms[1].tm_isdst = 0; - t1 = mktime(&tms[0]); /* UTC */ - t2 = mktime(&tms[1]); /* local */ + t1 = mktime(&tms[0]); /* UTC */ + t2 = mktime(&tms[1]); /* local */ if (t1 == (time_t) -1 || t2 == (time_t) -1) { /* This check used to be for (t < 0) but on some platforms * time_t is unsigned and apparently the proper way to detect @@ -33746,12 +34766,12 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_gmtime(duk_double_t d) { #endif return (duk_int_t) difftime(t2, t1); - mktime_error: +mktime_error: /* XXX: return something more useful, so that caller can throw? */ DUK_D(DUK_DPRINT("mktime() failed, d=%lf", (double) d)); return 0; } -#endif /* DUK_USE_DATE_TZO_GMTIME */ +#endif /* DUK_USE_DATE_TZO_GMTIME */ #if defined(DUK_USE_DATE_PRS_STRPTIME) DUK_INTERNAL duk_bool_t duk_bi_date_parse_string_strptime(duk_hthread *thr, const char *str) { @@ -33761,7 +34781,7 @@ DUK_INTERNAL duk_bool_t duk_bi_date_parse_string_strptime(duk_hthread *thr, cons /* Copy to buffer with slack to avoid Valgrind gripes from strptime. */ DUK_ASSERT(str != NULL); - duk_memzero(buf, sizeof(buf)); /* valgrind whine without this */ + duk_memzero(buf, sizeof(buf)); /* valgrind whine without this */ DUK_SNPRINTF(buf, sizeof(buf), "%s", (const char *) str); buf[sizeof(buf) - 1] = (char) 0; @@ -33771,10 +34791,16 @@ DUK_INTERNAL duk_bool_t duk_bi_date_parse_string_strptime(duk_hthread *thr, cons if (strptime((const char *) buf, "%c", &tm) != NULL) { DUK_DDD(DUK_DDDPRINT("before mktime: tm={sec:%ld,min:%ld,hour:%ld,mday:%ld,mon:%ld,year:%ld," "wday:%ld,yday:%ld,isdst:%ld}", - (long) tm.tm_sec, (long) tm.tm_min, (long) tm.tm_hour, - (long) tm.tm_mday, (long) tm.tm_mon, (long) tm.tm_year, - (long) tm.tm_wday, (long) tm.tm_yday, (long) tm.tm_isdst)); - tm.tm_isdst = -1; /* negative: dst info not available */ + (long) tm.tm_sec, + (long) tm.tm_min, + (long) tm.tm_hour, + (long) tm.tm_mday, + (long) tm.tm_mon, + (long) tm.tm_year, + (long) tm.tm_wday, + (long) tm.tm_yday, + (long) tm.tm_isdst)); + tm.tm_isdst = -1; /* negative: dst info not available */ t = mktime(&tm); DUK_DDD(DUK_DDDPRINT("mktime() -> %ld", (long) t)); @@ -33786,7 +34812,7 @@ DUK_INTERNAL duk_bool_t duk_bi_date_parse_string_strptime(duk_hthread *thr, cons return 0; } -#endif /* DUK_USE_DATE_PRS_STRPTIME */ +#endif /* DUK_USE_DATE_PRS_STRPTIME */ #if defined(DUK_USE_DATE_PRS_GETDATE) DUK_INTERNAL duk_bool_t duk_bi_date_parse_string_getdate(duk_hthread *thr, const char *str) { @@ -33813,10 +34839,13 @@ DUK_INTERNAL duk_bool_t duk_bi_date_parse_string_getdate(duk_hthread *thr, const return 0; } -#endif /* DUK_USE_DATE_PRS_GETDATE */ +#endif /* DUK_USE_DATE_PRS_GETDATE */ #if defined(DUK_USE_DATE_FMT_STRFTIME) -DUK_INTERNAL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, duk_int_t *parts, duk_int_t tzoffset, duk_small_uint_t flags) { +DUK_INTERNAL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, + duk_int_t *parts, + duk_int_t tzoffset, + duk_small_uint_t flags) { char buf[DUK__STRFTIME_BUF_SIZE]; struct tm tm; const char *fmt; @@ -33834,8 +34863,7 @@ DUK_INTERNAL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, duk_ * probably not an accurate guarantee of strftime() supporting or not * supporting a large time range (the full ECMAScript range). */ - if (sizeof(time_t) < 8 && - (parts[DUK_DATE_IDX_YEAR] < 1970 || parts[DUK_DATE_IDX_YEAR] > 2037)) { + if (sizeof(time_t) < 8 && (parts[DUK_DATE_IDX_YEAR] < 1970 || parts[DUK_DATE_IDX_YEAR] > 2037)) { /* be paranoid for 32-bit time values (even avoiding negative ones) */ return 0; } @@ -33844,8 +34872,8 @@ DUK_INTERNAL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, duk_ tm.tm_sec = parts[DUK_DATE_IDX_SECOND]; tm.tm_min = parts[DUK_DATE_IDX_MINUTE]; tm.tm_hour = parts[DUK_DATE_IDX_HOUR]; - tm.tm_mday = parts[DUK_DATE_IDX_DAY]; /* already one-based */ - tm.tm_mon = parts[DUK_DATE_IDX_MONTH] - 1; /* one-based -> zero-based */ + tm.tm_mday = parts[DUK_DATE_IDX_DAY]; /* already one-based */ + tm.tm_mon = parts[DUK_DATE_IDX_MONTH] - 1; /* one-based -> zero-based */ tm.tm_year = parts[DUK_DATE_IDX_YEAR] - 1900; tm.tm_wday = parts[DUK_DATE_IDX_WEEKDAY]; tm.tm_isdst = 0; @@ -33865,7 +34893,7 @@ DUK_INTERNAL duk_bool_t duk_bi_date_format_parts_strftime(duk_hthread *thr, duk_ duk_push_string(thr, buf); return 1; } -#endif /* DUK_USE_DATE_FMT_STRFTIME */ +#endif /* DUK_USE_DATE_FMT_STRFTIME */ #if defined(DUK_USE_GET_MONOTONIC_TIME_CLOCK_GETTIME) DUK_INTERNAL duk_double_t duk_bi_date_get_monotonic_time_clock_gettime(void) { @@ -33913,20 +34941,20 @@ DUK_LOCAL void duk__convert_filetime_to_ularge(const FILETIME *ft, ULARGE_INTEGE res->LowPart = ft->dwLowDateTime; res->HighPart = ft->dwHighDateTime; } -#endif /* DUK_USE_DATE_NOW_WINDOWS_SUBMS */ +#endif /* DUK_USE_DATE_NOW_WINDOWS_SUBMS */ DUK_LOCAL void duk__set_systime_jan1970(SYSTEMTIME *st) { duk_memzero((void *) st, sizeof(*st)); st->wYear = 1970; st->wMonth = 1; - st->wDayOfWeek = 4; /* not sure whether or not needed; Thursday */ + st->wDayOfWeek = 4; /* not sure whether or not needed; Thursday */ st->wDay = 1; DUK_ASSERT(st->wHour == 0); DUK_ASSERT(st->wMinute == 0); DUK_ASSERT(st->wSecond == 0); DUK_ASSERT(st->wMilliseconds == 0); } -#endif /* defined(DUK_USE_DATE_NOW_WINDOWS) || defined(DUK_USE_DATE_TZO_WINDOWS) */ +#endif /* defined(DUK_USE_DATE_NOW_WINDOWS) || defined(DUK_USE_DATE_TZO_WINDOWS) */ #if defined(DUK_USE_DATE_NOW_WINDOWS) DUK_INTERNAL duk_double_t duk_bi_date_get_now_windows(void) { @@ -33948,7 +34976,7 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_now_windows(void) { */ return (duk_double_t) ((LONGLONG) tmp1.QuadPart - (LONGLONG) tmp2.QuadPart) / 10000.0; } -#endif /* DUK_USE_DATE_NOW_WINDOWS */ +#endif /* DUK_USE_DATE_NOW_WINDOWS */ #if defined(DUK_USE_DATE_NOW_WINDOWS_SUBMS) DUK_INTERNAL duk_double_t duk_bi_date_get_now_windows_subms(void) { @@ -33970,7 +34998,7 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_now_windows_subms(void) { */ return (duk_double_t) ((LONGLONG) tmp1.QuadPart - (LONGLONG) tmp2.QuadPart) / 10000.0; } -#endif /* DUK_USE_DATE_NOW_WINDOWS */ +#endif /* DUK_USE_DATE_NOW_WINDOWS */ #if defined(DUK_USE_DATE_TZO_WINDOWS) DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_windows(duk_double_t d) { @@ -33995,8 +35023,8 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_windows(duk_double_t d) { duk__set_systime_jan1970(&st1); duk__convert_systime_to_ularge((const SYSTEMTIME *) &st1, &tmp1); - tmp2.QuadPart = (ULONGLONG) (d * 10000.0); /* millisec -> 100ns units since jan 1, 1970 */ - tmp2.QuadPart += tmp1.QuadPart; /* input 'd' in Windows UTC, 100ns units */ + tmp2.QuadPart = (ULONGLONG) (d * 10000.0); /* millisec -> 100ns units since jan 1, 1970 */ + tmp2.QuadPart += tmp1.QuadPart; /* input 'd' in Windows UTC, 100ns units */ ft1.dwLowDateTime = tmp2.LowPart; ft1.dwHighDateTime = tmp2.HighPart; @@ -34011,9 +35039,9 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_windows(duk_double_t d) { duk__convert_systime_to_ularge((const SYSTEMTIME *) &st3, &tmp3); /* Positive if local time ahead of UTC. */ - return (duk_int_t) (((LONGLONG) tmp3.QuadPart - (LONGLONG) tmp2.QuadPart) / DUK_I64_CONSTANT(10000000)); /* seconds */ + return (duk_int_t) (((LONGLONG) tmp3.QuadPart - (LONGLONG) tmp2.QuadPart) / DUK_I64_CONSTANT(10000000)); /* seconds */ } -#endif /* DUK_USE_DATE_TZO_WINDOWS */ +#endif /* DUK_USE_DATE_TZO_WINDOWS */ #if defined(DUK_USE_DATE_TZO_WINDOWS_NO_DST) DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_windows_no_dst(duk_double_t d) { @@ -34048,17 +35076,19 @@ DUK_INTERNAL duk_int_t duk_bi_date_get_local_tzoffset_windows_no_dst(duk_double_ } duk__convert_systime_to_ularge((const SYSTEMTIME *) &st2, &tmp2); - return (duk_int_t) (((LONGLONG) tmp2.QuadPart - (LONGLONG) tmp1.QuadPart) / DUK_I64_CONSTANT(10000000)); /* seconds */ + return (duk_int_t) (((LONGLONG) tmp2.QuadPart - (LONGLONG) tmp1.QuadPart) / DUK_I64_CONSTANT(10000000)); /* seconds */ } -#endif /* DUK_USE_DATE_TZO_WINDOWS_NO_DST */ +#endif /* DUK_USE_DATE_TZO_WINDOWS_NO_DST */ #if defined(DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC) DUK_INTERNAL duk_double_t duk_bi_date_get_monotonic_time_windows_qpc(void) { LARGE_INTEGER count, freq; /* There are legacy issues with QueryPerformanceCounter(): - * - Potential jumps: https://support.microsoft.com/en-us/help/274323/performance-counter-value-may-unexpectedly-leap-forward - * - Differences between cores (XP): https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx#qpc_support_in_windows_versions + * - Potential jumps: + * https://support.microsoft.com/en-us/help/274323/performance-counter-value-may-unexpectedly-leap-forward + * - Differences between cores (XP): + * https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx#qpc_support_in_windows_versions * * We avoid these by enabling QPC by default only for Vista or later. */ @@ -34075,7 +35105,7 @@ DUK_INTERNAL duk_double_t duk_bi_date_get_monotonic_time_windows_qpc(void) { return 0.0; } } -#endif /* DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC */ +#endif /* DUK_USE_GET_MONOTONIC_TIME_WINDOWS_QPC */ /* * Duktape built-ins * @@ -34138,7 +35168,7 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_fin(duk_hthread *thr) { return 1; } } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_enc(duk_hthread *thr) { duk_hstring *h_str; @@ -34148,7 +35178,7 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_enc(duk_hthread *thr) { * non-existent optional parameters. */ - h_str = duk_require_hstring(thr, 0); /* Could reject symbols, but no point: won't match comparisons. */ + h_str = duk_require_hstring(thr, 0); /* Could reject symbols, but no point: won't match comparisons. */ duk_require_valid_index(thr, 1); if (h_str == DUK_HTHREAD_STRING_HEX(thr)) { @@ -34165,9 +35195,8 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_enc(duk_hthread *thr) { 1 /*idx_value*/, 2 /*idx_replacer*/, 3 /*idx_space*/, - DUK_JSON_FLAG_EXT_CUSTOM | - DUK_JSON_FLAG_ASCII_ONLY | - DUK_JSON_FLAG_AVOID_KEY_QUOTES /*flags*/); + DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_ASCII_ONLY | + DUK_JSON_FLAG_AVOID_KEY_QUOTES /*flags*/); #endif #if defined(DUK_USE_JSON_SUPPORT) && defined(DUK_USE_JC) } else if (h_str == DUK_HTHREAD_STRING_JC(thr)) { @@ -34175,8 +35204,7 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_enc(duk_hthread *thr) { 1 /*idx_value*/, 2 /*idx_replacer*/, 3 /*idx_space*/, - DUK_JSON_FLAG_EXT_COMPATIBLE | - DUK_JSON_FLAG_ASCII_ONLY /*flags*/); + DUK_JSON_FLAG_EXT_COMPATIBLE | DUK_JSON_FLAG_ASCII_ONLY /*flags*/); #endif } else { DUK_DCERROR_TYPE_INVALID_ARGS(thr); @@ -34192,7 +35220,7 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_dec(duk_hthread *thr) { * non-existent optional parameters. */ - h_str = duk_require_hstring(thr, 0); /* Could reject symbols, but no point: won't match comparisons */ + h_str = duk_require_hstring(thr, 0); /* Could reject symbols, but no point: won't match comparisons */ duk_require_valid_index(thr, 1); if (h_str == DUK_HTHREAD_STRING_HEX(thr)) { @@ -34205,17 +35233,11 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_dec(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 2); #if defined(DUK_USE_JSON_SUPPORT) && defined(DUK_USE_JX) } else if (h_str == DUK_HTHREAD_STRING_JX(thr)) { - duk_bi_json_parse_helper(thr, - 1 /*idx_value*/, - 2 /*idx_replacer*/, - DUK_JSON_FLAG_EXT_CUSTOM /*flags*/); + duk_bi_json_parse_helper(thr, 1 /*idx_value*/, 2 /*idx_replacer*/, DUK_JSON_FLAG_EXT_CUSTOM /*flags*/); #endif #if defined(DUK_USE_JSON_SUPPORT) && defined(DUK_USE_JC) } else if (h_str == DUK_HTHREAD_STRING_JC(thr)) { - duk_bi_json_parse_helper(thr, - 1 /*idx_value*/, - 2 /*idx_replacer*/, - DUK_JSON_FLAG_EXT_COMPATIBLE /*flags*/); + duk_bi_json_parse_helper(thr, 1 /*idx_value*/, 2 /*idx_replacer*/, DUK_JSON_FLAG_EXT_COMPATIBLE /*flags*/); #endif } else { DUK_DCERROR_TYPE_INVALID_ARGS(thr); @@ -34230,10 +35252,10 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_dec(duk_hthread *thr) { DUK_INTERNAL duk_ret_t duk_bi_duktape_object_compact(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 1); duk_compact(thr, 0); - return 1; /* return the argument object */ + return 1; /* return the argument object */ } -#endif /* DUK_USE_DUKTAPE_BUILTIN */ +#endif /* DUK_USE_DUKTAPE_BUILTIN */ /* * WHATWG Encoding API built-ins * @@ -34248,17 +35270,17 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_compact(duk_hthread *thr) { */ typedef struct { - duk_uint8_t *out; /* where to write next byte(s) */ - duk_codepoint_t lead; /* lead surrogate */ + duk_uint8_t *out; /* where to write next byte(s) */ + duk_codepoint_t lead; /* lead surrogate */ } duk__encode_context; typedef struct { /* UTF-8 decoding state */ - duk_codepoint_t codepoint; /* built up incrementally */ - duk_uint8_t upper; /* max value of next byte (decode error otherwise) */ - duk_uint8_t lower; /* min value of next byte (ditto) */ - duk_uint8_t needed; /* how many more bytes we need */ - duk_uint8_t bom_handled; /* BOM seen or no longer expected */ + duk_codepoint_t codepoint; /* built up incrementally */ + duk_uint8_t upper; /* max value of next byte (decode error otherwise) */ + duk_uint8_t lower; /* min value of next byte (ditto) */ + duk_uint8_t needed; /* how many more bytes we need */ + duk_uint8_t bom_handled; /* BOM seen or no longer expected */ /* Decoder configuration */ duk_uint8_t fatal; @@ -34268,9 +35290,9 @@ typedef struct { /* The signed duk_codepoint_t type is used to signal a decoded codepoint * (>= 0) or various other states using negative values. */ -#define DUK__CP_CONTINUE (-1) /* continue to next byte, no completed codepoint */ -#define DUK__CP_ERROR (-2) /* decoding error */ -#define DUK__CP_RETRY (-3) /* decoding error; retry last byte */ +#define DUK__CP_CONTINUE (-1) /* continue to next byte, no completed codepoint */ +#define DUK__CP_ERROR (-2) /* decoding error */ +#define DUK__CP_RETRY (-3) /* decoding error; retry last byte */ /* * Raw helpers for encoding/decoding @@ -34357,7 +35379,7 @@ DUK_LOCAL duk_codepoint_t duk__utf8_decode_next(duk__decode_context *dec_ctx, du } else { /* got a codepoint */ duk_codepoint_t ret; - DUK_ASSERT(dec_ctx->codepoint <= 0x10ffffL); /* Decoding rules guarantee. */ + DUK_ASSERT(dec_ctx->codepoint <= 0x10ffffL); /* Decoding rules guarantee. */ ret = dec_ctx->codepoint; dec_ctx->codepoint = 0x0000L; dec_ctx->needed = 0; @@ -34413,7 +35435,8 @@ DUK_LOCAL void duk__utf8_encode_char(void *udata, duk_codepoint_t codepoint) { } else { /* low surrogate */ if (enc_ctx->lead != 0x0000L) { - codepoint = (duk_codepoint_t) (0x010000L + ((enc_ctx->lead - 0xd800L) << 10) + (codepoint - 0xdc00L)); + codepoint = + (duk_codepoint_t) (0x010000L + ((enc_ctx->lead - 0xd800L) << 10) + (codepoint - 0xdc00L)); enc_ctx->lead = 0x0000L; } else { /* unpaired low surrogate */ @@ -34434,7 +35457,7 @@ DUK_LOCAL void duk__utf8_encode_char(void *udata, duk_codepoint_t codepoint) { */ enc_ctx->out += duk_unicode_encode_xutf8((duk_ucodepoint_t) codepoint, enc_ctx->out); } -#endif /* DUK_USE_ENCODING_BUILTINS */ +#endif /* DUK_USE_ENCODING_BUILTINS */ /* Shared helper for buffer-to-string using a TextDecoder() compatible UTF-8 * decoder. @@ -34463,18 +35486,15 @@ DUK_LOCAL duk_ret_t duk__decode_helper(duk_hthread *thr, duk__decode_context *de duk_push_fixed_buffer_nozero(thr, 0); duk_replace(thr, 0); } - (void) duk_require_buffer_data(thr, 0, &len); /* Need 'len', avoid pointer. */ + (void) duk_require_buffer_data(thr, 0, &len); /* Need 'len', avoid pointer. */ - if (duk_check_type_mask(thr, 1, DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_NULL | - DUK_TYPE_MASK_NONE)) { + if (duk_check_type_mask(thr, 1, DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_NULL | DUK_TYPE_MASK_NONE)) { /* Use defaults, treat missing value like undefined. */ } else { - duk_require_type_mask(thr, 1, DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_NULL | - DUK_TYPE_MASK_LIGHTFUNC | - DUK_TYPE_MASK_BUFFER | - DUK_TYPE_MASK_OBJECT); + duk_require_type_mask(thr, + 1, + DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_NULL | DUK_TYPE_MASK_LIGHTFUNC | + DUK_TYPE_MASK_BUFFER | DUK_TYPE_MASK_OBJECT); if (duk_get_prop_literal(thr, 1, "stream")) { stream = duk_to_boolean(thr, -1); } @@ -34492,7 +35512,8 @@ DUK_LOCAL duk_ret_t duk__decode_helper(duk_hthread *thr, duk__decode_context *de DUK_ERROR_TYPE(thr, DUK_STR_RESULT_TOO_LONG); DUK_WO_NORETURN(return 0;); } - output = (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, 3 + (3 * len)); /* used parts will be always manually written over */ + output = + (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, 3 + (3 * len)); /* used parts will be always manually written over */ input = (const duk_uint8_t *) duk_get_buffer_data(thr, 0, &len_tmp); DUK_ASSERT(input != NULL || len == 0); @@ -34524,7 +35545,7 @@ DUK_LOCAL duk_ret_t duk__decode_helper(duk_hthread *thr, duk__decode_context *de /* Decoding error with or without retry. */ DUK_ASSERT(codepoint == DUK__CP_ERROR || codepoint == DUK__CP_RETRY); if (codepoint == DUK__CP_RETRY) { - --in; /* retry last byte */ + --in; /* retry last byte */ } /* replacement mode: replace with U+FFFD */ codepoint = DUK_UNICODE_CP_REPLACEMENT_CHARACTER; @@ -34557,7 +35578,7 @@ DUK_LOCAL duk_ret_t duk__decode_helper(duk_hthread *thr, duk__decode_context *de DUK_ASSERT(out <= output + (3 + (3 * len))); } } - duk__utf8_decode_init(dec_ctx); /* Initialize decoding state for potential reuse. */ + duk__utf8_decode_init(dec_ctx); /* Initialize decoding state for potential reuse. */ } /* Output buffer is fixed and thus stable even if there had been @@ -34566,7 +35587,7 @@ DUK_LOCAL duk_ret_t duk__decode_helper(duk_hthread *thr, duk__decode_context *de duk_push_lstring(thr, (const char *) output, (duk_size_t) (out - output)); return 1; - fail_type: +fail_type: DUK_ERROR_TYPE(thr, DUK_STR_UTF8_DECODE_FAILED); DUK_WO_NORETURN(return 0;); } @@ -34625,7 +35646,7 @@ DUK_INTERNAL duk_ret_t duk_bi_textencoder_prototype_encode(duk_hthread *thr) { output = (duk_uint8_t *) duk_push_dynamic_buffer(thr, 3 * len); if (len > 0) { - DUK_ASSERT(duk_is_string(thr, 0)); /* True if len > 0. */ + DUK_ASSERT(duk_is_string(thr, 0)); /* True if len > 0. */ /* XXX: duk_decode_string() is used to process the input * string. For standard ECMAScript strings, represented @@ -34701,7 +35722,7 @@ DUK_INTERNAL duk_ret_t duk_bi_textdecoder_constructor(duk_hthread *thr) { dec_ctx = (duk__decode_context *) duk_push_fixed_buffer(thr, sizeof(duk__decode_context)); dec_ctx->fatal = (duk_uint8_t) fatal; dec_ctx->ignore_bom = (duk_uint8_t) ignore_bom; - duk__utf8_decode_init(dec_ctx); /* Initializes remaining fields. */ + duk__utf8_decode_init(dec_ctx); /* Initializes remaining fields. */ duk_put_prop_literal(thr, -2, DUK_INTERNAL_SYMBOL("Context")); return 0; @@ -34747,7 +35768,7 @@ DUK_INTERNAL duk_ret_t duk_bi_textdecoder_prototype_decode(duk_hthread *thr) { dec_ctx = duk__get_textdecoder_context(thr); return duk__decode_helper(thr, dec_ctx); } -#endif /* DUK_USE_ENCODING_BUILTINS */ +#endif /* DUK_USE_ENCODING_BUILTINS */ /* * Internal helper for Node.js Buffer @@ -34761,8 +35782,8 @@ DUK_INTERNAL duk_ret_t duk_bi_textdecoder_prototype_decode(duk_hthread *thr) { DUK_INTERNAL duk_ret_t duk_textdecoder_decode_utf8_nodejs(duk_hthread *thr) { duk__decode_context dec_ctx; - dec_ctx.fatal = 0; /* use replacement chars */ - dec_ctx.ignore_bom = 1; /* ignore BOMs (matches Node.js Buffer .toString()) */ + dec_ctx.fatal = 0; /* use replacement chars */ + dec_ctx.ignore_bom = 1; /* ignore BOMs (matches Node.js Buffer .toString()) */ duk__utf8_decode_init(&dec_ctx); return duk__decode_helper(thr, &dec_ctx); @@ -34789,9 +35810,8 @@ DUK_INTERNAL duk_ret_t duk_bi_error_constructor_shared(duk_hthread *thr) { duk_small_int_t bidx_prototype = duk_get_current_magic(thr); /* same for both error and each subclass like TypeError */ - duk_uint_t flags_and_class = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ERROR); + duk_uint_t flags_and_class = + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ERROR); (void) duk_push_object_helper(thr, flags_and_class, bidx_prototype); @@ -34800,7 +35820,7 @@ DUK_INTERNAL duk_ret_t duk_bi_error_constructor_shared(duk_hthread *thr) { */ if (!duk_is_undefined(thr, 0)) { duk_to_string(thr, 0); - duk_dup_0(thr); /* [ message error message ] */ + duk_dup_0(thr); /* [ message error message ] */ duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_MESSAGE, DUK_PROPDESC_FLAGS_WC); } @@ -34859,7 +35879,7 @@ DUK_INTERNAL duk_ret_t duk_bi_error_prototype_to_string(duk_hthread *thr) { return 1; } duk_push_literal(thr, ": "); - duk_insert(thr, -2); /* ... name ': ' message */ + duk_insert(thr, -2); /* ... name ': ' message */ duk_concat(thr, 3); return 1; @@ -34882,15 +35902,15 @@ DUK_INTERNAL duk_ret_t duk_bi_error_prototype_to_string(duk_hthread *thr) { */ /* constants arbitrary, chosen for small loads */ -#define DUK__OUTPUT_TYPE_TRACEBACK (-1) -#define DUK__OUTPUT_TYPE_FILENAME 0 -#define DUK__OUTPUT_TYPE_LINENUMBER 1 +#define DUK__OUTPUT_TYPE_TRACEBACK (-1) +#define DUK__OUTPUT_TYPE_FILENAME 0 +#define DUK__OUTPUT_TYPE_LINENUMBER 1 DUK_LOCAL duk_ret_t duk__error_getter_helper(duk_hthread *thr, duk_small_int_t output_type) { duk_idx_t idx_td; - duk_small_int_t i; /* traceback depth fits into 16 bits */ - duk_small_int_t t; /* stack type fits into 16 bits */ - duk_small_int_t count_func = 0; /* traceback depth ensures fits into 16 bits */ + duk_small_int_t i; /* traceback depth fits into 16 bits */ + duk_small_int_t t; /* stack type fits into 16 bits */ + duk_small_int_t count_func = 0; /* traceback depth ensures fits into 16 bits */ const char *str_tailcall = " tailcall"; const char *str_strict = " strict"; const char *str_construct = " construct"; @@ -34898,7 +35918,7 @@ DUK_LOCAL duk_ret_t duk__error_getter_helper(duk_hthread *thr, duk_small_int_t o const char *str_directeval = " directeval"; const char *str_empty = ""; - DUK_ASSERT_TOP(thr, 0); /* fixed arg count */ + DUK_ASSERT_TOP(thr, 0); /* fixed arg count */ duk_push_this(thr); duk_xget_owndataprop_stridx_short(thr, -1, DUK_STRIDX_INT_TRACEDATA); @@ -34913,7 +35933,7 @@ DUK_LOCAL duk_ret_t duk__error_getter_helper(duk_hthread *thr, duk_small_int_t o if (duk_check_type(thr, idx_td, DUK_TYPE_OBJECT)) { /* Current tracedata contains 2 entries per callstack entry. */ - for (i = 0; ; i += 2) { + for (i = 0;; i += 2) { duk_int_t pc; duk_uint_t line; duk_uint_t flags; @@ -34969,46 +35989,53 @@ DUK_LOCAL duk_ret_t duk__error_getter_helper(duk_hthread *thr, duk_small_int_t o /* XXX: Change 'anon' handling here too, to use empty string for anonymous functions? */ /* XXX: Could be improved by coercing to a readable duk_tval (especially string escaping) */ - h_name = duk_get_hstring_notsymbol(thr, -2); /* may be NULL */ + h_name = duk_get_hstring_notsymbol(thr, -2); /* may be NULL */ funcname = (h_name == NULL || h_name == DUK_HTHREAD_STRING_EMPTY_STRING(thr)) ? - "[anon]" : (const char *) DUK_HSTRING_GET_DATA(h_name); + "[anon]" : + (const char *) DUK_HSTRING_GET_DATA(h_name); filename = duk_get_string_notsymbol(thr, -1); filename = filename ? filename : ""; DUK_ASSERT(funcname != NULL); DUK_ASSERT(filename != NULL); - h_func = duk_get_hobject(thr, -4); /* NULL for lightfunc */ + h_func = duk_get_hobject(thr, -4); /* NULL for lightfunc */ if (h_func == NULL) { - duk_push_sprintf(thr, "at %s light%s%s%s%s%s", - (const char *) funcname, - (const char *) ((flags & DUK_ACT_FLAG_STRICT) ? str_strict : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_TAILCALLED) ? str_tailcall : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_CONSTRUCT) ? str_construct : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_DIRECT_EVAL) ? str_directeval : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_PREVENT_YIELD) ? str_prevyield : str_empty)); + duk_push_sprintf( + thr, + "at %s light%s%s%s%s%s", + (const char *) funcname, + (const char *) ((flags & DUK_ACT_FLAG_STRICT) ? str_strict : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_TAILCALLED) ? str_tailcall : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_CONSTRUCT) ? str_construct : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_DIRECT_EVAL) ? str_directeval : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_PREVENT_YIELD) ? str_prevyield : str_empty)); } else if (DUK_HOBJECT_HAS_NATFUNC(h_func)) { - duk_push_sprintf(thr, "at %s (%s) native%s%s%s%s%s", - (const char *) funcname, - (const char *) filename, - (const char *) ((flags & DUK_ACT_FLAG_STRICT) ? str_strict : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_TAILCALLED) ? str_tailcall : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_CONSTRUCT) ? str_construct : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_DIRECT_EVAL) ? str_directeval : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_PREVENT_YIELD) ? str_prevyield : str_empty)); + duk_push_sprintf( + thr, + "at %s (%s) native%s%s%s%s%s", + (const char *) funcname, + (const char *) filename, + (const char *) ((flags & DUK_ACT_FLAG_STRICT) ? str_strict : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_TAILCALLED) ? str_tailcall : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_CONSTRUCT) ? str_construct : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_DIRECT_EVAL) ? str_directeval : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_PREVENT_YIELD) ? str_prevyield : str_empty)); } else { - duk_push_sprintf(thr, "at %s (%s:%lu)%s%s%s%s%s", - (const char *) funcname, - (const char *) filename, - (unsigned long) line, - (const char *) ((flags & DUK_ACT_FLAG_STRICT) ? str_strict : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_TAILCALLED) ? str_tailcall : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_CONSTRUCT) ? str_construct : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_DIRECT_EVAL) ? str_directeval : str_empty), - (const char *) ((flags & DUK_ACT_FLAG_PREVENT_YIELD) ? str_prevyield : str_empty)); + duk_push_sprintf( + thr, + "at %s (%s:%lu)%s%s%s%s%s", + (const char *) funcname, + (const char *) filename, + (unsigned long) line, + (const char *) ((flags & DUK_ACT_FLAG_STRICT) ? str_strict : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_TAILCALLED) ? str_tailcall : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_CONSTRUCT) ? str_construct : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_DIRECT_EVAL) ? str_directeval : str_empty), + (const char *) ((flags & DUK_ACT_FLAG_PREVENT_YIELD) ? str_prevyield : str_empty)); } - duk_replace(thr, -5); /* [ ... v1 v2 name filename str ] -> [ ... str v2 name filename ] */ - duk_pop_3(thr); /* -> [ ... str ] */ + duk_replace(thr, -5); /* [ ... v1 v2 name filename str ] -> [ ... str v2 name filename ] */ + duk_pop_3(thr); /* -> [ ... str ] */ } else if (t == DUK_TYPE_STRING) { const char *str_file; @@ -35039,10 +36066,12 @@ DUK_LOCAL duk_ret_t duk__error_getter_helper(duk_hthread *thr, duk_small_int_t o * safety issues. */ str_file = (const char *) duk_get_string(thr, -2); - duk_push_sprintf(thr, "at [anon] (%s:%ld) internal", - (const char *) (str_file ? str_file : "null"), (long) pc); - duk_replace(thr, -3); /* [ ... v1 v2 str ] -> [ ... str v2 ] */ - duk_pop(thr); /* -> [ ... str ] */ + duk_push_sprintf(thr, + "at [anon] (%s:%ld) internal", + (const char *) (str_file ? str_file : "null"), + (long) pc); + duk_replace(thr, -3); /* [ ... v1 v2 str ] -> [ ... str v2 ] */ + duk_pop(thr); /* -> [ ... str ] */ } else { /* unknown, ignore */ duk_pop_2(thr); @@ -35089,7 +36118,7 @@ DUK_INTERNAL duk_ret_t duk_bi_error_prototype_linenumber_getter(duk_hthread *thr return duk__error_getter_helper(thr, DUK__OUTPUT_TYPE_LINENUMBER); } -#else /* DUK_USE_TRACEBACKS */ +#else /* DUK_USE_TRACEBACKS */ /* * Traceback handling when tracebacks disabled. @@ -35120,7 +36149,7 @@ DUK_INTERNAL duk_ret_t duk_bi_error_prototype_linenumber_getter(duk_hthread *thr return 0; } -#endif /* DUK_USE_TRACEBACKS */ +#endif /* DUK_USE_TRACEBACKS */ DUK_LOCAL duk_ret_t duk__error_setter_helper(duk_hthread *thr, duk_small_uint_t stridx_key) { /* Attempt to write 'stack', 'fileName', 'lineNumber' works as if @@ -35130,7 +36159,7 @@ DUK_LOCAL duk_ret_t duk__error_setter_helper(duk_hthread *thr, duk_small_uint_t * See https://github.com/svaarala/duktape/issues/387. */ - DUK_ASSERT_TOP(thr, 1); /* fixed arg count: value */ + DUK_ASSERT_TOP(thr, 1); /* fixed arg count: value */ duk_push_this(thr); duk_push_hstring_stridx(thr, stridx_key); @@ -35138,13 +36167,13 @@ DUK_LOCAL duk_ret_t duk__error_setter_helper(duk_hthread *thr, duk_small_uint_t /* [ ... obj key value ] */ - DUK_DD(DUK_DDPRINT("error setter: %!T %!T %!T", - duk_get_tval(thr, -3), duk_get_tval(thr, -2), duk_get_tval(thr, -1))); + DUK_DD(DUK_DDPRINT("error setter: %!T %!T %!T", duk_get_tval(thr, -3), duk_get_tval(thr, -2), duk_get_tval(thr, -1))); - duk_def_prop(thr, -3, DUK_DEFPROP_HAVE_VALUE | - DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_WRITABLE | - DUK_DEFPROP_HAVE_ENUMERABLE | /*not enumerable*/ - DUK_DEFPROP_HAVE_CONFIGURABLE | DUK_DEFPROP_CONFIGURABLE); + duk_def_prop(thr, + -3, + DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_WRITABLE | + DUK_DEFPROP_HAVE_ENUMERABLE | /*not enumerable*/ + DUK_DEFPROP_HAVE_CONFIGURABLE | DUK_DEFPROP_CONFIGURABLE); return 0; } @@ -35191,7 +36220,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_constructor(duk_hthread *thr) { nargs = duk_get_top(thr); for (i = 0; i < nargs; i++) { - duk_to_string(thr, i); /* Rejects Symbols during coercion. */ + duk_to_string(thr, i); /* Rejects Symbols during coercion. */ } if (nargs == 0) { @@ -35201,7 +36230,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_constructor(duk_hthread *thr) { /* XXX: cover this with the generic >1 case? */ duk_push_hstring_empty(thr); } else { - duk_insert(thr, 0); /* [ arg1 ... argN-1 body] -> [body arg1 ... argN-1] */ + duk_insert(thr, 0); /* [ arg1 ... argN-1 body] -> [body arg1 ... argN-1] */ duk_push_literal(thr, ","); duk_insert(thr, 1); duk_join(thr, nargs - 1); @@ -35218,7 +36247,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_constructor(duk_hthread *thr) { duk_dup_1(thr); duk_push_literal(thr, "){"); duk_dup_0(thr); - duk_push_literal(thr, "\n}"); /* Newline is important to handle trailing // comment. */ + duk_push_literal(thr, "\n}"); /* Newline is important to handle trailing // comment. */ duk_concat(thr, 5); /* [ body formals source ] */ @@ -35228,8 +36257,8 @@ DUK_INTERNAL duk_ret_t duk_bi_function_constructor(duk_hthread *thr) { /* strictness is not inherited, intentional */ comp_flags = DUK_COMPILE_FUNCEXPR; - duk_push_hstring_stridx(thr, DUK_STRIDX_COMPILE); /* XXX: copy from caller? */ /* XXX: ignored now */ - h_sourcecode = duk_require_hstring(thr, -2); /* no symbol check needed; -2 is concat'd code */ + duk_push_hstring_stridx(thr, DUK_STRIDX_COMPILE); /* XXX: copy from caller? */ /* XXX: ignored now */ + h_sourcecode = duk_require_hstring(thr, -2); /* no symbol check needed; -2 is concat'd code */ duk_js_compile(thr, (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_sourcecode), (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_sourcecode), @@ -35258,7 +36287,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_constructor(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_FUNCTION_BUILTIN */ +#endif /* DUK_USE_FUNCTION_BUILTIN */ #if defined(DUK_USE_FUNCTION_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_function_prototype_to_string(duk_hthread *thr) { @@ -35324,7 +36353,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_to_string(duk_hthread *thr) { return 1; - type_error: +type_error: DUK_DCERROR_TYPE_INVALID_ARGS(thr); } #endif @@ -35366,7 +36395,7 @@ DUK_INTERNAL duk_ret_t duk_bi_reflect_construct(duk_hthread *thr) { */ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { duk_hboundfunc *h_bound; - duk_idx_t nargs; /* bound args, not counting 'this' binding */ + duk_idx_t nargs; /* bound args, not counting 'this' binding */ duk_idx_t bound_nargs; duk_int_t bound_len; duk_tval *tv_prevbound; @@ -35379,7 +36408,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { /* Vararg function, careful arg handling, e.g. thisArg may not * be present. */ - nargs = duk_get_top(thr) - 1; /* actual args, not counting 'this' binding */ + nargs = duk_get_top(thr) - 1; /* actual args, not counting 'this' binding */ if (nargs < 0) { nargs++; duk_push_undefined(thr); @@ -35474,7 +36503,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { DUK_HOBJECT_SET_PROTOTYPE_INIT_INCREF(thr, (duk_hobject *) h_bound, bound_proto); } - DUK_TVAL_INCREF(thr, &h_bound->target); /* old values undefined, no decref needed */ + DUK_TVAL_INCREF(thr, &h_bound->target); /* old values undefined, no decref needed */ DUK_TVAL_INCREF(thr, &h_bound->this_binding); bound_nargs = n_prevbound + nargs; @@ -35499,7 +36528,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { * For lightfuncs, simply read the virtual property. */ duk_get_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH); - bound_len = duk_get_int(thr, -1); /* ES2015: no coercion */ + bound_len = duk_get_int(thr, -1); /* ES2015: no coercion */ if (bound_len < nargs) { bound_len = 0; } else { @@ -35513,8 +36542,8 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { tv_tmp = thr->valstack_top++; DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(tv_tmp)); DUK_ASSERT(!DUK_TVAL_NEEDS_REFCOUNT_UPDATE(tv_tmp)); - DUK_TVAL_SET_U32(tv_tmp, (duk_uint32_t) bound_len); /* in-place update, fastint */ - duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_C); /* attrs in E6 Section 9.2.4 */ + DUK_TVAL_SET_U32(tv_tmp, (duk_uint32_t) bound_len); /* in-place update, fastint */ + duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_C); /* attrs in E6 Section 9.2.4 */ /* XXX: could these be virtual? */ /* Caller and arguments must use the same thrower, [[ThrowTypeError]]. */ @@ -35522,7 +36551,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { duk_xdef_prop_stridx_thrower(thr, -1, DUK_STRIDX_LC_ARGUMENTS); /* Function name and fileName (non-standard). */ - duk_push_literal(thr, "bound "); /* ES2015 19.2.3.2. */ + duk_push_literal(thr, "bound "); /* ES2015 19.2.3.2. */ duk_get_prop_stridx(thr, -3, DUK_STRIDX_NAME); if (!duk_is_string_notsymbol(thr, -1)) { /* ES2015 has requirement to check that .name of target is a string @@ -35543,7 +36572,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_bind(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_FUNCTION_BUILTIN */ +#endif /* DUK_USE_FUNCTION_BUILTIN */ /* %NativeFunctionPrototype% .length getter. */ DUK_INTERNAL duk_ret_t duk_bi_native_function_length(duk_hthread *thr) { @@ -35574,7 +36603,7 @@ DUK_INTERNAL duk_ret_t duk_bi_native_function_length(duk_hthread *thr) { } return 1; - fail_type: +fail_type: DUK_DCERROR_TYPE_INVALID_ARGS(thr); } @@ -35603,7 +36632,7 @@ DUK_INTERNAL duk_ret_t duk_bi_native_function_name(duk_hthread *thr) { } return 1; - fail_type: +fail_type: DUK_DCERROR_TYPE_INVALID_ARGS(thr); } @@ -35616,7 +36645,7 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_hasinstance(duk_hthread *thr) { duk_push_boolean(thr, ret); return 1; } -#endif /* DUK_USE_SYMBOL_BUILTIN */ +#endif /* DUK_USE_SYMBOL_BUILTIN */ /* * Global object built-ins */ @@ -35635,73 +36664,71 @@ DUK_INTERNAL duk_ret_t duk_bi_function_prototype_hasinstance(duk_hthread *thr) { /* Macros for creating and checking bitmasks for character encoding. * Bit number is a bit counterintuitive, but minimizes code size. */ -#define DUK__MKBITS(a,b,c,d,e,f,g,h) ((duk_uint8_t) ( \ - ((a) << 0) | ((b) << 1) | ((c) << 2) | ((d) << 3) | \ - ((e) << 4) | ((f) << 5) | ((g) << 6) | ((h) << 7) \ - )) -#define DUK__CHECK_BITMASK(table,cp) ((table)[(cp) >> 3] & (1 << ((cp) & 0x07))) +#define DUK__MKBITS(a, b, c, d, e, f, g, h) \ + ((duk_uint8_t) (((a) << 0) | ((b) << 1) | ((c) << 2) | ((d) << 3) | ((e) << 4) | ((f) << 5) | ((g) << 6) | ((h) << 7))) +#define DUK__CHECK_BITMASK(table, cp) ((table)[(cp) >> 3] & (1 << ((cp) &0x07))) /* E5.1 Section 15.1.3.3: uriReserved + uriUnescaped + '#' */ DUK_LOCAL const duk_uint8_t duk__encode_uriunescaped_table[16] = { - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ - DUK__MKBITS(0, 1, 0, 1, 1, 0, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x20-0x2f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 0, 1, 0, 1), /* 0x30-0x3f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x40-0x4f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 1), /* 0x50-0x5f */ - DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x60-0x6f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 1, 0), /* 0x70-0x7f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ + DUK__MKBITS(0, 1, 0, 1, 1, 0, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x20-0x2f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 0, 1, 0, 1), /* 0x30-0x3f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x40-0x4f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 1), /* 0x50-0x5f */ + DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x60-0x6f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 1, 0), /* 0x70-0x7f */ }; /* E5.1 Section 15.1.3.4: uriUnescaped */ DUK_LOCAL const duk_uint8_t duk__encode_uricomponent_unescaped_table[16] = { - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ - DUK__MKBITS(0, 1, 0, 0, 0, 0, 0, 1), DUK__MKBITS(1, 1, 1, 0, 0, 1, 1, 0), /* 0x20-0x2f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 0, 0, 0, 0, 0, 0), /* 0x30-0x3f */ - DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x40-0x4f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 1), /* 0x50-0x5f */ - DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x60-0x6f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 1, 0), /* 0x70-0x7f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ + DUK__MKBITS(0, 1, 0, 0, 0, 0, 0, 1), DUK__MKBITS(1, 1, 1, 0, 0, 1, 1, 0), /* 0x20-0x2f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 0, 0, 0, 0, 0, 0), /* 0x30-0x3f */ + DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x40-0x4f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 1), /* 0x50-0x5f */ + DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x60-0x6f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 1, 0), /* 0x70-0x7f */ }; /* E5.1 Section 15.1.3.1: uriReserved + '#' */ DUK_LOCAL const duk_uint8_t duk__decode_uri_reserved_table[16] = { - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ - DUK__MKBITS(0, 0, 0, 1, 1, 0, 1, 0), DUK__MKBITS(0, 0, 0, 1, 1, 0, 0, 1), /* 0x20-0x2f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 1, 1, 0, 1, 0, 1), /* 0x30-0x3f */ - DUK__MKBITS(1, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x40-0x4f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x50-0x5f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x60-0x6f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x70-0x7f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ + DUK__MKBITS(0, 0, 0, 1, 1, 0, 1, 0), DUK__MKBITS(0, 0, 0, 1, 1, 0, 0, 1), /* 0x20-0x2f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 1, 1, 0, 1, 0, 1), /* 0x30-0x3f */ + DUK__MKBITS(1, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x40-0x4f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x50-0x5f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x60-0x6f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x70-0x7f */ }; /* E5.1 Section 15.1.3.2: empty */ DUK_LOCAL const duk_uint8_t duk__decode_uri_component_reserved_table[16] = { - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x20-0x2f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x30-0x3f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x40-0x4f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x50-0x5f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x60-0x6f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x70-0x7f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x20-0x2f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x30-0x3f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x40-0x4f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x50-0x5f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x60-0x6f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x70-0x7f */ }; #if defined(DUK_USE_SECTION_B) /* E5.1 Section B.2.2, step 7. */ DUK_LOCAL const duk_uint8_t duk__escape_unescaped_table[16] = { - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ - DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 1, 1, 0, 1, 1, 1), /* 0x20-0x2f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 0, 0, 0, 0, 0, 0), /* 0x30-0x3f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x40-0x4f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 1), /* 0x50-0x5f */ - DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x60-0x6f */ - DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 0) /* 0x70-0x7f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x00-0x0f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), /* 0x10-0x1f */ + DUK__MKBITS(0, 0, 0, 0, 0, 0, 0, 0), DUK__MKBITS(0, 0, 1, 1, 0, 1, 1, 1), /* 0x20-0x2f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 0, 0, 0, 0, 0, 0), /* 0x30-0x3f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x40-0x4f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 1), /* 0x50-0x5f */ + DUK__MKBITS(0, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), /* 0x60-0x6f */ + DUK__MKBITS(1, 1, 1, 1, 1, 1, 1, 1), DUK__MKBITS(1, 1, 1, 0, 0, 0, 0, 0) /* 0x70-0x7f */ }; -#endif /* DUK_USE_SECTION_B */ +#endif /* DUK_USE_SECTION_B */ typedef struct { duk_hthread *thr; @@ -35742,7 +36769,7 @@ DUK_LOCAL int duk__transform_helper(duk_hthread *thr, duk__transform_callback ca tfm_ctx->h_str = duk_to_hstring(thr, 0); DUK_ASSERT(tfm_ctx->h_str != NULL); - DUK_BW_INIT_PUSHBUF(thr, &tfm_ctx->bw, DUK_HSTRING_GET_BYTELEN(tfm_ctx->h_str)); /* initial size guess */ + DUK_BW_INIT_PUSHBUF(thr, &tfm_ctx->bw, DUK_HSTRING_GET_BYTELEN(tfm_ctx->h_str)); /* initial size guess */ tfm_ctx->p_start = DUK_HSTRING_GET_DATA(tfm_ctx->h_str); tfm_ctx->p_end = tfm_ctx->p_start + DUK_HSTRING_GET_BYTELEN(tfm_ctx->h_str); @@ -35755,7 +36782,7 @@ DUK_LOCAL int duk__transform_helper(duk_hthread *thr, duk__transform_callback ca DUK_BW_COMPACT(thr, &tfm_ctx->bw); - (void) duk_buffer_to_string(thr, -1); /* Safe if transform is safe. */ + (void) duk_buffer_to_string(thr, -1); /* Safe if transform is safe. */ return 1; } @@ -35781,7 +36808,11 @@ DUK_LOCAL void duk__transform_callback_encode_uri(duk__transform_context *tfm_ct goto uri_error; } else if (cp >= 0xd800L && cp <= 0xdbffL) { /* Needs lookahead */ - if (duk_unicode_decode_xutf8(tfm_ctx->thr, &tfm_ctx->p, tfm_ctx->p_start, tfm_ctx->p_end, (duk_ucodepoint_t *) &cp2) == 0) { + if (duk_unicode_decode_xutf8(tfm_ctx->thr, + &tfm_ctx->p, + tfm_ctx->p_start, + tfm_ctx->p_end, + (duk_ucodepoint_t *) &cp2) == 0) { goto uri_error; } if (!(cp2 >= 0xdc00L && cp2 <= 0xdfffL)) { @@ -35812,12 +36843,12 @@ DUK_LOCAL void duk__transform_callback_encode_uri(duk__transform_context *tfm_ct &tfm_ctx->bw, DUK_ASC_PERCENT, (duk_uint8_t) duk_uc_nybbles[t >> 4], - (duk_uint8_t) duk_uc_nybbles[t & 0x0f]); + (duk_uint8_t) duk_uc_nybbles[t & 0x0f]); } return; - uri_error: +uri_error: DUK_ERROR_URI(tfm_ctx->thr, DUK_STR_INVALID_INPUT); DUK_WO_NORETURN(return;); } @@ -35826,7 +36857,7 @@ DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ct const duk_uint8_t *reserved_table = (const duk_uint8_t *) udata; duk_small_uint_t utf8_blen; duk_codepoint_t min_cp; - duk_small_int_t t; /* must be signed */ + duk_small_int_t t; /* must be signed */ duk_small_uint_t i; /* Maximum write size: XUTF8 path writes max DUK_UNICODE_MAX_XUTF8_LENGTH, @@ -35834,12 +36865,12 @@ DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ct */ DUK_BW_ENSURE(tfm_ctx->thr, &tfm_ctx->bw, - (DUK_UNICODE_MAX_XUTF8_LENGTH >= 2 * DUK_UNICODE_MAX_CESU8_BMP_LENGTH ? - DUK_UNICODE_MAX_XUTF8_LENGTH : DUK_UNICODE_MAX_CESU8_BMP_LENGTH)); + (DUK_UNICODE_MAX_XUTF8_LENGTH >= 2 * DUK_UNICODE_MAX_CESU8_BMP_LENGTH ? DUK_UNICODE_MAX_XUTF8_LENGTH : + DUK_UNICODE_MAX_CESU8_BMP_LENGTH)); if (cp == (duk_codepoint_t) '%') { const duk_uint8_t *p = tfm_ctx->p; - duk_size_t left = (duk_size_t) (tfm_ctx->p_end - p); /* bytes left */ + duk_size_t left = (duk_size_t) (tfm_ctx->p_end - p); /* bytes left */ DUK_DDD(DUK_DDDPRINT("percent encoding, left=%ld", (long) left)); @@ -35857,11 +36888,7 @@ DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ct if (DUK__CHECK_BITMASK(reserved_table, t)) { /* decode '%xx' to '%xx' if decoded char in reserved set */ DUK_ASSERT(tfm_ctx->p - 1 >= tfm_ctx->p_start); - DUK_BW_WRITE_RAW_U8_3(tfm_ctx->thr, - &tfm_ctx->bw, - DUK_ASC_PERCENT, - p[0], - p[1]); + DUK_BW_WRITE_RAW_U8_3(tfm_ctx->thr, &tfm_ctx->bw, DUK_ASC_PERCENT, p[0], p[1]); } else { DUK_BW_WRITE_RAW_U8(tfm_ctx->thr, &tfm_ctx->bw, (duk_uint8_t) t); } @@ -35912,7 +36939,10 @@ DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ct /* p points to digit part ('%xy', p points to 'x') */ t = duk__decode_hex_escape(p, 2); DUK_DDD(DUK_DDDPRINT("i=%ld utf8_blen=%ld cp=%ld t=0x%02lx", - (long) i, (long) utf8_blen, (long) cp, (unsigned long) t)); + (long) i, + (long) utf8_blen, + (long) cp, + (unsigned long) t)); if (t < 0) { goto uri_error; } @@ -35922,7 +36952,7 @@ DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ct cp = (cp << 6) + (t & 0x3f); p += 3; } - p--; /* p overshoots */ + p--; /* p overshoots */ tfm_ctx->p = p; DUK_DDD(DUK_DDDPRINT("final cp=%ld, min_cp=%ld", (long) cp, (long) min_cp)); @@ -35956,7 +36986,7 @@ DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ct } return; - uri_error: +uri_error: DUK_ERROR_URI(tfm_ctx->thr, DUK_STR_INVALID_INPUT); DUK_WO_NORETURN(return;); } @@ -35997,7 +37027,7 @@ DUK_LOCAL void duk__transform_callback_escape(duk__transform_context *tfm_ctx, c return; - esc_error: +esc_error: DUK_ERROR_TYPE(tfm_ctx->thr, DUK_STR_INVALID_INPUT); DUK_WO_NORETURN(return;); } @@ -36009,14 +37039,12 @@ DUK_LOCAL void duk__transform_callback_unescape(duk__transform_context *tfm_ctx, if (cp == (duk_codepoint_t) '%') { const duk_uint8_t *p = tfm_ctx->p; - duk_size_t left = (duk_size_t) (tfm_ctx->p_end - p); /* bytes left */ + duk_size_t left = (duk_size_t) (tfm_ctx->p_end - p); /* bytes left */ - if (left >= 5 && p[0] == 'u' && - ((t = duk__decode_hex_escape(p + 1, 4)) >= 0)) { + if (left >= 5 && p[0] == 'u' && ((t = duk__decode_hex_escape(p + 1, 4)) >= 0)) { cp = (duk_codepoint_t) t; tfm_ctx->p += 5; - } else if (left >= 2 && - ((t = duk__decode_hex_escape(p, 2)) >= 0)) { + } else if (left >= 2 && ((t = duk__decode_hex_escape(p, 2)) >= 0)) { cp = (duk_codepoint_t) t; tfm_ctx->p += 2; } @@ -36024,7 +37052,7 @@ DUK_LOCAL void duk__transform_callback_unescape(duk__transform_context *tfm_ctx, DUK_BW_WRITE_ENSURE_XUTF8(tfm_ctx->thr, &tfm_ctx->bw, cp); } -#endif /* DUK_USE_SECTION_B */ +#endif /* DUK_USE_SECTION_B */ /* * Eval @@ -36049,11 +37077,11 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_eval(duk_hthread *thr) { duk_int_t level = -2; duk_small_uint_t call_flags; - DUK_ASSERT(duk_get_top(thr) == 1 || duk_get_top(thr) == 2); /* 2 when called by debugger */ - DUK_ASSERT(thr->callstack_top >= 1); /* at least this function exists */ + DUK_ASSERT(duk_get_top(thr) == 1 || duk_get_top(thr) == 2); /* 2 when called by debugger */ + DUK_ASSERT(thr->callstack_top >= 1); /* at least this function exists */ DUK_ASSERT(thr->callstack_curr != NULL); DUK_ASSERT((thr->callstack_curr->flags & DUK_ACT_FLAG_DIRECT_EVAL) == 0 || /* indirect eval */ - (thr->callstack_top >= 2)); /* if direct eval, calling activation must exist */ + (thr->callstack_top >= 2)); /* if direct eval, calling activation must exist */ /* * callstack_top - 1 --> this function @@ -36066,32 +37094,31 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_eval(duk_hthread *thr) { h = duk_get_hstring_notsymbol(thr, 0); if (!h) { /* Symbol must be returned as is, like any non-string values. */ - return 1; /* return arg as-is */ + return 1; /* return arg as-is */ } #if defined(DUK_USE_DEBUGGER_SUPPORT) /* NOTE: level is used only by the debugger and should never be present * for an ECMAScript eval(). */ - DUK_ASSERT(level == -2); /* by default, use caller's environment */ + DUK_ASSERT(level == -2); /* by default, use caller's environment */ if (duk_get_top(thr) >= 2 && duk_is_number(thr, 1)) { level = duk_get_int(thr, 1); } - DUK_ASSERT(level <= -2); /* This is guaranteed by debugger code. */ + DUK_ASSERT(level <= -2); /* This is guaranteed by debugger code. */ #endif /* [ source ] */ comp_flags = DUK_COMPILE_EVAL; - act_eval = thr->callstack_curr; /* this function */ + act_eval = thr->callstack_curr; /* this function */ DUK_ASSERT(act_eval != NULL); act_caller = duk_hthread_get_activation_for_level(thr, level); if (act_caller != NULL) { /* Have a calling activation, check for direct eval (otherwise * assume indirect eval. */ - if ((act_caller->flags & DUK_ACT_FLAG_STRICT) && - (act_eval->flags & DUK_ACT_FLAG_DIRECT_EVAL)) { + if ((act_caller->flags & DUK_ACT_FLAG_STRICT) && (act_eval->flags & DUK_ACT_FLAG_DIRECT_EVAL)) { /* Only direct eval inherits strictness from calling code * (E5.1 Section 10.1.1). */ @@ -36101,11 +37128,8 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_eval(duk_hthread *thr) { DUK_ASSERT((act_eval->flags & DUK_ACT_FLAG_DIRECT_EVAL) == 0); } - duk_push_hstring_stridx(thr, DUK_STRIDX_INPUT); /* XXX: copy from caller? */ - duk_js_compile(thr, - (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h), - (duk_size_t) DUK_HSTRING_GET_BYTELEN(h), - comp_flags); + duk_push_hstring_stridx(thr, DUK_STRIDX_INPUT); /* XXX: copy from caller? */ + duk_js_compile(thr, (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h), (duk_size_t) DUK_HSTRING_GET_BYTELEN(h), comp_flags); func = (duk_hcompfunc *) duk_known_hobject(thr, -1); DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC((duk_hobject *) func)); @@ -36138,9 +37162,9 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_eval(duk_hthread *thr) { act_lex_env = act_caller->lex_env; - new_env = duk_hdecenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); + new_env = + duk_hdecenv_alloc(thr, + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); DUK_ASSERT(new_env != NULL); duk_push_hobject(thr, (duk_hobject *) new_env); @@ -36152,7 +37176,7 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_eval(duk_hthread *thr) { outer_lex_env = (duk_hobject *) new_env; outer_var_env = (duk_hobject *) new_env; - duk_insert(thr, 0); /* stash to bottom of value stack to keep new_env reachable for duration of eval */ + duk_insert(thr, 0); /* stash to bottom of value stack to keep new_env reachable for duration of eval */ /* compiler's responsibility */ DUK_ASSERT(DUK_HOBJECT_HAS_NEWENV((duk_hobject *) func)); @@ -36188,7 +37212,8 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_eval(duk_hthread *thr) { duk_tval *tv; DUK_ASSERT(thr->callstack_top >= 2); DUK_ASSERT(act_caller != NULL); - tv = (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + act_caller->bottom_byteoff - sizeof(duk_tval)); /* this is just beneath bottom */ + tv = (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + act_caller->bottom_byteoff - + sizeof(duk_tval)); /* this is just beneath bottom */ DUK_ASSERT(tv >= thr->valstack); duk_push_tval(thr, tv); } @@ -36227,19 +37252,15 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_parse_int(duk_hthread *thr) { duk_small_uint_t s2n_flags; DUK_ASSERT_TOP(thr, 2); - duk_to_string(thr, 0); /* Reject symbols. */ + duk_to_string(thr, 0); /* Reject symbols. */ radix = duk_to_int32(thr, 1); /* While parseInt() recognizes 0xdeadbeef, it doesn't recognize * ES2015 0o123 or 0b10001. */ - s2n_flags = DUK_S2N_FLAG_TRIM_WHITE | - DUK_S2N_FLAG_ALLOW_GARBAGE | - DUK_S2N_FLAG_ALLOW_PLUS | - DUK_S2N_FLAG_ALLOW_MINUS | - DUK_S2N_FLAG_ALLOW_LEADING_ZERO | - DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT; + s2n_flags = DUK_S2N_FLAG_TRIM_WHITE | DUK_S2N_FLAG_ALLOW_GARBAGE | DUK_S2N_FLAG_ALLOW_PLUS | DUK_S2N_FLAG_ALLOW_MINUS | + DUK_S2N_FLAG_ALLOW_LEADING_ZERO | DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT; /* Specification stripPrefix maps to DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT. * @@ -36263,35 +37284,28 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_parse_int(duk_hthread *thr) { duk_numconv_parse(thr, (duk_small_int_t) radix, s2n_flags); return 1; - ret_nan: +ret_nan: duk_push_nan(thr); return 1; } -#endif /* DUK_USE_GLOBAL_BUILTIN */ +#endif /* DUK_USE_GLOBAL_BUILTIN */ #if defined(DUK_USE_GLOBAL_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_global_object_parse_float(duk_hthread *thr) { duk_small_uint_t s2n_flags; DUK_ASSERT_TOP(thr, 1); - duk_to_string(thr, 0); /* Reject symbols. */ + duk_to_string(thr, 0); /* Reject symbols. */ /* XXX: check flags */ - s2n_flags = DUK_S2N_FLAG_TRIM_WHITE | - DUK_S2N_FLAG_ALLOW_EXP | - DUK_S2N_FLAG_ALLOW_GARBAGE | - DUK_S2N_FLAG_ALLOW_PLUS | - DUK_S2N_FLAG_ALLOW_MINUS | - DUK_S2N_FLAG_ALLOW_INF | - DUK_S2N_FLAG_ALLOW_FRAC | - DUK_S2N_FLAG_ALLOW_NAKED_FRAC | - DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | - DUK_S2N_FLAG_ALLOW_LEADING_ZERO; + s2n_flags = DUK_S2N_FLAG_TRIM_WHITE | DUK_S2N_FLAG_ALLOW_EXP | DUK_S2N_FLAG_ALLOW_GARBAGE | DUK_S2N_FLAG_ALLOW_PLUS | + DUK_S2N_FLAG_ALLOW_MINUS | DUK_S2N_FLAG_ALLOW_INF | DUK_S2N_FLAG_ALLOW_FRAC | DUK_S2N_FLAG_ALLOW_NAKED_FRAC | + DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | DUK_S2N_FLAG_ALLOW_LEADING_ZERO; duk_numconv_parse(thr, 10 /*radix*/, s2n_flags); return 1; } -#endif /* DUK_USE_GLOBAL_BUILTIN */ +#endif /* DUK_USE_GLOBAL_BUILTIN */ /* * Number checkers @@ -36303,7 +37317,7 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_is_nan(duk_hthread *thr) { duk_push_boolean(thr, (duk_bool_t) DUK_ISNAN(d)); return 1; } -#endif /* DUK_USE_GLOBAL_BUILTIN */ +#endif /* DUK_USE_GLOBAL_BUILTIN */ #if defined(DUK_USE_GLOBAL_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_global_object_is_finite(duk_hthread *thr) { @@ -36311,7 +37325,7 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_is_finite(duk_hthread *thr) { duk_push_boolean(thr, (duk_bool_t) DUK_ISFINITE(d)); return 1; } -#endif /* DUK_USE_GLOBAL_BUILTIN */ +#endif /* DUK_USE_GLOBAL_BUILTIN */ /* * URI handling @@ -36323,7 +37337,9 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_decode_uri(duk_hthread *thr) { } DUK_INTERNAL duk_ret_t duk_bi_global_object_decode_uri_component(duk_hthread *thr) { - return duk__transform_helper(thr, duk__transform_callback_decode_uri, (const void *) duk__decode_uri_component_reserved_table); + return duk__transform_helper(thr, + duk__transform_callback_decode_uri, + (const void *) duk__decode_uri_component_reserved_table); } DUK_INTERNAL duk_ret_t duk_bi_global_object_encode_uri(duk_hthread *thr) { @@ -36331,7 +37347,9 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_encode_uri(duk_hthread *thr) { } DUK_INTERNAL duk_ret_t duk_bi_global_object_encode_uri_component(duk_hthread *thr) { - return duk__transform_helper(thr, duk__transform_callback_encode_uri, (const void *) duk__encode_uricomponent_unescaped_table); + return duk__transform_helper(thr, + duk__transform_callback_encode_uri, + (const void *) duk__encode_uricomponent_unescaped_table); } #if defined(DUK_USE_SECTION_B) @@ -36342,8 +37360,8 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_escape(duk_hthread *thr) { DUK_INTERNAL duk_ret_t duk_bi_global_object_unescape(duk_hthread *thr) { return duk__transform_helper(thr, duk__transform_callback_unescape, (const void *) NULL); } -#endif /* DUK_USE_SECTION_B */ -#endif /* DUK_USE_GLOBAL_BUILTIN */ +#endif /* DUK_USE_SECTION_B */ +#endif /* DUK_USE_GLOBAL_BUILTIN */ /* automatic undefs */ #undef DUK__CHECK_BITMASK @@ -36372,11 +37390,11 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_unescape(duk_hthread *thr) { * Local defines and forward declarations. */ -#define DUK__JSON_DECSTR_BUFSIZE 128 -#define DUK__JSON_DECSTR_CHUNKSIZE 64 -#define DUK__JSON_ENCSTR_CHUNKSIZE 64 +#define DUK__JSON_DECSTR_BUFSIZE 128 +#define DUK__JSON_DECSTR_CHUNKSIZE 64 +#define DUK__JSON_ENCSTR_CHUNKSIZE 64 #define DUK__JSON_STRINGIFY_BUFSIZE 128 -#define DUK__JSON_MAX_ESC_LEN 10 /* '\Udeadbeef' */ +#define DUK__JSON_MAX_ESC_LEN 10 /* '\Udeadbeef' */ DUK_LOCAL_DECL void duk__json_dec_syntax_error(duk_json_dec_ctx *js_ctx); DUK_LOCAL_DECL void duk__json_dec_eat_white(duk_json_dec_ctx *js_ctx); @@ -36446,103 +37464,88 @@ DUK_LOCAL const duk_uint8_t duk__json_quotestr_lookup[256] = { * 0xa0 ... 0xff: backslash + one char */ - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xe2, 0xf4, 0xee, 0x80, 0xe6, 0xf2, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x20, 0x21, 0xa2, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0xdc, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xe2, 0xf4, 0xee, 0x80, 0xe6, 0xf2, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x20, 0x21, 0xa2, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0xdc, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, + 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81 }; -#else /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ -DUK_LOCAL const duk_uint8_t duk__json_quotestr_esc[14] = { - DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, - DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, - DUK_ASC_LC_B, DUK_ASC_LC_T, DUK_ASC_LC_N, DUK_ASC_NUL, - DUK_ASC_LC_F, DUK_ASC_LC_R -}; -#endif /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ +#else /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ +DUK_LOCAL const duk_uint8_t duk__json_quotestr_esc[14] = { DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, + DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_NUL, DUK_ASC_LC_B, DUK_ASC_LC_T, + DUK_ASC_LC_N, DUK_ASC_NUL, DUK_ASC_LC_F, DUK_ASC_LC_R }; +#endif /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ #if defined(DUK_USE_JSON_DECSTRING_FASTPATH) DUK_LOCAL const duk_uint8_t duk__json_decstr_lookup[256] = { /* 0x00: slow path * other: as is */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x21, 0x00, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x00, 0x5d, 0x5e, 0x5f, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, - 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, - 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, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x00, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, + 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x00, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, + 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, + 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, + 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 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 }; -#endif /* DUK_USE_JSON_DECSTRING_FASTPATH */ +#endif /* DUK_USE_JSON_DECSTRING_FASTPATH */ #if defined(DUK_USE_JSON_EATWHITE_FASTPATH) DUK_LOCAL const duk_uint8_t duk__json_eatwhite_lookup[256] = { /* 0x00: finish (non-white) * 0x01: continue */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#endif /* DUK_USE_JSON_EATWHITE_FASTPATH */ +#endif /* DUK_USE_JSON_EATWHITE_FASTPATH */ #if defined(DUK_USE_JSON_DECNUMBER_FASTPATH) DUK_LOCAL const duk_uint8_t duk__json_decnumber_lookup[256] = { /* 0x00: finish (not part of number) * 0x01: continue */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#endif /* DUK_USE_JSON_DECNUMBER_FASTPATH */ +#endif /* DUK_USE_JSON_DECNUMBER_FASTPATH */ /* * Parsing implementation. @@ -36562,8 +37565,7 @@ DUK_LOCAL void duk__json_dec_syntax_error(duk_json_dec_ctx *js_ctx) { * hidden, unfortunately, but we'll have an offset which * is often quite enough. */ - DUK_ERROR_FMT1(js_ctx->thr, DUK_ERR_SYNTAX_ERROR, DUK_STR_FMT_INVALID_JSON, - (long) (js_ctx->p - js_ctx->p_start)); + DUK_ERROR_FMT1(js_ctx->thr, DUK_ERR_SYNTAX_ERROR, DUK_STR_FMT_INVALID_JSON, (long) (js_ctx->p - js_ctx->p_start)); DUK_WO_NORETURN(return;); } @@ -36580,18 +37582,18 @@ DUK_LOCAL void duk__json_dec_eat_white(duk_json_dec_ctx *js_ctx) { /* This fast path is pretty marginal in practice. * XXX: candidate for removal. */ - DUK_ASSERT(duk__json_eatwhite_lookup[0x00] == 0x00); /* end-of-input breaks */ + DUK_ASSERT(duk__json_eatwhite_lookup[0x00] == 0x00); /* end-of-input breaks */ if (duk__json_eatwhite_lookup[t] == 0) { break; } -#else /* DUK_USE_JSON_EATWHITE_FASTPATH */ +#else /* DUK_USE_JSON_EATWHITE_FASTPATH */ if (!(t == 0x20 || t == 0x0a || t == 0x0d || t == 0x09)) { /* NUL also comes here. Comparison order matters, 0x20 * is most common whitespace. */ break; } -#endif /* DUK_USE_JSON_EATWHITE_FASTPATH */ +#endif /* DUK_USE_JSON_EATWHITE_FASTPATH */ p++; } js_ctx->p = p; @@ -36625,8 +37627,7 @@ DUK_LOCAL duk_uint_fast32_t duk__json_dec_decode_hex_escape(duk_json_dec_ctx *js /* XXX: share helper from lexer; duk_lexer.c / hexval(). */ x = duk__json_dec_get(js_ctx); - DUK_DDD(DUK_DDDPRINT("decode_hex_escape: i=%ld, n=%ld, res=%ld, x=%ld", - (long) i, (long) n, (long) res, (long) x)); + DUK_DDD(DUK_DDDPRINT("decode_hex_escape: i=%ld, n=%ld, res=%ld, x=%ld", (long) i, (long) n, (long) res, (long) x)); /* x == 0x00 (EOF) causes syntax_error */ DUK_ASSERT(duk_hex_dectab[0] == -1); @@ -36642,7 +37643,7 @@ DUK_LOCAL duk_uint_fast32_t duk__json_dec_decode_hex_escape(duk_json_dec_ctx *js DUK_DDD(DUK_DDDPRINT("final hex decoded value: %ld", (long) res)); return res; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); return 0; @@ -36663,7 +37664,7 @@ DUK_LOCAL void duk__json_dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint DUK_ASSERT(h != NULL); p = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h) + 1; - DUK_ASSERT(*(js_ctx->p - 1) == *(p - 1)); /* first character has been matched */ + DUK_ASSERT(*(js_ctx->p - 1) == *(p - 1)); /* first character has been matched */ for (;;) { x = *p; @@ -36680,7 +37681,7 @@ DUK_LOCAL void duk__json_dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } @@ -36694,14 +37695,27 @@ DUK_LOCAL duk_small_int_t duk__json_dec_string_escape(duk_json_dec_ctx *js_ctx, */ cp = (duk_uint_fast32_t) duk__json_dec_get(js_ctx); switch (cp) { - case DUK_ASC_BACKSLASH: break; - case DUK_ASC_DOUBLEQUOTE: break; - case DUK_ASC_SLASH: break; - case DUK_ASC_LC_T: cp = 0x09; break; - case DUK_ASC_LC_N: cp = 0x0a; break; - case DUK_ASC_LC_R: cp = 0x0d; break; - case DUK_ASC_LC_F: cp = 0x0c; break; - case DUK_ASC_LC_B: cp = 0x08; break; + case DUK_ASC_BACKSLASH: + break; + case DUK_ASC_DOUBLEQUOTE: + break; + case DUK_ASC_SLASH: + break; + case DUK_ASC_LC_T: + cp = 0x09; + break; + case DUK_ASC_LC_N: + cp = 0x0a; + break; + case DUK_ASC_LC_R: + cp = 0x0d; + break; + case DUK_ASC_LC_F: + cp = 0x0c; + break; + case DUK_ASC_LC_B: + cp = 0x08; + break; case DUK_ASC_LC_U: { cp = duk__json_dec_decode_hex_escape(js_ctx, 4); break; @@ -36711,7 +37725,7 @@ DUK_LOCAL duk_small_int_t duk__json_dec_string_escape(duk_json_dec_ctx *js_ctx, if (js_ctx->flag_ext_custom) { cp = duk__json_dec_decode_hex_escape(js_ctx, 8); } else { - return 1; /* syntax error */ + return 1; /* syntax error */ } break; } @@ -36719,14 +37733,14 @@ DUK_LOCAL duk_small_int_t duk__json_dec_string_escape(duk_json_dec_ctx *js_ctx, if (js_ctx->flag_ext_custom) { cp = duk__json_dec_decode_hex_escape(js_ctx, 2); } else { - return 1; /* syntax error */ + return 1; /* syntax error */ } break; } -#endif /* DUK_USE_JX */ +#endif /* DUK_USE_JX */ default: /* catches EOF (0x00) */ - return 1; /* syntax error */ + return 1; /* syntax error */ } DUK_RAW_WRITEINC_XUTF8(*ext_p, cp); @@ -36768,7 +37782,7 @@ DUK_LOCAL void duk__json_dec_string(duk_json_dec_ctx *js_ctx) { /* Ensure space for 1:1 output plus one escape. */ q = DUK_BW_ENSURE_RAW(js_ctx->thr, bw, safe + DUK_UNICODE_MAX_XUTF8_LENGTH, q); - p = js_ctx->p; /* temp copy, write back for next loop */ + p = js_ctx->p; /* temp copy, write back for next loop */ for (;;) { if (safe == 0) { js_ctx->p = p; @@ -36803,8 +37817,8 @@ DUK_LOCAL void duk__json_dec_string(duk_json_dec_ctx *js_ctx) { } } } - found_quote: -#else /* DUK_USE_JSON_DECSTRING_FASTPATH */ +found_quote: +#else /* DUK_USE_JSON_DECSTRING_FASTPATH */ for (;;) { duk_uint8_t x; @@ -36825,16 +37839,16 @@ DUK_LOCAL void duk__json_dec_string(duk_json_dec_ctx *js_ctx) { *q++ = (duk_uint8_t) x; } } -#endif /* DUK_USE_JSON_DECSTRING_FASTPATH */ +#endif /* DUK_USE_JSON_DECSTRING_FASTPATH */ DUK_BW_SETPTR_AND_COMPACT(js_ctx->thr, bw, q); - (void) duk_buffer_to_string(thr, -1); /* Safe if input string is safe. */ + (void) duk_buffer_to_string(thr, -1); /* Safe if input string is safe. */ /* [ ... str ] */ return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } @@ -36850,7 +37864,7 @@ DUK_LOCAL void duk__json_dec_plain_string(duk_json_dec_ctx *js_ctx) { /* Caller has already eaten the first char so backtrack one byte. */ - js_ctx->p--; /* safe */ + js_ctx->p--; /* safe */ p = js_ctx->p; /* Here again we parse bytes, and non-ASCII UTF-8 will cause end of @@ -36882,7 +37896,7 @@ DUK_LOCAL void duk__json_dec_plain_string(duk_json_dec_ctx *js_ctx) { /* [ ... str ] */ } -#endif /* DUK_USE_JX */ +#endif /* DUK_USE_JX */ #if defined(DUK_USE_JX) DUK_LOCAL void duk__json_dec_pointer(duk_json_dec_ctx *js_ctx) { @@ -36925,17 +37939,17 @@ DUK_LOCAL void duk__json_dec_pointer(duk_json_dec_ctx *js_ctx) { voidptr = NULL; (void) DUK_SSCANF((const char *) js_ctx->p, DUK_STR_FMT_PTR, &voidptr); duk_push_pointer(thr, voidptr); - js_ctx->p = p + 1; /* skip ')' */ + js_ctx->p = p + 1; /* skip ')' */ /* [ ... ptr ] */ return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } -#endif /* DUK_USE_JX */ +#endif /* DUK_USE_JX */ #if defined(DUK_USE_JX) DUK_LOCAL void duk__json_dec_buffer(duk_json_dec_ctx *js_ctx) { @@ -36983,17 +37997,17 @@ DUK_LOCAL void duk__json_dec_buffer(duk_json_dec_ctx *js_ctx) { duk_memcpy((void *) buf, (const void *) js_ctx->p, src_len); duk_hex_decode(thr, -1); - js_ctx->p = p + 1; /* skip '|' */ + js_ctx->p = p + 1; /* skip '|' */ /* [ ... buf ] */ return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } -#endif /* DUK_USE_JX */ +#endif /* DUK_USE_JX */ /* Parse a number, other than NaN or +/- Infinity */ DUK_LOCAL void duk__json_dec_number(duk_json_dec_ctx *js_ctx) { @@ -37016,47 +38030,45 @@ DUK_LOCAL void duk__json_dec_number(duk_json_dec_ctx *js_ctx) { x = *p; DUK_DDD(DUK_DDDPRINT("parse_number: p_start=%p, p=%p, p_end=%p, x=%ld", - (const void *) p_start, (const void *) p, - (const void *) js_ctx->p_end, (long) x)); + (const void *) p_start, + (const void *) p, + (const void *) js_ctx->p_end, + (long) x)); #if defined(DUK_USE_JSON_DECNUMBER_FASTPATH) /* This fast path is pretty marginal in practice. * XXX: candidate for removal. */ - DUK_ASSERT(duk__json_decnumber_lookup[0x00] == 0x00); /* end-of-input breaks */ + DUK_ASSERT(duk__json_decnumber_lookup[0x00] == 0x00); /* end-of-input breaks */ if (duk__json_decnumber_lookup[x] == 0) { break; } -#else /* DUK_USE_JSON_DECNUMBER_FASTPATH */ +#else /* DUK_USE_JSON_DECNUMBER_FASTPATH */ if (!((x >= DUK_ASC_0 && x <= DUK_ASC_9) || - (x == DUK_ASC_PERIOD || x == DUK_ASC_LC_E || - x == DUK_ASC_UC_E || x == DUK_ASC_MINUS || x == DUK_ASC_PLUS))) { + (x == DUK_ASC_PERIOD || x == DUK_ASC_LC_E || x == DUK_ASC_UC_E || x == DUK_ASC_MINUS || x == DUK_ASC_PLUS))) { /* Plus sign must be accepted for positive exponents * (e.g. '1.5e+2'). This clause catches NULs. */ break; } -#endif /* DUK_USE_JSON_DECNUMBER_FASTPATH */ - p++; /* safe, because matched (NUL causes a break) */ +#endif /* DUK_USE_JSON_DECNUMBER_FASTPATH */ + p++; /* safe, because matched (NUL causes a break) */ } js_ctx->p = p; DUK_ASSERT(js_ctx->p > p_start); duk_push_lstring(thr, (const char *) p_start, (duk_size_t) (p - p_start)); - s2n_flags = DUK_S2N_FLAG_ALLOW_EXP | - DUK_S2N_FLAG_ALLOW_MINUS | /* but don't allow leading plus */ + s2n_flags = DUK_S2N_FLAG_ALLOW_EXP | DUK_S2N_FLAG_ALLOW_MINUS | /* but don't allow leading plus */ DUK_S2N_FLAG_ALLOW_FRAC; - DUK_DDD(DUK_DDDPRINT("parse_number: string before parsing: %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("parse_number: string before parsing: %!T", (duk_tval *) duk_get_tval(thr, -1))); duk_numconv_parse(thr, 10 /*radix*/, s2n_flags); if (duk_is_nan(thr, -1)) { duk__json_dec_syntax_error(js_ctx); } DUK_ASSERT(duk_is_number(thr, -1)); - DUK_DDD(DUK_DDDPRINT("parse_number: final number: %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("parse_number: final number: %!T", (duk_tval *) duk_get_tval(thr, -1))); /* [ ... num ] */ } @@ -37069,7 +38081,7 @@ DUK_LOCAL void duk__json_dec_objarr_entry(duk_json_dec_ctx *js_ctx) { duk_native_stack_check(thr); - DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0); /* unsigned */ DUK_ASSERT(js_ctx->recursion_depth <= js_ctx->recursion_limit); if (js_ctx->recursion_depth >= js_ctx->recursion_limit) { DUK_ERROR_RANGE(thr, DUK_STR_DEC_RECLIMIT); @@ -37088,7 +38100,7 @@ DUK_LOCAL void duk__json_dec_objarr_exit(duk_json_dec_ctx *js_ctx) { DUK_LOCAL void duk__json_dec_object(duk_json_dec_ctx *js_ctx) { duk_hthread *thr = js_ctx->thr; - duk_int_t key_count; /* XXX: a "first" flag would suffice */ + duk_int_t key_count; /* XXX: a "first" flag would suffice */ duk_uint8_t x; DUK_DDD(DUK_DDDPRINT("parse_object")); @@ -37105,7 +38117,8 @@ DUK_LOCAL void duk__json_dec_object(duk_json_dec_ctx *js_ctx) { DUK_DDD(DUK_DDDPRINT("parse_object: obj=%!T, x=%ld, key_count=%ld", (duk_tval *) duk_get_tval(thr, -1), - (long) x, (long) key_count)); + (long) x, + (long) key_count)); /* handle comma and closing brace */ @@ -37130,8 +38143,7 @@ DUK_LOCAL void duk__json_dec_object(duk_json_dec_ctx *js_ctx) { if (x == DUK_ASC_DOUBLEQUOTE) { duk__json_dec_string(js_ctx); #if defined(DUK_USE_JX) - } else if (js_ctx->flag_ext_custom && - duk_unicode_is_identifier_start((duk_codepoint_t) x)) { + } else if (js_ctx->flag_ext_custom && duk_unicode_is_identifier_start((duk_codepoint_t) x)) { duk__json_dec_plain_string(js_ctx); #endif } else { @@ -37158,13 +38170,12 @@ DUK_LOCAL void duk__json_dec_object(duk_json_dec_ctx *js_ctx) { /* [ ... obj ] */ - DUK_DDD(DUK_DDDPRINT("parse_object: final object is %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("parse_object: final object is %!T", (duk_tval *) duk_get_tval(thr, -1))); duk__json_dec_objarr_exit(js_ctx); return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } @@ -37188,7 +38199,8 @@ DUK_LOCAL void duk__json_dec_array(duk_json_dec_ctx *js_ctx) { DUK_DDD(DUK_DDDPRINT("parse_array: arr=%!T, x=%ld, arr_idx=%ld", (duk_tval *) duk_get_tval(thr, -1), - (long) x, (long) arr_idx)); + (long) x, + (long) arr_idx)); /* handle comma and closing bracket */ @@ -37202,7 +38214,7 @@ DUK_LOCAL void duk__json_dec_array(duk_json_dec_ctx *js_ctx) { /* accept anything, expect first value (EOF will be * caught by duk__json_dec_value() below. */ - js_ctx->p--; /* backtrack (safe) */ + js_ctx->p--; /* backtrack (safe) */ } else { /* catches EOF (NUL) and initial comma */ goto syntax_error; @@ -37226,13 +38238,12 @@ DUK_LOCAL void duk__json_dec_array(duk_json_dec_ctx *js_ctx) { /* [ ... arr ] */ - DUK_DDD(DUK_DDDPRINT("parse_array: final array is %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("parse_array: final array is %!T", (duk_tval *) duk_get_tval(thr, -1))); duk__json_dec_objarr_exit(js_ctx); return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } @@ -37252,14 +38263,14 @@ DUK_LOCAL void duk__json_dec_value(duk_json_dec_ctx *js_ctx) { } else if ((x >= DUK_ASC_0 && x <= DUK_ASC_9) || (x == DUK_ASC_MINUS)) { #if defined(DUK_USE_JX) if (js_ctx->flag_ext_custom && x == DUK_ASC_MINUS && duk__json_dec_peek(js_ctx) == DUK_ASC_UC_I) { - duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_MINUS_INFINITY); /* "-Infinity", '-' has been eaten */ + duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_MINUS_INFINITY); /* "-Infinity", '-' has been eaten */ duk_push_number(thr, -DUK_DOUBLE_INFINITY); } else { #else - { /* unconditional block */ + { /* unconditional block */ #endif /* We already ate 'x', so backup one byte. */ - js_ctx->p--; /* safe */ + js_ctx->p--; /* safe */ duk__json_dec_number(js_ctx); } } else if (x == DUK_ASC_LC_T) { @@ -37300,7 +38311,7 @@ DUK_LOCAL void duk__json_dec_value(duk_json_dec_ctx *js_ctx) { /* [ ... val ] */ return; - syntax_error: +syntax_error: duk__json_dec_syntax_error(js_ctx); DUK_UNREACHABLE(); } @@ -37323,7 +38334,7 @@ DUK_LOCAL void duk__json_dec_reviver_walk(duk_json_dec_ctx *js_ctx) { (duk_tval *) duk_get_tval(thr, -1))); duk_dup_top(thr); - duk_get_prop(thr, -3); /* -> [ ... holder name val ] */ + duk_get_prop(thr, -3); /* -> [ ... holder name val ] */ h = duk_get_hobject(thr, -1); if (h != NULL) { @@ -37333,13 +38344,17 @@ DUK_LOCAL void duk__json_dec_reviver_walk(duk_json_dec_ctx *js_ctx) { /* [ ... holder name val ] */ DUK_DDD(DUK_DDDPRINT("walk: array, top=%ld, i=%ld, arr_len=%ld, holder=%!T, name=%!T, val=%!T", - (long) duk_get_top(thr), (long) i, (long) arr_len, - (duk_tval *) duk_get_tval(thr, -3), (duk_tval *) duk_get_tval(thr, -2), + (long) duk_get_top(thr), + (long) i, + (long) arr_len, + (duk_tval *) duk_get_tval(thr, -3), + (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); duk_dup_top(thr); - (void) duk_push_uint_to_hstring(thr, (duk_uint_t) i); /* -> [ ... holder name val val ToString(i) ] */ - duk__json_dec_reviver_walk(js_ctx); /* -> [ ... holder name val new_elem ] */ + (void) duk_push_uint_to_hstring(thr, + (duk_uint_t) i); /* -> [ ... holder name val val ToString(i) ] */ + duk__json_dec_reviver_walk(js_ctx); /* -> [ ... holder name val new_elem ] */ if (duk_is_undefined(thr, -1)) { duk_pop(thr); @@ -37357,9 +38372,12 @@ DUK_LOCAL void duk__json_dec_reviver_walk(duk_json_dec_ctx *js_ctx) { duk_enum(thr, -1, DUK_ENUM_OWN_PROPERTIES_ONLY /*flags*/); while (duk_next(thr, -1 /*enum_index*/, 0 /*get_value*/)) { DUK_DDD(DUK_DDDPRINT("walk: object, top=%ld, holder=%!T, name=%!T, val=%!T, enum=%!iT, obj_key=%!T", - (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, -5), - (duk_tval *) duk_get_tval(thr, -4), (duk_tval *) duk_get_tval(thr, -3), - (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); + (long) duk_get_top(thr), + (duk_tval *) duk_get_tval(thr, -5), + (duk_tval *) duk_get_tval(thr, -4), + (duk_tval *) duk_get_tval(thr, -3), + (duk_tval *) duk_get_tval(thr, -2), + (duk_tval *) duk_get_tval(thr, -1))); /* [ ... holder name val enum obj_key ] */ duk_dup_m3(thr); @@ -37385,34 +38403,33 @@ DUK_LOCAL void duk__json_dec_reviver_walk(duk_json_dec_ctx *js_ctx) { duk_put_prop(thr, -4); } } - duk_pop(thr); /* pop enum */ + duk_pop(thr); /* pop enum */ } } /* [ ... holder name val ] */ duk_dup(thr, js_ctx->idx_reviver); - duk_insert(thr, -4); /* -> [ ... reviver holder name val ] */ - duk_call_method(thr, 2); /* -> [ ... res ] */ + duk_insert(thr, -4); /* -> [ ... reviver holder name val ] */ + duk_call_method(thr, 2); /* -> [ ... res ] */ duk__json_dec_objarr_exit(js_ctx); - DUK_DDD(DUK_DDDPRINT("walk: top=%ld, result=%!T", - (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("walk: top=%ld, result=%!T", (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, -1))); } /* * Stringify implementation. */ -#define DUK__EMIT_1(js_ctx,ch) duk__emit_1((js_ctx), (duk_uint_fast8_t) (ch)) -#define DUK__EMIT_2(js_ctx,ch1,ch2) duk__emit_2((js_ctx), (duk_uint_fast8_t) (ch1), (duk_uint_fast8_t) (ch2)) -#define DUK__EMIT_HSTR(js_ctx,h) duk__emit_hstring((js_ctx), (h)) +#define DUK__EMIT_1(js_ctx, ch) duk__emit_1((js_ctx), (duk_uint_fast8_t) (ch)) +#define DUK__EMIT_2(js_ctx, ch1, ch2) duk__emit_2((js_ctx), (duk_uint_fast8_t) (ch1), (duk_uint_fast8_t) (ch2)) +#define DUK__EMIT_HSTR(js_ctx, h) duk__emit_hstring((js_ctx), (h)) #if defined(DUK_USE_FASTINT) || defined(DUK_USE_JX) || defined(DUK_USE_JC) -#define DUK__EMIT_CSTR(js_ctx,p) duk__emit_cstring((js_ctx), (p)) +#define DUK__EMIT_CSTR(js_ctx, p) duk__emit_cstring((js_ctx), (p)) #endif -#define DUK__EMIT_STRIDX(js_ctx,i) duk__emit_stridx((js_ctx), (i)) -#define DUK__UNEMIT_1(js_ctx) duk__unemit_1((js_ctx)) +#define DUK__EMIT_STRIDX(js_ctx, i) duk__emit_stridx((js_ctx), (i)) +#define DUK__UNEMIT_1(js_ctx) duk__unemit_1((js_ctx)) DUK_LOCAL void duk__emit_1(duk_json_enc_ctx *js_ctx, duk_uint_fast8_t ch) { DUK_BW_WRITE_ENSURE_U8(js_ctx->thr, &js_ctx->bw, ch); @@ -37447,10 +38464,8 @@ DUK_LOCAL void duk__unemit_1(duk_json_enc_ctx *js_ctx) { DUK_BW_ADD_PTR(js_ctx->thr, &js_ctx->bw, -1); } -#define DUK__MKESC(nybbles,esc1,esc2) \ - (((duk_uint_fast32_t) (nybbles)) << 16) | \ - (((duk_uint_fast32_t) (esc1)) << 8) | \ - ((duk_uint_fast32_t) (esc2)) +#define DUK__MKESC(nybbles, esc1, esc2) \ + (((duk_uint_fast32_t) (nybbles)) << 16) | (((duk_uint_fast32_t) (esc1)) << 8) | ((duk_uint_fast32_t) (esc2)) DUK_LOCAL duk_uint8_t *duk__emit_esc_auto_fast(duk_json_enc_ctx *js_ctx, duk_uint_fast32_t cp, duk_uint8_t *q) { duk_uint_fast32_t tmp; @@ -37475,7 +38490,7 @@ DUK_LOCAL duk_uint8_t *duk__emit_esc_auto_fast(duk_json_enc_ctx *js_ctx, duk_uin } } else #endif - if (DUK_LIKELY(cp < 0x10000UL)) { + if (DUK_LIKELY(cp < 0x10000UL)) { tmp = DUK__MKESC(4, DUK_ASC_BACKSLASH, DUK_ASC_LC_U); } else { #if defined(DUK_USE_JX) @@ -37507,7 +38522,7 @@ DUK_LOCAL duk_uint8_t *duk__emit_esc_auto_fast(duk_json_enc_ctx *js_ctx, duk_uin } DUK_LOCAL void duk__json_enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k) { - const duk_int8_t *p, *p_start, *p_end; /* Note: intentionally signed. */ + const duk_int8_t *p, *p_start, *p_end; /* Note: intentionally signed. */ duk_size_t k_len; duk_codepoint_t cp; @@ -37548,7 +38563,7 @@ DUK_LOCAL void duk__json_enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring return; } - quote_normally: +quote_normally: duk__json_enc_quote_string(js_ctx, k); } @@ -37561,7 +38576,7 @@ DUK_LOCAL void duk__json_enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring duk_hthread *thr = js_ctx->thr; const duk_uint8_t *p, *p_start, *p_end, *p_now, *p_tmp; duk_uint8_t *q; - duk_ucodepoint_t cp; /* typed for duk_unicode_decode_xutf8() */ + duk_ucodepoint_t cp; /* typed for duk_unicode_decode_xutf8() */ DUK_DDD(DUK_DDDPRINT("duk__json_enc_quote_string: h_str=%!O", (duk_heaphdr *) h_str)); @@ -37580,8 +38595,7 @@ DUK_LOCAL void duk__json_enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring duk_size_t left, now, space; left = (duk_size_t) (p_end - p); - now = (left > DUK__JSON_ENCSTR_CHUNKSIZE ? - DUK__JSON_ENCSTR_CHUNKSIZE : left); + now = (left > DUK__JSON_ENCSTR_CHUNKSIZE ? DUK__JSON_ENCSTR_CHUNKSIZE : left); /* Maximum expansion per input byte is 6: * - invalid UTF-8 byte causes "\uXXXX" to be emitted (6/1 = 6). @@ -37617,7 +38631,7 @@ DUK_LOCAL void duk__json_enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring p--; /* slow path is shared */ -#else /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ +#else /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ cp = *p; if (DUK_LIKELY(cp <= 0x7f)) { @@ -37648,7 +38662,7 @@ DUK_LOCAL void duk__json_enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring } } else { /* slow path is shared */ -#endif /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ +#endif /* DUK_USE_JSON_QUOTESTRING_FASTPATH */ /* slow path decode */ @@ -37724,11 +38738,10 @@ DUK_LOCAL void duk__json_enc_double(duk_json_enc_ctx *js_ctx) { /* Negative zero needs special handling in JX/JC because * it would otherwise serialize to '0', not '-0'. */ - if (DUK_UNLIKELY(c == DUK_FP_ZERO && s != 0 && - (js_ctx->flag_ext_custom_or_compatible))) { - duk_push_hstring_stridx(thr, DUK_STRIDX_MINUS_ZERO); /* '-0' */ + if (DUK_UNLIKELY(c == DUK_FP_ZERO && s != 0 && (js_ctx->flag_ext_custom_or_compatible))) { + duk_push_hstring_stridx(thr, DUK_STRIDX_MINUS_ZERO); /* '-0' */ } else -#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_JX || DUK_USE_JC */ { n2s_flags = 0; /* [ ... number ] -> [ ... string ] */ @@ -37740,8 +38753,7 @@ DUK_LOCAL void duk__json_enc_double(duk_json_enc_ctx *js_ctx) { } #if defined(DUK_USE_JX) || defined(DUK_USE_JC) - if (!(js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | - DUK_JSON_FLAG_EXT_COMPATIBLE))) { + if (!(js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_EXT_COMPATIBLE))) { stridx = DUK_STRIDX_LC_NULL; } else if (c == DUK_FP_NAN) { stridx = js_ctx->stridx_custom_nan; @@ -37840,7 +38852,7 @@ DUK_LOCAL duk_uint8_t *duk__json_enc_buffer_data_hex(const duk_uint8_t *src, duk return q; } -#else /* DUK_USE_HEX_FASTPATH */ +#else /* DUK_USE_HEX_FASTPATH */ DUK_LOCAL duk_uint8_t *duk__json_enc_buffer_data_hex(const duk_uint8_t *src, duk_size_t src_len, duk_uint8_t *dst) { const duk_uint8_t *p; const duk_uint8_t *p_end; @@ -37858,7 +38870,7 @@ DUK_LOCAL duk_uint8_t *duk__json_enc_buffer_data_hex(const duk_uint8_t *src, duk return q; } -#endif /* DUK_USE_HEX_FASTPATH */ +#endif /* DUK_USE_HEX_FASTPATH */ DUK_LOCAL void duk__json_enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t *buf_data, duk_size_t buf_len) { duk_hthread *thr; @@ -37867,7 +38879,7 @@ DUK_LOCAL void duk__json_enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t * thr = js_ctx->thr; - DUK_ASSERT(js_ctx->flag_ext_custom || js_ctx->flag_ext_compatible); /* caller checks */ + DUK_ASSERT(js_ctx->flag_ext_custom || js_ctx->flag_ext_compatible); /* caller checks */ DUK_ASSERT(js_ctx->flag_ext_custom_or_compatible); /* Buffer values are encoded in (lowercase) hex to make the @@ -37883,7 +38895,7 @@ DUK_LOCAL void duk__json_enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t * /* Note: space must cater for both JX and JC. */ space = 9 + buf_len * 2 + 2; DUK_ASSERT(DUK_HBUFFER_MAX_BYTELEN <= 0x7ffffffeUL); - DUK_ASSERT((space - 2) / 2 >= buf_len); /* overflow not possible, buffer limits */ + DUK_ASSERT((space - 2) / 2 >= buf_len); /* overflow not possible, buffer limits */ q = DUK_BW_ENSURE_GETPTR(thr, &js_ctx->bw, space); #if defined(DUK_USE_JX) && defined(DUK_USE_JC) @@ -37903,7 +38915,7 @@ DUK_LOCAL void duk__json_enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t * #if defined(DUK_USE_JC) { DUK_ASSERT(js_ctx->flag_ext_compatible); - duk_memcpy((void *) q, (const void *) "{\"_buf\":\"", 9); /* len: 9 */ + duk_memcpy((void *) q, (const void *) "{\"_buf\":\"", 9); /* len: 9 */ q += 9; q = duk__json_enc_buffer_data_hex(buf_data, buf_len, q); *q++ = DUK_ASC_DOUBLEQUOTE; @@ -37916,10 +38928,10 @@ DUK_LOCAL void duk__json_enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t * DUK_LOCAL void duk__json_enc_buffer_jx_jc(duk_json_enc_ctx *js_ctx, duk_hbuffer *h) { duk__json_enc_buffer_data(js_ctx, - (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(js_ctx->thr->heap, h), - (duk_size_t) DUK_HBUFFER_GET_SIZE(h)); + (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(js_ctx->thr->heap, h), + (duk_size_t) DUK_HBUFFER_GET_SIZE(h)); } -#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_JX || DUK_USE_JC */ #if defined(DUK_USE_JSON_STRINGIFY_FASTPATH) DUK_LOCAL void duk__json_enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuffer *h) { @@ -37959,21 +38971,21 @@ DUK_LOCAL void duk__json_enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_ } DUK_BW_SET_PTR(js_ctx->thr, &js_ctx->bw, q); } - DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ + DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth); } DUK__EMIT_1(js_ctx, DUK_ASC_RCURLY); } -#endif /* DUK_USE_JSON_STRINGIFY_FASTPATH */ +#endif /* DUK_USE_JSON_STRINGIFY_FASTPATH */ #if defined(DUK_USE_JX) || defined(DUK_USE_JC) DUK_LOCAL void duk__json_enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr) { - char buf[64]; /* XXX: how to figure correct size? */ + char buf[64]; /* XXX: how to figure correct size? */ const char *fmt; - DUK_ASSERT(js_ctx->flag_ext_custom || js_ctx->flag_ext_compatible); /* caller checks */ + DUK_ASSERT(js_ctx->flag_ext_custom || js_ctx->flag_ext_compatible); /* caller checks */ DUK_ASSERT(js_ctx->flag_ext_custom_or_compatible); duk_memzero(buf, sizeof(buf)); @@ -38000,10 +39012,10 @@ DUK_LOCAL void duk__json_enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr) { #endif /* When ptr == NULL, the format argument is unused. */ - DUK_SNPRINTF(buf, sizeof(buf) - 1, fmt, ptr); /* must not truncate */ + DUK_SNPRINTF(buf, sizeof(buf) - 1, fmt, ptr); /* must not truncate */ DUK__EMIT_CSTR(js_ctx, buf); } -#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_JX || DUK_USE_JC */ #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) #if defined(DUK_USE_JX) || defined(DUK_USE_JC) @@ -38015,12 +39027,12 @@ DUK_LOCAL void duk__json_enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_buf } else { /* Handle both full and partial slice (as long as covered). */ duk__json_enc_buffer_data(js_ctx, - (duk_uint8_t *) DUK_HBUFOBJ_GET_SLICE_BASE(js_ctx->thr->heap, h_bufobj), - (duk_size_t) h_bufobj->length); + (duk_uint8_t *) DUK_HBUFOBJ_GET_SLICE_BASE(js_ctx->thr->heap, h_bufobj), + (duk_size_t) h_bufobj->length); } } -#endif /* DUK_USE_JX || DUK_USE_JC */ -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* Indent helper. Calling code relies on js_ctx->recursion_depth also being * directly related to indent depth. @@ -38028,24 +39040,24 @@ DUK_LOCAL void duk__json_enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_buf #if defined(DUK_USE_PREFER_SIZE) DUK_LOCAL void duk__json_enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth) { DUK_ASSERT(js_ctx->h_gap != NULL); - DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(js_ctx->h_gap) > 0); /* caller guarantees */ + DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(js_ctx->h_gap) > 0); /* caller guarantees */ DUK__EMIT_1(js_ctx, 0x0a); while (depth-- > 0) { DUK__EMIT_HSTR(js_ctx, js_ctx->h_gap); } } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ DUK_LOCAL void duk__json_enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth) { const duk_uint8_t *gap_data; duk_size_t gap_len; - duk_size_t avail_bytes; /* bytes of indent available for copying */ - duk_size_t need_bytes; /* bytes of indent still needed */ + duk_size_t avail_bytes; /* bytes of indent available for copying */ + duk_size_t need_bytes; /* bytes of indent still needed */ duk_uint8_t *p_start; duk_uint8_t *p; DUK_ASSERT(js_ctx->h_gap != NULL); - DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(js_ctx->h_gap) > 0); /* caller guarantees */ + DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(js_ctx->h_gap) > 0); /* caller guarantees */ DUK__EMIT_1(js_ctx, 0x0a); if (DUK_UNLIKELY(depth == 0)) { @@ -38079,14 +39091,14 @@ DUK_LOCAL void duk__json_enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t avail_bytes <<= 1; } - DUK_ASSERT(need_bytes < avail_bytes); /* need_bytes may be zero */ + DUK_ASSERT(need_bytes < avail_bytes); /* need_bytes may be zero */ duk_memcpy((void *) p, (const void *) p_start, (size_t) need_bytes); p += need_bytes; /*avail_bytes += need_bytes*/ DUK_BW_SET_PTR(js_ctx->thr, &js_ctx->bw, p); } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ /* Shared entry handling for object/array serialization. */ DUK_LOCAL void duk__json_enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top) { @@ -38103,7 +39115,7 @@ DUK_LOCAL void duk__json_enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *e * with overflow in a loop check object. */ - h_target = duk_known_hobject(thr, -1); /* object or array */ + h_target = duk_known_hobject(thr, -1); /* object or array */ n = js_ctx->recursion_depth; if (DUK_UNLIKELY(n > DUK_JSON_ENC_LOOPARRAY)) { @@ -38120,18 +39132,18 @@ DUK_LOCAL void duk__json_enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *e js_ctx->visiting[js_ctx->recursion_depth] = h_target; } else { duk_push_sprintf(thr, DUK_STR_FMT_PTR, (void *) h_target); - duk_dup_top(thr); /* -> [ ... voidp voidp ] */ + duk_dup_top(thr); /* -> [ ... voidp voidp ] */ if (duk_has_prop(thr, js_ctx->idx_loop)) { DUK_ERROR_TYPE(thr, DUK_STR_CYCLIC_INPUT); DUK_WO_NORETURN(return;); } - duk_push_true(thr); /* -> [ ... voidp true ] */ - duk_put_prop(thr, js_ctx->idx_loop); /* -> [ ... ] */ + duk_push_true(thr); /* -> [ ... voidp true ] */ + duk_put_prop(thr, js_ctx->idx_loop); /* -> [ ... ] */ } /* C recursion check. */ - DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0); /* unsigned */ DUK_ASSERT(js_ctx->recursion_depth <= js_ctx->recursion_limit); if (js_ctx->recursion_depth >= js_ctx->recursion_limit) { DUK_ERROR_RANGE(thr, DUK_STR_ENC_RECLIMIT); @@ -38140,7 +39152,8 @@ DUK_LOCAL void duk__json_enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *e js_ctx->recursion_depth++; DUK_DDD(DUK_DDDPRINT("shared entry finished: top=%ld, loop=%!T", - (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, js_ctx->idx_loop))); + (long) duk_get_top(thr), + (duk_tval *) duk_get_tval(thr, js_ctx->idx_loop))); } /* Shared exit handling for object/array serialization. */ @@ -38156,20 +39169,21 @@ DUK_LOCAL void duk__json_enc_objarr_exit(duk_json_enc_ctx *js_ctx, duk_idx_t *en /* Loop check. */ - h_target = duk_known_hobject(thr, *entry_top - 1); /* original target at entry_top - 1 */ + h_target = duk_known_hobject(thr, *entry_top - 1); /* original target at entry_top - 1 */ if (js_ctx->recursion_depth < DUK_JSON_ENC_LOOPARRAY) { /* Previous entry was inside visited[], nothing to do. */ } else { duk_push_sprintf(thr, DUK_STR_FMT_PTR, (void *) h_target); - duk_del_prop(thr, js_ctx->idx_loop); /* -> [ ... ] */ + duk_del_prop(thr, js_ctx->idx_loop); /* -> [ ... ] */ } /* Restore stack top after unbalanced code paths. */ duk_set_top(thr, *entry_top); DUK_DDD(DUK_DDDPRINT("shared entry finished: top=%ld, loop=%!T", - (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, js_ctx->idx_loop))); + (long) duk_get_top(thr), + (duk_tval *) duk_get_tval(thr, js_ctx->idx_loop))); } /* The JO(value) operation: encode object. @@ -38197,13 +39211,14 @@ DUK_LOCAL void duk__json_enc_object(duk_json_enc_ctx *js_ctx) { } else { /* XXX: would be nice to enumerate an object at specified index */ duk_dup(thr, idx_obj); - (void) duk_hobject_get_enumerated_keys(thr, DUK_ENUM_OWN_PROPERTIES_ONLY /*flags*/); /* [ ... target ] -> [ ... target keys ] */ + (void) duk_hobject_get_enumerated_keys( + thr, + DUK_ENUM_OWN_PROPERTIES_ONLY /*flags*/); /* [ ... target ] -> [ ... target keys ] */ idx_keys = duk_require_normalize_index(thr, -1); /* leave stack unbalanced on purpose */ } - DUK_DDD(DUK_DDDPRINT("idx_keys=%ld, h_keys=%!T", - (long) idx_keys, (duk_tval *) duk_get_tval(thr, idx_keys))); + DUK_DDD(DUK_DDDPRINT("idx_keys=%ld, h_keys=%!T", (long) idx_keys, (duk_tval *) duk_get_tval(thr, idx_keys))); /* Steps 8-10 have been merged to avoid a "partial" variable. */ @@ -38218,7 +39233,7 @@ DUK_LOCAL void duk__json_enc_object(duk_json_enc_ctx *js_ctx) { arr_len = (duk_uarridx_t) duk_get_length(thr, idx_keys); emitted = 0; for (i = 0; i < arr_len; i++) { - duk_get_prop_index(thr, idx_keys, i); /* -> [ ... key ] */ + duk_get_prop_index(thr, idx_keys, i); /* -> [ ... key ] */ DUK_DDD(DUK_DDDPRINT("object property loop: holder=%!T, key=%!T", (duk_tval *) duk_get_tval(thr, idx_obj), @@ -38226,7 +39241,7 @@ DUK_LOCAL void duk__json_enc_object(duk_json_enc_ctx *js_ctx) { h_key = duk_known_hstring(thr, -1); DUK_ASSERT(h_key != NULL); - DUK_ASSERT(!DUK_HSTRING_HAS_SYMBOL(h_key)); /* proplist filtering; enum options */ + DUK_ASSERT(!DUK_HSTRING_HAS_SYMBOL(h_key)); /* proplist filtering; enum options */ prev_size = DUK_BW_GET_SIZE(js_ctx->thr, &js_ctx->bw); if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { @@ -38255,7 +39270,7 @@ DUK_LOCAL void duk__json_enc_object(duk_json_enc_ctx *js_ctx) { if (emitted) { DUK_ASSERT(*((duk_uint8_t *) DUK_BW_GET_PTR(js_ctx->thr, &js_ctx->bw) - 1) == DUK_ASC_COMMA); - DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ + DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { DUK_ASSERT(js_ctx->recursion_depth >= 1); duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U); @@ -38279,8 +39294,7 @@ DUK_LOCAL void duk__json_enc_array(duk_json_enc_ctx *js_ctx) { duk_bool_t emitted; duk_uarridx_t i, arr_len; - DUK_DDD(DUK_DDDPRINT("duk__json_enc_array: array=%!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("duk__json_enc_array: array=%!T", (duk_tval *) duk_get_tval(thr, -1))); duk__json_enc_objarr_entry(js_ctx, &entry_top); @@ -38295,14 +39309,15 @@ DUK_LOCAL void duk__json_enc_array(duk_json_enc_ctx *js_ctx) { for (i = 0; i < arr_len; i++) { DUK_DDD(DUK_DDDPRINT("array entry loop: array=%!T, index=%ld, arr_len=%ld", (duk_tval *) duk_get_tval(thr, idx_arr), - (long) i, (long) arr_len)); + (long) i, + (long) arr_len)); if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { DUK_ASSERT(js_ctx->recursion_depth >= 1); duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth); } - (void) duk_push_uint_to_hstring(thr, (duk_uint_t) i); /* -> [ ... key ] */ + (void) duk_push_uint_to_hstring(thr, (duk_uint_t) i); /* -> [ ... key ] */ /* [ ... key ] */ @@ -38321,7 +39336,7 @@ DUK_LOCAL void duk__json_enc_array(duk_json_enc_ctx *js_ctx) { if (emitted) { DUK_ASSERT(*((duk_uint8_t *) DUK_BW_GET_PTR(js_ctx->thr, &js_ctx->bw) - 1) == DUK_ASC_COMMA); - DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ + DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { DUK_ASSERT(js_ctx->recursion_depth >= 1); duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U); @@ -38346,14 +39361,15 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx duk_small_int_t c; DUK_DDD(DUK_DDDPRINT("duk__json_enc_value: idx_holder=%ld, holder=%!T, key=%!T", - (long) idx_holder, (duk_tval *) duk_get_tval(thr, idx_holder), + (long) idx_holder, + (duk_tval *) duk_get_tval(thr, idx_holder), (duk_tval *) duk_get_tval(thr, -1))); tv_holder = DUK_GET_TVAL_POSIDX(thr, idx_holder); DUK_ASSERT(DUK_TVAL_IS_OBJECT(tv_holder)); tv_key = DUK_GET_TVAL_NEGIDX(thr, -1); DUK_ASSERT(DUK_TVAL_IS_STRING(tv_key)); - DUK_ASSERT(!DUK_HSTRING_HAS_SYMBOL(DUK_TVAL_GET_STRING(tv_key))); /* Caller responsible. */ + DUK_ASSERT(!DUK_HSTRING_HAS_SYMBOL(DUK_TVAL_GET_STRING(tv_key))); /* Caller responsible. */ (void) duk_hobject_getprop(thr, tv_holder, tv_key); /* -> [ ... key val ] */ @@ -38365,19 +39381,17 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx * number won't invoke the .toJSON() method. However, lightfuncs and * plain buffers mimic objects so we check for their .toJSON() method. */ - if (duk_check_type_mask(thr, -1, DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_LIGHTFUNC | - DUK_TYPE_MASK_BUFFER)) { + if (duk_check_type_mask(thr, -1, DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER)) { duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_TO_JSON); - if (duk_is_callable(thr, -1)) { /* toJSON() can also be a lightfunc */ + if (duk_is_callable(thr, -1)) { /* toJSON() can also be a lightfunc */ DUK_DDD(DUK_DDDPRINT("value is object, has callable toJSON() -> call it")); /* XXX: duk_dup_unvalidated(thr, -2) etc. */ - duk_dup_m2(thr); /* -> [ ... key val toJSON val ] */ - duk_dup_m4(thr); /* -> [ ... key val toJSON val key ] */ - duk_call_method(thr, 1); /* -> [ ... key val val' ] */ - duk_remove_m2(thr); /* -> [ ... key val' ] */ + duk_dup_m2(thr); /* -> [ ... key val toJSON val ] */ + duk_dup_m4(thr); /* -> [ ... key val toJSON val key ] */ + duk_call_method(thr, 1); /* -> [ ... key val val' ] */ + duk_remove_m2(thr); /* -> [ ... key val' ] */ } else { - duk_pop(thr); /* -> [ ... key val ] */ + duk_pop(thr); /* -> [ ... key val ] */ } } @@ -38388,12 +39402,12 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx if (js_ctx->h_replacer) { /* XXX: Here a "slice copy" would be useful. */ DUK_DDD(DUK_DDDPRINT("replacer is set, call replacer")); - duk_push_hobject(thr, js_ctx->h_replacer); /* -> [ ... key val replacer ] */ - duk_dup(thr, idx_holder); /* -> [ ... key val replacer holder ] */ - duk_dup_m4(thr); /* -> [ ... key val replacer holder key ] */ - duk_dup_m4(thr); /* -> [ ... key val replacer holder key val ] */ - duk_call_method(thr, 2); /* -> [ ... key val val' ] */ - duk_remove_m2(thr); /* -> [ ... key val' ] */ + duk_push_hobject(thr, js_ctx->h_replacer); /* -> [ ... key val replacer ] */ + duk_dup(thr, idx_holder); /* -> [ ... key val replacer holder ] */ + duk_dup_m4(thr); /* -> [ ... key val replacer holder key ] */ + duk_dup_m4(thr); /* -> [ ... key val replacer holder key val ] */ + duk_call_method(thr, 2); /* -> [ ... key val val' ] */ + duk_remove_m2(thr); /* -> [ ... key val' ] */ } /* [ ... key val ] */ @@ -38409,8 +39423,7 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) #if defined(DUK_USE_JX) || defined(DUK_USE_JC) - if (DUK_HOBJECT_IS_BUFOBJ(h) && - js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_EXT_COMPATIBLE)) { + if (DUK_HOBJECT_IS_BUFOBJ(h) && js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_EXT_COMPATIBLE)) { /* With JX/JC a bufferobject gets serialized specially. */ duk_hbufobj *h_bufobj; h_bufobj = (duk_hbufobj *) h; @@ -38419,8 +39432,8 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx goto pop2_emitted; } /* Otherwise bufferobjects get serialized as normal objects. */ -#endif /* JX || JC */ -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* JX || JC */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ c = (duk_small_int_t) DUK_HOBJECT_GET_CLASS_NUMBER(h); switch (c) { case DUK_HOBJECT_CLASS_NUMBER: { @@ -38460,8 +39473,7 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx DUK_ASSERT(h != NULL); if (DUK_HOBJECT_IS_CALLABLE(h)) { #if defined(DUK_USE_JX) || defined(DUK_USE_JC) - if (js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | - DUK_JSON_FLAG_EXT_COMPATIBLE)) { + if (js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_EXT_COMPATIBLE)) { /* We only get here when doing non-standard JSON encoding */ DUK_DDD(DUK_DDDPRINT("-> function allowed, serialize to custom format")); DUK_ASSERT(js_ctx->flag_ext_custom || js_ctx->flag_ext_compatible); @@ -38471,13 +39483,13 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx DUK_DDD(DUK_DDDPRINT("-> will result in undefined (function)")); goto pop2_undef; } -#else /* DUK_USE_JX || DUK_USE_JC */ +#else /* DUK_USE_JX || DUK_USE_JC */ DUK_DDD(DUK_DDDPRINT("-> will result in undefined (function)")); goto pop2_undef; -#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_JX || DUK_USE_JC */ } } - } /* end switch */ + } /* end switch */ } /* [ ... key val ] */ @@ -38504,8 +39516,7 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx break; } case DUK_TAG_BOOLEAN: { - DUK__EMIT_STRIDX(js_ctx, DUK_TVAL_GET_BOOLEAN(tv) ? - DUK_STRIDX_TRUE : DUK_STRIDX_FALSE); + DUK__EMIT_STRIDX(js_ctx, DUK_TVAL_GET_BOOLEAN(tv) ? DUK_STRIDX_TRUE : DUK_STRIDX_FALSE); break; } #if defined(DUK_USE_JX) || defined(DUK_USE_JC) @@ -38514,7 +39525,7 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx duk__json_enc_pointer(js_ctx, DUK_TVAL_GET_POINTER(tv)); break; } -#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_JX || DUK_USE_JC */ case DUK_TAG_STRING: { duk_hstring *h = DUK_TVAL_GET_STRING(tv); DUK_ASSERT(h != NULL); @@ -38593,14 +39604,14 @@ DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx } #if defined(DUK_USE_JX) || defined(DUK_USE_JC) - pop2_emitted: +pop2_emitted: #endif duk_pop_2(thr); /* [ ... key val ] -> [ ... ] */ - return 1; /* emitted */ + return 1; /* emitted */ - pop2_undef: - duk_pop_2(thr); /* [ ... key val ] -> [ ... ] */ - return 0; /* not emitted */ +pop2_undef: + duk_pop_2(thr); /* [ ... key val ] -> [ ... ] */ + return 0; /* not emitted */ } /* E5 Section 15.12.3, main algorithm, step 4.b.ii steps 1-4. */ @@ -38676,8 +39687,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du break; } case DUK_TAG_BOOLEAN: { - DUK__EMIT_STRIDX(js_ctx, DUK_TVAL_GET_BOOLEAN(tv) ? - DUK_STRIDX_TRUE : DUK_STRIDX_FALSE); + DUK__EMIT_STRIDX(js_ctx, DUK_TVAL_GET_BOOLEAN(tv) ? DUK_STRIDX_TRUE : DUK_STRIDX_FALSE); break; } case DUK_TAG_STRING: { @@ -38694,8 +39704,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du duk_hobject *obj; duk_tval *tv_val; duk_bool_t emitted = 0; - duk_uint32_t c_bit, c_all, c_array, c_unbox, c_undef, - c_func, c_bufobj, c_object, c_abort; + duk_uint32_t c_bit, c_all, c_array, c_unbox, c_undef, c_func, c_bufobj, c_object, c_abort; /* For objects JSON.stringify() only looks for own, enumerable * properties which is nice for the fast path here. @@ -38728,7 +39737,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du * it (though it's OK to abort the fast path). */ - DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0); /* unsigned */ DUK_ASSERT(js_ctx->recursion_depth <= js_ctx->recursion_limit); if (js_ctx->recursion_depth >= js_ctx->recursion_limit) { DUK_DD(DUK_DDPRINT("fast path recursion limit")); @@ -38780,28 +39789,23 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du if (js_ctx->flag_ext_custom_or_compatible) { c_all = DUK_HOBJECT_CMASK_ALL; c_array = DUK_HOBJECT_CMASK_ARRAY; - c_unbox = DUK_HOBJECT_CMASK_NUMBER | - DUK_HOBJECT_CMASK_STRING | - DUK_HOBJECT_CMASK_BOOLEAN | - DUK_HOBJECT_CMASK_POINTER; /* Symbols are not unboxed. */ + c_unbox = DUK_HOBJECT_CMASK_NUMBER | DUK_HOBJECT_CMASK_STRING | DUK_HOBJECT_CMASK_BOOLEAN | + DUK_HOBJECT_CMASK_POINTER; /* Symbols are not unboxed. */ c_func = DUK_HOBJECT_CMASK_FUNCTION; c_bufobj = DUK_HOBJECT_CMASK_ALL_BUFOBJS; c_undef = 0; c_abort = 0; c_object = c_all & ~(c_array | c_unbox | c_func | c_bufobj | c_undef | c_abort); - } - else + } else #endif { c_all = DUK_HOBJECT_CMASK_ALL; c_array = DUK_HOBJECT_CMASK_ARRAY; - c_unbox = DUK_HOBJECT_CMASK_NUMBER | - DUK_HOBJECT_CMASK_STRING | - DUK_HOBJECT_CMASK_BOOLEAN; /* Symbols are not unboxed. */ + c_unbox = DUK_HOBJECT_CMASK_NUMBER | DUK_HOBJECT_CMASK_STRING | + DUK_HOBJECT_CMASK_BOOLEAN; /* Symbols are not unboxed. */ c_func = 0; c_bufobj = 0; - c_undef = DUK_HOBJECT_CMASK_FUNCTION | - DUK_HOBJECT_CMASK_POINTER; + c_undef = DUK_HOBJECT_CMASK_FUNCTION | DUK_HOBJECT_CMASK_POINTER; /* As the fast path doesn't currently properly support * duk_hbufobj virtual properties, abort fast path if * we encounter them in plain JSON mode. @@ -38883,7 +39887,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du if (emitted) { DUK_ASSERT(*((duk_uint8_t *) DUK_BW_GET_PTR(js_ctx->thr, &js_ctx->bw) - 1) == DUK_ASC_COMMA); - DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ + DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { DUK_ASSERT(js_ctx->recursion_depth >= 1); duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U); @@ -38953,14 +39957,14 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du #endif /* fall through */ - elem_done: + elem_done: DUK__EMIT_1(js_ctx, DUK_ASC_COMMA); emitted = 1; } if (emitted) { DUK_ASSERT(*((duk_uint8_t *) DUK_BW_GET_PTR(js_ctx->thr, &js_ctx->bw) - 1) == DUK_ASC_COMMA); - DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ + DUK__UNEMIT_1(js_ctx); /* eat trailing comma */ if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) { DUK_ASSERT(js_ctx->recursion_depth >= 1); duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U); @@ -38972,7 +39976,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du * automatic unboxing. Rely on internal value being * sane (to avoid infinite recursion). */ - DUK_ASSERT((c_bit & DUK_HOBJECT_CMASK_SYMBOL) == 0); /* Symbols are not unboxed. */ + DUK_ASSERT((c_bit & DUK_HOBJECT_CMASK_SYMBOL) == 0); /* Symbols are not unboxed. */ #if 1 /* The code below is incorrect if .toString() or .valueOf() have @@ -38982,7 +39986,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du * Unimplemented for now, abort fast path for boxed values. */ goto abort_fastpath; -#else /* disabled */ +#else /* disabled */ /* Disabled until fixed, see above. */ duk_tval *tv_internal; @@ -38990,16 +39994,14 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du tv_internal = duk_hobject_get_internal_value_tval_ptr(js_ctx->thr->heap, obj); DUK_ASSERT(tv_internal != NULL); - DUK_ASSERT(DUK_TVAL_IS_STRING(tv_internal) || - DUK_TVAL_IS_NUMBER(tv_internal) || - DUK_TVAL_IS_BOOLEAN(tv_internal) || - DUK_TVAL_IS_POINTER(tv_internal)); + DUK_ASSERT(DUK_TVAL_IS_STRING(tv_internal) || DUK_TVAL_IS_NUMBER(tv_internal) || + DUK_TVAL_IS_BOOLEAN(tv_internal) || DUK_TVAL_IS_POINTER(tv_internal)); tv = tv_internal; DUK_ASSERT(js_ctx->recursion_depth > 0); - js_ctx->recursion_depth--; /* required to keep recursion depth correct */ + js_ctx->recursion_depth--; /* required to keep recursion depth correct */ goto restart_match; -#endif /* disabled */ +#endif /* disabled */ #if defined(DUK_USE_JX) || defined(DUK_USE_JC) } else if (c_bit & c_func) { DUK__EMIT_STRIDX(js_ctx, js_ctx->stridx_custom_function); @@ -39112,12 +40114,12 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du #endif } } - return 1; /* not undefined */ + return 1; /* not undefined */ - emit_undefined: - return 0; /* value was undefined/unsupported */ +emit_undefined: + return 0; /* value was undefined/unsupported */ - abort_fastpath: +abort_fastpath: /* Error message doesn't matter: the error is ignored anyway. */ DUK_DD(DUK_DDPRINT("aborting fast path")); DUK_ERROR_INTERNAL(js_ctx->thr); @@ -39137,22 +40139,19 @@ DUK_LOCAL duk_ret_t duk__json_stringify_fast(duk_hthread *thr, void *udata) { tv = DUK_GET_TVAL_NEGIDX(thr, -1); if (duk__json_stringify_fast_value(js_ctx, tv) == 0) { DUK_DD(DUK_DDPRINT("top level value not supported, fail fast path")); - DUK_DCERROR_TYPE_INVALID_ARGS(thr); /* Error message is ignored, so doesn't matter. */ + DUK_DCERROR_TYPE_INVALID_ARGS(thr); /* Error message is ignored, so doesn't matter. */ } return 0; } -#endif /* DUK_USE_JSON_STRINGIFY_FASTPATH */ +#endif /* DUK_USE_JSON_STRINGIFY_FASTPATH */ /* * Top level wrappers */ DUK_INTERNAL -void duk_bi_json_parse_helper(duk_hthread *thr, - duk_idx_t idx_value, - duk_idx_t idx_reviver, - duk_small_uint_t flags) { +void duk_bi_json_parse_helper(duk_hthread *thr, duk_idx_t idx_value, duk_idx_t idx_reviver, duk_small_uint_t flags) { duk_json_dec_ctx js_ctx_alloc; duk_json_dec_ctx *js_ctx = &js_ctx_alloc; duk_hstring *h_text; @@ -39193,7 +40192,7 @@ void duk_bi_json_parse_helper(duk_hthread *thr, js_ctx->flag_ext_custom_or_compatible = flags & (DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_EXT_COMPATIBLE); #endif - h_text = duk_to_hstring(thr, idx_value); /* coerce in-place; rejects Symbols */ + h_text = duk_to_hstring(thr, idx_value); /* coerce in-place; rejects Symbols */ DUK_ASSERT(h_text != NULL); /* JSON parsing code is allowed to read [p_start,p_end]: p_end is @@ -39202,11 +40201,10 @@ void duk_bi_json_parse_helper(duk_hthread *thr, */ js_ctx->p_start = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_text); js_ctx->p = js_ctx->p_start; - js_ctx->p_end = ((const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_text)) + - DUK_HSTRING_GET_BYTELEN(h_text); + js_ctx->p_end = ((const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_text)) + DUK_HSTRING_GET_BYTELEN(h_text); DUK_ASSERT(*(js_ctx->p_end) == 0x00); - duk__json_dec_value(js_ctx); /* -> [ ... value ] */ + duk__json_dec_value(js_ctx); /* -> [ ... value ] */ DUK_ASSERT(js_ctx->recursion_depth == 0); /* Trailing whitespace has been eaten by duk__json_dec_value(), so if @@ -39218,27 +40216,26 @@ void duk_bi_json_parse_helper(duk_hthread *thr, } if (duk_is_callable(thr, idx_reviver)) { - DUK_DDD(DUK_DDDPRINT("applying reviver: %!T", - (duk_tval *) duk_get_tval(thr, idx_reviver))); + DUK_DDD(DUK_DDDPRINT("applying reviver: %!T", (duk_tval *) duk_get_tval(thr, idx_reviver))); js_ctx->idx_reviver = idx_reviver; duk_push_object(thr); - duk_dup_m2(thr); /* -> [ ... val root val ] */ - duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_EMPTY_STRING); /* default attrs ok */ - duk_push_hstring_stridx(thr, DUK_STRIDX_EMPTY_STRING); /* -> [ ... val root "" ] */ + duk_dup_m2(thr); /* -> [ ... val root val ] */ + duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_EMPTY_STRING); /* default attrs ok */ + duk_push_hstring_stridx(thr, DUK_STRIDX_EMPTY_STRING); /* -> [ ... val root "" ] */ DUK_DDD(DUK_DDDPRINT("start reviver walk, root=%!T, name=%!T", (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); DUK_ASSERT(js_ctx->recursion_depth == 0); - duk__json_dec_reviver_walk(js_ctx); /* [ ... val root "" ] -> [ ... val val' ] */ + duk__json_dec_reviver_walk(js_ctx); /* [ ... val root "" ] -> [ ... val val' ] */ DUK_ASSERT(js_ctx->recursion_depth == 0); - duk_remove_m2(thr); /* -> [ ... val' ] */ + duk_remove_m2(thr); /* -> [ ... val' ] */ } else { - DUK_DDD(DUK_DDDPRINT("reviver does not exist or is not callable: %!T", - (duk_tval *) duk_get_tval(thr, idx_reviver))); + DUK_DDD( + DUK_DDDPRINT("reviver does not exist or is not callable: %!T", (duk_tval *) duk_get_tval(thr, idx_reviver))); } /* Final result is at stack top. */ @@ -39312,7 +40309,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, * combinations properly. */ #if defined(DUK_USE_JX) || defined(DUK_USE_JC) - js_ctx->stridx_custom_undefined = DUK_STRIDX_LC_NULL; /* standard JSON; array gaps */ + js_ctx->stridx_custom_undefined = DUK_STRIDX_LC_NULL; /* standard JSON; array gaps */ #if defined(DUK_USE_JX) if (flags & DUK_JSON_FLAG_EXT_CUSTOM) { js_ctx->stridx_custom_undefined = DUK_STRIDX_LC_UNDEFINED; @@ -39320,41 +40317,35 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, js_ctx->stridx_custom_neginf = DUK_STRIDX_MINUS_INFINITY; js_ctx->stridx_custom_posinf = DUK_STRIDX_INFINITY; js_ctx->stridx_custom_function = - (flags & DUK_JSON_FLAG_AVOID_KEY_QUOTES) ? - DUK_STRIDX_JSON_EXT_FUNCTION2 : - DUK_STRIDX_JSON_EXT_FUNCTION1; + (flags & DUK_JSON_FLAG_AVOID_KEY_QUOTES) ? DUK_STRIDX_JSON_EXT_FUNCTION2 : DUK_STRIDX_JSON_EXT_FUNCTION1; } -#endif /* DUK_USE_JX */ +#endif /* DUK_USE_JX */ #if defined(DUK_USE_JX) && defined(DUK_USE_JC) else -#endif /* DUK_USE_JX && DUK_USE_JC */ +#endif /* DUK_USE_JX && DUK_USE_JC */ #if defined(DUK_USE_JC) - if (js_ctx->flags & DUK_JSON_FLAG_EXT_COMPATIBLE) { + if (js_ctx->flags & DUK_JSON_FLAG_EXT_COMPATIBLE) { js_ctx->stridx_custom_undefined = DUK_STRIDX_JSON_EXT_UNDEFINED; js_ctx->stridx_custom_nan = DUK_STRIDX_JSON_EXT_NAN; js_ctx->stridx_custom_neginf = DUK_STRIDX_JSON_EXT_NEGINF; js_ctx->stridx_custom_posinf = DUK_STRIDX_JSON_EXT_POSINF; js_ctx->stridx_custom_function = DUK_STRIDX_JSON_EXT_FUNCTION1; } -#endif /* DUK_USE_JC */ -#endif /* DUK_USE_JX || DUK_USE_JC */ +#endif /* DUK_USE_JC */ +#endif /* DUK_USE_JX || DUK_USE_JC */ #if defined(DUK_USE_JX) || defined(DUK_USE_JC) - if (js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | - DUK_JSON_FLAG_EXT_COMPATIBLE)) { - DUK_ASSERT(js_ctx->mask_for_undefined == 0); /* already zero */ - } - else -#endif /* DUK_USE_JX || DUK_USE_JC */ + if (js_ctx->flags & (DUK_JSON_FLAG_EXT_CUSTOM | DUK_JSON_FLAG_EXT_COMPATIBLE)) { + DUK_ASSERT(js_ctx->mask_for_undefined == 0); /* already zero */ + } else +#endif /* DUK_USE_JX || DUK_USE_JC */ { /* Plain buffer is treated like ArrayBuffer and serialized. * Lightfuncs are treated like objects, but JSON explicitly * skips serializing Function objects so we can just reject * lightfuncs here. */ - js_ctx->mask_for_undefined = DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_POINTER | - DUK_TYPE_MASK_LIGHTFUNC; + js_ctx->mask_for_undefined = DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_POINTER | DUK_TYPE_MASK_LIGHTFUNC; } DUK_BW_INIT_PUSHBUF(thr, &js_ctx->bw, DUK__JSON_STRINGIFY_BUFSIZE); @@ -39384,8 +40375,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, js_ctx->idx_proplist = duk_push_bare_array(thr); - enum_flags = DUK_ENUM_ARRAY_INDICES_ONLY | - DUK_ENUM_SORT_ARRAY_INDICES; /* expensive flag */ + enum_flags = DUK_ENUM_ARRAY_INDICES_ONLY | DUK_ENUM_SORT_ARRAY_INDICES; /* expensive flag */ duk_enum(thr, idx_replacer, enum_flags); while (duk_next(thr, -1 /*enum_index*/, 1 /*get_value*/)) { /* [ ... proplist enum_obj key val ] */ @@ -39394,8 +40384,8 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("proplist enum: key=%!T, val=%!T --> accept", (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); - duk_to_string(thr, -1); /* extra coercion of strings is OK */ - duk_put_prop_index(thr, -4, plist_idx); /* -> [ ... proplist enum_obj key ] */ + duk_to_string(thr, -1); /* extra coercion of strings is OK */ + duk_put_prop_index(thr, -4, plist_idx); /* -> [ ... proplist enum_obj key ] */ plist_idx++; duk_pop(thr); } else { @@ -39404,8 +40394,8 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, (duk_tval *) duk_get_tval(thr, -1))); duk_pop_2(thr); } - } - duk_pop(thr); /* pop enum */ + } + duk_pop(thr); /* pop enum */ /* [ ... proplist ] */ } @@ -39431,10 +40421,9 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, duk_small_int_t nspace; /* spaces[] must be static to allow initializer with old compilers like BCC */ static const char spaces[10] = { - DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, - DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, - DUK_ASC_SPACE, DUK_ASC_SPACE - }; /* XXX: helper */ + DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, + DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE, DUK_ASC_SPACE + }; /* XXX: helper */ /* ToInteger() coercion; NaN -> 0, infinities are clamped to 0 and 10 */ nspace = (duk_small_int_t) duk_to_int_clamped(thr, idx_space, 0 /*minval*/, 10 /*maxval*/); @@ -39445,7 +40434,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, DUK_ASSERT(js_ctx->h_gap != NULL); } else if (duk_is_string_notsymbol(thr, idx_space)) { duk_dup(thr, idx_space); - duk_substring(thr, -1, 0, 10); /* clamp to 10 chars */ + duk_substring(thr, -1, 0, 10); /* clamp to 10 chars */ js_ctx->h_gap = duk_known_hstring(thr, -1); } else { /* nop */ @@ -39469,8 +40458,8 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, */ #if defined(DUK_USE_JSON_STRINGIFY_FASTPATH) - if (js_ctx->h_replacer == NULL && /* replacer is a mutation risk */ - js_ctx->idx_proplist == -1) { /* proplist is very rare */ + if (js_ctx->h_replacer == NULL && /* replacer is a mutation risk */ + js_ctx->idx_proplist == -1) { /* proplist is very rare */ duk_int_t pcall_rc; duk_small_uint_t prev_ms_base_flags; @@ -39495,10 +40484,9 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, /* Must prevent finalizers which may have arbitrary side effects. */ prev_ms_base_flags = thr->heap->ms_base_flags; - thr->heap->ms_base_flags |= - DUK_MS_FLAG_NO_OBJECT_COMPACTION; /* Avoid attempt to compact any objects. */ - thr->heap->pf_prevent_count++; /* Prevent finalizers. */ - DUK_ASSERT(thr->heap->pf_prevent_count != 0); /* Wrap. */ + thr->heap->ms_base_flags |= DUK_MS_FLAG_NO_OBJECT_COMPACTION; /* Avoid attempt to compact any objects. */ + thr->heap->pf_prevent_count++; /* Prevent finalizers. */ + DUK_ASSERT(thr->heap->pf_prevent_count != 0); /* Wrap. */ pcall_rc = duk_safe_call(thr, duk__json_stringify_fast, (void *) js_ctx /*udata*/, 1 /*nargs*/, 0 /*nret*/); @@ -39549,7 +40537,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, js_ctx->recursion_limit = DUK_USE_JSON_ENC_RECLIMIT; DUK_ASSERT(js_ctx->recursion_depth == 0); - if (DUK_UNLIKELY(duk__json_enc_value(js_ctx, idx_holder) == 0)) { /* [ ... holder key ] -> [ ... holder ] */ + if (DUK_UNLIKELY(duk__json_enc_value(js_ctx, idx_holder) == 0)) { /* [ ... holder key ] -> [ ... holder ] */ /* Result is undefined. */ duk_push_undefined(thr); } else { @@ -39571,7 +40559,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, */ #if defined(DUK_USE_JSON_STRINGIFY_FASTPATH) - replace_finished: +replace_finished: #endif duk_replace(thr, entry_top); duk_set_top(thr, entry_top + 1); @@ -39595,25 +40583,18 @@ void duk_bi_json_stringify_helper(duk_hthread *thr, */ DUK_INTERNAL duk_ret_t duk_bi_json_object_parse(duk_hthread *thr) { - duk_bi_json_parse_helper(thr, - 0 /*idx_value*/, - 1 /*idx_replacer*/, - 0 /*flags*/); + duk_bi_json_parse_helper(thr, 0 /*idx_value*/, 1 /*idx_replacer*/, 0 /*flags*/); return 1; } DUK_INTERNAL duk_ret_t duk_bi_json_object_stringify(duk_hthread *thr) { - duk_bi_json_stringify_helper(thr, - 0 /*idx_value*/, - 1 /*idx_replacer*/, - 2 /*idx_space*/, - 0 /*flags*/); + duk_bi_json_stringify_helper(thr, 0 /*idx_value*/, 1 /*idx_replacer*/, 2 /*idx_space*/, 0 /*flags*/); return 1; } -#endif /* DUK_USE_JSON_BUILTIN */ +#endif /* DUK_USE_JSON_BUILTIN */ -#endif /* DUK_USE_JSON_SUPPORT */ +#endif /* DUK_USE_JSON_SUPPORT */ /* automatic undefs */ #undef DUK__EMIT_1 @@ -39771,7 +40752,7 @@ DUK_LOCAL double duk__trunc(double x) { return x >= 0.0 ? DUK_FLOOR(x) : DUK_CEIL(x); #endif } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ DUK_LOCAL double duk__round_fixed(double x) { /* Numbers half-way between integers must be rounded towards +Infinity, @@ -39886,51 +40867,23 @@ DUK_LOCAL double duk__atan2_fixed(double x, double y) { return DUK_ATAN2(x, y); } -#endif /* DUK_USE_AVOID_PLATFORM_FUNCPTRS */ +#endif /* DUK_USE_AVOID_PLATFORM_FUNCPTRS */ /* order must match constants in genbuiltins.py */ DUK_LOCAL const duk__one_arg_func duk__one_arg_funcs[] = { #if defined(DUK_USE_AVOID_PLATFORM_FUNCPTRS) - duk__fabs, - duk__acos, - duk__asin, - duk__atan, - duk__ceil, - duk__cos, - duk__exp, - duk__floor, - duk__log, - duk__round_fixed, - duk__sin, - duk__sqrt, - duk__tan, + duk__fabs, duk__acos, duk__asin, duk__atan, duk__ceil, duk__cos, duk__exp, + duk__floor, duk__log, duk__round_fixed, duk__sin, duk__sqrt, duk__tan, #if defined(DUK_USE_ES6) - duk__cbrt, - duk__log2, - duk__log10, - duk__trunc + duk__cbrt, duk__log2, duk__log10, duk__trunc #endif -#else /* DUK_USE_AVOID_PLATFORM_FUNCPTRS */ - DUK_FABS, - DUK_ACOS, - DUK_ASIN, - DUK_ATAN, - DUK_CEIL, - DUK_COS, - DUK_EXP, - DUK_FLOOR, - DUK_LOG, - duk__round_fixed, - DUK_SIN, - DUK_SQRT, - DUK_TAN, +#else /* DUK_USE_AVOID_PLATFORM_FUNCPTRS */ + DUK_FABS, DUK_ACOS, DUK_ASIN, DUK_ATAN, DUK_CEIL, DUK_COS, DUK_EXP, + DUK_FLOOR, DUK_LOG, duk__round_fixed, DUK_SIN, DUK_SQRT, DUK_TAN, #if defined(DUK_USE_ES6) - duk__cbrt, - duk__log2, - duk__log10, - duk__trunc + duk__cbrt, duk__log2, duk__log10, duk__trunc #endif -#endif /* DUK_USE_AVOID_PLATFORM_FUNCPTRS */ +#endif /* DUK_USE_AVOID_PLATFORM_FUNCPTRS */ }; /* order must match constants in genbuiltins.py */ @@ -39965,7 +40918,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_twoarg_shared(duk_hthread *thr) { DUK_ASSERT(fun_idx >= 0); DUK_ASSERT(fun_idx < (duk_small_int_t) (sizeof(duk__two_arg_funcs) / sizeof(duk__two_arg_func))); - arg1 = duk_to_number(thr, 0); /* explicit ordered evaluation to match coercion semantics */ + arg1 = duk_to_number(thr, 0); /* explicit ordered evaluation to match coercion semantics */ arg2 = duk_to_number(thr, 1); fun = duk__two_arg_funcs[fun_idx]; duk_push_number(thr, (duk_double_t) fun((double) arg1, (double) arg2)); @@ -39981,7 +40934,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_min(duk_hthread *thr) { } DUK_INTERNAL duk_ret_t duk_bi_math_object_random(duk_hthread *thr) { - duk_push_number(thr, (duk_double_t) DUK_UTIL_GET_RANDOM_DOUBLE(thr)); + duk_push_number(thr, (duk_double_t) duk_util_get_random_double(thr)); return 1; } @@ -40051,7 +41004,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_hypot(duk_hthread *thr) { duk_push_number(thr, (duk_double_t) DUK_SQRT(sum) * max); return 1; } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ #if defined(DUK_USE_ES6) DUK_INTERNAL duk_ret_t duk_bi_math_object_sign(duk_hthread *thr) { @@ -40060,7 +41013,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_sign(duk_hthread *thr) { d = duk_to_number(thr, 0); if (duk_double_is_nan(d)) { DUK_ASSERT(duk_is_nan(thr, -1)); - return 1; /* NaN input -> return NaN */ + return 1; /* NaN input -> return NaN */ } if (duk_double_equals(d, 0.0)) { /* Zero sign kept, i.e. -0 -> -0, +0 -> +0. */ @@ -40069,7 +41022,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_sign(duk_hthread *thr) { duk_push_int(thr, (d > 0.0 ? 1 : -1)); return 1; } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ #if defined(DUK_USE_ES6) DUK_INTERNAL duk_ret_t duk_bi_math_object_clz32(duk_hthread *thr) { @@ -40089,7 +41042,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_clz32(duk_hthread *thr) { DUK_ASSERT(i <= 32); duk_push_uint(thr, i); return 1; -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ i = 0; x = duk_to_uint32(thr, 0); if (x & 0xffff0000UL) { @@ -40125,9 +41078,9 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_clz32(duk_hthread *thr) { DUK_ASSERT(i <= 32); duk_push_uint(thr, i); return 1; -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ #if defined(DUK_USE_ES6) DUK_INTERNAL duk_ret_t duk_bi_math_object_imul(duk_hthread *thr) { @@ -40144,9 +41097,9 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_imul(duk_hthread *thr) { duk_push_i32(thr, (duk_int32_t) z); return 1; } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ -#endif /* DUK_USE_MATH_BUILTIN */ +#endif /* DUK_USE_MATH_BUILTIN */ /* * Number built-ins */ @@ -40168,8 +41121,7 @@ DUK_LOCAL duk_double_t duk__push_this_number_plain(duk_hthread *thr) { goto done; } h = duk_get_hobject(thr, -1); - if (!h || - (DUK_HOBJECT_GET_CLASS_NUMBER(h) != DUK_HOBJECT_CLASS_NUMBER)) { + if (!h || (DUK_HOBJECT_GET_CLASS_NUMBER(h) != DUK_HOBJECT_CLASS_NUMBER)) { DUK_DDD(DUK_DDDPRINT("unacceptable this value: %!T", (duk_tval *) duk_get_tval(thr, -1))); DUK_ERROR_TYPE(thr, "number expected"); DUK_WO_NORETURN(return 0.0;); @@ -40177,10 +41129,11 @@ DUK_LOCAL duk_double_t duk__push_this_number_plain(duk_hthread *thr) { duk_xget_owndataprop_stridx_short(thr, -1, DUK_STRIDX_INT_VALUE); DUK_ASSERT(duk_is_number(thr, -1)); DUK_DDD(DUK_DDDPRINT("number object: %!T, internal value: %!T", - (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); + (duk_tval *) duk_get_tval(thr, -2), + (duk_tval *) duk_get_tval(thr, -1))); duk_remove_m2(thr); - done: +done: return duk_get_number(thr, -1); } @@ -40229,9 +41182,9 @@ DUK_INTERNAL duk_ret_t duk_bi_number_constructor(duk_hthread *thr) { DUK_ASSERT(DUK_HOBJECT_GET_CLASS_NUMBER(h_this) == DUK_HOBJECT_CLASS_NUMBER); DUK_ASSERT(DUK_HOBJECT_HAS_EXTENSIBLE(h_this)); - duk_dup_0(thr); /* -> [ val obj val ] */ + duk_dup_0(thr); /* -> [ val obj val ] */ duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_VALUE, DUK_PROPDESC_FLAGS_NONE); - return 0; /* no return value -> don't replace created value */ + return 0; /* no return value -> don't replace created value */ } DUK_INTERNAL duk_ret_t duk_bi_number_prototype_value_of(duk_hthread *thr) { @@ -40253,10 +41206,7 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_string(duk_hthread *thr) { n2s_flags = 0; - duk_numconv_stringify(thr, - radix /*radix*/, - 0 /*digits*/, - n2s_flags /*flags*/); + duk_numconv_stringify(thr, radix /*radix*/, 0 /*digits*/, n2s_flags /*flags*/); return 1; } @@ -40294,16 +41244,12 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_fixed(duk_hthread *thr) { goto use_to_string; } - n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT | - DUK_N2S_FLAG_FRACTION_DIGITS; + n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT | DUK_N2S_FLAG_FRACTION_DIGITS; - duk_numconv_stringify(thr, - 10 /*radix*/, - frac_digits /*digits*/, - n2s_flags /*flags*/); + duk_numconv_stringify(thr, 10 /*radix*/, frac_digits /*digits*/, n2s_flags /*flags*/); return 1; - use_to_string: +use_to_string: DUK_ASSERT_TOP(thr, 2); duk_to_string(thr, -1); return 1; @@ -40319,7 +41265,7 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_exponential(duk_hthread *thr) d = duk__push_this_number_plain(thr); frac_undefined = duk_is_undefined(thr, 0); - duk_to_int(thr, 0); /* for side effects */ + duk_to_int(thr, 0); /* for side effects */ c = (duk_small_int_t) DUK_FPCLASSIFY(d); if (c == DUK_FP_NAN || c == DUK_FP_INFINITE) { @@ -40328,16 +41274,12 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_exponential(duk_hthread *thr) frac_digits = (duk_small_int_t) duk_to_int_check_range(thr, 0, 0, 20); - n2s_flags = DUK_N2S_FLAG_FORCE_EXP | - (frac_undefined ? 0 : DUK_N2S_FLAG_FIXED_FORMAT); + n2s_flags = DUK_N2S_FLAG_FORCE_EXP | (frac_undefined ? 0 : DUK_N2S_FLAG_FIXED_FORMAT); - duk_numconv_stringify(thr, - 10 /*radix*/, - frac_digits + 1 /*leading digit + fractions*/, - n2s_flags /*flags*/); + duk_numconv_stringify(thr, 10 /*radix*/, frac_digits + 1 /*leading digit + fractions*/, n2s_flags /*flags*/); return 1; - use_to_string: +use_to_string: DUK_ASSERT_TOP(thr, 2); duk_to_string(thr, -1); return 1; @@ -40362,7 +41304,7 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_precision(duk_hthread *thr) { } DUK_ASSERT_TOP(thr, 2); - duk_to_int(thr, 0); /* for side effects */ + duk_to_int(thr, 0); /* for side effects */ c = (duk_small_int_t) DUK_FPCLASSIFY(d); if (c == DUK_FP_NAN || c == DUK_FP_INFINITE) { @@ -40371,16 +41313,12 @@ DUK_INTERNAL duk_ret_t duk_bi_number_prototype_to_precision(duk_hthread *thr) { prec = (duk_small_int_t) duk_to_int_check_range(thr, 0, 1, 21); - n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT | - DUK_N2S_FLAG_NO_ZERO_PAD; + n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT | DUK_N2S_FLAG_NO_ZERO_PAD; - duk_numconv_stringify(thr, - 10 /*radix*/, - prec /*digits*/, - n2s_flags /*flags*/); + duk_numconv_stringify(thr, 10 /*radix*/, prec /*digits*/, n2s_flags /*flags*/); return 1; - use_to_string: +use_to_string: /* Used when precision is undefined; also used for NaN (-> "NaN"), * and +/- infinity (-> "Infinity", "-Infinity"). */ @@ -40406,16 +41344,16 @@ DUK_INTERNAL duk_ret_t duk_bi_number_check_shared(duk_hthread *thr) { d = duk_get_number(thr, 0); switch (magic) { - case 0: /* isFinite() */ + case 0: /* isFinite() */ ret = duk_double_is_finite(d); break; - case 1: /* isInteger() */ + case 1: /* isInteger() */ ret = duk_double_is_integer(d); break; - case 2: /* isNaN() */ + case 2: /* isNaN() */ ret = duk_double_is_nan(d); break; - default: /* isSafeInteger() */ + default: /* isSafeInteger() */ DUK_ASSERT(magic == 3); ret = duk_double_is_safe_integer(d); } @@ -40424,9 +41362,9 @@ DUK_INTERNAL duk_ret_t duk_bi_number_check_shared(duk_hthread *thr) { duk_push_boolean(thr, ret); return 1; } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ -#endif /* DUK_USE_NUMBER_BUILTIN */ +#endif /* DUK_USE_NUMBER_BUILTIN */ /* * Object built-ins */ @@ -40448,8 +41386,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor(duk_hthread *thr) { arg_mask = duk_get_type_mask(thr, 0); - if (!duk_is_constructor_call(thr) && /* not a constructor call */ - ((arg_mask & (DUK_TYPE_MASK_NULL | DUK_TYPE_MASK_UNDEFINED)) == 0)) { /* and argument not null or undefined */ + if (!duk_is_constructor_call(thr) && /* not a constructor call */ + ((arg_mask & (DUK_TYPE_MASK_NULL | DUK_TYPE_MASK_UNDEFINED)) == 0)) { /* and argument not null or undefined */ duk_to_object(thr, 0); return 1; } @@ -40459,13 +41397,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor(duk_hthread *thr) { * promote to an object value. Lightfuncs and plain buffers are * coerced with ToObject() even they could also be returned as is. */ - if (arg_mask & (DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_STRING | - DUK_TYPE_MASK_BOOLEAN | - DUK_TYPE_MASK_NUMBER | - DUK_TYPE_MASK_POINTER | - DUK_TYPE_MASK_BUFFER | - DUK_TYPE_MASK_LIGHTFUNC)) { + if (arg_mask & (DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_STRING | DUK_TYPE_MASK_BOOLEAN | DUK_TYPE_MASK_NUMBER | + DUK_TYPE_MASK_POINTER | DUK_TYPE_MASK_BUFFER | DUK_TYPE_MASK_LIGHTFUNC)) { /* For DUK_TYPE_OBJECT the coercion is a no-op and could * be checked for explicitly, but Object(obj) calls are * not very common so opt for minimal footprint. @@ -40475,13 +41408,12 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor(duk_hthread *thr) { } (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), DUK_BIDX_OBJECT_PROTOTYPE); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) && defined(DUK_USE_ES6) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_assign(duk_hthread *thr) { @@ -40538,9 +41470,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_create(duk_hthread *thr) { DUK_ASSERT(proto != NULL || duk_is_null(thr, 0)); (void) duk_push_object_helper_proto(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), proto); if (!duk_is_undefined(thr, 1)) { @@ -40561,7 +41492,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_create(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_properties(duk_hthread *thr) { @@ -40576,11 +41507,9 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_properties(duk_hthread * obj = duk_require_hobject_promote_mask(thr, 0, DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER); DUK_ASSERT(obj != NULL); - duk_to_object(thr, 1); /* properties object */ + duk_to_object(thr, 1); /* properties object */ - DUK_DDD(DUK_DDDPRINT("target=%!iT, properties=%!iT", - (duk_tval *) duk_get_tval(thr, 0), - (duk_tval *) duk_get_tval(thr, 1))); + DUK_DDD(DUK_DDDPRINT("target=%!iT, properties=%!iT", (duk_tval *) duk_get_tval(thr, 0), (duk_tval *) duk_get_tval(thr, 1))); /* * Two pass approach to processing the property descriptors. @@ -40593,7 +41522,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_properties(duk_hthread * */ for (pass = 0; pass < 2; pass++) { - duk_set_top(thr, 2); /* -> [ hobject props ] */ + duk_set_top(thr, 2); /* -> [ hobject props ] */ duk_enum(thr, 1, DUK_ENUM_OWN_PROPERTIES_ONLY | DUK_ENUM_INCLUDE_SYMBOLS /*enum_flags*/); for (;;) { @@ -40613,12 +41542,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_properties(duk_hthread * /* [ hobject props enum(props) key desc ] */ - duk_hobject_prepare_property_descriptor(thr, - 4 /*idx_desc*/, - &defprop_flags, - &idx_value, - &get, - &set); + duk_hobject_prepare_property_descriptor(thr, 4 /*idx_desc*/, &defprop_flags, &idx_value, &get, &set); /* [ hobject props enum(props) key desc [multiple values] ] */ @@ -40630,14 +41554,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_properties(duk_hthread * key = duk_known_hstring(thr, 3); DUK_ASSERT(key != NULL); - duk_hobject_define_property_helper(thr, - defprop_flags, - obj, - key, - idx_value, - get, - set, - 1 /*throw_flag*/); + duk_hobject_define_property_helper(thr, defprop_flags, obj, key, idx_value, get, set, 1 /*throw_flag*/); } } @@ -40648,7 +41565,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_properties(duk_hthread * duk_dup_0(thr); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_seal_freeze_shared(duk_hthread *thr) { @@ -40657,7 +41574,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_seal_freeze_shared(duk_hthread duk_seal_freeze_raw(thr, 0, (duk_bool_t) duk_get_current_magic(thr) /*is_freeze*/); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_is_sealed_frozen_shared(duk_hthread *thr) { @@ -40669,34 +41586,33 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_is_sealed_frozen_shared(duk_hth mask = duk_get_type_mask(thr, 0); if (mask & (DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER)) { DUK_ASSERT(is_frozen == 0 || is_frozen == 1); - duk_push_boolean(thr, (mask & DUK_TYPE_MASK_LIGHTFUNC) ? - 1 : /* lightfunc always frozen and sealed */ - (is_frozen ^ 1)); /* buffer sealed but not frozen (index props writable) */ + duk_push_boolean(thr, + (mask & DUK_TYPE_MASK_LIGHTFUNC) ? 1 : /* lightfunc always frozen and sealed */ + (is_frozen ^ 1)); /* buffer sealed but not frozen (index props writable) */ } else { /* ES2015 Sections 19.1.2.12, 19.1.2.13: anything other than an object * is considered to be already sealed and frozen. */ h = duk_get_hobject(thr, 0); - duk_push_boolean(thr, (h == NULL) || - duk_hobject_object_is_sealed_frozen_helper(thr, h, is_frozen /*is_frozen*/)); + duk_push_boolean(thr, (h == NULL) || duk_hobject_object_is_sealed_frozen_helper(thr, h, is_frozen /*is_frozen*/)); } return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_prototype_to_locale_string(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 0); (void) duk_push_this_coercible_to_object(thr); duk_get_prop_stridx_short(thr, 0, DUK_STRIDX_TO_STRING); -#if 0 /* This is mentioned explicitly in the E5.1 spec, but duk_call_method() checks for it in practice. */ +#if 0 /* This is mentioned explicitly in the E5.1 spec, but duk_call_method() checks for it in practice. */ duk_require_callable(thr, 1); #endif - duk_dup_0(thr); /* -> [ O toString O ] */ - duk_call_method(thr, 0); /* XXX: call method tail call? */ + duk_dup_0(thr); /* -> [ O toString O ] */ + duk_call_method(thr, 0); /* XXX: call method tail call? */ return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_prototype_value_of(duk_hthread *thr) { @@ -40704,7 +41620,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_prototype_value_of(duk_hthread *thr) { (void) duk_push_this_coercible_to_object(thr); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_prototype_is_prototype_of(duk_hthread *thr) { @@ -40715,7 +41631,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_prototype_is_prototype_of(duk_hthread *thr) h_v = duk_get_hobject(thr, 0); if (!h_v) { - duk_push_false(thr); /* XXX: tail call: return duk_push_false(thr) */ + duk_push_false(thr); /* XXX: tail call: return duk_push_false(thr) */ return 1; } @@ -40725,22 +41641,24 @@ DUK_INTERNAL duk_ret_t duk_bi_object_prototype_is_prototype_of(duk_hthread *thr) /* E5.1 Section 15.2.4.6, step 3.a, lookup proto once before compare. * Prototype loops should cause an error to be thrown. */ - duk_push_boolean(thr, duk_hobject_prototype_chain_contains(thr, DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_v), h_obj, 0 /*ignore_loop*/)); + duk_push_boolean( + thr, + duk_hobject_prototype_chain_contains(thr, DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_v), h_obj, 0 /*ignore_loop*/)); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_prototype_has_own_property(duk_hthread *thr) { return (duk_ret_t) duk_hobject_object_ownprop_helper(thr, 0 /*required_desc_flags*/); } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_prototype_property_is_enumerable(duk_hthread *thr) { return (duk_ret_t) duk_hobject_object_ownprop_helper(thr, DUK_PROPDESC_FLAG_ENUMERABLE /*required_desc_flags*/); } -#endif /* DUK_USE_OBJECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) /* Shared helper to implement Object.getPrototypeOf, @@ -40797,7 +41715,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_getprototype_shared(duk_hthread *thr) { } return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) /* Shared helper to implement ES2015 Object.setPrototypeOf, @@ -40816,7 +41734,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_hthread *thr) { duk_hobject *h_obj; duk_hobject *h_new_proto; duk_hobject *h_curr; - duk_ret_t ret_success = 1; /* retval for success path */ + duk_ret_t ret_success = 1; /* retval for success path */ duk_uint_t mask; duk_int_t magic; @@ -40837,9 +41755,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_hthread *thr) { if (magic == 1) { duk_require_object_coercible(thr, 0); } else { - duk_require_hobject_accept_mask(thr, 0, - DUK_TYPE_MASK_LIGHTFUNC | - DUK_TYPE_MASK_BUFFER); + duk_require_hobject_accept_mask(thr, 0, DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER); } duk_require_type_mask(thr, 1, DUK_TYPE_MASK_NULL | DUK_TYPE_MASK_OBJECT); } @@ -40850,9 +41766,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_hthread *thr) { mask = duk_get_type_mask(thr, 0); if (mask & (DUK_TYPE_MASK_LIGHTFUNC | DUK_TYPE_MASK_BUFFER)) { duk_hobject *curr_proto; - curr_proto = thr->builtins[(mask & DUK_TYPE_MASK_LIGHTFUNC) ? - DUK_BIDX_FUNCTION_PROTOTYPE : - DUK_BIDX_UINT8ARRAY_PROTOTYPE]; + curr_proto = + thr->builtins[(mask & DUK_TYPE_MASK_LIGHTFUNC) ? DUK_BIDX_FUNCTION_PROTOTYPE : DUK_BIDX_UINT8ARRAY_PROTOTYPE]; if (h_new_proto == curr_proto) { goto skip; } @@ -40882,15 +41797,15 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_hthread *thr) { DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr, h_obj, h_new_proto); /* fall thru */ - skip: +skip: duk_set_top(thr, 1); if (magic == 2) { duk_push_true(thr); } return ret_success; - fail_nonextensible: - fail_loop: +fail_nonextensible: +fail_loop: if (magic != 2) { DUK_DCERROR_TYPE_INVALID_ARGS(thr); } else { @@ -40898,7 +41813,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_setprototype_shared(duk_hthread *thr) { return 1; } } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_property(duk_hthread *thr) { @@ -40950,12 +41865,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_property(duk_hthread *th * Lightfunc set/get values are coerced to full Functions. */ - duk_hobject_prepare_property_descriptor(thr, - 2 /*idx_desc*/, - &defprop_flags, - &idx_value, - &get, - &set); + duk_hobject_prepare_property_descriptor(thr, 2 /*idx_desc*/, &defprop_flags, &idx_value, &get, &set); /* * Use Object.defineProperty() helper for the actual operation. @@ -40963,14 +41873,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_property(duk_hthread *th DUK_ASSERT(magic == 0U || magic == 1U); throw_flag = magic ^ 1U; - ret = duk_hobject_define_property_helper(thr, - defprop_flags, - obj, - key, - idx_value, - get, - set, - throw_flag); + ret = duk_hobject_define_property_helper(thr, defprop_flags, obj, key, idx_value, get, set, throw_flag); /* Ignore the normalize/validate helper outputs on the value stack, * they're popped automatically. @@ -40985,7 +41888,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_define_property(duk_hthread *th } return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_get_own_property_descriptor(duk_hthread *thr) { @@ -41001,7 +41904,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_get_own_property_descriptor(duk duk_hobject_object_get_own_property_descriptor(thr, -2); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_is_extensible(duk_hthread *thr) { @@ -41024,7 +41927,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_is_extensible(duk_hthread *thr) duk_push_boolean(thr, (h != NULL) && DUK_HOBJECT_HAS_EXTENSIBLE(h)); return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) /* Shared helper for various key/symbol listings, magic: @@ -41035,26 +41938,17 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_is_extensible(duk_hthread *thr) */ DUK_LOCAL const duk_small_uint_t duk__object_keys_enum_flags[4] = { /* Object.keys() */ - DUK_ENUM_OWN_PROPERTIES_ONLY | - DUK_ENUM_NO_PROXY_BEHAVIOR, + DUK_ENUM_OWN_PROPERTIES_ONLY | DUK_ENUM_NO_PROXY_BEHAVIOR, /* Object.getOwnPropertyNames() */ - DUK_ENUM_INCLUDE_NONENUMERABLE | - DUK_ENUM_OWN_PROPERTIES_ONLY | - DUK_ENUM_NO_PROXY_BEHAVIOR, + DUK_ENUM_INCLUDE_NONENUMERABLE | DUK_ENUM_OWN_PROPERTIES_ONLY | DUK_ENUM_NO_PROXY_BEHAVIOR, /* Object.getOwnPropertySymbols() */ - DUK_ENUM_INCLUDE_SYMBOLS | - DUK_ENUM_OWN_PROPERTIES_ONLY | - DUK_ENUM_EXCLUDE_STRINGS | - DUK_ENUM_INCLUDE_NONENUMERABLE | + DUK_ENUM_INCLUDE_SYMBOLS | DUK_ENUM_OWN_PROPERTIES_ONLY | DUK_ENUM_EXCLUDE_STRINGS | DUK_ENUM_INCLUDE_NONENUMERABLE | DUK_ENUM_NO_PROXY_BEHAVIOR, /* Reflect.ownKeys() */ - DUK_ENUM_INCLUDE_SYMBOLS | - DUK_ENUM_OWN_PROPERTIES_ONLY | - DUK_ENUM_INCLUDE_NONENUMERABLE | - DUK_ENUM_NO_PROXY_BEHAVIOR + DUK_ENUM_INCLUDE_SYMBOLS | DUK_ENUM_OWN_PROPERTIES_ONLY | DUK_ENUM_INCLUDE_NONENUMERABLE | DUK_ENUM_NO_PROXY_BEHAVIOR }; DUK_INTERNAL duk_ret_t duk_bi_object_constructor_keys_shared(duk_hthread *thr) { @@ -41086,9 +41980,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_keys_shared(duk_hthread *thr) { #if defined(DUK_USE_ES6_PROXY) /* XXX: better sharing of code between proxy target call sites */ - if (DUK_LIKELY(!duk_hobject_proxy_check(obj, - &h_proxy_target, - &h_proxy_handler))) { + if (DUK_LIKELY(!duk_hobject_proxy_check(obj, &h_proxy_target, &h_proxy_handler))) { goto skip_proxy; } @@ -41107,8 +41999,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_keys_shared(duk_hthread *thr) { /* [ obj handler trap ] */ duk_insert(thr, -2); - duk_push_hobject(thr, h_proxy_target); /* -> [ obj trap handler target ] */ - duk_call_method(thr, 1 /*nargs*/); /* -> [ obj trap_result ] */ + duk_push_hobject(thr, h_proxy_target); /* -> [ obj trap handler target ] */ + duk_call_method(thr, 1 /*nargs*/); /* -> [ obj trap_result ] */ h_trap_result = duk_require_hobject(thr, -1); DUK_UNREF(h_trap_result); @@ -41119,8 +42011,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_keys_shared(duk_hthread *thr) { duk_proxy_ownkeys_postprocess(thr, h_proxy_target, enum_flags); return 1; - skip_proxy: -#endif /* DUK_USE_ES6_PROXY */ +skip_proxy: +#endif /* DUK_USE_ES6_PROXY */ DUK_ASSERT_TOP(thr, 1); magic = duk_get_current_magic(thr); @@ -41128,7 +42020,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_keys_shared(duk_hthread *thr) { enum_flags = duk__object_keys_enum_flags[magic]; return duk_hobject_get_enumerated_keys(thr, enum_flags); } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ #if defined(DUK_USE_OBJECT_BUILTIN) || defined(DUK_USE_REFLECT_BUILTIN) DUK_INTERNAL duk_ret_t duk_bi_object_constructor_prevent_extensions(duk_hthread *thr) { @@ -41148,12 +42040,8 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_prevent_extensions(duk_hthread /* Object.preventExtensions() silent success for non-object. */ if (magic == 0) { - mask |= DUK_TYPE_MASK_UNDEFINED | - DUK_TYPE_MASK_NULL | - DUK_TYPE_MASK_BOOLEAN | - DUK_TYPE_MASK_NUMBER | - DUK_TYPE_MASK_STRING | - DUK_TYPE_MASK_POINTER; + mask |= DUK_TYPE_MASK_UNDEFINED | DUK_TYPE_MASK_NULL | DUK_TYPE_MASK_BOOLEAN | DUK_TYPE_MASK_NUMBER | + DUK_TYPE_MASK_STRING | DUK_TYPE_MASK_POINTER; } if (duk_check_type_mask(thr, 0, mask)) { @@ -41170,13 +42058,13 @@ DUK_INTERNAL duk_ret_t duk_bi_object_constructor_prevent_extensions(duk_hthread */ duk_hobject_compact_props(thr, h); - done: +done: if (magic == 1) { duk_push_true(thr); } return 1; } -#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_OBJECT_BUILTIN || DUK_USE_REFLECT_BUILTIN */ /* * __defineGetter__, __defineSetter__, __lookupGetter__, __lookupSetter__ @@ -41192,9 +42080,10 @@ DUK_INTERNAL duk_ret_t duk_bi_object_prototype_defineaccessor(duk_hthread *thr) /* [ ToObject(this) key getter/setter ] */ /* ToPropertyKey() coercion is not needed, duk_def_prop() does it. */ - duk_def_prop(thr, 0, DUK_DEFPROP_SET_ENUMERABLE | - DUK_DEFPROP_SET_CONFIGURABLE | - (duk_get_current_magic(thr) ? DUK_DEFPROP_HAVE_SETTER : DUK_DEFPROP_HAVE_GETTER)); + duk_def_prop(thr, + 0, + DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE | + (duk_get_current_magic(thr) ? DUK_DEFPROP_HAVE_SETTER : DUK_DEFPROP_HAVE_GETTER)); return 0; } DUK_INTERNAL duk_ret_t duk_bi_object_prototype_lookupaccessor(duk_hthread *thr) { @@ -41229,7 +42118,7 @@ DUK_INTERNAL duk_ret_t duk_bi_object_prototype_lookupaccessor(duk_hthread *thr) } return 1; } -#endif /* DUK_USE_ES8 */ +#endif /* DUK_USE_ES8 */ /* * High resolution time API (performance.now() et al) * @@ -41250,7 +42139,7 @@ DUK_INTERNAL duk_ret_t duk_bi_performance_now(duk_hthread *thr) { return 1; } -#if 0 /* Missing until semantics decided. */ +#if 0 /* Missing until semantics decided. */ DUK_INTERNAL duk_ret_t duk_bi_performance_timeorigin_getter(duk_hthread *thr) { /* No decision yet how to handle timeOrigins, e.g. should one be * initialized per heap, or per global object set. See @@ -41259,8 +42148,8 @@ DUK_INTERNAL duk_ret_t duk_bi_performance_timeorigin_getter(duk_hthread *thr) { duk_push_uint(thr, 0); return 1; } -#endif /* 0 */ -#endif /* DUK_USE_PERFORMANCE_BUILTIN */ +#endif /* 0 */ +#endif /* DUK_USE_PERFORMANCE_BUILTIN */ /* * Pointer built-ins */ @@ -41286,9 +42175,8 @@ DUK_INTERNAL duk_ret_t duk_bi_pointer_constructor(duk_hthread *thr) { if (duk_is_constructor_call(thr)) { (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_POINTER), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_POINTER), DUK_BIDX_POINTER_PROTOTYPE); /* Pointer object internal value is immutable. */ @@ -41333,7 +42221,7 @@ DUK_INTERNAL duk_ret_t duk_bi_pointer_prototype_tostring_shared(duk_hthread *thr } return 1; - type_error: +type_error: DUK_DCERROR_TYPE_INVALID_ARGS(thr); } /* @@ -41379,7 +42267,7 @@ DUK_INTERNAL duk_ret_t duk_bi_promise_then(duk_hthread *thr) { DUK_WO_NORETURN(return 0;); } -#endif /* DUK_USE_PROMISE_BUILTIN */ +#endif /* DUK_USE_PROMISE_BUILTIN */ /* * Proxy built-in (ES2015) */ @@ -41450,7 +42338,7 @@ DUK_INTERNAL void duk_proxy_ownkeys_postprocess(duk_hthread *thr, duk_hobject *h duk_def_prop(thr, -3, DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_SET_WEC); continue; - skip_key: + skip_key: duk_pop(thr); continue; } @@ -41467,17 +42355,17 @@ DUK_INTERNAL void duk_proxy_ownkeys_postprocess(duk_hthread *thr, duk_hobject *h * handled above. */ } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ #if defined(DUK_USE_ES6_PROXY) DUK_INTERNAL duk_ret_t duk_bi_proxy_constructor(duk_hthread *thr) { - DUK_ASSERT_TOP(thr, 2); /* [ target handler ] */ + DUK_ASSERT_TOP(thr, 2); /* [ target handler ] */ duk_require_constructor_call(thr); - duk_push_proxy(thr, 0 /*flags*/); /* [ target handler ] -> [ proxy ] */ - return 1; /* replacement */ + duk_push_proxy(thr, 0 /*flags*/); /* [ target handler ] -> [ proxy ] */ + return 1; /* replacement */ } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ /* * 'Reflect' built-in (ES2016 Section 26.1) * http://www.ecma-international.org/ecma-262/7.0/#sec-reflect-object @@ -41527,7 +42415,7 @@ DUK_INTERNAL duk_ret_t duk_bi_reflect_object_get(duk_hthread *thr) { tv_obj = DUK_GET_TVAL_POSIDX(thr, 0); tv_key = DUK_GET_TVAL_POSIDX(thr, 1); - (void) duk_hobject_getprop(thr, tv_obj, tv_key); /* This could also be a duk_get_prop(). */ + (void) duk_hobject_getprop(thr, tv_obj, tv_key); /* This could also be a duk_get_prop(). */ return 1; } @@ -41576,7 +42464,7 @@ DUK_INTERNAL duk_ret_t duk_bi_reflect_object_set(duk_hthread *thr) { duk_push_boolean(thr, ret); return 1; } -#endif /* DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_REFLECT_BUILTIN */ /* * RegExp built-ins */ @@ -41592,7 +42480,7 @@ DUK_LOCAL void duk__get_this_regexp(duk_hthread *thr) { h = duk_require_hobject_with_class(thr, -1, DUK_HOBJECT_CLASS_REGEXP); DUK_ASSERT(h != NULL); DUK_UNREF(h); - duk_insert(thr, 0); /* prepend regexp to valstack 0 index */ + duk_insert(thr, 0); /* prepend regexp to valstack 0 index */ } /* XXX: much to improve (code size) */ @@ -41602,10 +42490,8 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_constructor(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 2); h_pattern = duk_get_hobject(thr, 0); - if (!duk_is_constructor_call(thr) && - h_pattern != NULL && - DUK_HOBJECT_GET_CLASS_NUMBER(h_pattern) == DUK_HOBJECT_CLASS_REGEXP && - duk_is_undefined(thr, 1)) { + if (!duk_is_constructor_call(thr) && h_pattern != NULL && + DUK_HOBJECT_GET_CLASS_NUMBER(h_pattern) == DUK_HOBJECT_CLASS_REGEXP && duk_is_undefined(thr, 1)) { /* Called as a function, pattern has [[Class]] "RegExp" and * flags is undefined -> return object as is. */ @@ -41620,8 +42506,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_constructor(duk_hthread *thr) { * call. */ - if (h_pattern != NULL && - DUK_HOBJECT_GET_CLASS_NUMBER(h_pattern) == DUK_HOBJECT_CLASS_REGEXP) { + if (h_pattern != NULL && DUK_HOBJECT_GET_CLASS_NUMBER(h_pattern) == DUK_HOBJECT_CLASS_REGEXP) { duk_get_prop_stridx_short(thr, 0, DUK_STRIDX_SOURCE); if (duk_is_undefined(thr, 1)) { /* In ES5 one would need to read the flags individually; @@ -41637,20 +42522,21 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_constructor(duk_hthread *thr) { duk_push_hstring_empty(thr); } else { duk_dup_0(thr); - duk_to_string(thr, -1); /* Rejects Symbols. */ + duk_to_string(thr, -1); /* Rejects Symbols. */ } if (duk_is_undefined(thr, 1)) { duk_push_hstring_empty(thr); } else { duk_dup_1(thr); - duk_to_string(thr, -1); /* Rejects Symbols. */ + duk_to_string(thr, -1); /* Rejects Symbols. */ } /* [ ... pattern flags ] */ } DUK_DDD(DUK_DDDPRINT("RegExp constructor/function call, pattern=%!T, flags=%!T", - (duk_tval *) duk_get_tval(thr, -2), (duk_tval *) duk_get_tval(thr, -1))); + (duk_tval *) duk_get_tval(thr, -2), + (duk_tval *) duk_get_tval(thr, -1))); /* [ ... pattern flags ] (both uncoerced) */ @@ -41700,7 +42586,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_tostring(duk_hthread *thr) { duk_push_this(thr); duk_push_literal(thr, "/"); duk_get_prop_stridx(thr, 0, DUK_STRIDX_SOURCE); - duk_dup_m2(thr); /* another "/" */ + duk_dup_m2(thr); /* another "/" */ duk_get_prop_stridx(thr, 0, DUK_STRIDX_FLAGS); duk_concat(thr, 4); return 1; @@ -41710,7 +42596,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_flags(duk_hthread *thr) { /* .flags is ES2015 but present even when ES2015 bindings are * disabled because the constructor relies on it. */ - duk_uint8_t buf[8]; /* enough for all flags + NUL */ + duk_uint8_t buf[8]; /* enough for all flags + NUL */ duk_uint8_t *p = buf; /* .flags is generic and works on any object. */ @@ -41751,7 +42637,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_shared_getter(duk_hthread *thr) { duk_xget_owndataprop_stridx_short(thr, 0, DUK_STRIDX_INT_SOURCE); duk_xget_owndataprop_stridx_short(thr, 0, DUK_STRIDX_INT_BYTECODE); h_bc = duk_require_hstring(thr, -1); - re_flags = (duk_small_uint_t) DUK_HSTRING_GET_DATA(h_bc)[0]; /* Safe even if h_bc length is 0 (= NUL) */ + re_flags = (duk_small_uint_t) DUK_HSTRING_GET_DATA(h_bc)[0]; /* Safe even if h_bc length is 0 (= NUL) */ duk_pop(thr); } else if (h == thr->builtins[DUK_BIDX_REGEXP_PROTOTYPE]) { /* In ES2015 and ES2016 a TypeError would be thrown here. @@ -41762,7 +42648,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_shared_getter(duk_hthread *thr) { if (magic != 16 /* .source */) { return 0; } - duk_push_literal(thr, "(?:)"); /* .source handled by switch-case */ + duk_push_literal(thr, "(?:)"); /* .source handled by switch-case */ re_flags = 0; } else { DUK_DCERROR_TYPE_INVALID_ARGS(thr); @@ -41771,15 +42657,15 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_shared_getter(duk_hthread *thr) { /* [ regexp source ] */ switch (magic) { - case 0: { /* global */ + case 0: { /* global */ duk_push_boolean(thr, (re_flags & DUK_RE_FLAG_GLOBAL)); break; } - case 1: { /* ignoreCase */ + case 1: { /* ignoreCase */ duk_push_boolean(thr, (re_flags & DUK_RE_FLAG_IGNORE_CASE)); break; } - case 2: { /* multiline */ + case 2: { /* multiline */ duk_push_boolean(thr, (re_flags & DUK_RE_FLAG_MULTILINE)); break; } @@ -41793,7 +42679,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_shared_getter(duk_hthread *thr) { break; } #endif - default: { /* source */ + default: { /* source */ /* leave 'source' on top */ break; } @@ -41802,7 +42688,7 @@ DUK_INTERNAL duk_ret_t duk_bi_regexp_prototype_shared_getter(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* * String built-ins * @@ -41841,7 +42727,8 @@ DUK_LOCAL duk_hstring *duk__str_tostring_notregexp(duk_hthread *thr, duk_idx_t i return h; } -DUK_LOCAL duk_int_t duk__str_search_shared(duk_hthread *thr, duk_hstring *h_this, duk_hstring *h_search, duk_int_t start_cpos, duk_bool_t backwards) { +DUK_LOCAL duk_int_t +duk__str_search_shared(duk_hthread *thr, duk_hstring *h_this, duk_hstring *h_search, duk_int_t start_cpos, duk_bool_t backwards) { duk_int_t cpos; duk_int_t bpos; const duk_uint8_t *p_start, *p_end, *p; @@ -41876,7 +42763,7 @@ DUK_LOCAL duk_int_t duk__str_search_shared(duk_hthread *thr, duk_hstring *h_this * must be updated if 'p' is wound back (backward scanning). */ - firstbyte = q_start[0]; /* leading byte of match string */ + firstbyte = q_start[0]; /* leading byte of match string */ while (p <= p_end && p >= p_start) { t = *p; @@ -41942,15 +42829,13 @@ DUK_INTERNAL duk_ret_t duk_bi_string_constructor(duk_hthread *thr) { duk_replace(thr, 0); } } - duk_to_string(thr, 0); /* catches symbol argument for constructor call */ + duk_to_string(thr, 0); /* catches symbol argument for constructor call */ DUK_ASSERT(duk_is_string(thr, 0)); - duk_set_top(thr, 1); /* Top may be 1 or larger. */ + duk_set_top(thr, 1); /* Top may be 1 or larger. */ if (duk_is_constructor_call(thr)) { /* String object internal value is immutable */ - flags = DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | + flags = DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_STRING); duk_push_object_helper(thr, flags, DUK_BIDX_STRING_PROTOTYPE); duk_dup_0(thr); @@ -41976,7 +42861,7 @@ DUK_LOCAL duk_ret_t duk__construct_from_codepoints(duk_hthread *thr, duk_bool_t n = duk_get_top(thr); bw = &bw_alloc; - DUK_BW_INIT_PUSHBUF(thr, bw, (duk_size_t) n); /* initial estimate for ASCII only codepoints */ + DUK_BW_INIT_PUSHBUF(thr, bw, (duk_size_t) n); /* initial estimate for ASCII only codepoints */ for (i = 0; i < n; i++) { /* XXX: could improve bufwriter handling to write multiple codepoints @@ -41990,8 +42875,7 @@ DUK_LOCAL duk_ret_t duk__construct_from_codepoints(duk_hthread *thr, duk_bool_t * the same. */ duk_int32_t i32 = 0; - if (!duk_is_whole_get_int32(duk_to_number(thr, i), &i32) || - i32 < 0 || i32 > 0x10ffffL) { + if (!duk_is_whole_get_int32(duk_to_number(thr, i), &i32) || i32 < 0 || i32 > 0x10ffffL) { DUK_DCERROR_RANGE_INVALID_ARGS(thr); } DUK_ASSERT(i32 >= 0 && i32 <= 0x10ffffL); @@ -42015,7 +42899,7 @@ DUK_LOCAL duk_ret_t duk__construct_from_codepoints(duk_hthread *thr, duk_bool_t } DUK_BW_COMPACT(thr, bw); - (void) duk_buffer_to_string(thr, -1); /* Safe, extended UTF-8 or CESU-8 encoded. */ + (void) duk_buffer_to_string(thr, -1); /* Safe, extended UTF-8 or CESU-8 encoded. */ return 1; } @@ -42057,10 +42941,10 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_to_string(duk_hthread *thr) { goto type_error; } - (void) duk_require_hstring_notsymbol(thr, -1); /* Reject symbols (and wrapped symbols). */ + (void) duk_require_hstring_notsymbol(thr, -1); /* Reject symbols (and wrapped symbols). */ return 1; - type_error: +type_error: DUK_DCERROR_TYPE_INVALID_ARGS(thr); } @@ -42196,7 +43080,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_substr(duk_hthread *thr) { * ("undefined" and "null"). */ duk_push_this(thr); - h = duk_to_hstring_m1(thr); /* Reject Symbols. */ + h = duk_to_hstring_m1(thr); /* Reject Symbols. */ DUK_ASSERT(h != NULL); len = (duk_int_t) DUK_HSTRING_GET_CHARLEN(h); @@ -42228,7 +43112,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_substr(duk_hthread *thr) { duk_substring(thr, -1, (duk_size_t) start_pos, (duk_size_t) end_pos); return 1; } -#endif /* DUK_USE_SECTION_B */ +#endif /* DUK_USE_SECTION_B */ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_slice(duk_hthread *thr) { duk_hstring *h; @@ -42287,7 +43171,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_indexof_shared(duk_hthread *thr) duk_hstring *h_search; duk_int_t clen_this; duk_int_t cpos; - duk_small_uint_t is_lastindexof = (duk_small_uint_t) duk_get_current_magic(thr); /* 0=indexOf, 1=lastIndexOf */ + duk_small_uint_t is_lastindexof = (duk_small_uint_t) duk_get_current_magic(thr); /* 0=indexOf, 1=lastIndexOf */ h_this = duk_push_this_coercible_to_string(thr); DUK_ASSERT(h_this != NULL); @@ -42344,7 +43228,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { duk_int_t match_caps; #endif duk_uint32_t prev_match_end_boff; - const duk_uint8_t *r_start, *r_end, *r; /* repl string scan */ + const duk_uint8_t *r_start, *r_end, *r; /* repl string scan */ duk_size_t tmp_sz; DUK_ASSERT_TOP(thr, 2); @@ -42352,7 +43236,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { DUK_ASSERT(h_input != NULL); bw = &bw_alloc; - DUK_BW_INIT_PUSHBUF(thr, bw, DUK_HSTRING_GET_BYTELEN(h_input)); /* input size is good output starting point */ + DUK_BW_INIT_PUSHBUF(thr, bw, DUK_HSTRING_GET_BYTELEN(h_input)); /* input size is good output starting point */ DUK_ASSERT_TOP(thr, 4); @@ -42373,11 +43257,11 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { duk_push_int(thr, 0); duk_put_prop_stridx_short(thr, 0, DUK_STRIDX_LAST_INDEX); } -#else /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ DUK_DCERROR_UNSUPPORTED(thr); -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ } else { - duk_to_string(thr, 0); /* rejects symbols */ + duk_to_string(thr, 0); /* rejects symbols */ #if defined(DUK_USE_REGEXP_SUPPORT) is_regexp = 0; is_global = 0; @@ -42392,7 +43276,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { duk_hstring *h_repl; is_repl_func = 0; - h_repl = duk_to_hstring(thr, 1); /* reject symbols */ + h_repl = duk_to_hstring(thr, 1); /* reject symbols */ DUK_ASSERT(h_repl != NULL); r_start = DUK_HSTRING_GET_DATA(h_repl); r_end = r_start + DUK_HSTRING_GET_BYTELEN(h_repl); @@ -42430,7 +43314,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { if (is_regexp) { duk_dup_0(thr); duk_dup_2(thr); - duk_regexp_match(thr); /* [ ... regexp input ] -> [ res_obj ] */ + duk_regexp_match(thr); /* [ ... regexp input ] -> [ res_obj ] */ if (!duk_is_object(thr, -1)) { duk_pop(thr); break; @@ -42444,7 +43328,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { duk_get_prop_index(thr, -1, 0); DUK_ASSERT(duk_is_string(thr, -1)); h_match = duk_known_hstring(thr, -1); - duk_pop(thr); /* h_match is borrowed, remains reachable through match_obj */ + duk_pop(thr); /* h_match is borrowed, remains reachable through match_obj */ if (DUK_HSTRING_GET_BYTELEN(h_match) == 0) { /* This should be equivalent to match() algorithm step 8.f.iii.2: @@ -42455,25 +43339,26 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { duk_get_prop_stridx_short(thr, 0, DUK_STRIDX_LAST_INDEX); last_index = (duk_uint32_t) duk_get_uint(thr, -1); DUK_DDD(DUK_DDDPRINT("empty match, bump lastIndex: %ld -> %ld", - (long) last_index, (long) (last_index + 1))); + (long) last_index, + (long) (last_index + 1))); duk_pop(thr); duk_push_uint(thr, (duk_uint_t) (last_index + 1)); duk_put_prop_stridx_short(thr, 0, DUK_STRIDX_LAST_INDEX); } - DUK_ASSERT(duk_get_length(thr, -1) <= DUK_INT_MAX); /* string limits */ + DUK_ASSERT(duk_get_length(thr, -1) <= DUK_INT_MAX); /* string limits */ match_caps = (duk_int_t) duk_get_length(thr, -1); } else { -#else /* DUK_USE_REGEXP_SUPPORT */ - { /* unconditionally */ -#endif /* DUK_USE_REGEXP_SUPPORT */ - const duk_uint8_t *p_start, *p_end, *p; /* input string scan */ - const duk_uint8_t *q_start; /* match string */ +#else /* DUK_USE_REGEXP_SUPPORT */ + { /* unconditionally */ +#endif /* DUK_USE_REGEXP_SUPPORT */ + const duk_uint8_t *p_start, *p_end, *p; /* input string scan */ + const duk_uint8_t *q_start; /* match string */ duk_size_t p_blen; duk_size_t q_blen; #if defined(DUK_USE_REGEXP_SUPPORT) - DUK_ASSERT(!is_global); /* single match always */ + DUK_ASSERT(!is_global); /* single match always */ #endif p_start = DUK_HSTRING_GET_DATA(h_input); @@ -42486,10 +43371,10 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { q_blen = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_search); if (q_blen > p_blen) { - break; /* no match */ + break; /* no match */ } - p_end -= q_blen; /* ensure full memcmp() fits in while */ + p_end -= q_blen; /* ensure full memcmp() fits in while */ DUK_ASSERT(p_end >= p); match_start_coff = 0; @@ -42515,7 +43400,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { /* not found */ break; } - found: + found: /* stack[0] = search value * stack[1] = replace value @@ -42549,9 +43434,9 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { duk_get_prop_index(thr, 4, (duk_uarridx_t) idx); } } else { -#else /* DUK_USE_REGEXP_SUPPORT */ - { /* unconditionally */ -#endif /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ + { /* unconditionally */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* match == search string, by definition */ duk_dup_0(thr); } @@ -42561,12 +43446,12 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { /* [ ... replacer match [captures] match_char_offset input ] */ duk_call(thr, duk_get_top(thr) - idx_args); - h_repl = duk_to_hstring_m1(thr); /* -> [ ... repl_value ] */ + h_repl = duk_to_hstring_m1(thr); /* -> [ ... repl_value ] */ DUK_ASSERT(h_repl != NULL); DUK_BW_WRITE_ENSURE_HSTRING(thr, bw, h_repl); - duk_pop(thr); /* repl_value */ + duk_pop(thr); /* repl_value */ } else { r = r_start; @@ -42613,9 +43498,10 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { * match codepoint encodings would have different lengths. */ /* XXX: charlen computed here, and also in char2byte helper. */ - match_end_boff = (duk_uint32_t) duk_heap_strcache_offset_char2byte(thr, - h_input, - match_start_coff + (duk_uint_fast32_t) DUK_HSTRING_GET_CHARLEN(h_match)); + match_end_boff = (duk_uint32_t) duk_heap_strcache_offset_char2byte( + thr, + h_input, + match_start_coff + (duk_uint_fast32_t) DUK_HSTRING_GET_CHARLEN(h_match)); tmp_sz = (duk_size_t) (DUK_HSTRING_GET_BYTELEN(h_input) - match_end_boff); DUK_BW_WRITE_ENSURE_BYTES(thr, bw, DUK_HSTRING_GET_DATA(h_input) + match_end_boff, tmp_sz); @@ -42651,7 +43537,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { } if (capnum > 0 && capnum < match_caps) { - DUK_ASSERT(is_regexp != 0); /* match_caps == 0 without regexps */ + DUK_ASSERT(is_regexp != 0); /* match_caps == 0 without regexps */ /* regexp res_obj is at offset 4 */ duk_get_prop_index(thr, 4, (duk_uarridx_t) capnum); @@ -42670,26 +43556,26 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { } else { goto repl_write; } -#else /* DUK_USE_REGEXP_SUPPORT */ - goto repl_write; /* unconditionally */ -#endif /* DUK_USE_REGEXP_SUPPORT */ - } /* default case */ - } /* switch (ch2) */ +#else /* DUK_USE_REGEXP_SUPPORT */ + goto repl_write; /* unconditionally */ +#endif /* DUK_USE_REGEXP_SUPPORT */ + } /* default case */ + } /* switch (ch2) */ - repl_write: + repl_write: /* ch1 = (r_increment << 8) + byte */ DUK_BW_WRITE_ENSURE_U8(thr, bw, (duk_uint8_t) (ch1 & 0xff)); r += ch1 >> 8; - } /* while repl */ - } /* if (is_repl_func) */ + } /* while repl */ + } /* if (is_repl_func) */ - duk_pop(thr); /* pop regexp res_obj or match string */ + duk_pop(thr); /* pop regexp res_obj or match string */ #if defined(DUK_USE_REGEXP_SUPPORT) if (!is_global) { #else - { /* unconditionally; is_global==0 */ + { /* unconditionally; is_global==0 */ #endif break; } @@ -42701,7 +43587,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 4); DUK_BW_COMPACT(thr, bw); - (void) duk_buffer_to_string(thr, -1); /* Safe if inputs are safe. */ + (void) duk_buffer_to_string(thr, -1); /* Safe if inputs are safe. */ return 1; } @@ -42721,7 +43607,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { #if defined(DUK_USE_REGEXP_SUPPORT) duk_bool_t is_regexp; #endif - duk_bool_t matched; /* set to 1 if any match exists (needed for empty input special case) */ + duk_bool_t matched; /* set to 1 if any match exists (needed for empty input special case) */ duk_uint32_t prev_match_end_coff, prev_match_end_boff; duk_uint32_t match_start_boff, match_start_coff; duk_uint32_t match_end_boff, match_end_coff; @@ -42759,7 +43645,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { #if defined(DUK_USE_REGEXP_SUPPORT) duk_push_hobject_bidx(thr, DUK_BIDX_REGEXP_CONSTRUCTOR); duk_dup_0(thr); - duk_new(thr, 1); /* [ ... RegExp val ] -> [ ... res ] */ + duk_new(thr, 1); /* [ ... RegExp val ] -> [ ... res ] */ duk_replace(thr, 0); /* lastIndex is initialized to zero by new RegExp() */ is_regexp = 1; @@ -42798,7 +43684,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { if (is_regexp) { duk_dup_0(thr); duk_dup_2(thr); - duk_regexp_match_force_global(thr); /* [ ... regexp input ] -> [ res_obj ] */ + duk_regexp_match_force_global(thr); /* [ ... regexp input ] -> [ res_obj ] */ if (!duk_is_object(thr, -1)) { duk_pop(thr); break; @@ -42831,23 +43717,23 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { continue; } } else { -#else /* DUK_USE_REGEXP_SUPPORT */ - { /* unconditionally */ -#endif /* DUK_USE_REGEXP_SUPPORT */ - const duk_uint8_t *p_start, *p_end, *p; /* input string scan */ - const duk_uint8_t *q_start; /* match string */ +#else /* DUK_USE_REGEXP_SUPPORT */ + { /* unconditionally */ +#endif /* DUK_USE_REGEXP_SUPPORT */ + const duk_uint8_t *p_start, *p_end, *p; /* input string scan */ + const duk_uint8_t *q_start; /* match string */ duk_size_t q_blen, q_clen; p_start = DUK_HSTRING_GET_DATA(h_input); p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_input); p = p_start + prev_match_end_boff; - h_sep = duk_known_hstring(thr, 0); /* symbol already rejected above */ + h_sep = duk_known_hstring(thr, 0); /* symbol already rejected above */ q_start = DUK_HSTRING_GET_DATA(h_sep); q_blen = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_sep); q_clen = (duk_size_t) DUK_HSTRING_GET_CHARLEN(h_sep); - p_end -= q_blen; /* ensure full memcmp() fits in while */ + p_end -= q_blen; /* ensure full memcmp() fits in while */ match_start_coff = prev_match_end_coff; @@ -42860,7 +43746,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { * Don't allow an empty string to match at the end of the input. */ - matched = 1; /* empty separator can always match */ + matched = 1; /* empty separator can always match */ match_start_coff++; p++; @@ -42876,7 +43762,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { DUK_ASSERT(q_blen > 0 && q_clen > 0); while (p <= p_end) { DUK_ASSERT(p + q_blen <= DUK_HSTRING_GET_DATA(h_input) + DUK_HSTRING_GET_BYTELEN(h_input)); - DUK_ASSERT(q_blen > 0); /* no issues with empty memcmp() */ + DUK_ASSERT(q_blen > 0); /* no issues with empty memcmp() */ if (duk_memcmp((const void *) p, (const void *) q_start, (size_t) q_blen) == 0) { /* never an empty match, so step 13.c.iii can't be triggered */ goto found; @@ -42889,15 +43775,15 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { p++; } - not_found: + not_found: /* not found */ break; - found: + found: matched = 1; match_start_boff = (duk_uint32_t) (p - p_start); - match_end_coff = (duk_uint32_t) (match_start_coff + q_clen); /* constrained by string length */ - match_end_boff = (duk_uint32_t) (match_start_boff + q_blen); /* ditto */ + match_end_coff = (duk_uint32_t) (match_start_coff + q_clen); /* constrained by string length */ + match_end_boff = (duk_uint32_t) (match_start_boff + q_blen); /* ditto */ /* empty match (may happen with empty separator) -> bump and continue */ if (prev_match_end_boff == match_end_boff) { @@ -42905,7 +43791,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { prev_match_end_coff++; continue; } - } /* if (is_regexp) */ + } /* if (is_regexp) */ /* stack[0] = separator (string or regexp) * stack[1] = limit @@ -42915,9 +43801,12 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { */ DUK_DDD(DUK_DDDPRINT("split; match_start b=%ld,c=%ld, match_end b=%ld,c=%ld, prev_end b=%ld,c=%ld", - (long) match_start_boff, (long) match_start_coff, - (long) match_end_boff, (long) match_end_coff, - (long) prev_match_end_boff, (long) prev_match_end_coff)); + (long) match_start_boff, + (long) match_start_coff, + (long) match_end_boff, + (long) match_end_coff, + (long) prev_match_end_boff, + (long) prev_match_end_coff)); duk_push_lstring(thr, (const char *) (DUK_HSTRING_GET_DATA(h_input) + prev_match_end_boff), @@ -42934,7 +43823,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { len = duk_get_length(thr, 4); for (i = 1; i < len; i++) { - DUK_ASSERT(i <= DUK_UARRIDX_MAX); /* cannot have >4G captures */ + DUK_ASSERT(i <= DUK_UARRIDX_MAX); /* cannot have >4G captures */ duk_get_prop_index(thr, 4, (duk_uarridx_t) i); duk_put_prop_index(thr, 3, arr_idx); arr_idx++; @@ -42946,21 +43835,21 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { duk_pop(thr); /* lastIndex already set up for next match */ } else { -#else /* DUK_USE_REGEXP_SUPPORT */ - { /* unconditionally */ -#endif /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ + { + /* unconditionally */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* no action */ } prev_match_end_boff = match_end_boff; prev_match_end_coff = match_end_coff; continue; - } /* for */ + } /* for */ /* Combined step 11 (empty string special case) and 14-15. */ - DUK_DDD(DUK_DDDPRINT("split trailer; prev_end b=%ld,c=%ld", - (long) prev_match_end_boff, (long) prev_match_end_coff)); + DUK_DDD(DUK_DDDPRINT("split trailer; prev_end b=%ld,c=%ld", (long) prev_match_end_boff, (long) prev_match_end_coff)); if (DUK_HSTRING_GET_BYTELEN(h_input) > 0 || !matched) { /* Add trailer if: @@ -42977,7 +43866,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_split(duk_hthread *thr) { return 1; - hit_limit: +hit_limit: #if defined(DUK_USE_REGEXP_SUPPORT) if (is_regexp) { duk_pop(thr); @@ -43009,13 +43898,13 @@ DUK_LOCAL void duk__to_regexp_helper(duk_hthread *thr, duk_idx_t idx, duk_bool_t } return; - do_new: +do_new: duk_push_hobject_bidx(thr, DUK_BIDX_REGEXP_CONSTRUCTOR); duk_dup(thr, idx); - duk_new(thr, 1); /* [ ... RegExp val ] -> [ ... res ] */ + duk_new(thr, 1); /* [ ... RegExp val ] -> [ ... res ] */ duk_replace(thr, idx); } -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ #if defined(DUK_USE_REGEXP_SUPPORT) DUK_INTERNAL duk_ret_t duk_bi_string_prototype_search(duk_hthread *thr) { @@ -43030,7 +43919,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_search(duk_hthread *thr) { */ DUK_ASSERT_TOP(thr, 1); - (void) duk_push_this_coercible_to_string(thr); /* at index 1 */ + (void) duk_push_this_coercible_to_string(thr); /* at index 1 */ duk__to_regexp_helper(thr, 0 /*index*/, 1 /*force_new*/); /* stack[0] = regexp @@ -43042,8 +43931,8 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_search(duk_hthread *thr) { */ duk_dup_0(thr); - duk_dup_1(thr); /* [ ... re_obj input ] */ - duk_regexp_match(thr); /* -> [ ... res_obj ] */ + duk_dup_1(thr); /* [ ... re_obj input ] */ + duk_regexp_match(thr); /* -> [ ... res_obj ] */ if (!duk_is_object(thr, -1)) { duk_push_int(thr, -1); @@ -43054,7 +43943,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_search(duk_hthread *thr) { DUK_ASSERT(duk_is_number(thr, -1)); return 1; } -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ #if defined(DUK_USE_REGEXP_SUPPORT) DUK_INTERNAL duk_ret_t duk_bi_string_prototype_match(duk_hthread *thr) { @@ -43074,8 +43963,8 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_match(duk_hthread *thr) { */ if (!global) { - duk_regexp_match(thr); /* -> [ res_obj ] */ - return 1; /* return 'res_obj' */ + duk_regexp_match(thr); /* -> [ res_obj ] */ + return 1; /* return 'res_obj' */ } /* Global case is more complex. */ @@ -43096,7 +43985,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_match(duk_hthread *thr) { duk_dup_0(thr); duk_dup_1(thr); - duk_regexp_match(thr); /* -> [ ... regexp string ] -> [ ... res_obj ] */ + duk_regexp_match(thr); /* -> [ ... regexp string ] -> [ ... res_obj ] */ if (!duk_is_object(thr, -1)) { duk_pop(thr); @@ -43115,24 +44004,24 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_match(duk_hthread *thr) { } prev_last_index = this_index; - duk_get_prop_index(thr, -1, 0); /* match string */ + duk_get_prop_index(thr, -1, 0); /* match string */ duk_put_prop_index(thr, 2, (duk_uarridx_t) arr_idx); arr_idx++; - duk_pop(thr); /* res_obj */ + duk_pop(thr); /* res_obj */ } if (arr_idx == 0) { duk_push_null(thr); } - return 1; /* return 'res_arr' or 'null' */ + return 1; /* return 'res_arr' or 'null' */ } -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_concat(duk_hthread *thr) { /* duk_concat() coerces arguments with ToString() in correct order */ (void) duk_push_this_coercible_to_string(thr); - duk_insert(thr, 0); /* this is relatively expensive */ + duk_insert(thr, 0); /* this is relatively expensive */ duk_concat(thr, duk_get_top(thr)); return 1; } @@ -43197,10 +44086,10 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_repeat(duk_hthread *thr) { #if defined(DUK_USE_PREFER_SIZE) p = buf; while (count-- > 0) { - duk_memcpy((void *) p, (const void *) src, input_blen); /* copy size may be zero, but pointers are valid */ + duk_memcpy((void *) p, (const void *) src, input_blen); /* copy size may be zero, but pointers are valid */ p += input_blen; } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ /* Take advantage of already copied pieces to speed up the process * especially for small repeated strings. */ @@ -43210,7 +44099,9 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_repeat(duk_hthread *thr) { for (;;) { duk_size_t remain = (duk_size_t) (p_end - p); DUK_DDD(DUK_DDDPRINT("remain=%ld, copy_size=%ld, input_blen=%ld, result_len=%ld", - (long) remain, (long) copy_size, (long) input_blen, + (long) remain, + (long) copy_size, + (long) input_blen, (long) result_len)); if (remain <= copy_size) { /* If result_len is zero, this case is taken and does @@ -43223,10 +44114,10 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_repeat(duk_hthread *thr) { p += copy_size; } - src = (const duk_uint8_t *) buf; /* Use buf as source for larger copies. */ + src = (const duk_uint8_t *) buf; /* Use buf as source for larger copies. */ copy_size = (duk_size_t) (p - buf); } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ /* XXX: It would be useful to be able to create a duk_hstring with * a certain byte size whose data area wasn't initialized and which @@ -43237,13 +44128,13 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_repeat(duk_hthread *thr) { * intern table (they are not in heap_allocated). */ - duk_buffer_to_string(thr, -1); /* Safe if input is safe. */ + duk_buffer_to_string(thr, -1); /* Safe if input is safe. */ return 1; - fail_range: +fail_range: DUK_DCERROR_RANGE_INVALID_ARGS(thr); } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_locale_compare(duk_hthread *thr) { duk_hstring *h1; @@ -43297,7 +44188,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_locale_compare(duk_hthread *thr) ret = -1; goto done; - done: +done: duk_push_int(thr, (duk_int_t) ret); return 1; } @@ -43384,11 +44275,11 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_startswith_endswith(duk_hthread * } } - finish: +finish: duk_push_boolean(thr, result); return 1; } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ #if defined(DUK_USE_ES6) DUK_INTERNAL duk_ret_t duk_bi_string_prototype_includes(duk_hthread *thr) { @@ -43411,8 +44302,8 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_includes(duk_hthread *thr) { duk_push_boolean(thr, pos >= 0); return 1; } -#endif /* DUK_USE_ES6 */ -#endif /* DUK_USE_STRING_BUILTIN */ +#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_STRING_BUILTIN */ /* * Symbol built-in */ @@ -43454,7 +44345,7 @@ DUK_INTERNAL duk_ret_t duk_bi_symbol_constructor_shared(duk_hthread *thr) { buf = (duk_uint8_t *) duk_push_fixed_buffer(thr, 1 + len + 1 + 17 + 1); DUK_ASSERT(buf != NULL); p = buf + 1; - DUK_ASSERT(desc != NULL || len == 0); /* may be NULL if len is 0 */ + DUK_ASSERT(desc != NULL || len == 0); /* may be NULL if len is 0 */ duk_memcpy_unsafe((void *) p, (const void *) desc, len); p += len; if (magic == 0) { @@ -43465,7 +44356,9 @@ DUK_INTERNAL duk_ret_t duk_bi_symbol_constructor_shared(duk_hthread *thr) { if (++thr->heap->sym_counter[0] == 0) { thr->heap->sym_counter[1]++; } - p += DUK_SPRINTF((char *) p, "\xFF" "%lx-%lx", + p += DUK_SPRINTF((char *) p, + "\xFF" + "%lx-%lx", (unsigned long) thr->heap->sym_counter[1], (unsigned long) thr->heap->sym_counter[0]); if (desc == NULL) { @@ -43582,7 +44475,7 @@ DUK_INTERNAL duk_ret_t duk_bi_symbol_toprimitive(duk_hthread *thr) { return 1; } -#endif /* DUK_USE_SYMBOL_BUILTIN */ +#endif /* DUK_USE_SYMBOL_BUILTIN */ /* * Thread builtins */ @@ -43616,7 +44509,7 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_constructor(duk_hthread *thr) { */ duk_push_hobject(new_thr, func); - return 1; /* return thread */ + return 1; /* return thread */ } #endif @@ -43662,14 +44555,15 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_resume(duk_hthread *ctx) { */ if (thr->callstack_top < 2) { - DUK_DD(DUK_DDPRINT("resume state invalid: callstack should contain at least 2 entries (caller and Duktape.Thread.resume)")); + DUK_DD(DUK_DDPRINT( + "resume state invalid: callstack should contain at least 2 entries (caller and Duktape.Thread.resume)")); goto state_error; } DUK_ASSERT(thr->callstack_curr != NULL); DUK_ASSERT(thr->callstack_curr->parent != NULL); - DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr) != NULL); /* us */ + DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr) != NULL); /* us */ DUK_ASSERT(DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr))); - DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr->parent) != NULL); /* caller */ + DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr->parent) != NULL); /* caller */ caller_func = DUK_ACT_GET_FUNC(thr->callstack_curr->parent); if (!DUK_HOBJECT_IS_COMPFUNC(caller_func)) { @@ -43681,14 +44575,12 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_resume(duk_hthread *ctx) { * like for yield. */ - if (thr_resume->state != DUK_HTHREAD_STATE_INACTIVE && - thr_resume->state != DUK_HTHREAD_STATE_YIELDED) { + if (thr_resume->state != DUK_HTHREAD_STATE_INACTIVE && thr_resume->state != DUK_HTHREAD_STATE_YIELDED) { DUK_DD(DUK_DDPRINT("resume state invalid: target thread must be INACTIVE or YIELDED")); goto state_error; } - DUK_ASSERT(thr_resume->state == DUK_HTHREAD_STATE_INACTIVE || - thr_resume->state == DUK_HTHREAD_STATE_YIELDED); + DUK_ASSERT(thr_resume->state == DUK_HTHREAD_STATE_INACTIVE || thr_resume->state == DUK_HTHREAD_STATE_YIELDED); /* Further state-dependent pre-checks */ @@ -43706,14 +44598,13 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_resume(duk_hthread *ctx) { * because an error in the RESUME handler call processing will * not be handled very cleanly. */ - if ((thr_resume->callstack_top != 0) || - (thr_resume->valstack_top - thr_resume->valstack != 1)) { + if ((thr_resume->callstack_top != 0) || (thr_resume->valstack_top - thr_resume->valstack != 1)) { goto state_error; } duk_push_tval(thr, DUK_GET_TVAL_NEGIDX(thr_resume, -1)); duk_resolve_nonbound_function(thr); - h_fun = duk_require_hobject(thr, -1); /* reject lightfuncs on purpose */ + h_fun = duk_require_hobject(thr, -1); /* reject lightfuncs on purpose */ if (!DUK_HOBJECT_IS_CALLABLE(h_fun) || !DUK_HOBJECT_IS_COMPFUNC(h_fun)) { goto state_error; } @@ -43742,8 +44633,8 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_resume(duk_hthread *ctx) { #if defined(DUK_USE_AUGMENT_ERROR_THROW) if (is_error) { - DUK_ASSERT_TOP(thr, 2); /* value (error) is at stack top */ - duk_err_augment_error_throw(thr); /* in resumer's context */ + DUK_ASSERT_TOP(thr, 2); /* value (error) is at stack top */ + duk_err_augment_error_throw(thr); /* in resumer's context */ } #endif @@ -43767,21 +44658,21 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_resume(duk_hthread *ctx) { /* lj value2: thread */ DUK_ASSERT(thr->valstack_bottom < thr->valstack_top); - DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value2, &thr->valstack_bottom[0]); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value2, &thr->valstack_bottom[0]); /* side effects */ /* lj value1: value */ DUK_ASSERT(thr->valstack_bottom + 1 < thr->valstack_top); - DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value1, &thr->valstack_bottom[1]); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value1, &thr->valstack_bottom[1]); /* side effects */ DUK_TVAL_CHKFAST_INPLACE_SLOW(&thr->heap->lj.value1); thr->heap->lj.iserror = is_error; - DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* call is from executor, so we know we have a jmpbuf */ - duk_err_longjmp(thr); /* execution resumes in bytecode executor */ + DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* call is from executor, so we know we have a jmpbuf */ + duk_err_longjmp(thr); /* execution resumes in bytecode executor */ DUK_UNREACHABLE(); /* Never here, fall through to error (from compiler point of view). */ - state_error: +state_error: DUK_DCERROR_TYPE_INVALID_STATE(thr); } #endif @@ -43830,14 +44721,15 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_yield(duk_hthread *thr) { DUK_ASSERT(thr->resumer->state == DUK_HTHREAD_STATE_RESUMED); if (thr->callstack_top < 2) { - DUK_DD(DUK_DDPRINT("yield state invalid: callstack should contain at least 2 entries (caller and Duktape.Thread.yield)")); + DUK_DD(DUK_DDPRINT( + "yield state invalid: callstack should contain at least 2 entries (caller and Duktape.Thread.yield)")); goto state_error; } DUK_ASSERT(thr->callstack_curr != NULL); DUK_ASSERT(thr->callstack_curr->parent != NULL); - DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr) != NULL); /* us */ + DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr) != NULL); /* us */ DUK_ASSERT(DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr))); - DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr->parent) != NULL); /* caller */ + DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr->parent) != NULL); /* caller */ caller_func = DUK_ACT_GET_FUNC(thr->callstack_curr->parent); if (!DUK_HOBJECT_IS_COMPFUNC(caller_func)) { @@ -43845,10 +44737,11 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_yield(duk_hthread *thr) { goto state_error; } - DUK_ASSERT(thr->callstack_preventcount >= 1); /* should never be zero, because we (Duktape.Thread.yield) are on the stack */ + DUK_ASSERT(thr->callstack_preventcount >= 1); /* should never be zero, because we (Duktape.Thread.yield) are on the stack */ if (thr->callstack_preventcount != 1) { /* Note: the only yield-preventing call is Duktape.Thread.yield(), hence check for 1, not 0 */ - DUK_DD(DUK_DDPRINT("yield state invalid: there must be no yield-preventing calls in current thread callstack (preventcount is %ld)", + DUK_DD(DUK_DDPRINT("yield state invalid: there must be no yield-preventing calls in current thread callstack " + "(preventcount is %ld)", (long) thr->callstack_preventcount)); goto state_error; } @@ -43862,18 +44755,16 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_yield(duk_hthread *thr) { #if defined(DUK_USE_AUGMENT_ERROR_THROW) if (is_error) { - DUK_ASSERT_TOP(thr, 1); /* value (error) is at stack top */ - duk_err_augment_error_throw(thr); /* in yielder's context */ + DUK_ASSERT_TOP(thr, 1); /* value (error) is at stack top */ + duk_err_augment_error_throw(thr); /* in yielder's context */ } #endif #if defined(DUK_USE_DEBUG) if (is_error) { - DUK_DDD(DUK_DDDPRINT("YIELD ERROR: value=%!T", - (duk_tval *) duk_get_tval(thr, 0))); + DUK_DDD(DUK_DDDPRINT("YIELD ERROR: value=%!T", (duk_tval *) duk_get_tval(thr, 0))); } else { - DUK_DDD(DUK_DDDPRINT("YIELD NORMAL: value=%!T", - (duk_tval *) duk_get_tval(thr, 0))); + DUK_DDD(DUK_DDDPRINT("YIELD NORMAL: value=%!T", (duk_tval *) duk_get_tval(thr, 0))); } #endif @@ -43888,17 +44779,17 @@ DUK_INTERNAL duk_ret_t duk_bi_thread_yield(duk_hthread *thr) { /* lj value1: value */ DUK_ASSERT(thr->valstack_bottom < thr->valstack_top); - DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value1, &thr->valstack_bottom[0]); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value1, &thr->valstack_bottom[0]); /* side effects */ DUK_TVAL_CHKFAST_INPLACE_SLOW(&thr->heap->lj.value1); thr->heap->lj.iserror = is_error; - DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* call is from executor, so we know we have a jmpbuf */ - duk_err_longjmp(thr); /* execution resumes in bytecode executor */ + DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* call is from executor, so we know we have a jmpbuf */ + duk_err_longjmp(thr); /* execution resumes in bytecode executor */ DUK_UNREACHABLE(); /* Never here, fall through to error (from compiler point of view). */ - state_error: +state_error: DUK_DCERROR_TYPE_INVALID_STATE(thr); } #endif @@ -43976,7 +44867,7 @@ DUK_INTERNAL void duk_fb_sprintf(duk_fixedbuffer *fb, const char *fmt, ...) { } DUK_INTERNAL void duk_fb_put_funcptr(duk_fixedbuffer *fb, duk_uint8_t *fptr, duk_size_t fptr_size) { - char buf[64+1]; + char buf[64 + 1]; duk_debug_format_funcptr(buf, sizeof(buf), fptr, fptr_size); buf[sizeof(buf) - 1] = (char) 0; duk_fb_put_cstring(fb, buf); @@ -43986,7 +44877,7 @@ DUK_INTERNAL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb) { return (fb->offset >= fb->length); } -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ /* * Custom formatter for debug printing, allowing Duktape specific data * structures (such as tagged values and heap objects) to be printed with @@ -44052,58 +44943,58 @@ DUK_INTERNAL duk_bool_t duk_fb_is_full(duk_fixedbuffer *fb) { /* list of conversion specifiers that terminate a format tag; * this is unfortunately guesswork. */ -#define DUK__ALLOWED_STANDARD_SPECIFIERS "diouxXeEfFgGaAcsCSpnm" +#define DUK__ALLOWED_STANDARD_SPECIFIERS "diouxXeEfFgGaAcsCSpnm" /* maximum length of standard format tag that we support */ -#define DUK__MAX_FORMAT_TAG_LENGTH 32 +#define DUK__MAX_FORMAT_TAG_LENGTH 32 /* heapobj recursion depth when deep printing is selected */ -#define DUK__DEEP_DEPTH_LIMIT 8 +#define DUK__DEEP_DEPTH_LIMIT 8 /* maximum recursion depth for loop detection stacks */ -#define DUK__LOOP_STACK_DEPTH 256 +#define DUK__LOOP_STACK_DEPTH 256 /* must match bytecode defines now; build autogenerate? */ DUK_LOCAL const char * const duk__bc_optab[256] = { - "LDREG", "STREG", "JUMP", "LDCONST", "LDINT", "LDINTX", "LDTHIS", "LDUNDEF", - "LDNULL", "LDTRUE", "LDFALSE", "GETVAR", "BNOT", "LNOT", "UNM", "UNP", - "EQ_RR", "EQ_CR", "EQ_RC", "EQ_CC", "NEQ_RR", "NEQ_CR", "NEQ_RC", "NEQ_CC", - "SEQ_RR", "SEQ_CR", "SEQ_RC", "SEQ_CC", "SNEQ_RR", "SNEQ_CR", "SNEQ_RC", "SNEQ_CC", + "LDREG", "STREG", "JUMP", "LDCONST", "LDINT", "LDINTX", "LDTHIS", "LDUNDEF", + "LDNULL", "LDTRUE", "LDFALSE", "GETVAR", "BNOT", "LNOT", "UNM", "UNP", + "EQ_RR", "EQ_CR", "EQ_RC", "EQ_CC", "NEQ_RR", "NEQ_CR", "NEQ_RC", "NEQ_CC", + "SEQ_RR", "SEQ_CR", "SEQ_RC", "SEQ_CC", "SNEQ_RR", "SNEQ_CR", "SNEQ_RC", "SNEQ_CC", - "GT_RR", "GT_CR", "GT_RC", "GT_CC", "GE_RR", "GE_CR", "GE_RC", "GE_CC", - "LT_RR", "LT_CR", "LT_RC", "LT_CC", "LE_RR", "LE_CR", "LE_RC", "LE_CC", - "IFTRUE_R", "IFTRUE_C", "IFFALSE_R", "IFFALSE_C", "ADD_RR", "ADD_CR", "ADD_RC", "ADD_CC", - "SUB_RR", "SUB_CR", "SUB_RC", "SUB_CC", "MUL_RR", "MUL_CR", "MUL_RC", "MUL_CC", + "GT_RR", "GT_CR", "GT_RC", "GT_CC", "GE_RR", "GE_CR", "GE_RC", "GE_CC", + "LT_RR", "LT_CR", "LT_RC", "LT_CC", "LE_RR", "LE_CR", "LE_RC", "LE_CC", + "IFTRUE_R", "IFTRUE_C", "IFFALSE_R", "IFFALSE_C", "ADD_RR", "ADD_CR", "ADD_RC", "ADD_CC", + "SUB_RR", "SUB_CR", "SUB_RC", "SUB_CC", "MUL_RR", "MUL_CR", "MUL_RC", "MUL_CC", - "DIV_RR", "DIV_CR", "DIV_RC", "DIV_CC", "MOD_RR", "MOD_CR", "MOD_RC", "MOD_CC", - "EXP_RR", "EXP_CR", "EXP_RC", "EXP_CC", "BAND_RR", "BAND_CR", "BAND_RC", "BAND_CC", - "BOR_RR", "BOR_CR", "BOR_RC", "BOR_CC", "BXOR_RR", "BXOR_CR", "BXOR_RC", "BXOR_CC", - "BASL_RR", "BASL_CR", "BASL_RC", "BASL_CC", "BLSR_RR", "BLSR_CR", "BLSR_RC", "BLSR_CC", + "DIV_RR", "DIV_CR", "DIV_RC", "DIV_CC", "MOD_RR", "MOD_CR", "MOD_RC", "MOD_CC", + "EXP_RR", "EXP_CR", "EXP_RC", "EXP_CC", "BAND_RR", "BAND_CR", "BAND_RC", "BAND_CC", + "BOR_RR", "BOR_CR", "BOR_RC", "BOR_CC", "BXOR_RR", "BXOR_CR", "BXOR_RC", "BXOR_CC", + "BASL_RR", "BASL_CR", "BASL_RC", "BASL_CC", "BLSR_RR", "BLSR_CR", "BLSR_RC", "BLSR_CC", - "BASR_RR", "BASR_CR", "BASR_RC", "BASR_CC", "INSTOF_RR", "INSTOF_CR", "INSTOF_RC", "INSTOF_CC", - "IN_RR", "IN_CR", "IN_RC", "IN_CC", "GETPROP_RR", "GETPROP_CR", "GETPROP_RC", "GETPROP_CC", - "PUTPROP_RR", "PUTPROP_CR", "PUTPROP_RC", "PUTPROP_CC", "DELPROP_RR", "DELPROP_CR", "DELPROP_RC", "DELPROP_CC", - "PREINCR", "PREDECR", "POSTINCR", "POSTDECR", "PREINCV", "PREDECV", "POSTINCV", "POSTDECV", + "BASR_RR", "BASR_CR", "BASR_RC", "BASR_CC", "INSTOF_RR", "INSTOF_CR", "INSTOF_RC", "INSTOF_CC", + "IN_RR", "IN_CR", "IN_RC", "IN_CC", "GETPROP_RR", "GETPROP_CR", "GETPROP_RC", "GETPROP_CC", + "PUTPROP_RR", "PUTPROP_CR", "PUTPROP_RC", "PUTPROP_CC", "DELPROP_RR", "DELPROP_CR", "DELPROP_RC", "DELPROP_CC", + "PREINCR", "PREDECR", "POSTINCR", "POSTDECR", "PREINCV", "PREDECV", "POSTINCV", "POSTDECV", - "PREINCP_RR", "PREINCP_CR", "PREINCP_RC", "PREINCP_CC", "PREDECP_RR", "PREDECP_CR", "PREDECP_RC", "PREDECP_CC", + "PREINCP_RR", "PREINCP_CR", "PREINCP_RC", "PREINCP_CC", "PREDECP_RR", "PREDECP_CR", "PREDECP_RC", "PREDECP_CC", "POSTINCP_RR", "POSTINCP_CR", "POSTINCP_RC", "POSTINCP_CC", "POSTDECP_RR", "POSTDECP_CR", "POSTDECP_RC", "POSTDECP_CC", - "DECLVAR_RR", "DECLVAR_CR", "DECLVAR_RC", "DECLVAR_CC", "REGEXP_RR", "REGEXP_RC", "REGEXP_CR", "REGEXP_CC", - "CLOSURE", "TYPEOF", "TYPEOFID", "PUTVAR", "DELVAR", "RETREG", "RETUNDEF", "RETCONST", + "DECLVAR_RR", "DECLVAR_CR", "DECLVAR_RC", "DECLVAR_CC", "REGEXP_RR", "REGEXP_RC", "REGEXP_CR", "REGEXP_CC", + "CLOSURE", "TYPEOF", "TYPEOFID", "PUTVAR", "DELVAR", "RETREG", "RETUNDEF", "RETCONST", - "RETCONSTN", "LABEL", "ENDLABEL", "BREAK", "CONTINUE", "TRYCATCH", "ENDTRY", "ENDCATCH", - "ENDFIN", "THROW", "INVLHS", "CSREG", "CSVAR_RR", "CSVAR_CR", "CSVAR_RC", "CSVAR_CC", - "CALL0", "CALL1", "CALL2", "CALL3", "CALL4", "CALL5", "CALL6", "CALL7", - "CALL8", "CALL9", "CALL10", "CALL11", "CALL12", "CALL13", "CALL14", "CALL15", + "RETCONSTN", "LABEL", "ENDLABEL", "BREAK", "CONTINUE", "TRYCATCH", "ENDTRY", "ENDCATCH", + "ENDFIN", "THROW", "INVLHS", "CSREG", "CSVAR_RR", "CSVAR_CR", "CSVAR_RC", "CSVAR_CC", + "CALL0", "CALL1", "CALL2", "CALL3", "CALL4", "CALL5", "CALL6", "CALL7", + "CALL8", "CALL9", "CALL10", "CALL11", "CALL12", "CALL13", "CALL14", "CALL15", - "NEWOBJ", "NEWARR", "MPUTOBJ", "MPUTOBJI", "INITSET", "INITGET", "MPUTARR", "MPUTARRI", - "SETALEN", "INITENUM", "NEXTENUM", "NEWTARGET", "DEBUGGER", "NOP", "INVALID", "UNUSED207", - "GETPROPC_RR", "GETPROPC_CR", "GETPROPC_RC", "GETPROPC_CC", "UNUSED212", "UNUSED213", "UNUSED214", "UNUSED215", - "UNUSED216", "UNUSED217", "UNUSED218", "UNUSED219", "UNUSED220", "UNUSED221", "UNUSED222", "UNUSED223", + "NEWOBJ", "NEWARR", "MPUTOBJ", "MPUTOBJI", "INITSET", "INITGET", "MPUTARR", "MPUTARRI", + "SETALEN", "INITENUM", "NEXTENUM", "NEWTARGET", "DEBUGGER", "NOP", "INVALID", "UNUSED207", + "GETPROPC_RR", "GETPROPC_CR", "GETPROPC_RC", "GETPROPC_CC", "UNUSED212", "UNUSED213", "UNUSED214", "UNUSED215", + "UNUSED216", "UNUSED217", "UNUSED218", "UNUSED219", "UNUSED220", "UNUSED221", "UNUSED222", "UNUSED223", - "UNUSED224", "UNUSED225", "UNUSED226", "UNUSED227", "UNUSED228", "UNUSED229", "UNUSED230", "UNUSED231", - "UNUSED232", "UNUSED233", "UNUSED234", "UNUSED235", "UNUSED236", "UNUSED237", "UNUSED238", "UNUSED239", - "UNUSED240", "UNUSED241", "UNUSED242", "UNUSED243", "UNUSED244", "UNUSED245", "UNUSED246", "UNUSED247", - "UNUSED248", "UNUSED249", "UNUSED250", "UNUSED251", "UNUSED252", "UNUSED253", "UNUSED254", "UNUSED255" + "UNUSED224", "UNUSED225", "UNUSED226", "UNUSED227", "UNUSED228", "UNUSED229", "UNUSED230", "UNUSED231", + "UNUSED232", "UNUSED233", "UNUSED234", "UNUSED235", "UNUSED236", "UNUSED237", "UNUSED238", "UNUSED239", + "UNUSED240", "UNUSED241", "UNUSED242", "UNUSED243", "UNUSED244", "UNUSED245", "UNUSED246", "UNUSED247", + "UNUSED248", "UNUSED249", "UNUSED250", "UNUSED251", "UNUSED252", "UNUSED253", "UNUSED254", "UNUSED255" }; typedef struct duk__dprint_state duk__dprint_state; @@ -44153,14 +45044,15 @@ DUK_LOCAL void duk__print_shared_heaphdr(duk__dprint_state *st, duk_heaphdr *h) duk_size_t i; duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_LBRACKET); for (i = 0; i < (duk_size_t) sizeof(*h); i++) { - duk_fb_sprintf(fb, "%02lx", (unsigned long) ((duk_uint8_t *)h)[i]); + duk_fb_sprintf(fb, "%02lx", (unsigned long) ((duk_uint8_t *) h)[i]); } duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_RBRACKET); } -#if defined(DUK_USE_REFERENCE_COUNTING) /* currently implicitly also DUK_USE_DOUBLE_LINKED_HEAP */ +#if defined(DUK_USE_REFERENCE_COUNTING) /* currently implicitly also DUK_USE_DOUBLE_LINKED_HEAP */ if (st->heavy) { - duk_fb_sprintf(fb, "[h_next=%p,h_prev=%p,h_refcount=%lu,h_flags=%08lx,type=%ld," + duk_fb_sprintf(fb, + "[h_next=%p,h_prev=%p,h_refcount=%lu,h_flags=%08lx,type=%ld," "reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", (void *) DUK_HEAPHDR_GET_NEXT(NULL, h), (void *) DUK_HEAPHDR_GET_PREV(NULL, h), @@ -44174,7 +45066,8 @@ DUK_LOCAL void duk__print_shared_heaphdr(duk__dprint_state *st, duk_heaphdr *h) } #else if (st->heavy) { - duk_fb_sprintf(fb, "[h_next=%p,h_flags=%08lx,type=%ld,reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", + duk_fb_sprintf(fb, + "[h_next=%p,h_flags=%08lx,type=%ld,reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", (void *) DUK_HEAPHDR_GET_NEXT(NULL, h), (unsigned long) DUK_HEAPHDR_GET_FLAGS(h), (long) DUK_HEAPHDR_GET_TYPE(h), @@ -44201,14 +45094,15 @@ DUK_LOCAL void duk__print_shared_heaphdr_string(duk__dprint_state *st, duk_heaph duk_size_t i; duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_LBRACKET); for (i = 0; i < (duk_size_t) sizeof(*h); i++) { - duk_fb_sprintf(fb, "%02lx", (unsigned long) ((duk_uint8_t *)h)[i]); + duk_fb_sprintf(fb, "%02lx", (unsigned long) ((duk_uint8_t *) h)[i]); } duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_RBRACKET); } #if defined(DUK_USE_REFERENCE_COUNTING) if (st->heavy) { - duk_fb_sprintf(fb, "[h_refcount=%lu,h_flags=%08lx,type=%ld,reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", + duk_fb_sprintf(fb, + "[h_refcount=%lu,h_flags=%08lx,type=%ld,reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", (unsigned long) DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h), (unsigned long) DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) h), (long) DUK_HEAPHDR_GET_TYPE((duk_heaphdr *) h), @@ -44219,7 +45113,8 @@ DUK_LOCAL void duk__print_shared_heaphdr_string(duk__dprint_state *st, duk_heaph } #else if (st->heavy) { - duk_fb_sprintf(fb, "[h_flags=%08lx,type=%ld,reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", + duk_fb_sprintf(fb, + "[h_flags=%08lx,type=%ld,reachable=%ld,temproot=%ld,finalizable=%ld,finalized=%ld]", (unsigned long) DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) h), (long) DUK_HEAPHDR_GET_TYPE((duk_heaphdr *) h), (long) (DUK_HEAPHDR_HAS_REACHABLE((duk_heaphdr *) h) ? 1 : 0), @@ -44290,7 +45185,8 @@ DUK_LOCAL void duk__print_hstring(duk__dprint_state *st, duk_hstring *h, duk_boo #endif } -#define DUK__COMMA() do { \ +#define DUK__COMMA() \ + do { \ if (first) { \ first = 0; \ } else { \ @@ -44403,7 +45299,8 @@ DUK_LOCAL void duk__print_hobject(duk__dprint_state *st, duk_hobject *h) { duk__print_hstring(st, key, 0); duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_COLON); if (DUK_HOBJECT_E_SLOT_IS_ACCESSOR(NULL, h, i)) { - duk_fb_sprintf(fb, "[get:%p,set:%p]", + duk_fb_sprintf(fb, + "[get:%p,set:%p]", (void *) DUK_HOBJECT_E_GET_VALUE(NULL, h, i).a.get, (void *) DUK_HOBJECT_E_GET_VALUE(NULL, h, i).a.set); } else { @@ -44417,158 +45314,238 @@ DUK_LOCAL void duk__print_hobject(duk__dprint_state *st, duk_hobject *h) { } if (st->internal) { if (DUK_HOBJECT_IS_ARRAY(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__array:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__array:true"); } if (DUK_HOBJECT_HAS_EXTENSIBLE(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__extensible:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__extensible:true"); } if (DUK_HOBJECT_HAS_CONSTRUCTABLE(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__constructable:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__constructable:true"); } if (DUK_HOBJECT_HAS_BOUNDFUNC(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__boundfunc:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__boundfunc:true"); } if (DUK_HOBJECT_HAS_COMPFUNC(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__compfunc:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__compfunc:true"); } if (DUK_HOBJECT_HAS_NATFUNC(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__natfunc:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__natfunc:true"); } if (DUK_HOBJECT_HAS_BUFOBJ(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__bufobj:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__bufobj:true"); } if (DUK_HOBJECT_IS_THREAD(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__thread:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__thread:true"); } if (DUK_HOBJECT_HAS_ARRAY_PART(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__array_part:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__array_part:true"); } if (DUK_HOBJECT_HAS_STRICT(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__strict:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__strict:true"); } if (DUK_HOBJECT_HAS_NOTAIL(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__notail:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__notail:true"); } if (DUK_HOBJECT_HAS_NEWENV(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__newenv:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__newenv:true"); } if (DUK_HOBJECT_HAS_NAMEBINDING(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__namebinding:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__namebinding:true"); } if (DUK_HOBJECT_HAS_CREATEARGS(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__createargs:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__createargs:true"); } if (DUK_HOBJECT_HAS_EXOTIC_ARRAY(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__exotic_array:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__exotic_array:true"); } if (DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__exotic_stringobj:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__exotic_stringobj:true"); } if (DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__exotic_arguments:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__exotic_arguments:true"); } if (DUK_HOBJECT_IS_BUFOBJ(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__exotic_bufobj:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__exotic_bufobj:true"); } if (DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h)) { - DUK__COMMA(); duk_fb_sprintf(fb, "__exotic_proxyobj:true"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__exotic_proxyobj:true"); } } if (st->internal && DUK_HOBJECT_IS_ARRAY(h)) { duk_harray *a = (duk_harray *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__length:%ld", (long) a->length); - DUK__COMMA(); duk_fb_sprintf(fb, "__length_nonwritable:%ld", (long) a->length_nonwritable); + DUK__COMMA(); + duk_fb_sprintf(fb, "__length:%ld", (long) a->length); + DUK__COMMA(); + duk_fb_sprintf(fb, "__length_nonwritable:%ld", (long) a->length_nonwritable); } else if (st->internal && DUK_HOBJECT_IS_COMPFUNC(h)) { duk_hcompfunc *f = (duk_hcompfunc *) h; - DUK__COMMA(); duk_fb_put_cstring(fb, "__data:"); + DUK__COMMA(); + duk_fb_put_cstring(fb, "__data:"); duk__print_hbuffer(st, (duk_hbuffer *) DUK_HCOMPFUNC_GET_DATA(NULL, f)); - DUK__COMMA(); duk_fb_put_cstring(fb, "__lexenv:"); duk__print_hobject(st, DUK_HCOMPFUNC_GET_LEXENV(NULL, f)); - DUK__COMMA(); duk_fb_put_cstring(fb, "__varenv:"); duk__print_hobject(st, DUK_HCOMPFUNC_GET_VARENV(NULL, f)); - DUK__COMMA(); duk_fb_sprintf(fb, "__nregs:%ld", (long) f->nregs); - DUK__COMMA(); duk_fb_sprintf(fb, "__nargs:%ld", (long) f->nargs); + DUK__COMMA(); + duk_fb_put_cstring(fb, "__lexenv:"); + duk__print_hobject(st, DUK_HCOMPFUNC_GET_LEXENV(NULL, f)); + DUK__COMMA(); + duk_fb_put_cstring(fb, "__varenv:"); + duk__print_hobject(st, DUK_HCOMPFUNC_GET_VARENV(NULL, f)); + DUK__COMMA(); + duk_fb_sprintf(fb, "__nregs:%ld", (long) f->nregs); + DUK__COMMA(); + duk_fb_sprintf(fb, "__nargs:%ld", (long) f->nargs); #if defined(DUK_USE_DEBUGGER_SUPPORT) - DUK__COMMA(); duk_fb_sprintf(fb, "__start_line:%ld", (long) f->start_line); - DUK__COMMA(); duk_fb_sprintf(fb, "__end_line:%ld", (long) f->end_line); + DUK__COMMA(); + duk_fb_sprintf(fb, "__start_line:%ld", (long) f->start_line); + DUK__COMMA(); + duk_fb_sprintf(fb, "__end_line:%ld", (long) f->end_line); #endif - DUK__COMMA(); duk_fb_put_cstring(fb, "__data:"); + DUK__COMMA(); + duk_fb_put_cstring(fb, "__data:"); duk__print_hbuffer(st, (duk_hbuffer *) DUK_HCOMPFUNC_GET_DATA(NULL, f)); } else if (st->internal && DUK_HOBJECT_IS_NATFUNC(h)) { duk_hnatfunc *f = (duk_hnatfunc *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__func:"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__func:"); duk_fb_put_funcptr(fb, (duk_uint8_t *) &f->func, sizeof(f->func)); - DUK__COMMA(); duk_fb_sprintf(fb, "__nargs:%ld", (long) f->nargs); - DUK__COMMA(); duk_fb_sprintf(fb, "__magic:%ld", (long) f->magic); + DUK__COMMA(); + duk_fb_sprintf(fb, "__nargs:%ld", (long) f->nargs); + DUK__COMMA(); + duk_fb_sprintf(fb, "__magic:%ld", (long) f->magic); } else if (st->internal && DUK_HOBJECT_IS_DECENV(h)) { duk_hdecenv *e = (duk_hdecenv *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__thread:"); duk__print_hobject(st, (duk_hobject *) e->thread); - DUK__COMMA(); duk_fb_sprintf(fb, "__varmap:"); duk__print_hobject(st, (duk_hobject *) e->varmap); - DUK__COMMA(); duk_fb_sprintf(fb, "__regbase_byteoff:%ld", (long) e->regbase_byteoff); + DUK__COMMA(); + duk_fb_sprintf(fb, "__thread:"); + duk__print_hobject(st, (duk_hobject *) e->thread); + DUK__COMMA(); + duk_fb_sprintf(fb, "__varmap:"); + duk__print_hobject(st, (duk_hobject *) e->varmap); + DUK__COMMA(); + duk_fb_sprintf(fb, "__regbase_byteoff:%ld", (long) e->regbase_byteoff); } else if (st->internal && DUK_HOBJECT_IS_OBJENV(h)) { duk_hobjenv *e = (duk_hobjenv *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__target:"); duk__print_hobject(st, (duk_hobject *) e->target); - DUK__COMMA(); duk_fb_sprintf(fb, "__has_this:%ld", (long) e->has_this); + DUK__COMMA(); + duk_fb_sprintf(fb, "__target:"); + duk__print_hobject(st, (duk_hobject *) e->target); + DUK__COMMA(); + duk_fb_sprintf(fb, "__has_this:%ld", (long) e->has_this); #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) } else if (st->internal && DUK_HOBJECT_IS_BUFOBJ(h)) { duk_hbufobj *b = (duk_hbufobj *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__buf:"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__buf:"); duk__print_hbuffer(st, (duk_hbuffer *) b->buf); - DUK__COMMA(); duk_fb_sprintf(fb, "__buf_prop:"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__buf_prop:"); duk__print_hobject(st, (duk_hobject *) b->buf_prop); - DUK__COMMA(); duk_fb_sprintf(fb, "__offset:%ld", (long) b->offset); - DUK__COMMA(); duk_fb_sprintf(fb, "__length:%ld", (long) b->length); - DUK__COMMA(); duk_fb_sprintf(fb, "__shift:%ld", (long) b->shift); - DUK__COMMA(); duk_fb_sprintf(fb, "__elemtype:%ld", (long) b->elem_type); + DUK__COMMA(); + duk_fb_sprintf(fb, "__offset:%ld", (long) b->offset); + DUK__COMMA(); + duk_fb_sprintf(fb, "__length:%ld", (long) b->length); + DUK__COMMA(); + duk_fb_sprintf(fb, "__shift:%ld", (long) b->shift); + DUK__COMMA(); + duk_fb_sprintf(fb, "__elemtype:%ld", (long) b->elem_type); #endif } else if (st->internal && DUK_HOBJECT_IS_PROXY(h)) { duk_hproxy *p = (duk_hproxy *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__target:"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__target:"); duk__print_hobject(st, p->target); - DUK__COMMA(); duk_fb_sprintf(fb, "__handler:"); + DUK__COMMA(); + duk_fb_sprintf(fb, "__handler:"); duk__print_hobject(st, p->handler); } else if (st->internal && DUK_HOBJECT_IS_THREAD(h)) { duk_hthread *t = (duk_hthread *) h; - DUK__COMMA(); duk_fb_sprintf(fb, "__ptr_curr_pc:%p", (void *) t->ptr_curr_pc); - DUK__COMMA(); duk_fb_sprintf(fb, "__heap:%p", (void *) t->heap); - DUK__COMMA(); duk_fb_sprintf(fb, "__strict:%ld", (long) t->strict); - DUK__COMMA(); duk_fb_sprintf(fb, "__state:%ld", (long) t->state); - DUK__COMMA(); duk_fb_sprintf(fb, "__unused1:%ld", (long) t->unused1); - DUK__COMMA(); duk_fb_sprintf(fb, "__unused2:%ld", (long) t->unused2); - DUK__COMMA(); duk_fb_sprintf(fb, "__valstack:%p", (void *) t->valstack); - DUK__COMMA(); duk_fb_sprintf(fb, "__valstack_end:%p/%ld", (void *) t->valstack_end, (long) (t->valstack_end - t->valstack)); - DUK__COMMA(); duk_fb_sprintf(fb, "__valstack_alloc_end:%p/%ld", (void *) t->valstack_alloc_end, (long) (t->valstack_alloc_end - t->valstack)); - DUK__COMMA(); duk_fb_sprintf(fb, "__valstack_bottom:%p/%ld", (void *) t->valstack_bottom, (long) (t->valstack_bottom - t->valstack)); - DUK__COMMA(); duk_fb_sprintf(fb, "__valstack_top:%p/%ld", (void *) t->valstack_top, (long) (t->valstack_top - t->valstack)); - DUK__COMMA(); duk_fb_sprintf(fb, "__callstack_curr:%p", (void *) t->callstack_curr); - DUK__COMMA(); duk_fb_sprintf(fb, "__callstack_top:%ld", (long) t->callstack_top); - DUK__COMMA(); duk_fb_sprintf(fb, "__callstack_preventcount:%ld", (long) t->callstack_preventcount); - DUK__COMMA(); duk_fb_sprintf(fb, "__resumer:"); duk__print_hobject(st, (duk_hobject *) t->resumer); - DUK__COMMA(); duk_fb_sprintf(fb, "__compile_ctx:%p", (void *) t->compile_ctx); + DUK__COMMA(); + duk_fb_sprintf(fb, "__ptr_curr_pc:%p", (void *) t->ptr_curr_pc); + DUK__COMMA(); + duk_fb_sprintf(fb, "__heap:%p", (void *) t->heap); + DUK__COMMA(); + duk_fb_sprintf(fb, "__strict:%ld", (long) t->strict); + DUK__COMMA(); + duk_fb_sprintf(fb, "__state:%ld", (long) t->state); + DUK__COMMA(); + duk_fb_sprintf(fb, "__unused1:%ld", (long) t->unused1); + DUK__COMMA(); + duk_fb_sprintf(fb, "__unused2:%ld", (long) t->unused2); + DUK__COMMA(); + duk_fb_sprintf(fb, "__valstack:%p", (void *) t->valstack); + DUK__COMMA(); + duk_fb_sprintf(fb, "__valstack_end:%p/%ld", (void *) t->valstack_end, (long) (t->valstack_end - t->valstack)); + DUK__COMMA(); + duk_fb_sprintf(fb, + "__valstack_alloc_end:%p/%ld", + (void *) t->valstack_alloc_end, + (long) (t->valstack_alloc_end - t->valstack)); + DUK__COMMA(); + duk_fb_sprintf(fb, + "__valstack_bottom:%p/%ld", + (void *) t->valstack_bottom, + (long) (t->valstack_bottom - t->valstack)); + DUK__COMMA(); + duk_fb_sprintf(fb, "__valstack_top:%p/%ld", (void *) t->valstack_top, (long) (t->valstack_top - t->valstack)); + DUK__COMMA(); + duk_fb_sprintf(fb, "__callstack_curr:%p", (void *) t->callstack_curr); + DUK__COMMA(); + duk_fb_sprintf(fb, "__callstack_top:%ld", (long) t->callstack_top); + DUK__COMMA(); + duk_fb_sprintf(fb, "__callstack_preventcount:%ld", (long) t->callstack_preventcount); + DUK__COMMA(); + duk_fb_sprintf(fb, "__resumer:"); + duk__print_hobject(st, (duk_hobject *) t->resumer); + DUK__COMMA(); + duk_fb_sprintf(fb, "__compile_ctx:%p", (void *) t->compile_ctx); #if defined(DUK_USE_INTERRUPT_COUNTER) - DUK__COMMA(); duk_fb_sprintf(fb, "__interrupt_counter:%ld", (long) t->interrupt_counter); - DUK__COMMA(); duk_fb_sprintf(fb, "__interrupt_init:%ld", (long) t->interrupt_init); + DUK__COMMA(); + duk_fb_sprintf(fb, "__interrupt_counter:%ld", (long) t->interrupt_counter); + DUK__COMMA(); + duk_fb_sprintf(fb, "__interrupt_init:%ld", (long) t->interrupt_init); #endif /* XXX: print built-ins array? */ - } #if defined(DUK_USE_REFERENCE_COUNTING) if (st->internal) { - DUK__COMMA(); duk_fb_sprintf(fb, "__refcount:%lu", (unsigned long) DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h)); + DUK__COMMA(); + duk_fb_sprintf(fb, "__refcount:%lu", (unsigned long) DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h)); } #endif if (st->internal) { - DUK__COMMA(); duk_fb_sprintf(fb, "__class:%ld", (long) DUK_HOBJECT_GET_CLASS_NUMBER(h)); + DUK__COMMA(); + duk_fb_sprintf(fb, "__class:%ld", (long) DUK_HOBJECT_GET_CLASS_NUMBER(h)); } - DUK__COMMA(); duk_fb_sprintf(fb, "__heapptr:%p", (void *) h); /* own pointer */ + DUK__COMMA(); + duk_fb_sprintf(fb, "__heapptr:%p", (void *) h); /* own pointer */ /* prototype should be last, for readability */ if (DUK_HOBJECT_GET_PROTOTYPE(NULL, h)) { if (st->follow_proto) { - DUK__COMMA(); duk_fb_put_cstring(fb, "__prototype:"); duk__print_hobject(st, DUK_HOBJECT_GET_PROTOTYPE(NULL, h)); + DUK__COMMA(); + duk_fb_put_cstring(fb, "__prototype:"); + duk__print_hobject(st, DUK_HOBJECT_GET_PROTOTYPE(NULL, h)); } else { - DUK__COMMA(); duk_fb_sprintf(fb, "__prototype:%p", (void *) DUK_HOBJECT_GET_PROTOTYPE(NULL, h)); + DUK__COMMA(); + duk_fb_sprintf(fb, "__prototype:%p", (void *) DUK_HOBJECT_GET_PROTOTYPE(NULL, h)); } } @@ -44594,7 +45571,7 @@ DUK_LOCAL void duk__print_hobject(duk__dprint_state *st, duk_hobject *h) { } #endif - finished: +finished: st->depth--; if (pushed_loopstack) { st->loop_stack_index--; @@ -44621,12 +45598,14 @@ DUK_LOCAL void duk__print_hbuffer(duk__dprint_state *st, duk_hbuffer *h) { if (DUK_HBUFFER_HAS_DYNAMIC(h)) { if (DUK_HBUFFER_HAS_EXTERNAL(h)) { duk_hbuffer_external *g = (duk_hbuffer_external *) h; - duk_fb_sprintf(fb, "buffer:external:%p:%ld", + duk_fb_sprintf(fb, + "buffer:external:%p:%ld", (void *) DUK_HBUFFER_EXTERNAL_GET_DATA_PTR(NULL, g), (long) DUK_HBUFFER_EXTERNAL_GET_SIZE(g)); } else { duk_hbuffer_dynamic *g = (duk_hbuffer_dynamic *) h; - duk_fb_sprintf(fb, "buffer:dynamic:%p:%ld", + duk_fb_sprintf(fb, + "buffer:dynamic:%p:%ld", (void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(NULL, g), (long) DUK_HBUFFER_DYNAMIC_GET_SIZE(g)); } @@ -44699,7 +45678,7 @@ DUK_LOCAL void duk__print_tval(duk__dprint_state *st, duk_tval *tv) { duk_size_t i; duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_LBRACKET); for (i = 0; i < (duk_size_t) sizeof(*tv); i++) { - duk_fb_sprintf(fb, "%02lx", (unsigned long) ((duk_uint8_t *)tv)[i]); + duk_fb_sprintf(fb, "%02lx", (unsigned long) ((duk_uint8_t *) tv)[i]); } duk_fb_put_byte(fb, (duk_uint8_t) DUK_ASC_RBRACKET); } @@ -44782,17 +45761,22 @@ DUK_LOCAL void duk__print_instr(duk__dprint_state *st, duk_instr_t ins) { /* XXX: option to fix opcode length so it lines up nicely */ if (op == DUK_OP_JUMP) { - duk_int_t diff1 = (duk_int_t) (DUK_DEC_ABC(ins) - DUK_BC_JUMP_BIAS); /* from next pc */ - duk_int_t diff2 = diff1 + 1; /* from curr pc */ + duk_int_t diff1 = (duk_int_t) (DUK_DEC_ABC(ins) - DUK_BC_JUMP_BIAS); /* from next pc */ + duk_int_t diff2 = diff1 + 1; /* from curr pc */ - duk_fb_sprintf(fb, "%s %ld (to pc%c%ld)", - (const char *) op_name, (long) diff1, - (int) (diff2 >= 0 ? '+' : '-'), /* char format: use int */ + duk_fb_sprintf(fb, + "%s %ld (to pc%c%ld)", + (const char *) op_name, + (long) diff1, + (int) (diff2 >= 0 ? '+' : '-'), /* char format: use int */ (long) (diff2 >= 0 ? diff2 : -diff2)); } else { - duk_fb_sprintf(fb, "%s %ld, %ld, %ld", - (const char *) op_name, (long) DUK_DEC_A(ins), - (long) DUK_DEC_B(ins), (long) DUK_DEC_C(ins)); + duk_fb_sprintf(fb, + "%s %ld, %ld, %ld", + (const char *) op_name, + (long) DUK_DEC_A(ins), + (long) DUK_DEC_B(ins), + (long) DUK_DEC_C(ins)); } } @@ -44818,13 +45802,16 @@ DUK_LOCAL void duk__print_catcher(duk__dprint_state *st, duk_catcher *cat) { return; } - duk_fb_sprintf(fb, "[catcher ptr=%p parent=%p varname=%p pc_base=%p, idx_base=%ld, flags=0x%08lx]", + duk_fb_sprintf(fb, + "[catcher ptr=%p parent=%p varname=%p pc_base=%p, idx_base=%ld, flags=0x%08lx]", (void *) cat, - (void *) cat->parent, (void *) cat->h_varname, (void *) cat->pc_base, - (long) cat->idx_base, (unsigned long) cat->flags); + (void *) cat->parent, + (void *) cat->h_varname, + (void *) cat->pc_base, + (long) cat->idx_base, + (unsigned long) cat->flags); } - DUK_LOCAL void duk__print_activation(duk__dprint_state *st, duk_activation *act) { duk_fixedbuffer *fb = st->fb; @@ -44839,12 +45826,20 @@ DUK_LOCAL void duk__print_activation(duk__dprint_state *st, duk_activation *act) /* prev_caller: conditional, omitted on purpose, it's rarely used. */ /* prev_line: conditional, omitted on purpose (but would be nice). */ - duk_fb_sprintf(fb, "[activation ptr=%p tv_func= func=%p parent=%p var_env=%p lex_env=%p cat=%p curr_pc=%p bottom_byteoff=%ld retval_byteoff=%ld reserve_byteoff=%ld flags=%ld]", + duk_fb_sprintf(fb, + "[activation ptr=%p tv_func= func=%p parent=%p var_env=%p lex_env=%p cat=%p curr_pc=%p " + "bottom_byteoff=%ld retval_byteoff=%ld reserve_byteoff=%ld flags=%ld]", (void *) act, - (void *) act->func, (void *) act->parent, (void *) act->var_env, - (void *) act->lex_env, (void *) act->cat, (void *) act->curr_pc, - (long) act->bottom_byteoff, (long) act->retval_byteoff, (long) act->reserve_byteoff, - (long) act->flags); + (void *) act->func, + (void *) act->parent, + (void *) act->var_env, + (void *) act->lex_env, + (void *) act->cat, + (void *) act->curr_pc, + (long) act->bottom_byteoff, + (long) act->retval_byteoff, + (long) act->reserve_byteoff, + (long) act->flags); } DUK_INTERNAL duk_int_t duk_debug_vsnprintf(char *str, duk_size_t size, const char *format, va_list ap) { @@ -44863,7 +45858,7 @@ DUK_INTERNAL duk_int_t duk_debug_vsnprintf(char *str, duk_size_t size, const cha char ch = *p++; const char *p_begfmt = NULL; duk_bool_t got_exclamation = 0; - duk_bool_t got_long = 0; /* %lf, %ld etc */ + duk_bool_t got_long = 0; /* %lf, %ld etc */ duk__dprint_state st; if (ch != DUK_ASC_PERCENT) { @@ -45026,11 +46021,11 @@ DUK_INTERNAL duk_int_t duk_debug_vsnprintf(char *str, duk_size_t size, const cha } goto done; - format_error: +format_error: duk_fb_put_cstring(&fb, "FMTERR"); /* fall through */ - done: +done: retval = (duk_int_t) fb.offset; duk_fb_put_byte(&fb, (duk_uint8_t) 0); @@ -45038,7 +46033,7 @@ DUK_INTERNAL duk_int_t duk_debug_vsnprintf(char *str, duk_size_t size, const cha return retval; } -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL duk_int_t duk_debug_snprintf(char *str, duk_size_t size, const char *format, ...) { duk_int_t retval; va_list ap; @@ -45079,7 +46074,7 @@ DUK_INTERNAL void duk_debug_format_funcptr(char *buf, duk_size_t buf_size, duk_u } } -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ /* automatic undefs */ #undef DUK__ALLOWED_STANDARD_SPECIFIERS @@ -45100,17 +46095,23 @@ DUK_INTERNAL void duk_debug_format_funcptr(char *buf, duk_size_t buf_size, duk_u */ #if defined(DUK_USE_ASSERTIONS) -#define DUK__DBG_TPORT_ENTER() do { \ +#define DUK__DBG_TPORT_ENTER() \ + do { \ DUK_ASSERT(heap->dbg_calling_transport == 0); \ heap->dbg_calling_transport = 1; \ } while (0) -#define DUK__DBG_TPORT_EXIT() do { \ +#define DUK__DBG_TPORT_EXIT() \ + do { \ DUK_ASSERT(heap->dbg_calling_transport == 1); \ heap->dbg_calling_transport = 0; \ } while (0) #else -#define DUK__DBG_TPORT_ENTER() do {} while (0) -#define DUK__DBG_TPORT_EXIT() do {} while (0) +#define DUK__DBG_TPORT_ENTER() \ + do { \ + } while (0) +#define DUK__DBG_TPORT_EXIT() \ + do { \ + } while (0) #endif /* @@ -45130,7 +46131,8 @@ typedef union { * Detach handling */ -#define DUK__SET_CONN_BROKEN(thr,reason) do { \ +#define DUK__SET_CONN_BROKEN(thr, reason) \ + do { \ /* For now shared handler is fine. */ \ duk__debug_do_detach1((thr)->heap, (reason)); \ } while (0) @@ -45151,7 +46153,7 @@ DUK_LOCAL void duk__debug_do_detach1(duk_heap *heap, duk_int_t reason) { DUK_D(DUK_DPRINT("debugger transport detaching, marking transport broken")); - heap->dbg_detaching = 1; /* prevent multiple in-progress detaches */ + heap->dbg_detaching = 1; /* prevent multiple in-progress detaches */ if (heap->dbg_write_cb != NULL) { duk_hthread *thr; @@ -45179,8 +46181,8 @@ DUK_LOCAL void duk__debug_do_detach1(duk_heap *heap, duk_int_t reason) { heap->dbg_pause_act = NULL; heap->dbg_pause_startline = 0; heap->dbg_have_next_byte = 0; - duk_debug_clear_paused(heap); /* XXX: some overlap with field inits above */ - heap->dbg_state_dirty = 0; /* XXX: clear_paused sets dirty; rework? */ + duk_debug_clear_paused(heap); /* XXX: some overlap with field inits above */ + heap->dbg_state_dirty = 0; /* XXX: clear_paused sets dirty; rework? */ /* Ensure there are no stale active breakpoint pointers. * Breakpoint list is currently kept - we could empty it @@ -45240,7 +46242,7 @@ DUK_LOCAL void duk__debug_null_most_callbacks(duk_hthread *thr) { heap = thr->heap; DUK_D(DUK_DPRINT("transport read/write error, NULL all callbacks expected detached")); heap->dbg_read_cb = NULL; - heap->dbg_write_cb = NULL; /* this is especially critical to avoid another write call in detach1() */ + heap->dbg_write_cb = NULL; /* this is especially critical to avoid another write call in detach1() */ heap->dbg_peek_cb = NULL; heap->dbg_read_flush_cb = NULL; heap->dbg_write_flush_cb = NULL; @@ -45262,7 +46264,8 @@ DUK_LOCAL void duk__debug_set_pause_state(duk_hthread *thr, duk_heap *heap, duk_ updated_flags = pause_flags & ~(DUK_PAUSE_FLAG_LINE_CHANGE); DUK_D(DUK_DPRINT("no line info for current activation, disable line-based pause flags: 0x%08lx -> 0x%08lx", - (long) pause_flags, (long) updated_flags)); + (long) pause_flags, + (long) updated_flags)); pause_flags = updated_flags; } @@ -45272,7 +46275,8 @@ DUK_LOCAL void duk__debug_set_pause_state(duk_hthread *thr, duk_heap *heap, duk_ heap->dbg_state_dirty = 1; DUK_D(DUK_DPRINT("set state for automatic pause triggers, flags=0x%08lx, act=%p, startline=%ld", - (long) heap->dbg_pause_flags, (void *) heap->dbg_pause_act, + (long) heap->dbg_pause_flags, + (void *) heap->dbg_pause_act, (long) heap->dbg_pause_startline)); } @@ -45427,7 +46431,7 @@ DUK_INTERNAL void duk_debug_read_bytes(duk_hthread *thr, duk_uint8_t *data, duk_ if (got == 0 || got > left) { DUK_D(DUK_DPRINT("connection error during read, return zero data")); - duk__debug_null_most_callbacks(thr); /* avoid calling write callback in detach1() */ + duk__debug_null_most_callbacks(thr); /* avoid calling write callback in detach1() */ DUK__SET_CONN_BROKEN(thr, 1); goto fail; } @@ -45435,14 +46439,14 @@ DUK_INTERNAL void duk_debug_read_bytes(duk_hthread *thr, duk_uint8_t *data, duk_ } return; - fail: +fail: duk_memzero((void *) data, (size_t) length); } DUK_INTERNAL duk_uint8_t duk_debug_read_byte(duk_hthread *thr) { duk_uint8_t x; - x = 0; /* just in case callback is broken and won't write 'x' */ + x = 0; /* just in case callback is broken and won't write 'x' */ duk_debug_read_bytes(thr, &x, 1); return x; } @@ -45453,10 +46457,7 @@ DUK_LOCAL duk_uint32_t duk__debug_read_uint32_raw(duk_hthread *thr) { DUK_ASSERT(thr != NULL); duk_debug_read_bytes(thr, buf, 4); - return ((duk_uint32_t) buf[0] << 24) | - ((duk_uint32_t) buf[1] << 16) | - ((duk_uint32_t) buf[2] << 8) | - (duk_uint32_t) buf[3]; + return ((duk_uint32_t) buf[0] << 24) | ((duk_uint32_t) buf[1] << 16) | ((duk_uint32_t) buf[2] << 8) | (duk_uint32_t) buf[3]; } DUK_LOCAL duk_int32_t duk__debug_read_int32_raw(duk_hthread *thr) { @@ -45469,8 +46470,7 @@ DUK_LOCAL duk_uint16_t duk__debug_read_uint16_raw(duk_hthread *thr) { DUK_ASSERT(thr != NULL); duk_debug_read_bytes(thr, buf, 2); - return ((duk_uint16_t) buf[0] << 8) | - (duk_uint16_t) buf[1]; + return ((duk_uint16_t) buf[0] << 8) | (duk_uint16_t) buf[1]; } DUK_INTERNAL duk_int32_t duk_debug_read_int(duk_hthread *thr) { @@ -45502,10 +46502,10 @@ DUK_LOCAL duk_hstring *duk__debug_read_hstring_raw(duk_hthread *thr, duk_uint32_ duk_debug_read_bytes(thr, buf, (duk_size_t) len); duk_push_lstring(thr, (const char *) buf, (duk_size_t) len); } else { - p = (duk_uint8_t *) duk_push_fixed_buffer(thr, (duk_size_t) len); /* zero for paranoia */ + p = (duk_uint8_t *) duk_push_fixed_buffer(thr, (duk_size_t) len); /* zero for paranoia */ DUK_ASSERT(p != NULL); duk_debug_read_bytes(thr, p, (duk_size_t) len); - (void) duk_buffer_to_string(thr, -1); /* Safety relies on debug client, which is OK. */ + (void) duk_buffer_to_string(thr, -1); /* Safety relies on debug client, which is OK. */ } return duk_require_hstring(thr, -1); @@ -45531,17 +46531,17 @@ DUK_INTERNAL duk_hstring *duk_debug_read_hstring(duk_hthread *thr) { return duk__debug_read_hstring_raw(thr, len); - fail: +fail: DUK_D(DUK_DPRINT("debug connection error: failed to decode int")); DUK__SET_CONN_BROKEN(thr, 1); - duk_push_hstring_empty(thr); /* always push some string */ + duk_push_hstring_empty(thr); /* always push some string */ return duk_require_hstring(thr, -1); } DUK_LOCAL duk_hbuffer *duk__debug_read_hbuffer_raw(duk_hthread *thr, duk_uint32_t len) { duk_uint8_t *p; - p = (duk_uint8_t *) duk_push_fixed_buffer(thr, (duk_size_t) len); /* zero for paranoia */ + p = (duk_uint8_t *) duk_push_fixed_buffer(thr, (duk_size_t) len); /* zero for paranoia */ DUK_ASSERT(p != NULL); duk_debug_read_bytes(thr, p, (duk_size_t) len); @@ -45564,7 +46564,7 @@ DUK_LOCAL void *duk__debug_read_pointer_raw(duk_hthread *thr) { #endif return (void *) pu.p; - fail: +fail: DUK_D(DUK_DPRINT("debug connection error: failed to decode pointer")); DUK__SET_CONN_BROKEN(thr, 1); return (void *) NULL; @@ -45622,7 +46622,7 @@ DUK_INTERNAL duk_heaphdr *duk_debug_read_any_ptr(duk_hthread *thr) { return (duk_heaphdr *) duk__debug_read_pointer_raw(thr); - fail: +fail: DUK_D(DUK_DPRINT("debug connection error: failed to decode any pointer (object, pointer, heapptr)")); DUK__SET_CONN_BROKEN(thr, 1); return NULL; @@ -45728,15 +46728,15 @@ DUK_INTERNAL duk_tval *duk_debug_read_tval(duk_hthread *thr) { duk_push_heapptr(thr, (void *) h); break; } - case DUK_DBG_IB_UNUSED: /* unused: not accepted in inbound messages */ + case DUK_DBG_IB_UNUSED: /* unused: not accepted in inbound messages */ default: goto fail; } - return_ptr: +return_ptr: return DUK_GET_TVAL_NEGIDX(thr, -1); - fail: +fail: DUK_D(DUK_DPRINT("debug connection error: failed to decode tval")); DUK__SET_CONN_BROKEN(thr, 1); return NULL; @@ -45786,7 +46786,7 @@ DUK_INTERNAL void duk_debug_write_bytes(duk_hthread *thr, const duk_uint8_t *dat DUK__DBG_TPORT_EXIT(); if (got == 0 || got > left) { - duk__debug_null_most_callbacks(thr); /* avoid calling write callback in detach1() */ + duk__debug_null_most_callbacks(thr); /* avoid calling write callback in detach1() */ DUK_D(DUK_DPRINT("connection error during write")); DUK__SET_CONN_BROKEN(thr, 1); return; @@ -45853,8 +46853,7 @@ DUK_INTERNAL void duk_debug_write_uint(duk_hthread *thr, duk_uint32_t x) { * unsigned 32-bit dvalue. */ if (x >= 0x80000000UL) { - DUK_D(DUK_DPRINT("writing unsigned integer 0x%08lx as signed integer", - (long) x)); + DUK_D(DUK_DPRINT("writing unsigned integer 0x%08lx as signed integer", (long) x)); } duk_debug_write_int(thr, (duk_int32_t) x); } @@ -45895,9 +46894,7 @@ DUK_INTERNAL void duk_debug_write_string(duk_hthread *thr, const char *data, duk DUK_INTERNAL void duk_debug_write_cstring(duk_hthread *thr, const char *data) { DUK_ASSERT(thr != NULL); - duk_debug_write_string(thr, - data, - data ? DUK_STRLEN(data) : 0); + duk_debug_write_string(thr, data, data ? DUK_STRLEN(data) : 0); } DUK_INTERNAL void duk_debug_write_hstring(duk_hthread *thr, duk_hstring *h) { @@ -45951,7 +46948,7 @@ DUK_INTERNAL void duk_debug_write_pointer(duk_hthread *thr, void *ptr) { DUK_INTERNAL void duk_debug_write_heapptr(duk_hthread *thr, duk_heaphdr *h) { duk__debug_write_pointer_raw(thr, (void *) h, DUK_DBG_IB_HEAPPTR); } -#endif /* DUK_USE_DEBUGGER_DUMPHEAP || DUK_USE_DEBUGGER_INSPECT */ +#endif /* DUK_USE_DEBUGGER_DUMPHEAP || DUK_USE_DEBUGGER_INSPECT */ DUK_INTERNAL void duk_debug_write_hobject(duk_hthread *thr, duk_hobject *obj) { duk_uint8_t buf[3]; @@ -45994,8 +46991,7 @@ DUK_INTERNAL void duk_debug_write_tval(duk_hthread *thr, duk_tval *tv) { duk_debug_write_byte(thr, DUK_DBG_IB_NULL); break; case DUK_TAG_BOOLEAN: - DUK_ASSERT(DUK_TVAL_GET_BOOLEAN(tv) == 0 || - DUK_TVAL_GET_BOOLEAN(tv) == 1); + DUK_ASSERT(DUK_TVAL_GET_BOOLEAN(tv) == 0 || DUK_TVAL_GET_BOOLEAN(tv) == 1); duk_debug_write_boolean(thr, DUK_TVAL_GET_BOOLEAN(tv)); break; case DUK_TAG_POINTER: @@ -46040,14 +47036,22 @@ DUK_INTERNAL void duk_debug_write_tval(duk_hthread *thr, duk_tval *tv) { DUK_DD(DUK_DDPRINT("i32=%ld du1=%02x%02x%02x%02x%02x%02x%02x%02x " "du2=%02x%02x%02x%02x%02x%02x%02x%02x", (long) i32, - (unsigned int) du1.uc[0], (unsigned int) du1.uc[1], - (unsigned int) du1.uc[2], (unsigned int) du1.uc[3], - (unsigned int) du1.uc[4], (unsigned int) du1.uc[5], - (unsigned int) du1.uc[6], (unsigned int) du1.uc[7], - (unsigned int) du2.uc[0], (unsigned int) du2.uc[1], - (unsigned int) du2.uc[2], (unsigned int) du2.uc[3], - (unsigned int) du2.uc[4], (unsigned int) du2.uc[5], - (unsigned int) du2.uc[6], (unsigned int) du2.uc[7])); + (unsigned int) du1.uc[0], + (unsigned int) du1.uc[1], + (unsigned int) du1.uc[2], + (unsigned int) du1.uc[3], + (unsigned int) du1.uc[4], + (unsigned int) du1.uc[5], + (unsigned int) du1.uc[6], + (unsigned int) du1.uc[7], + (unsigned int) du2.uc[0], + (unsigned int) du2.uc[1], + (unsigned int) du2.uc[2], + (unsigned int) du2.uc[3], + (unsigned int) du2.uc[4], + (unsigned int) du2.uc[5], + (unsigned int) du2.uc[6], + (unsigned int) du2.uc[7])); if (duk_memcmp((const void *) du1.uc, (const void *) du2.uc, sizeof(du1.uc)) == 0) { duk_debug_write_int(thr, i32); @@ -46071,13 +47075,13 @@ DUK_LOCAL void duk__debug_write_tval_heapptr(duk_hthread *thr, duk_tval *tv) { duk_debug_write_tval(thr, tv); } } -#endif /* DUK_USE_DEBUGGER_DUMPHEAP */ +#endif /* DUK_USE_DEBUGGER_DUMPHEAP */ /* * Debug connection message write helpers */ -#if 0 /* unused */ +#if 0 /* unused */ DUK_INTERNAL void duk_debug_write_request(duk_hthread *thr, duk_small_uint_t command) { duk_debug_write_byte(thr, DUK_DBG_IB_REQUEST); duk_debug_write_int(thr, command); @@ -46180,7 +47184,7 @@ DUK_INTERNAL void duk_debug_send_throw(duk_hthread *thr, duk_bool_t fatal) { duk_activation *act; duk_uint32_t pc; - DUK_ASSERT(thr->valstack_top > thr->valstack); /* At least: ... [err] */ + DUK_ASSERT(thr->valstack_top > thr->valstack); /* At least: ... [err] */ duk_debug_write_notify(thr, DUK_DBG_CMD_THROW); duk_debug_write_int(thr, (duk_int32_t) fatal); @@ -46221,7 +47225,7 @@ DUK_INTERNAL void duk_debug_send_throw(duk_hthread *thr, duk_bool_t fatal) { duk_debug_write_eom(thr); } -#endif /* DUK_USE_DEBUGGER_THROW_NOTIFY */ +#endif /* DUK_USE_DEBUGGER_THROW_NOTIFY */ /* * Debug message processing @@ -46245,9 +47249,9 @@ DUK_LOCAL duk_bool_t duk__debug_skip_dvalue(duk_hthread *thr) { duk_debug_skip_bytes(thr, (duk_size_t) (x - 0x60)); return 0; } - switch(x) { + switch (x) { case DUK_DBG_IB_EOM: - return 1; /* Return 1: got EOM */ + return 1; /* Return 1: got EOM */ case DUK_DBG_IB_REQUEST: case DUK_DBG_IB_REPLY: case DUK_DBG_IB_ERROR: @@ -46296,9 +47300,9 @@ DUK_LOCAL duk_bool_t duk__debug_skip_dvalue(duk_hthread *thr) { return 0; - fail: +fail: DUK__SET_CONN_BROKEN(thr, 1); - return 1; /* Pretend like we got EOM */ + return 1; /* Pretend like we got EOM */ } /* Skip dvalues to EOM. */ @@ -46318,7 +47322,7 @@ DUK_LOCAL duk_int32_t duk__debug_read_validate_csindex(duk_hthread *thr) { level = duk_debug_read_int(thr); if (level >= 0 || -level > (duk_int32_t) thr->callstack_top) { duk_debug_write_error_eom(thr, DUK_DBG_ERR_NOTFOUND, "invalid callstack index"); - return 0; /* zero indicates failure */ + return 0; /* zero indicates failure */ } return level; } @@ -46387,7 +47391,7 @@ DUK_LOCAL void duk__debug_handle_resume(duk_hthread *thr, duk_heap *heap) { duk_debug_clear_paused(heap); pause_flags = 0; -#if 0 /* manual testing */ +#if 0 /* manual testing */ pause_flags |= DUK_PAUSE_FLAG_ONE_OPCODE; pause_flags |= DUK_PAUSE_FLAG_CAUGHT_ERROR; pause_flags |= DUK_PAUSE_FLAG_UNCAUGHT_ERROR; @@ -46408,12 +47412,9 @@ DUK_LOCAL void duk__debug_handle_step(duk_hthread *thr, duk_heap *heap, duk_int3 DUK_D(DUK_DPRINT("debug command StepInto/StepOver/StepOut: %d", (int) cmd)); if (cmd == DUK_DBG_CMD_STEPINTO) { - pause_flags = DUK_PAUSE_FLAG_LINE_CHANGE | - DUK_PAUSE_FLAG_FUNC_ENTRY | - DUK_PAUSE_FLAG_FUNC_EXIT; + pause_flags = DUK_PAUSE_FLAG_LINE_CHANGE | DUK_PAUSE_FLAG_FUNC_ENTRY | DUK_PAUSE_FLAG_FUNC_EXIT; } else if (cmd == DUK_DBG_CMD_STEPOVER) { - pause_flags = DUK_PAUSE_FLAG_LINE_CHANGE | - DUK_PAUSE_FLAG_FUNC_EXIT; + pause_flags = DUK_PAUSE_FLAG_LINE_CHANGE | DUK_PAUSE_FLAG_FUNC_EXIT; } else { DUK_ASSERT(cmd == DUK_DBG_CMD_STEPOUT); pause_flags = DUK_PAUSE_FLAG_FUNC_EXIT; @@ -46492,7 +47493,7 @@ DUK_LOCAL void duk__debug_handle_get_var(duk_hthread *thr, duk_heap *heap) { if (act == NULL) { return; } - str = duk_debug_read_hstring(thr); /* push to stack */ + str = duk_debug_read_hstring(thr); /* push to stack */ DUK_ASSERT(str != NULL); rc = duk_js_getvar_activation(thr, act, str, 0); @@ -46521,7 +47522,7 @@ DUK_LOCAL void duk__debug_handle_put_var(duk_hthread *thr, duk_heap *heap) { if (act == NULL) { return; } - str = duk_debug_read_hstring(thr); /* push to stack */ + str = duk_debug_read_hstring(thr); /* push to stack */ DUK_ASSERT(str != NULL); tv = duk_debug_read_tval(thr); if (tv == NULL) { @@ -46619,7 +47620,7 @@ DUK_LOCAL void duk__debug_handle_get_locals(duk_hthread *thr, duk_heap *heap) { /* [ ... func varmap enum key value this ] */ duk_debug_write_hstring(thr, duk_get_hstring(thr, -3)); duk_debug_write_tval(thr, duk_get_tval(thr, -2)); - duk_pop_3(thr); /* -> [ ... func varmap enum ] */ + duk_pop_3(thr); /* -> [ ... func varmap enum ] */ } } else { DUK_D(DUK_DPRINT("varmap missing in GetLocals, ignore")); @@ -46654,12 +47655,12 @@ DUK_LOCAL void duk__debug_handle_eval(duk_hthread *thr, duk_heap *heap) { /* nargs == 2 so we can pass a callstack index to eval(). */ idx_func = duk_get_top(thr); duk_push_c_function(thr, duk_bi_global_object_eval, 2 /*nargs*/); - duk_push_undefined(thr); /* 'this' binding shouldn't matter here */ + duk_push_undefined(thr); /* 'this' binding shouldn't matter here */ /* Read callstack index, if non-null. */ if (duk_debug_peek_byte(thr) == DUK_DBG_IB_NULL) { direct_eval = 0; - level = -1; /* Not needed, but silences warning. */ + level = -1; /* Not needed, but silences warning. */ (void) duk_debug_read_byte(thr); } else { direct_eval = 1; @@ -46669,12 +47670,11 @@ DUK_LOCAL void duk__debug_handle_eval(duk_hthread *thr, duk_heap *heap) { } } - DUK_ASSERT(!direct_eval || - (level < 0 && -level <= (duk_int32_t) thr->callstack_top)); + DUK_ASSERT(!direct_eval || (level < 0 && -level <= (duk_int32_t) thr->callstack_top)); (void) duk_debug_read_hstring(thr); if (direct_eval) { - duk_push_int(thr, level - 1); /* compensate for eval() call */ + duk_push_int(thr, level - 1); /* compensate for eval() call */ } /* [ ... eval "eval" eval_input level? ] */ @@ -46729,7 +47729,7 @@ DUK_LOCAL void duk__debug_handle_detach(duk_hthread *thr, duk_heap *heap) { duk_debug_write_eom(thr); DUK_D(DUK_DPRINT("debug connection detached, mark broken")); - DUK__SET_CONN_BROKEN(thr, 0); /* not an error */ + DUK__SET_CONN_BROKEN(thr, 0); /* not an error */ } DUK_LOCAL void duk__debug_handle_apprequest(duk_hthread *thr, duk_heap *heap) { @@ -46737,7 +47737,7 @@ DUK_LOCAL void duk__debug_handle_apprequest(duk_hthread *thr, duk_heap *heap) { DUK_D(DUK_DPRINT("debug command AppRequest")); - old_top = duk_get_top(thr); /* save stack top */ + old_top = duk_get_top(thr); /* save stack top */ if (heap->dbg_request_cb != NULL) { duk_idx_t nrets; @@ -46753,7 +47753,7 @@ DUK_LOCAL void duk__debug_handle_apprequest(duk_hthread *thr, duk_heap *heap) { DUK_D(DUK_DPRINT("failed to allocate space for request dvalue(s)")); goto fail; } - tv = duk_debug_read_tval(thr); /* push to stack */ + tv = duk_debug_read_tval(thr); /* push to stack */ if (tv == NULL) { /* detached */ return; @@ -46764,17 +47764,24 @@ DUK_LOCAL void duk__debug_handle_apprequest(duk_hthread *thr, duk_heap *heap) { /* Request callback should push values for reply to client onto valstack */ DUK_D(DUK_DPRINT("calling into AppRequest request_cb with nvalues=%ld, old_top=%ld, top=%ld", - (long) nvalues, (long) old_top, (long) duk_get_top(thr))); + (long) nvalues, + (long) old_top, + (long) duk_get_top(thr))); nrets = heap->dbg_request_cb(thr, heap->dbg_udata, nvalues); DUK_D(DUK_DPRINT("returned from AppRequest request_cb; nvalues=%ld -> nrets=%ld, old_top=%ld, top=%ld", - (long) nvalues, (long) nrets, (long) old_top, (long) duk_get_top(thr))); + (long) nvalues, + (long) nrets, + (long) old_top, + (long) duk_get_top(thr))); if (nrets >= 0) { DUK_ASSERT(duk_get_top(thr) >= old_top + nrets); if (duk_get_top(thr) < old_top + nrets) { DUK_D(DUK_DPRINT("AppRequest callback doesn't match value stack configuration, " "top=%ld < old_top=%ld + nrets=%ld; " "this might mean it's unsafe to continue!", - (long) duk_get_top(thr), (long) old_top, (long) nrets)); + (long) duk_get_top(thr), + (long) old_top, + (long) nrets)); goto fail; } @@ -46794,7 +47801,7 @@ DUK_LOCAL void duk__debug_handle_apprequest(duk_hthread *thr, duk_heap *heap) { duk_debug_write_error_eom(thr, DUK_DBG_ERR_APPLICATION, duk_get_string(thr, -1)); } - duk_set_top(thr, old_top); /* restore stack top */ + duk_set_top(thr, old_top); /* restore stack top */ } else { DUK_D(DUK_DPRINT("no request callback, treat AppRequest as unsupported")); duk_debug_write_error_eom(thr, DUK_DBG_ERR_UNSUPPORTED, "AppRequest unsupported by target"); @@ -46802,8 +47809,8 @@ DUK_LOCAL void duk__debug_handle_apprequest(duk_hthread *thr, duk_heap *heap) { return; - fail: - duk_set_top(thr, old_top); /* restore stack top */ +fail: + duk_set_top(thr, old_top); /* restore stack top */ DUK__SET_CONN_BROKEN(thr, 1); } @@ -46854,16 +47861,16 @@ DUK_LOCAL void duk__debug_dump_heaphdr(duk_hthread *thr, duk_heap *heap, duk_hea k = DUK_HOBJECT_E_GET_KEY(heap, h, i); duk_debug_write_heapptr(thr, (duk_heaphdr *) k); if (k == NULL) { - duk_debug_write_int(thr, 0); /* isAccessor */ + duk_debug_write_int(thr, 0); /* isAccessor */ duk_debug_write_unused(thr); continue; } if (DUK_HOBJECT_E_SLOT_IS_ACCESSOR(heap, h, i)) { - duk_debug_write_int(thr, 1); /* isAccessor */ + duk_debug_write_int(thr, 1); /* isAccessor */ duk_debug_write_heapptr(thr, (duk_heaphdr *) DUK_HOBJECT_E_GET_VALUE_PTR(heap, h, i)->a.get); duk_debug_write_heapptr(thr, (duk_heaphdr *) DUK_HOBJECT_E_GET_VALUE_PTR(heap, h, i)->a.set); } else { - duk_debug_write_int(thr, 0); /* isAccessor */ + duk_debug_write_int(thr, 0); /* isAccessor */ duk__debug_write_tval_heapptr(thr, &DUK_HOBJECT_E_GET_VALUE_PTR(heap, h, i)->v); } @@ -46925,7 +47932,7 @@ DUK_LOCAL void duk__debug_handle_dump_heap(duk_hthread *thr, duk_heap *heap) { duk__debug_dump_strtab(thr, heap); duk_debug_write_eom(thr); } -#endif /* DUK_USE_DEBUGGER_DUMPHEAP */ +#endif /* DUK_USE_DEBUGGER_DUMPHEAP */ DUK_LOCAL void duk__debug_handle_get_bytecode(duk_hthread *thr, duk_heap *heap) { duk_activation *act; @@ -46994,11 +48001,11 @@ DUK_LOCAL void duk__debug_handle_get_bytecode(duk_hthread *thr, duk_heap *heap) duk_debug_write_eom(thr); return; - fail_args: +fail_args: duk_debug_write_error_eom(thr, DUK_DBG_ERR_UNKNOWN, "invalid argument"); return; - fail_index: +fail_index: duk_debug_write_error_eom(thr, DUK_DBG_ERR_NOTFOUND, "invalid callstack index"); return; } @@ -47050,53 +48057,22 @@ DUK_LOCAL duk_uint_t duk__debug_getinfo_hstring_masks[] = { DUK_HSTRING_FLAG_EVAL_OR_ARGUMENTS, #endif DUK_HSTRING_FLAG_EXTDATA, - 0 /* terminator */ + 0 /* terminator */ }; DUK_LOCAL const char * const duk__debug_getinfo_hobject_keys[] = { - "extensible", - "constructable", - "callable", - "boundfunc", - "compfunc", - "natfunc", - "bufobj", - "fastrefs", - "array_part", - "strict", - "notail", - "newenv", - "namebinding", - "createargs", - "have_finalizer", - "exotic_array", - "exotic_stringobj", - "exotic_arguments", - "exotic_proxyobj", - "special_call" + "extensible", "constructable", "callable", "boundfunc", "compfunc", "natfunc", "bufobj", + "fastrefs", "array_part", "strict", "notail", "newenv", "namebinding", "createargs", + "have_finalizer", "exotic_array", "exotic_stringobj", "exotic_arguments", "exotic_proxyobj", "special_call" /* NULL not needed here */ }; DUK_LOCAL duk_uint_t duk__debug_getinfo_hobject_masks[] = { - DUK_HOBJECT_FLAG_EXTENSIBLE, - DUK_HOBJECT_FLAG_CONSTRUCTABLE, - DUK_HOBJECT_FLAG_CALLABLE, - DUK_HOBJECT_FLAG_BOUNDFUNC, - DUK_HOBJECT_FLAG_COMPFUNC, - DUK_HOBJECT_FLAG_NATFUNC, - DUK_HOBJECT_FLAG_BUFOBJ, - DUK_HOBJECT_FLAG_FASTREFS, - DUK_HOBJECT_FLAG_ARRAY_PART, - DUK_HOBJECT_FLAG_STRICT, - DUK_HOBJECT_FLAG_NOTAIL, - DUK_HOBJECT_FLAG_NEWENV, - DUK_HOBJECT_FLAG_NAMEBINDING, - DUK_HOBJECT_FLAG_CREATEARGS, - DUK_HOBJECT_FLAG_HAVE_FINALIZER, - DUK_HOBJECT_FLAG_EXOTIC_ARRAY, - DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ, - DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS, - DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ, - DUK_HOBJECT_FLAG_SPECIAL_CALL, - 0 /* terminator */ + DUK_HOBJECT_FLAG_EXTENSIBLE, DUK_HOBJECT_FLAG_CONSTRUCTABLE, DUK_HOBJECT_FLAG_CALLABLE, + DUK_HOBJECT_FLAG_BOUNDFUNC, DUK_HOBJECT_FLAG_COMPFUNC, DUK_HOBJECT_FLAG_NATFUNC, + DUK_HOBJECT_FLAG_BUFOBJ, DUK_HOBJECT_FLAG_FASTREFS, DUK_HOBJECT_FLAG_ARRAY_PART, + DUK_HOBJECT_FLAG_STRICT, DUK_HOBJECT_FLAG_NOTAIL, DUK_HOBJECT_FLAG_NEWENV, + DUK_HOBJECT_FLAG_NAMEBINDING, DUK_HOBJECT_FLAG_CREATEARGS, DUK_HOBJECT_FLAG_HAVE_FINALIZER, + DUK_HOBJECT_FLAG_EXOTIC_ARRAY, DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ, DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS, + DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ, DUK_HOBJECT_FLAG_SPECIAL_CALL, 0 /* terminator */ }; DUK_LOCAL const char * const duk__debug_getinfo_hbuffer_keys[] = { "dynamic", @@ -47106,7 +48082,7 @@ DUK_LOCAL const char * const duk__debug_getinfo_hbuffer_keys[] = { DUK_LOCAL duk_uint_t duk__debug_getinfo_hbuffer_masks[] = { DUK_HBUFFER_FLAG_DYNAMIC, DUK_HBUFFER_FLAG_EXTERNAL, - 0 /* terminator */ + 0 /* terminator */ }; DUK_LOCAL void duk__debug_getinfo_flags_key(duk_hthread *thr, const char *key) { @@ -47132,7 +48108,7 @@ DUK_LOCAL void duk__debug_getinfo_prop_bool(duk_hthread *thr, const char *key, d duk_debug_write_boolean(thr, val); } -DUK_LOCAL void duk__debug_getinfo_bitmask(duk_hthread *thr, const char * const * keys, duk_uint_t *masks, duk_uint_t flags) { +DUK_LOCAL void duk__debug_getinfo_bitmask(duk_hthread *thr, const char * const *keys, duk_uint_t *masks, duk_uint_t flags) { const char *key; duk_uint_t mask; @@ -47144,7 +48120,10 @@ DUK_LOCAL void duk__debug_getinfo_bitmask(duk_hthread *thr, const char * const * key = *keys++; DUK_ASSERT(key != NULL); - DUK_DD(DUK_DDPRINT("inspect bitmask: key=%s, mask=0x%08lx, flags=0x%08lx", key, (unsigned long) mask, (unsigned long) flags)); + DUK_DD(DUK_DDPRINT("inspect bitmask: key=%s, mask=0x%08lx, flags=0x%08lx", + key, + (unsigned long) mask, + (unsigned long) flags)); duk__debug_getinfo_prop_bool(thr, key, flags & mask); } } @@ -47220,9 +48199,12 @@ DUK_LOCAL void duk__debug_handle_get_heap_obj_info(duk_hthread *thr, duk_heap *h DUK_D(DUK_DPRINT("debug command GetHeapObjInfo")); DUK_UNREF(heap); - DUK_ASSERT(sizeof(duk__debug_getinfo_hstring_keys) / sizeof(const char *) == sizeof(duk__debug_getinfo_hstring_masks) / sizeof(duk_uint_t) - 1); - DUK_ASSERT(sizeof(duk__debug_getinfo_hobject_keys) / sizeof(const char *) == sizeof(duk__debug_getinfo_hobject_masks) / sizeof(duk_uint_t) - 1); - DUK_ASSERT(sizeof(duk__debug_getinfo_hbuffer_keys) / sizeof(const char *) == sizeof(duk__debug_getinfo_hbuffer_masks) / sizeof(duk_uint_t) - 1); + DUK_ASSERT(sizeof(duk__debug_getinfo_hstring_keys) / sizeof(const char *) == + sizeof(duk__debug_getinfo_hstring_masks) / sizeof(duk_uint_t) - 1); + DUK_ASSERT(sizeof(duk__debug_getinfo_hobject_keys) / sizeof(const char *) == + sizeof(duk__debug_getinfo_hobject_masks) / sizeof(duk_uint_t) - 1); + DUK_ASSERT(sizeof(duk__debug_getinfo_hbuffer_keys) / sizeof(const char *) == + sizeof(duk__debug_getinfo_hbuffer_masks) / sizeof(duk_uint_t) - 1); h = duk_debug_read_any_ptr(thr); if (!h) { @@ -47410,7 +48392,7 @@ DUK_LOCAL void duk__debug_handle_get_heap_obj_info(duk_hthread *thr, duk_heap *h duk_debug_write_heapptr(thr, (duk_heaphdr *) h_bufobj->buf); } } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ break; } case DUK_HTYPE_BUFFER: { @@ -47425,7 +48407,7 @@ DUK_LOCAL void duk__debug_handle_get_heap_obj_info(duk_hthread *thr, duk_heap *h duk__debug_getinfo_flags_key(thr, "dataptr"); duk_debug_write_pointer(thr, (void *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_buf)); duk__debug_getinfo_flags_key(thr, "data"); - duk_debug_write_hbuffer(thr, h_buf); /* tolerates NULL h_buf */ + duk_debug_write_hbuffer(thr, h_buf); /* tolerates NULL h_buf */ break; } default: { @@ -47463,8 +48445,7 @@ DUK_LOCAL void duk__debug_handle_get_obj_prop_desc(duk_hthread *thr, duk_heap *h /* To use the shared helper need the virtual index. */ DUK_ASSERT(desc.e_idx >= 0 || desc.a_idx >= 0); - virtual_idx = (desc.a_idx >= 0 ? desc.a_idx : - (duk_int_t) DUK_HOBJECT_GET_ASIZE(h_obj) + desc.e_idx); + virtual_idx = (desc.a_idx >= 0 ? desc.a_idx : (duk_int_t) DUK_HOBJECT_GET_ASIZE(h_obj) + desc.e_idx); duk_debug_write_reply(thr); rc = duk__debug_getprop_index(thr, heap, h_obj, (duk_uint_t) virtual_idx); @@ -47476,7 +48457,7 @@ DUK_LOCAL void duk__debug_handle_get_obj_prop_desc(duk_hthread *thr, duk_heap *h } return; - fail_args: +fail_args: duk_debug_write_error_eom(thr, DUK_DBG_ERR_UNKNOWN, "invalid args"); } @@ -47512,11 +48493,11 @@ DUK_LOCAL void duk__debug_handle_get_obj_prop_desc_range(duk_hthread *thr, duk_h duk_debug_write_eom(thr); return; - fail_args: +fail_args: duk_debug_write_error_eom(thr, DUK_DBG_ERR_UNKNOWN, "invalid args"); } -#endif /* DUK_USE_DEBUGGER_INSPECT */ +#endif /* DUK_USE_DEBUGGER_INSPECT */ /* * Process incoming debug requests @@ -47614,7 +48595,7 @@ DUK_LOCAL void duk__debug_process_message(duk_hthread *thr) { duk__debug_handle_dump_heap(thr, heap); break; } -#endif /* DUK_USE_DEBUGGER_DUMPHEAP */ +#endif /* DUK_USE_DEBUGGER_DUMPHEAP */ case DUK_DBG_CMD_GETBYTECODE: { duk__debug_handle_get_bytecode(thr, heap); break; @@ -47636,12 +48617,12 @@ DUK_LOCAL void duk__debug_process_message(duk_hthread *thr) { duk__debug_handle_get_obj_prop_desc_range(thr, heap); break; } -#endif /* DUK_USE_DEBUGGER_INSPECT */ +#endif /* DUK_USE_DEBUGGER_INSPECT */ default: { DUK_D(DUK_DPRINT("debug command unsupported: %d", (int) cmd)); duk_debug_write_error_eom(thr, DUK_DBG_ERR_UNSUPPORTED, "unsupported command"); } - } /* switch cmd */ + } /* switch cmd */ break; } case DUK_DBG_IB_REPLY: { @@ -47660,14 +48641,14 @@ DUK_LOCAL void duk__debug_process_message(duk_hthread *thr) { DUK_D(DUK_DPRINT("invalid initial byte, drop connection: %d", (int) x)); goto fail; } - } /* switch initial byte */ + } /* switch initial byte */ DUK_ASSERT(duk_get_top(thr) >= entry_top); duk_set_top(thr, entry_top); duk__debug_skip_to_eom(thr); return; - fail: +fail: DUK_ASSERT(duk_get_top(thr) >= entry_top); duk_set_top(thr, entry_top); DUK__SET_CONN_BROKEN(thr, 1); @@ -47694,8 +48675,10 @@ DUK_INTERNAL duk_bool_t duk_debug_process_messages(duk_hthread *thr, duk_bool_t #endif DUK_D(DUK_DPRINT("process debug messages: read_cb=%s, no_block=%ld, detaching=%ld, processing=%ld", - thr->heap->dbg_read_cb ? "not NULL" : "NULL", (long) no_block, - (long) thr->heap->dbg_detaching, (long) thr->heap->dbg_processing)); + thr->heap->dbg_read_cb ? "not NULL" : "NULL", + (long) no_block, + (long) thr->heap->dbg_detaching, + (long) thr->heap->dbg_processing)); DUK_DD(DUK_DDPRINT("top at entry: %ld", (long) duk_get_top(thr))); /* thr->heap->dbg_detaching may be != 0 if a debugger write outside @@ -47742,13 +48725,14 @@ DUK_INTERNAL duk_bool_t duk_debug_process_messages(duk_hthread *thr, duk_bool_t DUK_D(DUK_DPRINT("detach pending (dbg_read_cb == NULL, dbg_detaching != 0), call detach2")); duk__debug_do_detach2(thr->heap); - thr->heap->dbg_processing = 1; /* may be set to 0 by duk_debugger_attach() inside callback */ + thr->heap->dbg_processing = 1; /* may be set to 0 by duk_debugger_attach() inside callback */ DUK_D(DUK_DPRINT("after detach2 (and possible reattach): dbg_read_cb=%s, dbg_detaching=%ld", - thr->heap->dbg_read_cb ? "not NULL" : "NULL", (long) thr->heap->dbg_detaching)); + thr->heap->dbg_read_cb ? "not NULL" : "NULL", + (long) thr->heap->dbg_detaching)); } - DUK_ASSERT(thr->heap->dbg_detaching == 0); /* true even with reattach */ - DUK_ASSERT(thr->heap->dbg_processing == 1); /* even after a detach and possible reattach */ + DUK_ASSERT(thr->heap->dbg_detaching == 0); /* true even with reattach */ + DUK_ASSERT(thr->heap->dbg_processing == 1); /* even after a detach and possible reattach */ if (thr->heap->dbg_read_cb == NULL) { DUK_D(DUK_DPRINT("debug connection broken (and not detaching), stop processing messages")); @@ -47773,7 +48757,7 @@ DUK_INTERNAL duk_bool_t duk_debug_process_messages(duk_hthread *thr, duk_bool_t duk__debug_process_message(thr); duk__check_resend_status(thr); - retval = 1; /* processed one or more messages */ + retval = 1; /* processed one or more messages */ } DUK_ASSERT(thr->heap->dbg_detaching == 0); @@ -47783,7 +48767,7 @@ DUK_INTERNAL duk_bool_t duk_debug_process_messages(duk_hthread *thr, duk_bool_t /* As an initial implementation, read flush after exiting the message * loop. If transport is broken, this is a no-op (with debug logs). */ - duk_debug_read_flush(thr); /* this cannot initiate a detach */ + duk_debug_read_flush(thr); /* this cannot initiate a detach */ DUK_ASSERT(thr->heap->dbg_detaching == 0); DUK_DD(DUK_DDPRINT("top at exit: %ld", (long) duk_get_top(thr))); @@ -47834,11 +48818,8 @@ DUK_INTERNAL void duk_debug_halt_execution(duk_hthread *thr, duk_bool_t use_prev /* Short circuit if is safe: if act->curr_pc != NULL, 'fun' is * guaranteed to be a non-NULL ECMAScript function. */ - DUK_ASSERT(act->curr_pc == NULL || - (fun != NULL && DUK_HOBJECT_IS_COMPFUNC((duk_hobject *) fun))); - if (use_prev_pc && - act->curr_pc != NULL && - act->curr_pc > DUK_HCOMPFUNC_GET_CODE_BASE(thr->heap, fun)) { + DUK_ASSERT(act->curr_pc == NULL || (fun != NULL && DUK_HOBJECT_IS_COMPFUNC((duk_hobject *) fun))); + if (use_prev_pc && act->curr_pc != NULL && act->curr_pc > DUK_HCOMPFUNC_GET_CODE_BASE(thr->heap, fun)) { act->curr_pc--; } } @@ -47865,7 +48846,7 @@ DUK_INTERNAL void duk_debug_halt_execution(duk_hthread *thr, duk_bool_t use_prev * with PC values. */ if (act != NULL) { - act->curr_pc = old_pc; /* restore PC */ + act->curr_pc = old_pc; /* restore PC */ } } @@ -47889,7 +48870,8 @@ DUK_INTERNAL duk_small_int_t duk_debug_add_breakpoint(duk_hthread *thr, duk_hstr if (heap->dbg_breakpoint_count >= DUK_HEAP_MAX_BREAKPOINTS) { DUK_D(DUK_DPRINT("failed to add breakpoint for %O:%ld, all breakpoint slots used", - (duk_heaphdr *) filename, (long) line)); + (duk_heaphdr *) filename, + (long) line)); return -1; } heap->dbg_breakpoints_active[0] = (duk_breakpoint *) NULL; @@ -47898,7 +48880,7 @@ DUK_INTERNAL duk_small_int_t duk_debug_add_breakpoint(duk_hthread *thr, duk_hstr b->line = line; DUK_HSTRING_INCREF(thr, filename); - return (duk_small_int_t) (heap->dbg_breakpoint_count - 1); /* index */ + return (duk_small_int_t) (heap->dbg_breakpoint_count - 1); /* index */ } DUK_INTERNAL duk_bool_t duk_debug_remove_breakpoint(duk_hthread *thr, duk_small_uint_t breakpoint_index) { @@ -47916,7 +48898,7 @@ DUK_INTERNAL duk_bool_t duk_debug_remove_breakpoint(duk_hthread *thr, duk_small_ heap = thr->heap; DUK_ASSERT(heap != NULL); DUK_ASSERT(duk_debug_is_attached(thr->heap)); - DUK_ASSERT_DISABLE(breakpoint_index >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(breakpoint_index >= 0); /* unsigned */ if (breakpoint_index >= heap->dbg_breakpoint_count) { DUK_D(DUK_DPRINT("invalid breakpoint index: %ld", (long) breakpoint_index)); @@ -47928,15 +48910,13 @@ DUK_INTERNAL duk_bool_t duk_debug_remove_breakpoint(duk_hthread *thr, duk_small_ DUK_ASSERT(h != NULL); move_size = sizeof(duk_breakpoint) * (heap->dbg_breakpoint_count - breakpoint_index - 1); - duk_memmove((void *) b, - (const void *) (b + 1), - (size_t) move_size); + duk_memmove((void *) b, (const void *) (b + 1), (size_t) move_size); heap->dbg_breakpoint_count--; heap->dbg_breakpoints_active[0] = (duk_breakpoint *) NULL; - DUK_HSTRING_DECREF(thr, h); /* side effects */ - DUK_UNREF(h); /* w/o refcounting */ + DUK_HSTRING_DECREF(thr, h); /* side effects */ + DUK_UNREF(h); /* w/o refcounting */ /* Breakpoint entries above the used area are left as garbage. */ @@ -47962,10 +48942,10 @@ DUK_INTERNAL void duk_debug_set_paused(duk_heap *heap) { DUK_HEAP_SET_DEBUGGER_PAUSED(heap); heap->dbg_state_dirty = 1; duk_debug_clear_pause_state(heap); - DUK_ASSERT(heap->ms_running == 0); /* debugger can't be triggered within mark-and-sweep */ - heap->ms_running = 2; /* prevent mark-and-sweep, prevent refzero queueing */ + DUK_ASSERT(heap->ms_running == 0); /* debugger can't be triggered within mark-and-sweep */ + heap->ms_running = 2; /* prevent mark-and-sweep, prevent refzero queueing */ heap->ms_prevent_count++; - DUK_ASSERT(heap->ms_prevent_count != 0); /* Wrap. */ + DUK_ASSERT(heap->ms_prevent_count != 0); /* Wrap. */ DUK_ASSERT(heap->heap_thread != NULL); } } @@ -47991,11 +48971,11 @@ DUK_INTERNAL void duk_debug_clear_pause_state(duk_heap *heap) { heap->dbg_pause_startline = 0; } -#else /* DUK_USE_DEBUGGER_SUPPORT */ +#else /* DUK_USE_DEBUGGER_SUPPORT */ /* No debugger support. */ -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ /* automatic undefs */ #undef DUK__DBG_TPORT_ENTER @@ -48085,7 +49065,7 @@ DUK_LOCAL void duk__err_augment_user(duk_hthread *thr, duk_small_uint_t stridx_c * when it is called and that error replaces the original one. */ - DUK_ASSERT_VALSTACK_SPACE(thr, 4); /* 3 entries actually needed below */ + DUK_ASSERT_VALSTACK_SPACE(thr, 4); /* 3 entries actually needed below */ /* [ ... errval ] */ @@ -48096,23 +49076,19 @@ DUK_LOCAL void duk__err_augment_user(duk_hthread *thr, duk_small_uint_t stridx_c DUK_DD(DUK_DDPRINT("error occurred when DUK_BIDX_DUKTAPE is NULL, ignoring")); return; } - tv_hnd = duk_hobject_find_entry_tval_ptr_stridx(thr->heap, - thr->builtins[DUK_BIDX_DUKTAPE], - stridx_cb); + tv_hnd = duk_hobject_find_entry_tval_ptr_stridx(thr->heap, thr->builtins[DUK_BIDX_DUKTAPE], stridx_cb); if (tv_hnd == NULL) { - DUK_DD(DUK_DDPRINT("error handler does not exist or is not a plain value: %!T", - (duk_tval *) tv_hnd)); + DUK_DD(DUK_DDPRINT("error handler does not exist or is not a plain value: %!T", (duk_tval *) tv_hnd)); return; } - DUK_DDD(DUK_DDDPRINT("error handler dump (callability not checked): %!T", - (duk_tval *) tv_hnd)); + DUK_DDD(DUK_DDDPRINT("error handler dump (callability not checked): %!T", (duk_tval *) tv_hnd)); duk_push_tval(thr, tv_hnd); /* [ ... errval errhandler ] */ - duk_insert(thr, -2); /* -> [ ... errhandler errval ] */ + duk_insert(thr, -2); /* -> [ ... errhandler errval ] */ duk_push_undefined(thr); - duk_insert(thr, -2); /* -> [ ... errhandler undefined(= this) errval ] */ + duk_insert(thr, -2); /* -> [ ... errhandler undefined(= this) errval ] */ /* [ ... errhandler undefined errval ] */ @@ -48129,21 +49105,25 @@ DUK_LOCAL void duk__err_augment_user(duk_hthread *thr, duk_small_uint_t stridx_c thr->heap->augmenting_error = 1; rc = duk_pcall_method(thr, 1); - DUK_UNREF(rc); /* no need to check now: both success and error are OK */ + DUK_UNREF(rc); /* no need to check now: both success and error are OK */ DUK_ASSERT(thr->heap->augmenting_error == 1); thr->heap->augmenting_error = 0; /* [ ... errval ] */ } -#endif /* DUK_USE_ERRTHROW || DUK_USE_ERRCREATE */ +#endif /* DUK_USE_ERRTHROW || DUK_USE_ERRCREATE */ /* * Add ._Tracedata to an error on the stack top. */ #if defined(DUK_USE_TRACEBACKS) -DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, const char *c_filename, duk_int_t c_line, duk_small_uint_t flags) { +DUK_LOCAL void duk__add_traceback(duk_hthread *thr, + duk_hthread *thr_callstack, + const char *c_filename, + duk_int_t c_line, + duk_small_uint_t flags) { duk_activation *act; duk_int_t depth; duk_int_t arr_size; @@ -48165,15 +49145,14 @@ DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, * See doc/error-objects.rst. */ - DUK_DDD(DUK_DDDPRINT("adding traceback to object: %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("adding traceback to object: %!T", (duk_tval *) duk_get_tval(thr, -1))); /* Preallocate array to correct size, so that we can just write out * the _Tracedata values into the array part. */ act = thr->callstack_curr; depth = DUK_USE_TRACEBACK_DEPTH; - DUK_ASSERT(thr_callstack->callstack_top <= DUK_INT_MAX); /* callstack limits */ + DUK_ASSERT(thr_callstack->callstack_top <= DUK_INT_MAX); /* callstack limits */ if (depth > (duk_int_t) thr_callstack->callstack_top) { depth = (duk_int_t) thr_callstack->callstack_top; } @@ -48215,7 +49194,7 @@ DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, DUK_HSTRING_INCREF(thr, s); tv++; - u32 = (duk_uint32_t) thr->compile_ctx->curr_token.start_line; /* (flags<<32) + (line), flags = 0 */ + u32 = (duk_uint32_t) thr->compile_ctx->curr_token.start_line; /* (flags<<32) + (line), flags = 0 */ DUK_TVAL_SET_U32(tv, u32); tv++; } @@ -48229,13 +49208,15 @@ DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, if (c_filename) { DUK_ASSERT(DUK_TVAL_IS_STRING(thr->valstack_top - 2)); - s = DUK_TVAL_GET_STRING(thr->valstack_top - 2); /* interned c_filename */ + s = DUK_TVAL_GET_STRING(thr->valstack_top - 2); /* interned c_filename */ DUK_ASSERT(s != NULL); DUK_TVAL_SET_STRING(tv, s); DUK_HSTRING_INCREF(thr, s); tv++; - d = ((flags & DUK_AUGMENT_FLAG_NOBLAME_FILELINE) ? ((duk_double_t) DUK_TB_FLAG_NOBLAME_FILELINE) * DUK_DOUBLE_2TO32 : 0.0) + + d = ((flags & DUK_AUGMENT_FLAG_NOBLAME_FILELINE) ? + ((duk_double_t) DUK_TB_FLAG_NOBLAME_FILELINE) * DUK_DOUBLE_2TO32 : + 0.0) + (duk_double_t) c_line; DUK_TVAL_SET_DOUBLE(tv, d); tv++; @@ -48250,11 +49231,11 @@ DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, /* [... arr] */ - DUK_ASSERT(act != NULL); /* depth check above, assumes book-keeping is correct */ - DUK_ASSERT_DISABLE(act->pc >= 0); /* unsigned */ + DUK_ASSERT(act != NULL); /* depth check above, assumes book-keeping is correct */ + DUK_ASSERT_DISABLE(act->pc >= 0); /* unsigned */ /* Add function object. */ - tv_src = &act->tv_func; /* object (function) or lightfunc */ + tv_src = &act->tv_func; /* object (function) or lightfunc */ DUK_ASSERT(DUK_TVAL_IS_OBJECT(tv_src) || DUK_TVAL_IS_LIGHTFUNC(tv_src)); DUK_TVAL_SET_TVAL(tv, tv_src); DUK_TVAL_INCREF(thr, tv); @@ -48266,8 +49247,8 @@ DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, * PC == 0 for native code. */ pc = (duk_uint32_t) duk_hthread_get_act_prev_pc(thr_callstack, act); - DUK_ASSERT_DISABLE(pc >= 0); /* unsigned */ - DUK_ASSERT((duk_double_t) pc < DUK_DOUBLE_2TO32); /* assume PC is at most 32 bits and non-negative */ + DUK_ASSERT_DISABLE(pc >= 0); /* unsigned */ + DUK_ASSERT((duk_double_t) pc < DUK_DOUBLE_2TO32); /* assume PC is at most 32 bits and non-negative */ d = ((duk_double_t) act->flags) * DUK_DOUBLE_2TO32 + (duk_double_t) pc; DUK_TVAL_SET_DOUBLE(tv, d); tv++; @@ -48292,16 +49273,20 @@ DUK_LOCAL void duk__add_traceback(duk_hthread *thr, duk_hthread *thr_callstack, /* [ ... error arr ] */ - duk_xdef_prop_stridx_short_wec(thr, -2, DUK_STRIDX_INT_TRACEDATA); /* -> [ ... error ] */ + duk_xdef_prop_stridx_short_wec(thr, -2, DUK_STRIDX_INT_TRACEDATA); /* -> [ ... error ] */ } -#endif /* DUK_USE_TRACEBACKS */ +#endif /* DUK_USE_TRACEBACKS */ /* * Add .fileName and .lineNumber to an error on the stack top. */ #if defined(DUK_USE_AUGMENT_ERROR_CREATE) && !defined(DUK_USE_TRACEBACKS) -DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, const char *c_filename, duk_int_t c_line, duk_small_uint_t flags) { +DUK_LOCAL void duk__add_fileline(duk_hthread *thr, + duk_hthread *thr_callstack, + const char *c_filename, + duk_int_t c_line, + duk_small_uint_t flags) { #if defined(DUK_USE_ASSERTIONS) duk_int_t entry_top; #endif @@ -48339,7 +49324,7 @@ DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, c duk_uint32_t ecma_line; duk_activation *act; - DUK_ASSERT(thr_callstack->callstack_top <= DUK_INT_MAX); /* callstack limits */ + DUK_ASSERT(thr_callstack->callstack_top <= DUK_INT_MAX); /* callstack limits */ depth = DUK_USE_TRACEBACK_DEPTH; if (depth > thr_callstack->callstack_top) { depth = thr_callstack->callstack_top; @@ -48358,10 +49343,12 @@ DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, c /* PC points to next instruction, find offending PC, * PC == 0 for native code. */ - pc = duk_hthread_get_act_prev_pc(thr, act); /* thr argument only used for thr->heap, so specific thread doesn't matter */ + pc = duk_hthread_get_act_prev_pc( + thr, + act); /* thr argument only used for thr->heap, so specific thread doesn't matter */ DUK_UNREF(pc); - DUK_ASSERT_DISABLE(pc >= 0); /* unsigned */ - DUK_ASSERT((duk_double_t) pc < DUK_DOUBLE_2TO32); /* assume PC is at most 32 bits and non-negative */ + DUK_ASSERT_DISABLE(pc >= 0); /* unsigned */ + DUK_ASSERT((duk_double_t) pc < DUK_DOUBLE_2TO32); /* assume PC is at most 32 bits and non-negative */ duk_push_hobject(thr, func); @@ -48382,7 +49369,7 @@ DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, c } else { /* Native function, no relevant lineNumber. */ } -#endif /* DUK_USE_PC2LINE */ +#endif /* DUK_USE_PC2LINE */ duk_push_u32(thr, ecma_line); /* [ ... error func fileName lineNumber ] */ @@ -48401,7 +49388,7 @@ DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, c duk_push_undefined(thr); } - define_props: +define_props: /* [ ... error lineNumber fileName ] */ #if defined(DUK_USE_ASSERTIONS) DUK_ASSERT(duk_get_top(thr) == entry_top + 2); @@ -48409,7 +49396,7 @@ DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, c duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_FILE_NAME, DUK_PROPDESC_FLAGS_C | DUK_PROPDESC_FLAG_NO_OVERWRITE); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LINE_NUMBER, DUK_PROPDESC_FLAGS_C | DUK_PROPDESC_FLAG_NO_OVERWRITE); } -#endif /* DUK_USE_AUGMENT_ERROR_CREATE && !DUK_USE_TRACEBACKS */ +#endif /* DUK_USE_AUGMENT_ERROR_CREATE && !DUK_USE_TRACEBACKS */ /* * Add line number to a compiler error. @@ -48417,7 +49404,6 @@ DUK_LOCAL void duk__add_fileline(duk_hthread *thr, duk_hthread *thr_callstack, c #if defined(DUK_USE_AUGMENT_ERROR_CREATE) DUK_LOCAL void duk__add_compiler_error_line(duk_hthread *thr) { - /* Append a "(line NNN)" to the "message" property of any error * thrown during compilation. Usually compilation errors are * SyntaxErrors but they can also be out-of-memory errors and @@ -48432,8 +49418,7 @@ DUK_LOCAL void duk__add_compiler_error_line(duk_hthread *thr) { return; } - DUK_DDD(DUK_DDDPRINT("compile error, before adding line info: %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("compile error, before adding line info: %!T", (duk_tval *) duk_get_tval(thr, -1))); if (duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_MESSAGE)) { duk_bool_t at_end; @@ -48455,7 +49440,8 @@ DUK_LOCAL void duk__add_compiler_error_line(duk_hthread *thr) { (long) thr->compile_ctx->lex.window[0].codepoint, (long) thr->compile_ctx->lex.window[1].codepoint)); - duk_push_sprintf(thr, " (line %ld%s)", + duk_push_sprintf(thr, + " (line %ld%s)", (long) thr->compile_ctx->curr_token.start_line, at_end ? ", end of input" : ""); duk_concat(thr, 2); @@ -48464,10 +49450,9 @@ DUK_LOCAL void duk__add_compiler_error_line(duk_hthread *thr) { duk_pop(thr); } - DUK_DDD(DUK_DDDPRINT("compile error, after adding line info: %!T", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("compile error, after adding line info: %!T", (duk_tval *) duk_get_tval(thr, -1))); } -#endif /* DUK_USE_AUGMENT_ERROR_CREATE */ +#endif /* DUK_USE_AUGMENT_ERROR_CREATE */ /* * Augment an error being created using Duktape specific properties @@ -48475,7 +49460,12 @@ DUK_LOCAL void duk__add_compiler_error_line(duk_hthread *thr) { */ #if defined(DUK_USE_AUGMENT_ERROR_CREATE) -DUK_LOCAL void duk__err_augment_builtin_create(duk_hthread *thr, duk_hthread *thr_callstack, const char *c_filename, duk_int_t c_line, duk_hobject *obj, duk_small_uint_t flags) { +DUK_LOCAL void duk__err_augment_builtin_create(duk_hthread *thr, + duk_hthread *thr_callstack, + const char *c_filename, + duk_int_t c_line, + duk_hobject *obj, + duk_small_uint_t flags) { #if defined(DUK_USE_ASSERTIONS) duk_int_t entry_top; #endif @@ -48485,7 +49475,7 @@ DUK_LOCAL void duk__err_augment_builtin_create(duk_hthread *thr, duk_hthread *th #endif DUK_ASSERT(obj != NULL); - DUK_UNREF(obj); /* unreferenced w/o tracebacks */ + DUK_UNREF(obj); /* unreferenced w/o tracebacks */ duk__add_compiler_error_line(thr); @@ -48510,7 +49500,7 @@ DUK_LOCAL void duk__err_augment_builtin_create(duk_hthread *thr, duk_hthread *th DUK_ASSERT(duk_get_top(thr) == entry_top); #endif } -#endif /* DUK_USE_AUGMENT_ERROR_CREATE */ +#endif /* DUK_USE_AUGMENT_ERROR_CREATE */ /* * Augment an error at creation time with _Tracedata/fileName/lineNumber @@ -48528,7 +49518,11 @@ DUK_LOCAL void duk__err_augment_builtin_create(duk_hthread *thr, duk_hthread *th */ #if defined(DUK_USE_AUGMENT_ERROR_CREATE) -DUK_INTERNAL void duk_err_augment_error_create(duk_hthread *thr, duk_hthread *thr_callstack, const char *c_filename, duk_int_t c_line, duk_small_uint_t flags) { +DUK_INTERNAL void duk_err_augment_error_create(duk_hthread *thr, + duk_hthread *thr_callstack, + const char *c_filename, + duk_int_t c_line, + duk_small_uint_t flags) { duk_hobject *obj; DUK_ASSERT(thr != NULL); @@ -48574,7 +49568,7 @@ DUK_INTERNAL void duk_err_augment_error_create(duk_hthread *thr, duk_hthread *th duk__err_augment_user(thr, DUK_STRIDX_ERR_CREATE); #endif } -#endif /* DUK_USE_AUGMENT_ERROR_CREATE */ +#endif /* DUK_USE_AUGMENT_ERROR_CREATE */ /* * Augment an error at throw time; allow a user error handler (if defined) @@ -48586,9 +49580,9 @@ DUK_INTERNAL void duk_err_augment_error_create(duk_hthread *thr, duk_hthread *th DUK_INTERNAL void duk_err_augment_error_throw(duk_hthread *thr) { #if defined(DUK_USE_ERRTHROW) duk__err_augment_user(thr, DUK_STRIDX_ERR_THROW); -#endif /* DUK_USE_ERRTHROW */ +#endif /* DUK_USE_ERRTHROW */ } -#endif /* DUK_USE_AUGMENT_ERROR_THROW */ +#endif /* DUK_USE_AUGMENT_ERROR_THROW */ /* * Do a longjmp call, calling the fatal error handler if no * catchpoint exists. @@ -48638,8 +49632,10 @@ DUK_INTERNAL void duk_err_longjmp(duk_hthread *thr) { DUK_ASSERT(thr->heap != NULL); DUK_DD(DUK_DDPRINT("longjmp error: type=%d iserror=%d value1=%!T value2=%!T", - (int) thr->heap->lj.type, (int) thr->heap->lj.iserror, - &thr->heap->lj.value1, &thr->heap->lj.value2)); + (int) thr->heap->lj.type, + (int) thr->heap->lj.iserror, + &thr->heap->lj.value1, + &thr->heap->lj.value2)); /* Prevent finalizer execution during error handling. All error * handling sites will process pending finalizers once error handling @@ -48657,11 +49653,11 @@ DUK_INTERNAL void duk_err_longjmp(duk_hthread *thr) { DUK_ASSERT_LJSTATE_SET(thr->heap); thr->heap->pf_prevent_count++; - DUK_ASSERT(thr->heap->pf_prevent_count != 0); /* Wrap. */ + DUK_ASSERT(thr->heap->pf_prevent_count != 0); /* Wrap. */ #if defined(DUK_USE_ASSERTIONS) /* XXX: set this immediately when longjmp state is set */ - DUK_ASSERT(thr->heap->error_not_allowed == 0); /* Detect error within critical section. */ + DUK_ASSERT(thr->heap->error_not_allowed == 0); /* Detect error within critical section. */ thr->heap->error_not_allowed = 1; #endif @@ -48673,8 +49669,10 @@ DUK_INTERNAL void duk_err_longjmp(duk_hthread *thr) { */ if (!thr->heap->lj.jmpbuf_ptr) { DUK_D(DUK_DPRINT("uncaught error: type=%d iserror=%d value1=%!T value2=%!T", - (int) thr->heap->lj.type, (int) thr->heap->lj.iserror, - &thr->heap->lj.value1, &thr->heap->lj.value2)); + (int) thr->heap->lj.type, + (int) thr->heap->lj.iserror, + &thr->heap->lj.value1, + &thr->heap->lj.value2)); #if defined(DUK_USE_PREFER_SIZE) duk__uncaught_minimal(thr); @@ -48685,7 +49683,7 @@ DUK_INTERNAL void duk_err_longjmp(duk_hthread *thr) { } #if defined(DUK_USE_CPP_EXCEPTIONS) - throw duk_internal_exception(); /* dummy */ + throw duk_internal_exception(); /* dummy */ #else DUK_LONGJMP(thr->heap->lj.jmpbuf_ptr->jb); #endif @@ -48720,14 +49718,14 @@ DUK_LOCAL duk_bool_t duk__have_active_catcher(duk_hthread *thr) { for (act = thr->callstack_curr; act != NULL; act = act->parent) { for (cat = act->cat; cat != NULL; cat = cat->parent) { if (DUK_CAT_HAS_CATCH_ENABLED(cat)) { - return 1; /* all we need to know */ + return 1; /* all we need to know */ } } } } return 0; } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ /* * Get prototype object for an integer error code. @@ -48777,11 +49775,10 @@ DUK_INTERNAL void duk_err_check_debugger_integration(duk_hthread *thr) { * config options. */ - if (!duk_debug_is_attached(thr->heap) || - thr->heap->dbg_processing || - thr->heap->lj.type != DUK_LJ_TYPE_THROW || + if (!duk_debug_is_attached(thr->heap) || thr->heap->dbg_processing || thr->heap->lj.type != DUK_LJ_TYPE_THROW || thr->heap->creating_error) { - DUK_D(DUK_DPRINT("skip debugger error integration; not attached, debugger processing, not THROW, or error thrown while creating error")); + DUK_D(DUK_DPRINT("skip debugger error integration; not attached, debugger processing, not THROW, or error thrown " + "while creating error")); return; } @@ -48809,7 +49806,7 @@ DUK_INTERNAL void duk_err_check_debugger_integration(duk_hthread *thr) { /* Store and reset longjmp state. */ DUK_ASSERT_LJSTATE_SET(thr->heap); DUK_TVAL_DECREF_NORZ(thr, tv_obj); - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(&thr->heap->lj.value2)); /* Always for THROW type. */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(&thr->heap->lj.value2)); /* Always for THROW type. */ DUK_TVAL_SET_UNDEFINED(tv_obj); thr->heap->lj.type = DUK_LJ_TYPE_UNKNOWN; DUK_ASSERT_LJSTATE_UNSET(thr->heap); @@ -48844,7 +49841,7 @@ DUK_INTERNAL void duk_err_check_debugger_integration(duk_hthread *thr) { duk_pop(thr); } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ /* * Helpers for setting up heap longjmp state. @@ -48889,14 +49886,20 @@ DUK_INTERNAL void duk_err_setup_ljstate1(duk_hthread *thr, duk_small_uint_t lj_t */ #if defined(DUK_USE_VERBOSE_ERRORS) -DUK_INTERNAL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code, const char *msg, const char *filename, duk_int_t line) { +DUK_INTERNAL void duk_err_create_and_throw(duk_hthread *thr, + duk_errcode_t code, + const char *msg, + const char *filename, + duk_int_t line) { #else DUK_INTERNAL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code) { #endif #if defined(DUK_USE_VERBOSE_ERRORS) DUK_DD(DUK_DDPRINT("duk_err_create_and_throw(): code=%ld, msg=%s, filename=%s, line=%ld", - (long) code, (const char *) msg, - (const char *) filename, (long) line)); + (long) code, + (const char *) msg, + (const char *) filename, + (long) line)); #else DUK_DD(DUK_DDPRINT("duk_err_create_and_throw(): code=%ld", (long) code)); #endif @@ -48956,18 +49959,9 @@ DUK_INTERNAL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code) * use 'msg' as a format string directly. */ #if defined(DUK_USE_VERBOSE_ERRORS) - duk_push_error_object_raw(thr, - code | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, - filename, - line, - "%s", - (const char *) msg); + duk_push_error_object_raw(thr, code | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, filename, line, "%s", (const char *) msg); #else - duk_push_error_object_raw(thr, - code | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, - NULL, - 0, - NULL); + duk_push_error_object_raw(thr, code | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, NULL, 0, NULL); #endif /* Note that an alloc error may happen during error augmentation. @@ -48977,8 +49971,7 @@ DUK_INTERNAL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code) * avoiding it for alloc errors (this differs from Duktape 1.x). */ #if defined(DUK_USE_AUGMENT_ERROR_THROW) - DUK_DDD(DUK_DDDPRINT("THROW ERROR (INTERNAL): %!iT (before throw augment)", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("THROW ERROR (INTERNAL): %!iT (before throw augment)", (duk_tval *) duk_get_tval(thr, -1))); duk_err_augment_error_throw(thr); #endif @@ -49001,7 +49994,8 @@ DUK_INTERNAL void duk_err_create_and_throw(duk_hthread *thr, duk_errcode_t code) */ DUK_DDD(DUK_DDDPRINT("THROW ERROR (INTERNAL): %!iT, %!iT (after throw augment)", - (duk_tval *) &thr->heap->lj.value1, (duk_tval *) &thr->heap->lj.value2)); + (duk_tval *) &thr->heap->lj.value1, + (duk_tval *) &thr->heap->lj.value2)); duk_err_longjmp(thr); DUK_UNREACHABLE(); @@ -49055,7 +50049,7 @@ DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk */ if (size > DUK_HBUFFER_MAX_BYTELEN) { DUK_D(DUK_DPRINT("hbuffer alloc failed: size too large: %ld", (long) size)); - return NULL; /* no need to write 'out_bufdata' */ + return NULL; /* no need to write 'out_bufdata' */ } if (flags & DUK_BUF_FLAG_EXTERNAL) { @@ -49067,7 +50061,7 @@ DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk } else { header_size = sizeof(duk_hbuffer_fixed); alloc_size = sizeof(duk_hbuffer_fixed) + size; - DUK_ASSERT(alloc_size >= sizeof(duk_hbuffer_fixed)); /* no wrapping */ + DUK_ASSERT(alloc_size >= sizeof(duk_hbuffer_fixed)); /* no wrapping */ } res = (duk_hbuffer *) DUK_ALLOC(heap, alloc_size); @@ -49077,8 +50071,7 @@ DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk /* zero everything unless requested not to do so */ #if defined(DUK_USE_ZERO_BUFFER_DATA) - duk_memzero((void *) res, - (flags & DUK_BUF_FLAG_NOZERO) ? header_size : alloc_size); + duk_memzero((void *) res, (flags & DUK_BUF_FLAG_NOZERO) ? header_size : alloc_size); #else duk_memzero((void *) res, header_size); #endif @@ -49101,7 +50094,7 @@ DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk void *ptr; if (size > 0) { - DUK_ASSERT(!(flags & DUK_BUF_FLAG_EXTERNAL)); /* alloc external with size zero */ + DUK_ASSERT(!(flags & DUK_BUF_FLAG_EXTERNAL)); /* alloc external with size zero */ DUK_DDD(DUK_DDDPRINT("dynamic buffer with nonzero size, alloc actual buffer")); #if defined(DUK_USE_ZERO_BUFFER_DATA) ptr = DUK_ALLOC_ZEROED(heap, size); @@ -49141,16 +50134,16 @@ DUK_INTERNAL duk_hbuffer *duk_hbuffer_alloc(duk_heap *heap, duk_size_t size, duk } else { DUK_ASSERT(!(flags & DUK_BUF_FLAG_EXTERNAL)); } - DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, &res->hdr); + DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, &res->hdr); DUK_DDD(DUK_DDDPRINT("allocated hbuffer: %p", (void *) res)); return res; - alloc_error: +alloc_error: DUK_DD(DUK_DDPRINT("hbuffer allocation failed")); DUK_FREE(heap, res); - return NULL; /* no need to write 'out_bufdata' */ + return NULL; /* no need to write 'out_bufdata' */ } /* For indirect allocs. */ @@ -49172,7 +50165,7 @@ DUK_INTERNAL void duk_hbuffer_assert_valid(duk_hbuffer *h) { DUK_ASSERT(h != NULL); } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* * duk_hbuffer operations such as resizing and inserting/appending data to * a dynamic buffer. @@ -49228,8 +50221,7 @@ DUK_INTERNAL void duk_hbuffer_resize(duk_hthread *thr, duk_hbuffer_dynamic *buf, if (new_size > prev_size) { DUK_ASSERT(new_size - prev_size > 0); #if defined(DUK_USE_ZERO_BUFFER_DATA) - duk_memzero((void *) ((char *) res + prev_size), - (duk_size_t) (new_size - prev_size)); + duk_memzero((void *) ((char *) res + prev_size), (duk_size_t) (new_size - prev_size)); #endif } @@ -49270,7 +50262,7 @@ DUK_INTERNAL duk_uint_t duk_hbufobj_clamp_bytelength(duk_hbufobj *h_bufobj, duk_ return buf_avail >= len ? len : buf_avail; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * duk_heap allocation and freeing. */ @@ -49279,7 +50271,7 @@ DUK_INTERNAL duk_uint_t duk_hbufobj_clamp_bytelength(duk_hbufobj *h_bufobj, duk_ #if defined(DUK_USE_ROM_STRINGS) /* Fixed seed value used with ROM strings. */ -#define DUK__FIXED_HASH_SEED 0xabcd1234 +#define DUK__FIXED_HASH_SEED 0xabcd1234 #endif /* @@ -49368,8 +50360,8 @@ DUK_INTERNAL void duk_free_hstring(duk_heap *heap, duk_hstring *h) { #if defined(DUK_USE_HSTRING_EXTDATA) && defined(DUK_USE_EXTSTR_FREE) if (DUK_HSTRING_HAS_EXTDATA(h)) { - DUK_DDD(DUK_DDDPRINT("free extstr: hstring %!O, extdata: %p", - h, DUK_HSTRING_GET_EXTDATA((duk_hstring_external *) h))); + DUK_DDD( + DUK_DDDPRINT("free extstr: hstring %!O, extdata: %p", h, DUK_HSTRING_GET_EXTDATA((duk_hstring_external *) h))); DUK_USE_EXTSTR_FREE(heap->heap_udata, (const void *) DUK_HSTRING_GET_EXTDATA((duk_hstring_external *) h)); } #endif @@ -49393,7 +50385,6 @@ DUK_INTERNAL void duk_heap_free_heaphdr_raw(duk_heap *heap, duk_heaphdr *hdr) { DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(hdr) == DUK_HTYPE_BUFFER); duk_free_hbuffer(heap, (duk_hbuffer *) hdr); } - } /* @@ -49423,10 +50414,10 @@ DUK_LOCAL duk_size_t duk__heap_free_activation_freelist(duk_heap *heap) { count_act++; #endif } - heap->activation_free = NULL; /* needed when called from mark-and-sweep */ + heap->activation_free = NULL; /* needed when called from mark-and-sweep */ return count_act; } -#endif /* DUK_USE_CACHE_ACTIVATION */ +#endif /* DUK_USE_CACHE_ACTIVATION */ #if defined(DUK_USE_CACHE_CATCHER) DUK_LOCAL duk_size_t duk__heap_free_catcher_freelist(duk_heap *heap) { @@ -49442,11 +50433,11 @@ DUK_LOCAL duk_size_t duk__heap_free_catcher_freelist(duk_heap *heap) { count_cat++; #endif } - heap->catcher_free = NULL; /* needed when called from mark-and-sweep */ + heap->catcher_free = NULL; /* needed when called from mark-and-sweep */ return count_cat; } -#endif /* DUK_USE_CACHE_CATCHER */ +#endif /* DUK_USE_CACHE_CATCHER */ DUK_INTERNAL void duk_heap_free_freelists(duk_heap *heap) { duk_size_t count_act = 0; @@ -49462,8 +50453,8 @@ DUK_INTERNAL void duk_heap_free_freelists(duk_heap *heap) { DUK_UNREF(count_act); DUK_UNREF(count_cat); - DUK_D(DUK_DPRINT("freed %ld activation freelist entries, %ld catcher freelist entries", - (long) count_act, (long) count_cat)); + DUK_D( + DUK_DPRINT("freed %ld activation freelist entries, %ld catcher freelist entries", (long) count_act, (long) count_cat)); } DUK_LOCAL void duk__free_allocated(duk_heap *heap) { @@ -49476,8 +50467,7 @@ DUK_LOCAL void duk__free_allocated(duk_heap *heap) { * because they may happen with finalizer processing. */ - DUK_DDD(DUK_DDDPRINT("FINALFREE (allocated): %!iO", - (duk_heaphdr *) curr)); + DUK_DDD(DUK_DDDPRINT("FINALFREE (allocated): %!iO", (duk_heaphdr *) curr)); next = DUK_HEAPHDR_GET_NEXT(heap, curr); duk_heap_free_heaphdr_raw(heap, curr); curr = next; @@ -49491,14 +50481,13 @@ DUK_LOCAL void duk__free_finalize_list(duk_heap *heap) { curr = heap->finalize_list; while (curr) { - DUK_DDD(DUK_DDDPRINT("FINALFREE (finalize_list): %!iO", - (duk_heaphdr *) curr)); + DUK_DDD(DUK_DDDPRINT("FINALFREE (finalize_list): %!iO", (duk_heaphdr *) curr)); next = DUK_HEAPHDR_GET_NEXT(heap, curr); duk_heap_free_heaphdr_raw(heap, curr); curr = next; } } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ DUK_LOCAL void duk__free_stringtable(duk_heap *heap) { /* strings are only tracked by stringtable */ @@ -49516,9 +50505,9 @@ DUK_LOCAL void duk__free_run_finalizers(duk_heap *heap) { DUK_ASSERT(heap != NULL); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* refzero not running -> must be empty */ + DUK_ASSERT(heap->refzero_list == NULL); /* refzero not running -> must be empty */ #endif - DUK_ASSERT(heap->finalize_list == NULL); /* mark-and-sweep last pass */ + DUK_ASSERT(heap->finalize_list == NULL); /* mark-and-sweep last pass */ if (heap->heap_thread == NULL) { /* May happen when heap allocation fails right off. There @@ -49541,11 +50530,11 @@ DUK_LOCAL void duk__free_run_finalizers(duk_heap *heap) { DUK_ASSERT(heap->ms_running == 0); DUK_ASSERT(heap->ms_prevent_count == 0); heap->pf_prevent_count = 1; - heap->ms_running = 2; /* Use distinguishable value. */ - heap->ms_prevent_count = 1; /* Bump, because mark-and-sweep assumes it's bumped when ms_running is set. */ + heap->ms_running = 2; /* Use distinguishable value. */ + heap->ms_prevent_count = 1; /* Bump, because mark-and-sweep assumes it's bumped when ms_running is set. */ - curr_limit = 0; /* suppress warning, not used */ - for (round_no = 0; ; round_no++) { + curr_limit = 0; /* suppress warning, not used */ + for (round_no = 0;; round_no++) { curr = heap->heap_allocated; count_all = 0; count_finalized = 0; @@ -49560,7 +50549,8 @@ DUK_LOCAL void duk__free_run_finalizers(duk_heap *heap) { if (DUK_HOBJECT_HAS_FINALIZER_FAST(heap, (duk_hobject *) curr)) { if (!DUK_HEAPHDR_HAS_FINALIZED((duk_heaphdr *) curr)) { - DUK_ASSERT(DUK_HEAP_HAS_FINALIZER_NORESCUE(heap)); /* maps to finalizer 2nd argument */ + DUK_ASSERT( + DUK_HEAP_HAS_FINALIZER_NORESCUE(heap)); /* maps to finalizer 2nd argument */ duk_heap_run_finalizer(heap, (duk_hobject *) curr); count_finalized++; } @@ -49587,10 +50577,13 @@ DUK_LOCAL void duk__free_run_finalizers(duk_heap *heap) { */ curr_limit = count_all * 2; } else { - curr_limit = (curr_limit * 3) / 4; /* Decrease by 25% every round */ + curr_limit = (curr_limit * 3) / 4; /* Decrease by 25% every round */ } DUK_D(DUK_DPRINT("finalizer round %ld complete, %ld objects, tried to execute %ld finalizers, current limit is %ld", - (long) round_no, (long) count_all, (long) count_finalized, (long) curr_limit)); + (long) round_no, + (long) count_all, + (long) count_finalized, + (long) curr_limit)); if (count_finalized == 0) { DUK_D(DUK_DPRINT("no more finalizable objects, forced finalization finished")); @@ -49607,7 +50600,7 @@ DUK_LOCAL void duk__free_run_finalizers(duk_heap *heap) { heap->ms_running = 0; heap->pf_prevent_count = 0; } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ DUK_INTERNAL void duk_heap_free(duk_heap *heap) { DUK_D(DUK_DPRINT("free heap: %p", (void *) heap)); @@ -49650,7 +50643,7 @@ DUK_INTERNAL void duk_heap_free(duk_heap *heap) { duk_heap_mark_and_sweep(heap, 0); DUK_D(DUK_DPRINT("forced gc #3 in heap destruction (don't run finalizers)")); heap->pf_skip_finalizers = 1; - duk_heap_mark_and_sweep(heap, 0); /* Skip finalizers; queue finalizable objects to heap_allocated. */ + duk_heap_mark_and_sweep(heap, 0); /* Skip finalizers; queue finalizable objects to heap_allocated. */ /* There are never objects in refzero_list at this point, or at any * point beyond a DECREF (even a DECREF_NORZ). Since Duktape 2.1 @@ -49659,17 +50652,17 @@ DUK_INTERNAL void duk_heap_free(duk_heap *heap) { * refcount. */ #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* Always processed to completion inline. */ + DUK_ASSERT(heap->refzero_list == NULL); /* Always processed to completion inline. */ #endif #if defined(DUK_USE_FINALIZER_SUPPORT) - DUK_ASSERT(heap->finalize_list == NULL); /* Last mark-and-sweep with skip_finalizers. */ + DUK_ASSERT(heap->finalize_list == NULL); /* Last mark-and-sweep with skip_finalizers. */ #endif #if defined(DUK_USE_FINALIZER_SUPPORT) DUK_D(DUK_DPRINT("run finalizers for remaining finalizable objects")); - DUK_HEAP_SET_FINALIZER_NORESCUE(heap); /* Rescue no longer supported. */ + DUK_HEAP_SET_FINALIZER_NORESCUE(heap); /* Rescue no longer supported. */ duk__free_run_finalizers(heap); -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* Note: heap->heap_thread, heap->curr_thread, and heap->heap_object * are on the heap allocated list. @@ -49682,7 +50675,7 @@ DUK_INTERNAL void duk_heap_free(duk_heap *heap) { duk__free_allocated(heap); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* Always processed to completion inline. */ + DUK_ASSERT(heap->refzero_list == NULL); /* Always processed to completion inline. */ #endif #if defined(DUK_USE_FINALIZER_SUPPORT) @@ -49725,7 +50718,9 @@ DUK_LOCAL duk_bool_t duk__init_heap_strings(duk_heap *heap) { while (h != NULL) { hash = duk_heap_hashstring(heap, (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h), DUK_HSTRING_GET_BYTELEN(h)); DUK_DD(DUK_DDPRINT("duk_rom_strings_lookup[%d] -> hash 0x%08lx, computed 0x%08lx", - (int) i, (unsigned long) DUK_HSTRING_GET_HASH(h), (unsigned long) hash)); + (int) i, + (unsigned long) DUK_HSTRING_GET_HASH(h), + (unsigned long) hash)); DUK_ASSERT(hash == (duk_uint32_t) DUK_HSTRING_GET_HASH(h)); h = (const duk_hstring *) h->hdr.h_next; @@ -49734,11 +50729,11 @@ DUK_LOCAL duk_bool_t duk__init_heap_strings(duk_heap *heap) { #endif return 1; } -#else /* DUK_USE_ROM_STRINGS */ +#else /* DUK_USE_ROM_STRINGS */ DUK_LOCAL duk_bool_t duk__init_heap_strings(duk_heap *heap) { duk_bitdecoder_ctx bd_ctx; - duk_bitdecoder_ctx *bd = &bd_ctx; /* convenience */ + duk_bitdecoder_ctx *bd = &bd_ctx; /* convenience */ duk_small_uint_t i; duk_memzero(&bd_ctx, sizeof(bd_ctx)); @@ -49794,18 +50789,16 @@ DUK_LOCAL duk_bool_t duk__init_heap_strings(duk_heap *heap) { return 1; - failed: +failed: return 0; } -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ DUK_LOCAL duk_bool_t duk__init_heap_thread(duk_heap *heap) { duk_hthread *thr; DUK_D(DUK_DPRINT("heap init: alloc heap thread")); - thr = duk_hthread_alloc_unchecked(heap, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_THREAD)); + thr = duk_hthread_alloc_unchecked(heap, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_THREAD)); if (thr == NULL) { DUK_D(DUK_DPRINT("failed to alloc heap_thread")); return 0; @@ -49813,16 +50806,16 @@ DUK_LOCAL duk_bool_t duk__init_heap_thread(duk_heap *heap) { thr->state = DUK_HTHREAD_STATE_INACTIVE; #if defined(DUK_USE_ROM_STRINGS) /* No strs[] pointer. */ -#else /* DUK_USE_ROM_STRINGS */ +#else /* DUK_USE_ROM_STRINGS */ #if defined(DUK_USE_HEAPPTR16) thr->strs16 = heap->strs16; #else thr->strs = heap->strs; #endif -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ heap->heap_thread = thr; - DUK_HTHREAD_INCREF(thr, thr); /* Note: first argument not really used */ + DUK_HTHREAD_INCREF(thr, thr); /* Note: first argument not really used */ /* 'thr' is now reachable */ @@ -49841,7 +50834,8 @@ DUK_LOCAL duk_bool_t duk__init_heap_thread(duk_heap *heap) { } #if defined(DUK_USE_DEBUG) -#define DUK__DUMPSZ(t) do { \ +#define DUK__DUMPSZ(t) \ + do { \ DUK_D(DUK_DPRINT("" #t "=%ld", (long) sizeof(t))); \ } while (0) @@ -49850,20 +50844,20 @@ DUK_LOCAL duk_bool_t duk__init_heap_thread(duk_heap *heap) { * enough; the limits will then not be printed accurately but the magnitude * will be correct. */ -#define DUK__DUMPLM_SIGNED_RAW(t,a,b) do { \ - DUK_D(DUK_DPRINT(t "=[%ld,%ld]=[%lf,%lf]", \ - (long) (a), (long) (b), \ - (double) (a), (double) (b))); \ +#define DUK__DUMPLM_SIGNED_RAW(t, a, b) \ + do { \ + DUK_D(DUK_DPRINT(t "=[%ld,%ld]=[%lf,%lf]", (long) (a), (long) (b), (double) (a), (double) (b))); \ } while (0) -#define DUK__DUMPLM_UNSIGNED_RAW(t,a,b) do { \ - DUK_D(DUK_DPRINT(t "=[%lu,%lu]=[%lf,%lf]", \ - (unsigned long) (a), (unsigned long) (b), \ - (double) (a), (double) (b))); \ +#define DUK__DUMPLM_UNSIGNED_RAW(t, a, b) \ + do { \ + DUK_D(DUK_DPRINT(t "=[%lu,%lu]=[%lf,%lf]", (unsigned long) (a), (unsigned long) (b), (double) (a), (double) (b))); \ } while (0) -#define DUK__DUMPLM_SIGNED(t) do { \ +#define DUK__DUMPLM_SIGNED(t) \ + do { \ DUK__DUMPLM_SIGNED_RAW("DUK_" #t "_{MIN,MAX}", DUK_##t##_MIN, DUK_##t##_MAX); \ } while (0) -#define DUK__DUMPLM_UNSIGNED(t) do { \ +#define DUK__DUMPLM_UNSIGNED(t) \ + do { \ DUK__DUMPLM_UNSIGNED_RAW("DUK_" #t "_{MIN,MAX}", DUK_##t##_MIN, DUK_##t##_MAX); \ } while (0) @@ -49936,7 +50930,7 @@ DUK_LOCAL void duk__dump_type_sizes(void) { DUK__DUMPSZ(duk_tval); /* structs from duk_forwdecl.h */ - DUK__DUMPSZ(duk_jmpbuf); /* just one 'int' for C++ exceptions */ + DUK__DUMPSZ(duk_jmpbuf); /* just one 'int' for C++ exceptions */ DUK__DUMPSZ(duk_heaphdr); DUK__DUMPSZ(duk_heaphdr_string); DUK__DUMPSZ(duk_hstring); @@ -50060,7 +51054,7 @@ DUK_LOCAL void duk__dump_misc_options(void) { DUK_D(DUK_DPRINT("IEEE double endianness: ???")); #endif } -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ DUK_INTERNAL duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, @@ -50081,7 +51075,7 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, DUK_ASSERT((DUK_HTYPE_STRING & 0x01U) == 0); DUK_ASSERT((DUK_HTYPE_BUFFER & 0x01U) == 0); - DUK_ASSERT((DUK_HTYPE_OBJECT & 0x01U) == 1); /* DUK_HEAPHDR_IS_OBJECT() relies ont his. */ + DUK_ASSERT((DUK_HTYPE_OBJECT & 0x01U) == 1); /* DUK_HEAPHDR_IS_OBJECT() relies ont his. */ /* * Debug dump type sizes @@ -50122,7 +51116,7 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, #endif fatal_func(heap_udata, "sizeof(duk_tval) not 8 or 16, cannot use DUK_USE_EXEC_REGCONST_OPTIMIZE option"); } -#endif /* DUK_USE_EXEC_REGCONST_OPTIMIZE */ +#endif /* DUK_USE_EXEC_REGCONST_OPTIMIZE */ /* * Computed values (e.g. INFINITY) @@ -50206,18 +51200,18 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, #endif #if defined(DUK_USE_ROM_STRINGS) /* no res->strs[] */ -#else /* DUK_USE_ROM_STRINGS */ +#else /* DUK_USE_ROM_STRINGS */ #if defined(DUK_USE_HEAPPTR16) /* res->strs16[] is zeroed and zero decodes to NULL, so no NULL inits. */ #else { duk_small_uint_t i; - for (i = 0; i < DUK_HEAP_NUM_STRINGS; i++) { + for (i = 0; i < DUK_HEAP_NUM_STRINGS; i++) { res->strs[i] = NULL; - } + } } #endif -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ #if defined(DUK_USE_DEBUGGER_SUPPORT) res->dbg_read_cb = NULL; res->dbg_write_cb = NULL; @@ -50228,7 +51222,7 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, res->dbg_udata = NULL; res->dbg_pause_act = NULL; #endif -#endif /* DUK_USE_EXPLICIT_NULL_INIT */ +#endif /* DUK_USE_EXPLICIT_NULL_INIT */ res->alloc_func = alloc_func; res->realloc_func = realloc_func; @@ -50267,17 +51261,17 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, /* XXX: make a common DUK_USE_ option, and allow custom fixed seed? */ DUK_D(DUK_DPRINT("using rom strings, force heap hash_seed to fixed value 0x%08lx", (long) DUK__FIXED_HASH_SEED)); res->hash_seed = (duk_uint32_t) DUK__FIXED_HASH_SEED; -#else /* DUK_USE_ROM_STRINGS */ +#else /* DUK_USE_ROM_STRINGS */ res->hash_seed = (duk_uint32_t) (duk_uintptr_t) res; #if !defined(DUK_USE_STRHASH_DENSE) - res->hash_seed ^= 5381; /* Bernstein hash init value is normally 5381; XOR it in in case pointer low bits are 0 */ + res->hash_seed ^= 5381; /* Bernstein hash init value is normally 5381; XOR it in in case pointer low bits are 0 */ #endif -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ #if defined(DUK_USE_EXPLICIT_NULL_INIT) res->lj.jmpbuf_ptr = NULL; #endif - DUK_ASSERT(res->lj.type == DUK_LJ_TYPE_UNKNOWN); /* zero */ + DUK_ASSERT(res->lj.type == DUK_LJ_TYPE_UNKNOWN); /* zero */ DUK_ASSERT(res->lj.iserror == 0); DUK_TVAL_SET_UNDEFINED(&res->lj.value1); DUK_TVAL_SET_UNDEFINED(&res->lj.value2); @@ -50313,14 +51307,14 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, #if defined(DUK_USE_EXPLICIT_NULL_INIT) { duk_uint32_t i; - for (i = 0; i < st_initsize; i++) { + for (i = 0; i < st_initsize; i++) { res->strtable[i] = NULL; - } + } } #else duk_memzero(res->strtable, sizeof(duk_hstring *) * st_initsize); -#endif /* DUK_USE_EXPLICIT_NULL_INIT */ -#endif /* DUK_USE_STRTAB_PTRCOMP */ +#endif /* DUK_USE_EXPLICIT_NULL_INIT */ +#endif /* DUK_USE_STRTAB_PTRCOMP */ /* * Init stringcache @@ -50350,7 +51344,7 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, } } #endif -#endif /* DUK_USE_LITCACHE_SIZE */ +#endif /* DUK_USE_LITCACHE_SIZE */ /* XXX: error handling is incomplete. It would be cleanest if * there was a setjmp catchpoint, so that all init code could @@ -50391,9 +51385,9 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, #endif DUK_D(DUK_DPRINT("heap init: initialize heap object")); DUK_ASSERT(res->heap_thread != NULL); - res->heap_object = duk_hobject_alloc_unchecked(res, DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT)); + res->heap_object = duk_hobject_alloc_unchecked(res, + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT)); if (res->heap_object == NULL) { goto failed; } @@ -50409,8 +51403,8 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, duk_util_tinyrandom_prepare_seed(res->heap_thread); #else res->rnd_state[0] = (duk_uint64_t) duk_time_get_ecmascript_time(res->heap_thread); - DUK_ASSERT(res->rnd_state[1] == 0); /* Not filled here, filled in by seed preparation. */ -#if 0 /* Manual test values matching misc/xoroshiro128plus_test.c. */ + DUK_ASSERT(res->rnd_state[1] == 0); /* Not filled here, filled in by seed preparation. */ +#if 0 /* Manual test values matching misc/xoroshiro128plus_test.c. */ res->rnd_state[0] = DUK_U64_CONSTANT(0xdeadbeef12345678); res->rnd_state[1] = DUK_U64_CONSTANT(0xcafed00d12345678); #endif @@ -50462,7 +51456,7 @@ duk_heap *duk_heap_alloc(duk_alloc_function alloc_func, DUK_D(DUK_DPRINT("allocated heap: %p", (void *) res)); return res; - failed: +failed: DUK_D(DUK_DPRINT("heap allocation failed")); if (res != NULL) { @@ -50522,14 +51516,14 @@ DUK_LOCAL duk_ret_t duk__fake_global_finalizer(duk_hthread *thr) { /* Inner function call, error throw. */ duk_eval_string_noresult(thr, - "(function dummy() {\n" - " dummy.prototype = null; /* break reference loop */\n" - " try {\n" - " throw 'fake-finalizer-dummy-error';\n" - " } catch (e) {\n" - " void e;\n" - " }\n" - "})()"); + "(function dummy() {\n" + " dummy.prototype = null; /* break reference loop */\n" + " try {\n" + " throw 'fake-finalizer-dummy-error';\n" + " } catch (e) {\n" + " void e;\n" + " }\n" + "})()"); /* The above creates garbage (e.g. a function instance). Because * the function/prototype reference loop is broken, it gets collected @@ -50561,7 +51555,7 @@ DUK_LOCAL void duk__run_global_torture_finalizer(duk_hthread *thr) { (void) duk_pcall(thr, 0 /*nargs*/); duk_pop(thr); } -#endif /* DUK_USE_FINALIZER_TORTURE */ +#endif /* DUK_USE_FINALIZER_TORTURE */ /* * Process the finalize_list to completion. @@ -50673,12 +51667,13 @@ DUK_INTERNAL void duk_heap_process_finalize_list(duk_heap *heap) { DUK_DD(DUK_DDPRINT("processing finalize_list entry: %p -> %!iO", (void *) curr, curr)); - DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); /* Only objects have finalizers. */ + DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); /* Only objects have finalizers. */ DUK_ASSERT(!DUK_HEAPHDR_HAS_REACHABLE(curr)); DUK_ASSERT(!DUK_HEAPHDR_HAS_TEMPROOT(curr)); - DUK_ASSERT(DUK_HEAPHDR_HAS_FINALIZABLE(curr)); /* All objects on finalize_list will have this flag (except object being finalized right now). */ - DUK_ASSERT(!DUK_HEAPHDR_HAS_FINALIZED(curr)); /* Queueing code ensures. */ - DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY(curr)); /* ROM objects never get freed (or finalized). */ + DUK_ASSERT(DUK_HEAPHDR_HAS_FINALIZABLE( + curr)); /* All objects on finalize_list will have this flag (except object being finalized right now). */ + DUK_ASSERT(!DUK_HEAPHDR_HAS_FINALIZED(curr)); /* Queueing code ensures. */ + DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY(curr)); /* ROM objects never get freed (or finalized). */ #if defined(DUK_USE_ASSERTIONS) DUK_ASSERT(heap->currently_finalizing == NULL); @@ -50706,11 +51701,11 @@ DUK_INTERNAL void duk_heap_process_finalize_list(duk_heap *heap) { */ #if defined(DUK_USE_REFERENCE_COUNTING) DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(curr) >= 1); - had_zero_refcount = (DUK_HEAPHDR_GET_REFCOUNT(curr) == 1); /* Preincremented on finalize_list insert. */ + had_zero_refcount = (DUK_HEAPHDR_GET_REFCOUNT(curr) == 1); /* Preincremented on finalize_list insert. */ #endif DUK_ASSERT(!DUK_HEAPHDR_HAS_FINALIZED(curr)); - duk_heap_run_finalizer(heap, (duk_hobject *) curr); /* must never longjmp */ + duk_heap_run_finalizer(heap, (duk_hobject *) curr); /* must never longjmp */ DUK_ASSERT(DUK_HEAPHDR_HAS_FINALIZED(curr)); /* XXX: assert that object is still in finalize_list * when duk_push_heapptr() allows automatic rescue. @@ -50718,12 +51713,14 @@ DUK_INTERNAL void duk_heap_process_finalize_list(duk_heap *heap) { #if defined(DUK_USE_REFERENCE_COUNTING) DUK_DD(DUK_DDPRINT("refcount after finalizer (includes bump): %ld", (long) DUK_HEAPHDR_GET_REFCOUNT(curr))); - if (DUK_HEAPHDR_GET_REFCOUNT(curr) == 1) { /* Only artificial bump in refcount? */ + if (DUK_HEAPHDR_GET_REFCOUNT(curr) == 1) { /* Only artificial bump in refcount? */ #if defined(DUK_USE_DEBUG) if (had_zero_refcount) { - DUK_DD(DUK_DDPRINT("finalized object's refcount is zero -> free immediately (refcount queued)")); + DUK_DD(DUK_DDPRINT( + "finalized object's refcount is zero -> free immediately (refcount queued)")); } else { - DUK_DD(DUK_DDPRINT("finalized object's refcount is zero -> free immediately (mark-and-sweep queued)")); + DUK_DD(DUK_DDPRINT( + "finalized object's refcount is zero -> free immediately (mark-and-sweep queued)")); } #endif queue_back = 0; @@ -50773,21 +51770,21 @@ DUK_INTERNAL void duk_heap_process_finalize_list(duk_heap *heap) { * decision. */ DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(curr) >= 1); - DUK_HEAPHDR_PREDEC_REFCOUNT(curr); /* Remove artificial refcount bump. */ + DUK_HEAPHDR_PREDEC_REFCOUNT(curr); /* Remove artificial refcount bump. */ DUK_HEAPHDR_CLEAR_FINALIZABLE(curr); DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, curr); } else { /* No need to remove the refcount bump here. */ - DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); /* currently, always the case */ + DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); /* currently, always the case */ DUK_DD(DUK_DDPRINT("refcount finalize after finalizer call: %!O", curr)); duk_hobject_refcount_finalize_norz(heap, (duk_hobject *) curr); duk_free_hobject(heap, (duk_hobject *) curr); DUK_DD(DUK_DDPRINT("freed hobject after finalization: %p", (void *) curr)); } -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ DUK_HEAPHDR_CLEAR_FINALIZABLE(curr); DUK_HEAP_INSERT_INTO_HEAP_ALLOCATED(heap, curr); -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ #if defined(DUK_USE_DEBUG) count++; @@ -50853,11 +51850,11 @@ DUK_LOCAL duk_ret_t duk__finalize_helper(duk_hthread *thr, void *udata) { * caller must ensure that this function is not called if the target is * a Proxy. */ - duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_INT_FINALIZER); /* -> [... obj finalizer] */ + duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_INT_FINALIZER); /* -> [... obj finalizer] */ duk_dup_m2(thr); duk_push_boolean(thr, DUK_HEAP_HAS_FINALIZER_NORESCUE(thr->heap)); DUK_DDD(DUK_DDDPRINT("calling finalizer")); - duk_call(thr, 2); /* [ ... obj finalizer obj heapDestruct ] -> [ ... obj retval ] */ + duk_call(thr, 2); /* [ ... obj finalizer obj heapDestruct ] -> [ ... obj retval ] */ DUK_DDD(DUK_DDDPRINT("finalizer returned successfully")); return 0; @@ -50906,7 +51903,7 @@ DUK_INTERNAL void duk_heap_run_finalizer(duk_heap *heap, duk_hobject *obj) { return; } #endif - DUK_HEAPHDR_SET_FINALIZED((duk_heaphdr *) obj); /* ensure never re-entered until rescue cycle complete */ + DUK_HEAPHDR_SET_FINALIZED((duk_heaphdr *) obj); /* ensure never re-entered until rescue cycle complete */ #if defined(DUK_USE_ES6_PROXY) if (DUK_HOBJECT_IS_PROXY(obj)) { @@ -50918,29 +51915,30 @@ DUK_INTERNAL void duk_heap_run_finalizer(duk_heap *heap, duk_hobject *obj) { DUK_D(DUK_DPRINT("object is a Proxy, skip finalizer call")); return; } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ - duk_push_hobject(thr, obj); /* this also increases refcount by one */ - rc = duk_safe_call(thr, duk__finalize_helper, NULL /*udata*/, 0 /*nargs*/, 1 /*nrets*/); /* -> [... obj retval/error] */ - DUK_ASSERT_TOP(thr, entry_top + 2); /* duk_safe_call discipline */ + duk_push_hobject(thr, obj); /* this also increases refcount by one */ + rc = duk_safe_call(thr, duk__finalize_helper, NULL /*udata*/, 0 /*nargs*/, 1 /*nrets*/); /* -> [... obj retval/error] */ + DUK_ASSERT_TOP(thr, entry_top + 2); /* duk_safe_call discipline */ if (rc != DUK_EXEC_SUCCESS) { /* Note: we ask for one return value from duk_safe_call to get this * error debugging here. */ DUK_D(DUK_DPRINT("wrapped finalizer call failed for object %p (ignored); error: %!T", - (void *) obj, (duk_tval *) duk_get_tval(thr, -1))); + (void *) obj, + (duk_tval *) duk_get_tval(thr, -1))); } - duk_pop_2(thr); /* -> [...] */ + duk_pop_2(thr); /* -> [...] */ DUK_ASSERT_TOP(thr, entry_top); } -#else /* DUK_USE_FINALIZER_SUPPORT */ +#else /* DUK_USE_FINALIZER_SUPPORT */ /* nothing */ -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * String hash computation (interning). * @@ -50964,9 +51962,9 @@ DUK_INTERNAL void duk_heap_run_finalizer(duk_heap *heap, duk_hobject *obj) { #if defined(DUK_USE_STRHASH_DENSE) /* Constants for duk_hashstring(). */ -#define DUK__STRHASH_SHORTSTRING 4096L -#define DUK__STRHASH_MEDIUMSTRING (256L * 1024L) -#define DUK__STRHASH_BLOCKSIZE 256L +#define DUK__STRHASH_SHORTSTRING 4096L +#define DUK__STRHASH_MEDIUMSTRING (256L * 1024L) +#define DUK__STRHASH_BLOCKSIZE 256L DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uint8_t *str, duk_size_t len) { duk_uint32_t hash; @@ -51023,7 +52021,7 @@ DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uint8_t #endif return hash; } -#else /* DUK_USE_STRHASH_DENSE */ +#else /* DUK_USE_STRHASH_DENSE */ DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uint8_t *str, duk_size_t len) { duk_uint32_t hash; duk_size_t step; @@ -51041,10 +52039,10 @@ DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uint8_t * more often in the suffix than in the prefix. */ - hash = heap->hash_seed ^ ((duk_uint32_t) len); /* Bernstein hash init value is normally 5381 */ + hash = heap->hash_seed ^ ((duk_uint32_t) len); /* Bernstein hash init value is normally 5381 */ step = (len >> DUK_USE_STRHASH_SKIP_SHIFT) + 1; for (off = len; off >= step; off -= step) { - DUK_ASSERT(off >= 1); /* off >= step, and step >= 1 */ + DUK_ASSERT(off >= 1); /* off >= step, and step >= 1 */ hash = (hash * 33) + str[off - 1]; } @@ -51056,7 +52054,7 @@ DUK_INTERNAL duk_uint32_t duk_heap_hashstring(duk_heap *heap, const duk_uint8_t #endif return hash; } -#endif /* DUK_USE_STRHASH_DENSE */ +#endif /* DUK_USE_STRHASH_DENSE */ /* automatic undefs */ #undef DUK__STRHASH_BLOCKSIZE @@ -51178,7 +52176,7 @@ DUK_LOCAL void duk__mark_hobject(duk_heap *heap, duk_hobject *h) { DUK_HBUFOBJ_ASSERT_VALID(b); duk__mark_heaphdr(heap, (duk_heaphdr *) b->buf); duk__mark_heaphdr(heap, (duk_heaphdr *) b->buf_prop); -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ } else if (DUK_HOBJECT_IS_BOUNDFUNC(h)) { duk_hboundfunc *f = (duk_hboundfunc *) (void *) h; DUK_HBOUNDFUNC_ASSERT_VALID(f); @@ -51191,7 +52189,7 @@ DUK_LOCAL void duk__mark_hobject(duk_heap *heap, duk_hobject *h) { DUK_HPROXY_ASSERT_VALID(p); duk__mark_heaphdr_nonnull(heap, (duk_heaphdr *) p->target); duk__mark_heaphdr_nonnull(heap, (duk_heaphdr *) p->handler); -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ } else if (DUK_HOBJECT_IS_THREAD(h)) { duk_hthread *t = (duk_hthread *) h; duk_activation *act; @@ -51212,7 +52210,7 @@ DUK_LOCAL void duk__mark_hobject(duk_heap *heap, duk_hobject *h) { #if defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) duk__mark_heaphdr(heap, (duk_heaphdr *) act->prev_caller); #endif -#if 0 /* nothing now */ +#if 0 /* nothing now */ for (cat = act->cat; cat != NULL; cat = cat->parent) { } #endif @@ -51235,9 +52233,8 @@ DUK_LOCAL void duk__mark_hobject(duk_heap *heap, duk_hobject *h) { /* Mark any duk_heaphdr type. Recursion tracking happens only here. */ DUK_LOCAL void duk__mark_heaphdr(duk_heap *heap, duk_heaphdr *h) { - DUK_DDD(DUK_DDDPRINT("duk__mark_heaphdr %p, type %ld", - (void *) h, - (h != NULL ? (long) DUK_HEAPHDR_GET_TYPE(h) : (long) -1))); + DUK_DDD( + DUK_DDDPRINT("duk__mark_heaphdr %p, type %ld", (void *) h, (h != NULL ? (long) DUK_HEAPHDR_GET_TYPE(h) : (long) -1))); /* XXX: add non-null variant? */ if (h == NULL) { @@ -51249,7 +52246,7 @@ DUK_LOCAL void duk__mark_heaphdr(duk_heap *heap, duk_heaphdr *h) { #if defined(DUK_USE_ASSERTIONS) && defined(DUK_USE_REFERENCE_COUNTING) if (!DUK_HEAPHDR_HAS_READONLY(h)) { - h->h_assert_refcount++; /* Comparison refcount: bump even if already reachable. */ + h->h_assert_refcount++; /* Comparison refcount: bump even if already reachable. */ } #endif if (DUK_HEAPHDR_HAS_REACHABLE(h)) { @@ -51273,7 +52270,7 @@ DUK_LOCAL void duk__mark_heaphdr(duk_heap *heap, duk_heaphdr *h) { } heap->ms_recursion_depth++; - DUK_ASSERT(heap->ms_recursion_depth != 0); /* Wrap. */ + DUK_ASSERT(heap->ms_recursion_depth != 0); /* Wrap. */ switch (DUK_HEAPHDR_GET_TYPE(h)) { case DUK_HTYPE_STRING: @@ -51388,9 +52385,7 @@ DUK_LOCAL void duk__mark_finalizable(duk_heap *heap) { * of a _Finalizer hidden symbol. */ - if (!DUK_HEAPHDR_HAS_REACHABLE(hdr) && - DUK_HEAPHDR_IS_OBJECT(hdr) && - !DUK_HEAPHDR_HAS_FINALIZED(hdr) && + if (!DUK_HEAPHDR_HAS_REACHABLE(hdr) && DUK_HEAPHDR_IS_OBJECT(hdr) && !DUK_HEAPHDR_HAS_FINALIZED(hdr) && DUK_HOBJECT_HAS_FINALIZER_FAST(heap, (duk_hobject *) hdr)) { /* heaphdr: * - is not reachable @@ -51415,8 +52410,7 @@ DUK_LOCAL void duk__mark_finalizable(duk_heap *heap) { return; } - DUK_DD(DUK_DDPRINT("marked %ld heap objects as finalizable, now mark them reachable", - (long) count_finalizable)); + DUK_DD(DUK_DDPRINT("marked %ld heap objects as finalizable, now mark them reachable", (long) count_finalizable)); hdr = heap->heap_allocated; while (hdr != NULL) { @@ -51429,7 +52423,7 @@ DUK_LOCAL void duk__mark_finalizable(duk_heap *heap) { /* Caller will finish the marking process if we hit a recursion limit. */ } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * Mark objects on finalize_list. @@ -51460,7 +52454,7 @@ DUK_LOCAL void duk__mark_finalize_list(duk_heap *heap) { } #endif } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * Fallback marking handler if recursion limit is reached. @@ -51493,9 +52487,9 @@ DUK_LOCAL void duk__handle_temproot(duk_heap *heap, duk_heaphdr *hdr) { DUK_DDD(DUK_DDDPRINT("found a temp root: %p", (void *) hdr)); DUK_HEAPHDR_CLEAR_TEMPROOT(hdr); - DUK_HEAPHDR_CLEAR_REACHABLE(hdr); /* Done so that duk__mark_heaphdr() works correctly. */ + DUK_HEAPHDR_CLEAR_REACHABLE(hdr); /* Done so that duk__mark_heaphdr() works correctly. */ #if defined(DUK_USE_ASSERTIONS) && defined(DUK_USE_REFERENCE_COUNTING) - hdr->h_assert_refcount--; /* Same node visited twice. */ + hdr->h_assert_refcount--; /* Same node visited twice. */ #endif duk__mark_heaphdr_nonnull(heap, hdr); @@ -51590,7 +52584,7 @@ DUK_LOCAL void duk__finalize_refcounts(duk_heap *heap) { hdr = DUK_HEAPHDR_GET_NEXT(heap, hdr); } } -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ /* * Clear (reachable) flags of finalize_list. @@ -51613,15 +52607,14 @@ DUK_LOCAL void duk__clear_finalize_list_flags(duk_heap *heap) { while (hdr) { DUK_HEAPHDR_CLEAR_REACHABLE(hdr); #if defined(DUK_USE_ASSERTIONS) - DUK_ASSERT(DUK_HEAPHDR_HAS_FINALIZABLE(hdr) || \ - (heap->currently_finalizing == hdr)); + DUK_ASSERT(DUK_HEAPHDR_HAS_FINALIZABLE(hdr) || (heap->currently_finalizing == hdr)); #endif /* DUK_HEAPHDR_FLAG_FINALIZED may be set. */ DUK_ASSERT(!DUK_HEAPHDR_HAS_TEMPROOT(hdr)); hdr = DUK_HEAPHDR_GET_NEXT(heap, hdr); } } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * Sweep stringtable. @@ -51657,8 +52650,7 @@ DUK_LOCAL void duk__sweep_stringtable(duk_heap *heap, duk_size_t *out_count_keep duk_hstring *next; next = h->hdr.h_next; - if (DUK_HEAPHDR_HAS_REACHABLE((duk_heaphdr *) h)) - { + if (DUK_HEAPHDR_HAS_REACHABLE((duk_heaphdr *) h)) { DUK_HEAPHDR_CLEAR_REACHABLE((duk_heaphdr *) h); count_keep++; prev = h; @@ -51685,8 +52677,8 @@ DUK_LOCAL void duk__sweep_stringtable(duk_heap *heap, duk_size_t *out_count_keep * should have decreased unreachable string refcounts to zero * (even for cycles). However, pinned strings have a +1 bump. */ - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) == - DUK_HSTRING_HAS_PINNED_LITERAL(h) ? 1U : 0U); + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) == DUK_HSTRING_HAS_PINNED_LITERAL(h) ? 1U : + 0U); #endif /* Deal with weak references first. */ @@ -51707,10 +52699,9 @@ DUK_LOCAL void duk__sweep_stringtable(duk_heap *heap, duk_size_t *out_count_keep } } - done: +done: #if defined(DUK_USE_DEBUG) - DUK_D(DUK_DPRINT("mark-and-sweep sweep stringtable: %ld freed, %ld kept", - (long) count_free, (long) count_keep)); + DUK_D(DUK_DPRINT("mark-and-sweep sweep stringtable: %ld freed, %ld kept", (long) count_free, (long) count_keep)); #endif *out_count_keep = count_keep; } @@ -51720,7 +52711,7 @@ DUK_LOCAL void duk__sweep_stringtable(duk_heap *heap, duk_size_t *out_count_keep */ DUK_LOCAL void duk__sweep_heap(duk_heap *heap, duk_small_uint_t flags, duk_size_t *out_count_keep) { - duk_heaphdr *prev; /* last element that was left in the heap */ + duk_heaphdr *prev; /* last element that was left in the heap */ duk_heaphdr *curr; duk_heaphdr *next; #if defined(DUK_USE_DEBUG) @@ -51763,25 +52754,28 @@ DUK_LOCAL void duk__sweep_heap(duk_heap *heap, duk_small_uint_t flags, duk_size_ DUK_DD(DUK_DDPRINT("sweep; reachable, finalizable --> move to finalize_list: %p", (void *) curr)); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_HEAPHDR_PREINC_REFCOUNT(curr); /* Bump refcount so that refzero never occurs when pending a finalizer call. */ + DUK_HEAPHDR_PREINC_REFCOUNT( + curr); /* Bump refcount so that refzero never occurs when pending a finalizer call. */ #endif DUK_HEAP_INSERT_INTO_FINALIZE_LIST(heap, curr); #if defined(DUK_USE_DEBUG) count_finalize++; #endif - } - else -#endif /* DUK_USE_FINALIZER_SUPPORT */ + } else +#endif /* DUK_USE_FINALIZER_SUPPORT */ { if (DUK_UNLIKELY(DUK_HEAPHDR_HAS_FINALIZED(curr))) { DUK_ASSERT(!DUK_HEAPHDR_HAS_FINALIZABLE(curr)); DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); if (flags & DUK_MS_FLAG_POSTPONE_RESCUE) { - DUK_DD(DUK_DDPRINT("sweep; reachable, finalized, but postponing rescue decisions --> keep object (with FINALIZED set): %!iO", curr)); + DUK_DD(DUK_DDPRINT("sweep; reachable, finalized, but postponing rescue decisions " + "--> keep object (with FINALIZED set): %!iO", + curr)); count_keep++; } else { - DUK_DD(DUK_DDPRINT("sweep; reachable, finalized --> rescued after finalization: %p", (void *) curr)); + DUK_DD(DUK_DDPRINT("sweep; reachable, finalized --> rescued after finalization: %p", + (void *) curr)); #if defined(DUK_USE_FINALIZER_SUPPORT) DUK_HEAPHDR_CLEAR_FINALIZED(curr); #endif @@ -51850,7 +52844,8 @@ DUK_LOCAL void duk__sweep_heap(duk_heap *heap, duk_small_uint_t flags, duk_size_ #if defined(DUK_USE_DEBUG) if (DUK_HEAPHDR_HAS_FINALIZED(curr)) { - DUK_DD(DUK_DDPRINT("sweep; unreachable, finalized --> finalized object not rescued: %p", (void *) curr)); + DUK_DD(DUK_DDPRINT("sweep; unreachable, finalized --> finalized object not rescued: %p", + (void *) curr)); } else { DUK_DD(DUK_DDPRINT("sweep; not reachable --> free: %p", (void *) curr)); } @@ -51884,7 +52879,10 @@ DUK_LOCAL void duk__sweep_heap(duk_heap *heap, duk_small_uint_t flags, duk_size_ #if defined(DUK_USE_DEBUG) DUK_D(DUK_DPRINT("mark-and-sweep sweep objects (non-string): %ld freed, %ld kept, %ld rescued, %ld queued for finalization", - (long) count_free, (long) count_keep, (long) count_rescue, (long) count_finalize)); + (long) count_free, + (long) count_keep, + (long) count_rescue, + (long) count_finalize)); #endif *out_count_keep = count_keep; } @@ -51907,7 +52905,7 @@ DUK_LOCAL void duk__wipe_litcache(duk_heap *heap) { e++; } } -#endif /* DUK_USE_LITCACHE_SIZE */ +#endif /* DUK_USE_LITCACHE_SIZE */ /* * Object compaction. @@ -51926,7 +52924,12 @@ DUK_LOCAL int duk__protected_compact_object(duk_hthread *thr, void *udata) { } #if defined(DUK_USE_DEBUG) -DUK_LOCAL void duk__compact_object_list(duk_heap *heap, duk_hthread *thr, duk_heaphdr *start, duk_size_t *p_count_check, duk_size_t *p_count_compact, duk_size_t *p_count_bytes_saved) { +DUK_LOCAL void duk__compact_object_list(duk_heap *heap, + duk_hthread *thr, + duk_heaphdr *start, + duk_size_t *p_count_check, + duk_size_t *p_count_compact, + duk_size_t *p_count_bytes_saved) { #else DUK_LOCAL void duk__compact_object_list(duk_heap *heap, duk_hthread *thr, duk_heaphdr *start) { #endif @@ -51948,9 +52951,8 @@ DUK_LOCAL void duk__compact_object_list(duk_heap *heap, duk_hthread *thr, duk_he obj = (duk_hobject *) curr; #if defined(DUK_USE_DEBUG) - old_size = DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), - DUK_HOBJECT_GET_ASIZE(obj), - DUK_HOBJECT_GET_HSIZE(obj)); + old_size = + DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), DUK_HOBJECT_GET_ASIZE(obj), DUK_HOBJECT_GET_HSIZE(obj)); #endif DUK_DD(DUK_DDPRINT("compact object: %p", (void *) obj)); @@ -51959,9 +52961,8 @@ DUK_LOCAL void duk__compact_object_list(duk_heap *heap, duk_hthread *thr, duk_he duk_safe_call(thr, duk__protected_compact_object, NULL, 1, 0); #if defined(DUK_USE_DEBUG) - new_size = DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), - DUK_HOBJECT_GET_ASIZE(obj), - DUK_HOBJECT_GET_HSIZE(obj)); + new_size = + DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), DUK_HOBJECT_GET_ASIZE(obj), DUK_HOBJECT_GET_HSIZE(obj)); #endif #if defined(DUK_USE_DEBUG) @@ -51969,7 +52970,7 @@ DUK_LOCAL void duk__compact_object_list(duk_heap *heap, duk_hthread *thr, duk_he (*p_count_bytes_saved) += (duk_size_t) (old_size - new_size); #endif - next: + next: curr = DUK_HEAPHDR_GET_NEXT(heap, curr); #if defined(DUK_USE_DEBUG) (*p_count_check)++; @@ -52001,12 +53002,14 @@ DUK_LOCAL void duk__compact_objects(duk_heap *heap) { #endif #endif #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ + DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ #endif #if defined(DUK_USE_DEBUG) DUK_D(DUK_DPRINT("mark-and-sweep compact objects: %ld checked, %ld compaction attempts, %ld bytes saved by compaction", - (long) count_check, (long) count_compact, (long) count_bytes_saved)); + (long) count_check, + (long) count_compact, + (long) count_bytes_saved)); #endif } @@ -52053,7 +53056,7 @@ DUK_LOCAL void duk__assert_heaphdr_flags_cb(duk_heap *heap, duk_heaphdr *h) { DUK_LOCAL void duk__assert_heaphdr_flags(duk_heap *heap) { duk__assert_walk_list(heap, heap->heap_allocated, duk__assert_heaphdr_flags_cb); #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ + DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ #endif /* XXX: Assertions for finalize_list? */ } @@ -52084,8 +53087,7 @@ DUK_LOCAL void duk__assert_valid_refcounts_cb(duk_heap *heap, duk_heaphdr *h) { /* Cannot really assert much w.r.t. refcounts now. */ DUK_UNREF(heap); - if (DUK_HEAPHDR_GET_REFCOUNT(h) == 0 && - DUK_HEAPHDR_HAS_FINALIZED(h)) { + if (DUK_HEAPHDR_GET_REFCOUNT(h) == 0 && DUK_HEAPHDR_HAS_FINALIZED(h)) { /* An object may be in heap_allocated list with a zero * refcount if it has just been finalized and is waiting * to be collected by the next cycle. @@ -52099,7 +53101,7 @@ DUK_LOCAL void duk__assert_valid_refcounts_cb(duk_heap *heap, duk_heaphdr *h) { * (presumably not reachable because refcount is 0). */ } - DUK_ASSERT_DISABLE(DUK_HEAPHDR_GET_REFCOUNT(h) >= 0); /* Unsigned. */ + DUK_ASSERT_DISABLE(DUK_HEAPHDR_GET_REFCOUNT(h) >= 0); /* Unsigned. */ } DUK_LOCAL void duk__assert_valid_refcounts(duk_heap *heap) { duk__assert_walk_list(heap, heap->heap_allocated, duk__assert_valid_refcounts_cb); @@ -52150,8 +53152,10 @@ DUK_LOCAL void duk__check_refcount_heaphdr(duk_heaphdr *hdr) { count_ok = ((duk_size_t) DUK_HEAPHDR_GET_REFCOUNT(hdr) == expect_refc); if (!count_ok) { DUK_D(DUK_DPRINT("refcount mismatch for: %p: header=%ld counted=%ld --> %!iO", - (void *) hdr, (long) DUK_HEAPHDR_GET_REFCOUNT(hdr), - (long) hdr->h_assert_refcount, hdr)); + (void *) hdr, + (long) DUK_HEAPHDR_GET_REFCOUNT(hdr), + (long) hdr->h_assert_refcount, + hdr)); DUK_ASSERT(0); } } @@ -52172,7 +53176,7 @@ DUK_LOCAL void duk__check_assert_refcounts(duk_heap *heap) { /* XXX: Assert anything for refzero_list? */ duk__assert_walk_strtable(heap, duk__check_assert_refcounts_cb2); } -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ #if defined(DUK_USE_LITCACHE_SIZE) DUK_LOCAL void duk__assert_litcache_nulls(duk_heap *heap) { @@ -52188,8 +53192,8 @@ DUK_LOCAL void duk__assert_litcache_nulls(duk_heap *heap) { DUK_ASSERT(e->addr == NULL); } } -#endif /* DUK_USE_LITCACHE_SIZE */ -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_LITCACHE_SIZE */ +#endif /* DUK_USE_ASSERTIONS */ /* * Stats dump. @@ -52198,49 +53202,64 @@ DUK_LOCAL void duk__assert_litcache_nulls(duk_heap *heap) { #if defined(DUK_USE_DEBUG) DUK_LOCAL void duk__dump_stats(duk_heap *heap) { DUK_D(DUK_DPRINT("stats executor: opcodes=%ld, interrupt=%ld, throw=%ld", - (long) heap->stats_exec_opcodes, (long) heap->stats_exec_interrupt, + (long) heap->stats_exec_opcodes, + (long) heap->stats_exec_interrupt, (long) heap->stats_exec_throw)); DUK_D(DUK_DPRINT("stats call: all=%ld, tailcall=%ld, ecmatoecma=%ld", - (long) heap->stats_call_all, (long) heap->stats_call_tailcall, + (long) heap->stats_call_all, + (long) heap->stats_call_tailcall, (long) heap->stats_call_ecmatoecma)); DUK_D(DUK_DPRINT("stats safecall: all=%ld, nothrow=%ld, throw=%ld", - (long) heap->stats_safecall_all, (long) heap->stats_safecall_nothrow, + (long) heap->stats_safecall_all, + (long) heap->stats_safecall_nothrow, (long) heap->stats_safecall_throw)); DUK_D(DUK_DPRINT("stats mark-and-sweep: try_count=%ld, skip_count=%ld, emergency_count=%ld", - (long) heap->stats_ms_try_count, (long) heap->stats_ms_skip_count, + (long) heap->stats_ms_try_count, + (long) heap->stats_ms_skip_count, (long) heap->stats_ms_emergency_count)); DUK_D(DUK_DPRINT("stats stringtable: intern_hit=%ld, intern_miss=%ld, " "resize_check=%ld, resize_grow=%ld, resize_shrink=%ld, " "litcache_hit=%ld, litcache_miss=%ld, litcache_pin=%ld", - (long) heap->stats_strtab_intern_hit, (long) heap->stats_strtab_intern_miss, - (long) heap->stats_strtab_resize_check, (long) heap->stats_strtab_resize_grow, - (long) heap->stats_strtab_resize_shrink, (long) heap->stats_strtab_litcache_hit, - (long) heap->stats_strtab_litcache_miss, (long) heap->stats_strtab_litcache_pin)); + (long) heap->stats_strtab_intern_hit, + (long) heap->stats_strtab_intern_miss, + (long) heap->stats_strtab_resize_check, + (long) heap->stats_strtab_resize_grow, + (long) heap->stats_strtab_resize_shrink, + (long) heap->stats_strtab_litcache_hit, + (long) heap->stats_strtab_litcache_miss, + (long) heap->stats_strtab_litcache_pin)); DUK_D(DUK_DPRINT("stats object: realloc_props=%ld, abandon_array=%ld", - (long) heap->stats_object_realloc_props, (long) heap->stats_object_abandon_array)); + (long) heap->stats_object_realloc_props, + (long) heap->stats_object_abandon_array)); DUK_D(DUK_DPRINT("stats getownpropdesc: count=%ld, hit=%ld, miss=%ld", - (long) heap->stats_getownpropdesc_count, (long) heap->stats_getownpropdesc_hit, + (long) heap->stats_getownpropdesc_count, + (long) heap->stats_getownpropdesc_hit, (long) heap->stats_getownpropdesc_miss)); DUK_D(DUK_DPRINT("stats getpropdesc: count=%ld, hit=%ld, miss=%ld", - (long) heap->stats_getpropdesc_count, (long) heap->stats_getpropdesc_hit, + (long) heap->stats_getpropdesc_count, + (long) heap->stats_getpropdesc_hit, (long) heap->stats_getpropdesc_miss)); DUK_D(DUK_DPRINT("stats getprop: all=%ld, arrayidx=%ld, bufobjidx=%ld, " "bufferidx=%ld, bufferlen=%ld, stringidx=%ld, stringlen=%ld, " "proxy=%ld, arguments=%ld", - (long) heap->stats_getprop_all, (long) heap->stats_getprop_arrayidx, - (long) heap->stats_getprop_bufobjidx, (long) heap->stats_getprop_bufferidx, - (long) heap->stats_getprop_bufferlen, (long) heap->stats_getprop_stringidx, - (long) heap->stats_getprop_stringlen, (long) heap->stats_getprop_proxy, + (long) heap->stats_getprop_all, + (long) heap->stats_getprop_arrayidx, + (long) heap->stats_getprop_bufobjidx, + (long) heap->stats_getprop_bufferidx, + (long) heap->stats_getprop_bufferlen, + (long) heap->stats_getprop_stringidx, + (long) heap->stats_getprop_stringlen, + (long) heap->stats_getprop_proxy, (long) heap->stats_getprop_arguments)); DUK_D(DUK_DPRINT("stats putprop: all=%ld, arrayidx=%ld, bufobjidx=%ld, " "bufferidx=%ld, proxy=%ld", - (long) heap->stats_putprop_all, (long) heap->stats_putprop_arrayidx, - (long) heap->stats_putprop_bufobjidx, (long) heap->stats_putprop_bufferidx, + (long) heap->stats_putprop_all, + (long) heap->stats_putprop_arrayidx, + (long) heap->stats_putprop_bufobjidx, + (long) heap->stats_putprop_bufferidx, (long) heap->stats_putprop_proxy)); - DUK_D(DUK_DPRINT("stats getvar: all=%ld", - (long) heap->stats_getvar_all)); - DUK_D(DUK_DPRINT("stats putvar: all=%ld", - (long) heap->stats_putvar_all)); + DUK_D(DUK_DPRINT("stats getvar: all=%ld", (long) heap->stats_getvar_all)); + DUK_D(DUK_DPRINT("stats putvar: all=%ld", (long) heap->stats_putvar_all)); DUK_D(DUK_DPRINT("stats envrec: delayedcreate=%ld, create=%ld, newenv=%ld, oldenv=%ld, pushclosure=%ld", (long) heap->stats_envrec_delayedcreate, (long) heap->stats_envrec_create, @@ -52248,7 +53267,7 @@ DUK_LOCAL void duk__dump_stats(duk_heap *heap) { (long) heap->stats_envrec_oldenv, (long) heap->stats_envrec_pushclosure)); } -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ /* * Main mark-and-sweep function. @@ -52287,7 +53306,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags DUK_STATS_INC(heap, stats_ms_skip_count); return; } - DUK_ASSERT(heap->ms_running == 0); /* ms_prevent_count is bumped when ms_running is set */ + DUK_ASSERT(heap->ms_running == 0); /* ms_prevent_count is bumped when ms_running is set */ /* Heap_thread is used during mark-and-sweep for refcount finalization * (it's also used for finalizer execution once mark-and-sweep is @@ -52298,7 +53317,8 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags DUK_ASSERT(heap->heap_thread->valstack != NULL); DUK_D(DUK_DPRINT("garbage collect (mark-and-sweep) starting, requested flags: 0x%08lx, effective flags: 0x%08lx", - (unsigned long) flags, (unsigned long) (flags | heap->ms_base_flags))); + (unsigned long) flags, + (unsigned long) (flags | heap->ms_base_flags))); flags |= heap->ms_base_flags; #if defined(DUK_USE_FINALIZER_SUPPORT) @@ -52324,8 +53344,8 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags * finalizer may trigger a mark-and-sweep. */ duk__assert_valid_refcounts(heap); -#endif /* DUK_USE_REFERENCE_COUNTING */ -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_ASSERTIONS */ /* * Begin @@ -52369,17 +53389,17 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags #if defined(DUK_USE_LITCACHE_SIZE) duk__wipe_litcache(heap); #endif - duk__mark_roots_heap(heap); /* Mark main reachability roots. */ + duk__mark_roots_heap(heap); /* Mark main reachability roots. */ #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ + DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ #endif - duk__mark_temproots_by_heap_scan(heap); /* Temproots. */ + duk__mark_temproots_by_heap_scan(heap); /* Temproots. */ #if defined(DUK_USE_FINALIZER_SUPPORT) - duk__mark_finalizable(heap); /* Mark finalizable as reachability roots. */ - duk__mark_finalize_list(heap); /* Mark finalizer work list as reachability roots. */ + duk__mark_finalizable(heap); /* Mark finalizable as reachability roots. */ + duk__mark_finalize_list(heap); /* Mark finalizer work list as reachability roots. */ #endif - duk__mark_temproots_by_heap_scan(heap); /* Temproots. */ + duk__mark_temproots_by_heap_scan(heap); /* Temproots. */ /* * Sweep garbage and remove marking flags, and move objects with @@ -52406,7 +53426,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags duk__check_assert_refcounts(heap); #endif #if defined(DUK_USE_REFERENCE_COUNTING) - DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ + DUK_ASSERT(heap->refzero_list == NULL); /* Always handled to completion inline in DECREF. */ #endif #if defined(DUK_USE_FINALIZER_SUPPORT) duk__clear_finalize_list_flags(heap); @@ -52433,8 +53453,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags * interfering with error state. */ - if ((flags & DUK_MS_FLAG_EMERGENCY) && - !(flags & DUK_MS_FLAG_NO_OBJECT_COMPACTION)) { + if ((flags & DUK_MS_FLAG_EMERGENCY) && !(flags & DUK_MS_FLAG_NO_OBJECT_COMPACTION)) { if (heap->lj.type != DUK_LJ_TYPE_UNKNOWN) { DUK_D(DUK_DPRINT("lj.type (%ld) not DUK_LJ_TYPE_UNKNOWN, skip object compaction", (long) heap->lj.type)); } else { @@ -52467,7 +53486,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags DUK_ASSERT(heap->ms_running == 1); heap->ms_prevent_count = 0; heap->ms_running = 0; - heap->creating_error = entry_creating_error; /* for nested error handling, see GH-2278 */ + heap->creating_error = entry_creating_error; /* for nested error handling, see GH-2278 */ /* * Assertions after @@ -52484,11 +53503,11 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags * finalizer may trigger a mark-and-sweep. */ duk__assert_valid_refcounts(heap); -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ #if defined(DUK_USE_LITCACHE_SIZE) duk__assert_litcache_nulls(heap); -#endif /* DUK_USE_LITCACHE_SIZE */ -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_LITCACHE_SIZE */ +#endif /* DUK_USE_ASSERTIONS */ /* * Reset trigger counter @@ -52496,14 +53515,15 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags #if defined(DUK_USE_VOLUNTARY_GC) tmp = (count_keep_obj + count_keep_str) / 256; - heap->ms_trigger_counter = (duk_int_t) ( - (tmp * DUK_HEAP_MARK_AND_SWEEP_TRIGGER_MULT) + - DUK_HEAP_MARK_AND_SWEEP_TRIGGER_ADD); + heap->ms_trigger_counter = (duk_int_t) ((tmp * DUK_HEAP_MARK_AND_SWEEP_TRIGGER_MULT) + DUK_HEAP_MARK_AND_SWEEP_TRIGGER_ADD); DUK_D(DUK_DPRINT("garbage collect (mark-and-sweep) finished: %ld objects kept, %ld strings kept, trigger reset to %ld", - (long) count_keep_obj, (long) count_keep_str, (long) heap->ms_trigger_counter)); + (long) count_keep_obj, + (long) count_keep_str, + (long) heap->ms_trigger_counter)); #else DUK_D(DUK_DPRINT("garbage collect (mark-and-sweep) finished: %ld objects kept, %ld strings kept, no voluntary trigger", - (long) count_keep_obj, (long) count_keep_str)); + (long) count_keep_obj, + (long) count_keep_str)); #endif /* @@ -52546,7 +53566,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags * is inside the target. */ duk_heap_process_finalize_list(heap); -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ } /* * Memory allocation handling. @@ -52608,7 +53628,8 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_alloc_slowpath(duk_heap res = heap->alloc_func(heap->heap_udata, size); if (res != NULL) { DUK_D(DUK_DPRINT("duk_heap_mem_alloc() succeeded after gc (pass %ld), alloc size %ld", - (long) (i + 1), (long) size)); + (long) (i + 1), + (long) size)); return res; } } @@ -52652,7 +53673,7 @@ DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_alloc(duk_heap *heap, du return res; } - slowpath: +slowpath: if (size == 0) { DUK_D(DUK_DPRINT("first alloc attempt returned NULL for zero size alloc, use slow path to deal with it")); @@ -52727,13 +53748,7 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_slowpath(duk_he /* ptr may be NULL */ DUK_ASSERT_DISABLE(newsize >= 0); - /* Newsize was 0 and realloc() returned NULL, this has the semantics - * of free(oldptr), i.e. memory was successfully freed. - */ - if (newsize == 0) { - DUK_D(DUK_DPRINT("zero size realloc in slow path, return NULL")); - return NULL; - } + /* Unlike for malloc(), zero size NULL result check happens at the call site. */ DUK_D(DUK_DPRINT("first realloc attempt failed, attempt to gc and retry")); @@ -52764,11 +53779,11 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_slowpath(duk_he duk_heap_mark_and_sweep(heap, flags); - DUK_ASSERT(newsize > 0); res = heap->realloc_func(heap->heap_udata, ptr, newsize); - if (res || newsize == 0) { + if (res != NULL || newsize == 0) { DUK_D(DUK_DPRINT("duk_heap_mem_realloc() succeeded after gc (pass %ld), alloc size %ld", - (long) (i + 1), (long) newsize)); + (long) (i + 1), + (long) newsize)); return res; } } @@ -52788,7 +53803,7 @@ DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc(duk_heap *heap, #if defined(DUK_USE_VOLUNTARY_GC) /* Voluntary periodic GC (if enabled). */ if (DUK_UNLIKELY(--(heap)->ms_trigger_counter < 0)) { - goto slowpath; + goto gc_retry; } #endif @@ -52800,22 +53815,22 @@ DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc(duk_heap *heap, DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first realloc attempt fails")); res = NULL; DUK_UNREF(res); - goto slowpath; + goto gc_retry; } #endif res = heap->realloc_func(heap->heap_udata, ptr, newsize); - if (DUK_LIKELY(res != NULL)) { + if (DUK_LIKELY(res != NULL) || newsize == 0) { + if (res != NULL && newsize == 0) { + DUK_DD(DUK_DDPRINT("first realloc attempt returned NULL for zero size realloc, accept and return NULL")); + } return res; - } - - slowpath: - - if (newsize == 0) { - DUK_D(DUK_DPRINT("first realloc attempt returned NULL for zero size realloc, use slow path to deal with it")); } else { - DUK_D(DUK_DPRINT("first realloc attempt failed, attempt to gc and retry")); + goto gc_retry; } + /* Never here. */ + +gc_retry: return duk__heap_mem_realloc_slowpath(heap, ptr, newsize); } @@ -52826,7 +53841,10 @@ DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc(duk_heap *heap, */ /* Slow path: voluntary GC triggered, first realloc attempt failed, or zero size. */ -DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpath(duk_heap *heap, duk_mem_getptr cb, void *ud, duk_size_t newsize) { +DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpath(duk_heap *heap, + duk_mem_getptr cb, + void *ud, + duk_size_t newsize) { void *res; duk_small_int_t i; @@ -52834,10 +53852,7 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpa DUK_ASSERT(heap->realloc_func != NULL); DUK_ASSERT_DISABLE(newsize >= 0); - if (newsize == 0) { - DUK_D(DUK_DPRINT("zero size indirect realloc in slow path, return NULL")); - return NULL; - } + /* Unlike for malloc(), zero size NULL result check happens at the call site. */ DUK_D(DUK_DPRINT("first indirect realloc attempt failed, attempt to gc and retry")); @@ -52879,7 +53894,8 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpa ptr_post = cb(heap, ud); if (ptr_pre != ptr_post) { DUK_DD(DUK_DDPRINT("realloc base pointer changed by mark-and-sweep: %p -> %p", - (void *) ptr_pre, (void *) ptr_post)); + (void *) ptr_pre, + (void *) ptr_post)); } #endif @@ -52887,11 +53903,11 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpa * The pointer being reallocated may change after every mark-and-sweep. */ - DUK_ASSERT(newsize > 0); res = heap->realloc_func(heap->heap_udata, cb(heap, ud), newsize); - if (res || newsize == 0) { + if (res != NULL || newsize == 0) { DUK_D(DUK_DPRINT("duk_heap_mem_realloc_indirect() succeeded after gc (pass %ld), alloc size %ld", - (long) (i + 1), (long) newsize)); + (long) (i + 1), + (long) newsize)); return res; } } @@ -52900,7 +53916,10 @@ DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpa return NULL; } -DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc_indirect(duk_heap *heap, duk_mem_getptr cb, void *ud, duk_size_t newsize) { +DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc_indirect(duk_heap *heap, + duk_mem_getptr cb, + void *ud, + duk_size_t newsize) { void *res; DUK_ASSERT(heap != NULL); @@ -52910,7 +53929,7 @@ DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc_indirect(duk_hea #if defined(DUK_USE_VOLUNTARY_GC) /* Voluntary periodic GC (if enabled). */ if (DUK_UNLIKELY(--(heap)->ms_trigger_counter < 0)) { - goto slowpath; + goto gc_retry; } #endif @@ -52922,22 +53941,23 @@ DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc_indirect(duk_hea DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first indirect realloc attempt fails")); res = NULL; DUK_UNREF(res); - goto slowpath; + goto gc_retry; } #endif res = heap->realloc_func(heap->heap_udata, cb(heap, ud), newsize); - if (DUK_LIKELY(res != NULL)) { + if (DUK_LIKELY(res != NULL) || newsize == 0) { + if (res != NULL && newsize == 0) { + DUK_DD(DUK_DDPRINT( + "first indirect realloc attempt returned NULL for zero size realloc, accept and return NULL")); + } return res; - } - - slowpath: - - if (newsize == 0) { - DUK_D(DUK_DPRINT("first indirect realloc attempt returned NULL for zero size realloc, use slow path to deal with it")); } else { - DUK_D(DUK_DPRINT("first indirect realloc attempt failed, attempt to gc and retry")); + goto gc_retry; } + /* Never here. */ + +gc_retry: return duk__heap_mem_realloc_indirect_slowpath(heap, cb, ud, newsize); } @@ -53026,7 +54046,7 @@ DUK_INTERNAL void duk_heap_remove_from_heap_allocated(duk_heap *heap, duk_heaphd ; } } -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ #if defined(DUK_USE_FINALIZER_SUPPORT) DUK_INTERNAL void duk_heap_insert_into_finalize_list(duk_heap *heap, duk_heaphdr *hdr) { @@ -53045,7 +54065,7 @@ DUK_INTERNAL void duk_heap_insert_into_finalize_list(duk_heap *heap, duk_heaphdr DUK_HEAPHDR_ASSERT_LINKS(heap, root); heap->finalize_list = hdr; } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ #if defined(DUK_USE_FINALIZER_SUPPORT) DUK_INTERNAL void duk_heap_remove_from_finalize_list(duk_heap *heap, duk_heaphdr *hdr) { @@ -53079,7 +54099,7 @@ DUK_INTERNAL void duk_heap_remove_from_finalize_list(duk_heap *heap, duk_heaphdr } else { DUK_ASSERT(hdr != heap->finalize_list); for (;;) { - DUK_ASSERT(curr != NULL); /* Caller responsibility. */ + DUK_ASSERT(curr != NULL); /* Caller responsibility. */ next = DUK_HEAPHDR_GET_NEXT(heap, curr); if (next == hdr) { @@ -53091,7 +54111,7 @@ DUK_INTERNAL void duk_heap_remove_from_finalize_list(duk_heap *heap, duk_heaphdr } #endif } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL duk_bool_t duk_heap_in_heap_allocated(duk_heap *heap, duk_heaphdr *ptr) { @@ -53105,7 +54125,7 @@ DUK_INTERNAL duk_bool_t duk_heap_in_heap_allocated(duk_heap *heap, duk_heaphdr * } return 0; } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ #if defined(DUK_USE_INTERRUPT_COUNTER) DUK_INTERNAL void duk_heap_switch_thread(duk_heap *heap, duk_hthread *new_thr) { @@ -53138,9 +54158,9 @@ DUK_INTERNAL void duk_heap_switch_thread(duk_heap *heap, duk_hthread *new_thr) { DUK_DD(DUK_DDPRINT("switch thread, new thread is NULL, no interrupt counter changes")); } - heap->curr_thread = new_thr; /* may be NULL */ + heap->curr_thread = new_thr; /* may be NULL */ } -#endif /* DUK_USE_INTERRUPT_COUNTER */ +#endif /* DUK_USE_INTERRUPT_COUNTER */ #if defined(DUK_USE_ASSERTIONS) DUK_INTERNAL void duk_heap_assert_valid(duk_heap *heap) { @@ -53309,7 +54329,7 @@ DUK_INTERNAL void duk_hobject_refcount_finalize_norz(duk_heap *heap, duk_hobject } else if (DUK_HOBJECT_IS_OBJENV(h)) { duk_hobjenv *e = (duk_hobjenv *) h; DUK_HOBJENV_ASSERT_VALID(e); - DUK_ASSERT(e->target != NULL); /* Required for object environments. */ + DUK_ASSERT(e->target != NULL); /* Required for object environments. */ DUK_HOBJECT_DECREF_NORZ(thr, e->target); #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) } else if (DUK_HOBJECT_IS_BUFOBJ(h)) { @@ -53317,7 +54337,7 @@ DUK_INTERNAL void duk_hobject_refcount_finalize_norz(duk_heap *heap, duk_hobject DUK_HBUFOBJ_ASSERT_VALID(b); DUK_HBUFFER_DECREF_NORZ_ALLOWNULL(thr, (duk_hbuffer *) b->buf); DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr, (duk_hobject *) b->buf_prop); -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ } else if (DUK_HOBJECT_IS_BOUNDFUNC(h)) { duk_hboundfunc *f = (duk_hboundfunc *) (void *) h; DUK_HBOUNDFUNC_ASSERT_VALID(f); @@ -53330,7 +54350,7 @@ DUK_INTERNAL void duk_hobject_refcount_finalize_norz(duk_heap *heap, duk_hobject DUK_HPROXY_ASSERT_VALID(p); DUK_HOBJECT_DECREF_NORZ(thr, p->target); DUK_HOBJECT_DECREF_NORZ(thr, p->handler); -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ } else if (DUK_HOBJECT_IS_THREAD(h)) { duk_hthread *t = (duk_hthread *) h; duk_activation *act; @@ -53351,13 +54371,12 @@ DUK_INTERNAL void duk_hobject_refcount_finalize_norz(duk_heap *heap, duk_hobject #if defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr, (duk_hobject *) act->prev_caller); #endif -#if 0 /* nothing now */ +#if 0 /* nothing now */ for (cat = act->cat; cat != NULL; cat = cat->parent) { } #endif } - for (i = 0; i < DUK_NUM_BUILTINS; i++) { DUK_HOBJECT_DECREF_NORZ_ALLOWNULL(thr, (duk_hobject *) t->builtins[i]); } @@ -53442,7 +54461,7 @@ DUK_LOCAL void duk__refcount_free_pending(duk_heap *heap) { curr = heap->refzero_list; DUK_ASSERT(curr != NULL); - DUK_ASSERT(DUK_HEAPHDR_GET_PREV(heap, curr) == NULL); /* We're called on initial insert only. */ + DUK_ASSERT(DUK_HEAPHDR_GET_PREV(heap, curr) == NULL); /* We're called on initial insert only. */ /* curr->next is GARBAGE. */ do { @@ -53455,7 +54474,7 @@ DUK_LOCAL void duk__refcount_free_pending(duk_heap *heap) { #endif DUK_ASSERT(curr != NULL); - DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); /* currently, always the case */ + DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(curr) == DUK_HTYPE_OBJECT); /* currently, always the case */ /* FINALIZED may be set; don't care about flags here. */ /* Refcount finalize 'curr'. Refzero_list must be non-NULL @@ -53465,11 +54484,10 @@ DUK_LOCAL void duk__refcount_free_pending(duk_heap *heap) { duk_hobject_refcount_finalize_norz(heap, (duk_hobject *) curr); prev = DUK_HEAPHDR_GET_PREV(heap, curr); - DUK_ASSERT((prev == NULL && heap->refzero_list == curr) || \ - (prev != NULL && heap->refzero_list != curr)); + DUK_ASSERT((prev == NULL && heap->refzero_list == curr) || (prev != NULL && heap->refzero_list != curr)); /* prev->next is intentionally not updated and is garbage. */ - duk_free_hobject(heap, (duk_hobject *) curr); /* Invalidates 'curr'. */ + duk_free_hobject(heap, (duk_hobject *) curr); /* Invalidates 'curr'. */ curr = prev; } while (curr != NULL); @@ -53545,7 +54563,7 @@ DUK_LOCAL DUK_INLINE void duk__refcount_refzero_hobject(duk_heap *heap, duk_hobj return; } } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* No need to finalize, free object via refzero_list. */ @@ -53589,7 +54607,7 @@ DUK_LOCAL DUK_INLINE void duk__refcount_refzero_hobject(duk_heap *heap, duk_hobj DUK_INTERNAL DUK_ALWAYS_INLINE void duk_refzero_check_fast(duk_hthread *thr) { DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); - DUK_ASSERT(thr->heap->refzero_list == NULL); /* Processed to completion inline. */ + DUK_ASSERT(thr->heap->refzero_list == NULL); /* Processed to completion inline. */ if (DUK_UNLIKELY(thr->heap->finalize_list != NULL)) { duk_heap_process_finalize_list(thr->heap); @@ -53599,13 +54617,13 @@ DUK_INTERNAL DUK_ALWAYS_INLINE void duk_refzero_check_fast(duk_hthread *thr) { DUK_INTERNAL void duk_refzero_check_slow(duk_hthread *thr) { DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); - DUK_ASSERT(thr->heap->refzero_list == NULL); /* Processed to completion inline. */ + DUK_ASSERT(thr->heap->refzero_list == NULL); /* Processed to completion inline. */ if (DUK_UNLIKELY(thr->heap->finalize_list != NULL)) { duk_heap_process_finalize_list(thr->heap); } } -#endif /* DUK_USE_FINALIZER_SUPPORT */ +#endif /* DUK_USE_FINALIZER_SUPPORT */ /* * Refzero processing for duk_hstring. @@ -53665,7 +54683,8 @@ DUK_LOCAL DUK_INLINE void duk__refcount_refzero_hbuffer(duk_heap *heap, duk_hbuf * The suppress condition is important to performance. */ -#define DUK__RZ_SUPPRESS_ASSERT1() do { \ +#define DUK__RZ_SUPPRESS_ASSERT1() \ + do { \ DUK_ASSERT(thr != NULL); \ DUK_ASSERT(thr->heap != NULL); \ /* When mark-and-sweep runs, heap_thread must exist. */ \ @@ -53687,32 +54706,41 @@ DUK_LOCAL DUK_INLINE void duk__refcount_refzero_hbuffer(duk_heap *heap, duk_hbuf } while (0) #if defined(DUK_USE_DEBUGGER_SUPPORT) -#define DUK__RZ_SUPPRESS_ASSERT2() do { \ +#define DUK__RZ_SUPPRESS_ASSERT2() \ + do { \ /* When debugger is paused, ms_running is set. */ \ DUK_ASSERT(!DUK_HEAP_HAS_DEBUGGER_PAUSED(thr->heap) || thr->heap->ms_running != 0); \ } while (0) -#define DUK__RZ_SUPPRESS_COND() (heap->ms_running != 0) +#define DUK__RZ_SUPPRESS_COND() (heap->ms_running != 0) #else -#define DUK__RZ_SUPPRESS_ASSERT2() do { } while (0) -#define DUK__RZ_SUPPRESS_COND() (heap->ms_running != 0) -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#define DUK__RZ_SUPPRESS_ASSERT2() \ + do { \ + } while (0) +#define DUK__RZ_SUPPRESS_COND() (heap->ms_running != 0) +#endif /* DUK_USE_DEBUGGER_SUPPORT */ -#define DUK__RZ_SUPPRESS_CHECK() do { \ +#define DUK__RZ_SUPPRESS_CHECK() \ + do { \ DUK__RZ_SUPPRESS_ASSERT1(); \ DUK__RZ_SUPPRESS_ASSERT2(); \ if (DUK_UNLIKELY(DUK__RZ_SUPPRESS_COND())) { \ - DUK_DDD(DUK_DDDPRINT("refzero handling suppressed (not even queued) when mark-and-sweep running, object: %p", (void *) h)); \ + DUK_DDD( \ + DUK_DDDPRINT("refzero handling suppressed (not even queued) when mark-and-sweep running, object: %p", \ + (void *) h)); \ return; \ } \ } while (0) -#define DUK__RZ_STRING() do { \ +#define DUK__RZ_STRING() \ + do { \ duk__refcount_refzero_hstring(heap, (duk_hstring *) h); \ } while (0) -#define DUK__RZ_BUFFER() do { \ +#define DUK__RZ_BUFFER() \ + do { \ duk__refcount_refzero_hbuffer(heap, (duk_hbuffer *) h); \ } while (0) -#define DUK__RZ_OBJECT() do { \ +#define DUK__RZ_OBJECT() \ + do { \ duk__refcount_refzero_hobject(heap, (duk_hobject *) h, skip_free_pending); \ } while (0) @@ -53833,7 +54861,7 @@ DUK_INTERNAL void duk_tval_incref(duk_tval *tv) { DUK_ASSERT(DUK_HEAPHDR_HTYPE_VALID(h)); DUK_ASSERT_DISABLE(h->h_refcount >= 0); DUK_HEAPHDR_PREINC_REFCOUNT(h); - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(h) != 0); /* No wrapping. */ + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT(h) != 0); /* No wrapping. */ } } @@ -53876,9 +54904,10 @@ DUK_INTERNAL void duk_tval_decref_norz(duk_hthread *thr, duk_tval *tv) { #endif } } -#endif /* !DUK_USE_FAST_REFCOUNT_DEFAULT */ +#endif /* !DUK_USE_FAST_REFCOUNT_DEFAULT */ -#define DUK__DECREF_ASSERTS() do { \ +#define DUK__DECREF_ASSERTS() \ + do { \ DUK_ASSERT(thr != NULL); \ DUK_ASSERT(thr->heap != NULL); \ DUK_ASSERT(h != NULL); \ @@ -53886,14 +54915,16 @@ DUK_INTERNAL void duk_tval_decref_norz(duk_hthread *thr, duk_tval *tv) { DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) >= 1); \ } while (0) #if defined(DUK_USE_ROM_OBJECTS) -#define DUK__INCREF_SHARED() do { \ +#define DUK__INCREF_SHARED() \ + do { \ if (DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) h)) { \ return; \ } \ DUK_HEAPHDR_PREINC_REFCOUNT((duk_heaphdr *) h); \ - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) != 0); /* No wrapping. */ \ + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) != 0); /* No wrapping. */ \ } while (0) -#define DUK__DECREF_SHARED() do { \ +#define DUK__DECREF_SHARED() \ + do { \ if (DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) h)) { \ return; \ } \ @@ -53902,11 +54933,13 @@ DUK_INTERNAL void duk_tval_decref_norz(duk_hthread *thr, duk_tval *tv) { } \ } while (0) #else -#define DUK__INCREF_SHARED() do { \ +#define DUK__INCREF_SHARED() \ + do { \ DUK_HEAPHDR_PREINC_REFCOUNT((duk_heaphdr *) h); \ - DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) != 0); /* No wrapping. */ \ + DUK_ASSERT(DUK_HEAPHDR_GET_REFCOUNT((duk_heaphdr *) h) != 0); /* No wrapping. */ \ } while (0) -#define DUK__DECREF_SHARED() do { \ +#define DUK__DECREF_SHARED() \ + do { \ if (DUK_HEAPHDR_PREDEC_REFCOUNT((duk_heaphdr *) h) != 0) { \ return; \ } \ @@ -53940,9 +54973,9 @@ DUK_INTERNAL void duk_heaphdr_decref_norz(duk_hthread *thr, duk_heaphdr *h) { DUK__DECREF_SHARED(); duk_heaphdr_refzero_norz(thr, h); } -#endif /* !DUK_USE_FAST_REFCOUNT_DEFAULT */ +#endif /* !DUK_USE_FAST_REFCOUNT_DEFAULT */ -#if 0 /* Not needed. */ +#if 0 /* Not needed. */ DUK_INTERNAL void duk_hstring_decref(duk_hthread *thr, duk_hstring *h) { DUK__DECREF_ASSERTS(); DUK__DECREF_SHARED(); @@ -53975,11 +55008,11 @@ DUK_INTERNAL void duk_hobject_decref_norz(duk_hthread *thr, duk_hobject *h) { } #endif -#else /* DUK_USE_REFERENCE_COUNTING */ +#else /* DUK_USE_REFERENCE_COUNTING */ /* no refcounting */ -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ /* automatic undefs */ #undef DUK__DECREF_ASSERTS @@ -54017,8 +55050,8 @@ DUK_INTERNAL void duk_heap_strcache_string_remove(duk_heap *heap, duk_hstring *h for (i = 0; i < DUK_HEAP_STRCACHE_SIZE; i++) { duk_strcache_entry *c = heap->strcache + i; if (c->h == h) { - DUK_DD(DUK_DDPRINT("deleting weak strcache reference to hstring %p from heap %p", - (void *) h, (void *) heap)); + DUK_DD( + DUK_DDPRINT("deleting weak strcache reference to hstring %p from heap %p", (void *) h, (void *) heap)); c->h = NULL; /* XXX: the string shouldn't appear twice, but we now loop to the @@ -54128,7 +55161,8 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t */ DUK_DDD(DUK_DDDPRINT("non-ascii string %p, char_offset=%ld, clen=%ld, blen=%ld", - (void *) h, (long) char_offset, + (void *) h, + (long) char_offset, (long) DUK_HSTRING_GET_CHARLEN(h), (long) DUK_HSTRING_GET_BYTELEN(h))); @@ -54142,7 +55176,10 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t for (i = 0; i < DUK_HEAP_STRCACHE_SIZE; i++) { duk_strcache_entry *c = heap->strcache + i; DUK_DDD(DUK_DDDPRINT(" [%ld] -> h=%p, cidx=%ld, bidx=%ld", - (long) i, (void *) c->h, (long) c->cidx, (long) c->bidx)); + (long) i, + (void *) c->h, + (long) c->cidx, + (long) c->bidx)); } #endif @@ -54166,7 +55203,8 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t DUK_ASSERT(DUK_HSTRING_GET_CHARLEN(h) >= char_offset); dist_start = char_offset; dist_end = char_length - char_offset; - dist_sce = 0; DUK_UNREF(dist_sce); /* initialize for debug prints, needed if sce==NULL */ + dist_sce = 0; + DUK_UNREF(dist_sce); /* initialize for debug prints, needed if sce==NULL */ p_start = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h); p_end = (const duk_uint8_t *) (p_start + DUK_HSTRING_GET_BYTELEN(h)); @@ -54179,14 +55217,15 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t DUK_DDD(DUK_DDDPRINT("non-ascii string, use_cache=%ld, sce=%p:%ld:%ld, " "dist_start=%ld, dist_end=%ld, dist_sce=%ld => " "scan forwards from sce", - (long) use_cache, (void *) (sce ? sce->h : NULL), + (long) use_cache, + (void *) (sce ? sce->h : NULL), (sce ? (long) sce->cidx : (long) -1), (sce ? (long) sce->bidx : (long) -1), - (long) dist_start, (long) dist_end, (long) dist_sce)); + (long) dist_start, + (long) dist_end, + (long) dist_sce)); - p_found = duk__scan_forwards(p_start + sce->bidx, - p_end, - dist_sce); + p_found = duk__scan_forwards(p_start + sce->bidx, p_end, dist_sce); goto scan_done; } } else { @@ -54195,14 +55234,15 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t DUK_DDD(DUK_DDDPRINT("non-ascii string, use_cache=%ld, sce=%p:%ld:%ld, " "dist_start=%ld, dist_end=%ld, dist_sce=%ld => " "scan backwards from sce", - (long) use_cache, (void *) (sce ? sce->h : NULL), + (long) use_cache, + (void *) (sce ? sce->h : NULL), (sce ? (long) sce->cidx : (long) -1), (sce ? (long) sce->bidx : (long) -1), - (long) dist_start, (long) dist_end, (long) dist_sce)); + (long) dist_start, + (long) dist_end, + (long) dist_sce)); - p_found = duk__scan_backwards(p_start + sce->bidx, - p_start, - dist_sce); + p_found = duk__scan_backwards(p_start + sce->bidx, p_start, dist_sce); goto scan_done; } } @@ -54214,29 +55254,31 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t DUK_DDD(DUK_DDDPRINT("non-ascii string, use_cache=%ld, sce=%p:%ld:%ld, " "dist_start=%ld, dist_end=%ld, dist_sce=%ld => " "scan forwards from string start", - (long) use_cache, (void *) (sce ? sce->h : NULL), + (long) use_cache, + (void *) (sce ? sce->h : NULL), (sce ? (long) sce->cidx : (long) -1), (sce ? (long) sce->bidx : (long) -1), - (long) dist_start, (long) dist_end, (long) dist_sce)); + (long) dist_start, + (long) dist_end, + (long) dist_sce)); - p_found = duk__scan_forwards(p_start, - p_end, - dist_start); + p_found = duk__scan_forwards(p_start, p_end, dist_start); } else { DUK_DDD(DUK_DDDPRINT("non-ascii string, use_cache=%ld, sce=%p:%ld:%ld, " "dist_start=%ld, dist_end=%ld, dist_sce=%ld => " "scan backwards from string end", - (long) use_cache, (void *) (sce ? sce->h : NULL), + (long) use_cache, + (void *) (sce ? sce->h : NULL), (sce ? (long) sce->cidx : (long) -1), (sce ? (long) sce->bidx : (long) -1), - (long) dist_start, (long) dist_end, (long) dist_sce)); + (long) dist_start, + (long) dist_end, + (long) dist_sce)); - p_found = duk__scan_backwards(p_end, - p_start, - dist_end); + p_found = duk__scan_backwards(p_end, p_start, dist_end); } - scan_done: +scan_done: if (DUK_UNLIKELY(p_found == NULL)) { /* Scan error: this shouldn't normally happen; it could happen if @@ -54247,11 +55289,10 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t } DUK_ASSERT(p_found >= p_start); - DUK_ASSERT(p_found <= p_end); /* may be equal */ + DUK_ASSERT(p_found <= p_end); /* may be equal */ byte_offset = (duk_uint32_t) (p_found - p_start); - DUK_DDD(DUK_DDDPRINT("-> string %p, cidx %ld -> bidx %ld", - (void *) h, (long) char_offset, (long) byte_offset)); + DUK_DDD(DUK_DDDPRINT("-> string %p, cidx %ld -> bidx %ld", (void *) h, (long) char_offset, (long) byte_offset)); /* * Update cache entry (allocating if necessary), and move the @@ -54261,7 +55302,7 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t if (use_cache) { /* update entry, allocating if necessary */ if (!sce) { - sce = heap->strcache + DUK_HEAP_STRCACHE_SIZE - 1; /* take last entry */ + sce = heap->strcache + DUK_HEAP_STRCACHE_SIZE - 1; /* take last entry */ sce->h = h; } DUK_ASSERT(sce != NULL); @@ -54291,14 +55332,17 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t for (i = 0; i < DUK_HEAP_STRCACHE_SIZE; i++) { duk_strcache_entry *c = heap->strcache + i; DUK_DDD(DUK_DDDPRINT(" [%ld] -> h=%p, cidx=%ld, bidx=%ld", - (long) i, (void *) c->h, (long) c->cidx, (long) c->bidx)); + (long) i, + (void *) c->h, + (long) c->cidx, + (long) c->bidx)); } #endif } return byte_offset; - scan_error: +scan_error: DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return 0;); } @@ -54317,16 +55361,16 @@ DUK_INTERNAL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *t #endif #if defined(DUK_USE_STRTAB_PTRCOMP) -#define DUK__HEAPPTR_ENC16(heap,ptr) DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (ptr)) -#define DUK__HEAPPTR_DEC16(heap,val) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (val)) -#define DUK__GET_STRTABLE(heap) ((heap)->strtable16) +#define DUK__HEAPPTR_ENC16(heap, ptr) DUK_USE_HEAPPTR_ENC16((heap)->heap_udata, (ptr)) +#define DUK__HEAPPTR_DEC16(heap, val) DUK_USE_HEAPPTR_DEC16((heap)->heap_udata, (val)) +#define DUK__GET_STRTABLE(heap) ((heap)->strtable16) #else -#define DUK__HEAPPTR_ENC16(heap,ptr) (ptr) -#define DUK__HEAPPTR_DEC16(heap,val) (val) -#define DUK__GET_STRTABLE(heap) ((heap)->strtable) +#define DUK__HEAPPTR_ENC16(heap, ptr) (ptr) +#define DUK__HEAPPTR_DEC16(heap, val) (val) +#define DUK__GET_STRTABLE(heap) ((heap)->strtable) #endif -#define DUK__STRTAB_U32_MAX_STRLEN 10 /* 4'294'967'295 */ +#define DUK__STRTAB_U32_MAX_STRLEN 10 /* 4'294'967'295 */ /* * Debug dump stringtable. @@ -54345,7 +55389,7 @@ DUK_INTERNAL void duk_heap_strtable_dump(duk_heap *heap) { duk_size_t count_chain; duk_size_t count_chain_min = DUK_SIZE_MAX; duk_size_t count_chain_max = 0; - duk_size_t count_len[8]; /* chain lengths from 0 to 7 */ + duk_size_t count_len[8]; /* chain lengths from 0 to 7 */ if (heap == NULL) { DUK_D(DUK_DPRINT("string table, heap=NULL")); @@ -54376,15 +55420,21 @@ DUK_INTERNAL void duk_heap_strtable_dump(duk_heap *heap) { DUK_D(DUK_DPRINT("string table, strtab=%p, count=%lu, chain min=%lu max=%lu avg=%lf: " "counts: %lu %lu %lu %lu %lu %lu %lu %lu ...", - (void *) heap->strtable, (unsigned long) count_total, - (unsigned long) count_chain_min, (unsigned long) count_chain_max, + (void *) heap->strtable, + (unsigned long) count_total, + (unsigned long) count_chain_min, + (unsigned long) count_chain_max, (double) count_total / (double) heap->st_size, - (unsigned long) count_len[0], (unsigned long) count_len[1], - (unsigned long) count_len[2], (unsigned long) count_len[3], - (unsigned long) count_len[4], (unsigned long) count_len[5], - (unsigned long) count_len[6], (unsigned long) count_len[7])); + (unsigned long) count_len[0], + (unsigned long) count_len[1], + (unsigned long) count_len[2], + (unsigned long) count_len[3], + (unsigned long) count_len[4], + (unsigned long) count_len[5], + (unsigned long) count_len[6], + (unsigned long) count_len[7])); } -#endif /* DUK_USE_DEBUG */ +#endif /* DUK_USE_DEBUG */ /* * Assertion helper to ensure strtable is populated correctly. @@ -54425,7 +55475,7 @@ DUK_LOCAL void duk__strtable_assert_checks(duk_heap *heap) { DUK_ASSERT(count == (duk_size_t) heap->st_count); #endif } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* * Allocate and initialize a duk_hstring. @@ -54476,16 +55526,16 @@ DUK_LOCAL duk_hstring *duk__strtable_alloc_hstring(duk_heap *heap, #endif DUK_HEAPHDR_SET_TYPE_AND_FLAGS(&res->hdr, DUK_HTYPE_STRING, DUK_HSTRING_FLAG_EXTDATA); - DUK_ASSERT(extdata[blen] == 0); /* Application responsibility. */ + DUK_ASSERT(extdata[blen] == 0); /* Application responsibility. */ data = extdata; ((duk_hstring_external *) res)->extdata = extdata; } else -#endif /* DUK_USE_HSTRING_EXTDATA && DUK_USE_EXTSTR_INTERN_CHECK */ +#endif /* DUK_USE_HSTRING_EXTDATA && DUK_USE_EXTSTR_INTERN_CHECK */ { duk_uint8_t *data_tmp; /* NUL terminate for convenient C access */ - DUK_ASSERT(sizeof(duk_hstring) + blen + 1 > blen); /* No wrap, limits ensure. */ + DUK_ASSERT(sizeof(duk_hstring) + blen + 1 > blen); /* No wrap, limits ensure. */ res = (duk_hstring *) DUK_ALLOC(heap, sizeof(duk_hstring) + blen + 1); if (DUK_UNLIKELY(res == NULL)) { goto alloc_error; @@ -54544,7 +55594,7 @@ DUK_LOCAL duk_hstring *duk__strtable_alloc_hstring(duk_heap *heap, #if defined(DUK_USE_HSTRING_LAZY_CLEN) /* Charlen initialized to 0, updated on-the-fly. */ #else - duk_hstring_init_charlen(res); /* Also sets ASCII flag. */ + duk_hstring_init_charlen(res); /* Also sets ASCII flag. */ #endif } @@ -54557,7 +55607,7 @@ DUK_LOCAL duk_hstring *duk__strtable_alloc_hstring(duk_heap *heap, DUK_ASSERT(res != NULL); return res; - alloc_error: +alloc_error: return NULL; } @@ -54586,13 +55636,13 @@ DUK_LOCAL void duk__strtable_grow_inplace(duk_heap *heap) { DUK_ASSERT(heap != NULL); DUK_ASSERT(heap->st_resizing == 1); DUK_ASSERT(heap->st_size >= 2); - DUK_ASSERT((heap->st_size & (heap->st_size - 1)) == 0); /* 2^N */ + DUK_ASSERT((heap->st_size & (heap->st_size - 1)) == 0); /* 2^N */ DUK_ASSERT(DUK__GET_STRTABLE(heap) != NULL); DUK_STATS_INC(heap, stats_strtab_resize_grow); new_st_size = heap->st_size << 1U; - DUK_ASSERT(new_st_size > heap->st_size); /* No overflow. */ + DUK_ASSERT(new_st_size > heap->st_size); /* No overflow. */ /* Reallocate the strtable first and then work in-place to rehash * strings. We don't need an indirect allocation here: even if GC @@ -54676,7 +55726,7 @@ DUK_LOCAL void duk__strtable_grow_inplace(duk_heap *heap) { duk__strtable_assert_checks(heap); #endif } -#endif /* DUK__STRTAB_RESIZE_CHECK */ +#endif /* DUK__STRTAB_RESIZE_CHECK */ /* * Shrink strtable allocation in-place. @@ -54704,7 +55754,7 @@ DUK_LOCAL void duk__strtable_shrink_inplace(duk_heap *heap) { DUK_ASSERT(heap != NULL); DUK_ASSERT(heap->st_resizing == 1); DUK_ASSERT(heap->st_size >= 2); - DUK_ASSERT((heap->st_size & (heap->st_size - 1)) == 0); /* 2^N */ + DUK_ASSERT((heap->st_size & (heap->st_size - 1)) == 0); /* 2^N */ DUK_ASSERT(DUK__GET_STRTABLE(heap) != NULL); DUK_STATS_INC(heap, stats_strtab_resize_shrink); @@ -54762,7 +55812,7 @@ DUK_LOCAL void duk__strtable_shrink_inplace(duk_heap *heap) { duk__strtable_assert_checks(heap); #endif } -#endif /* DUK__STRTAB_RESIZE_CHECK */ +#endif /* DUK__STRTAB_RESIZE_CHECK */ /* * Grow/shrink check. @@ -54770,7 +55820,7 @@ DUK_LOCAL void duk__strtable_shrink_inplace(duk_heap *heap) { #if defined(DUK__STRTAB_RESIZE_CHECK) DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap *heap) { - duk_uint32_t load_factor; /* fixed point */ + duk_uint32_t load_factor; /* fixed point */ DUK_ASSERT(heap != NULL); #if defined(DUK_USE_STRTAB_PTRCOMP) @@ -54794,7 +55844,8 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap *heap) load_factor = heap->st_count / (heap->st_size >> 4U); DUK_DD(DUK_DDPRINT("resize check string table: size=%lu, count=%lu, load_factor=%lu (fixed point .4; float %lf)", - (unsigned long) heap->st_size, (unsigned long) heap->st_count, + (unsigned long) heap->st_size, + (unsigned long) heap->st_count, (unsigned long) load_factor, (double) heap->st_count / (double) heap->st_size)); @@ -54802,7 +55853,9 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap *heap) if (heap->st_size >= DUK_USE_STRTAB_MAXSIZE) { DUK_DD(DUK_DDPRINT("want to grow strtable (based on load factor) but already maximum size")); } else { - DUK_D(DUK_DPRINT("grow string table: %lu -> %lu", (unsigned long) heap->st_size, (unsigned long) heap->st_size * 2)); + DUK_D(DUK_DPRINT("grow string table: %lu -> %lu", + (unsigned long) heap->st_size, + (unsigned long) heap->st_size * 2)); #if defined(DUK_USE_DEBUG) duk_heap_strtable_dump(heap); #endif @@ -54812,7 +55865,9 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap *heap) if (heap->st_size <= DUK_USE_STRTAB_MINSIZE) { DUK_DD(DUK_DDPRINT("want to shrink strtable (based on load factor) but already minimum size")); } else { - DUK_D(DUK_DPRINT("shrink string table: %lu -> %lu", (unsigned long) heap->st_size, (unsigned long) heap->st_size / 2)); + DUK_D(DUK_DPRINT("shrink string table: %lu -> %lu", + (unsigned long) heap->st_size, + (unsigned long) heap->st_size / 2)); #if defined(DUK_USE_DEBUG) duk_heap_strtable_dump(heap); #endif @@ -54824,7 +55879,7 @@ DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap *heap) heap->st_resizing = 0; } -#endif /* DUK__STRTAB_RESIZE_CHECK */ +#endif /* DUK__STRTAB_RESIZE_CHECK */ /* * Torture grow/shrink: unconditionally grow and shrink back. @@ -54848,7 +55903,7 @@ DUK_LOCAL void duk__strtable_resize_torture(duk_heap *heap) { } heap->st_resizing = 0; } -#endif /* DUK_USE_STRTAB_TORTURE && DUK__STRTAB_RESIZE_CHECK */ +#endif /* DUK_USE_STRTAB_TORTURE && DUK__STRTAB_RESIZE_CHECK */ /* * Raw intern; string already checked not to be present. @@ -54864,8 +55919,12 @@ DUK_LOCAL duk_hstring *duk__strtable_do_intern(duk_heap *heap, const duk_uint8_t #endif DUK_DDD(DUK_DDDPRINT("do_intern: heap=%p, str=%p, blen=%lu, strhash=%lx, st_size=%lu, st_count=%lu, load=%lf", - (void *) heap, (const void *) str, (unsigned long) blen, (unsigned long) strhash, - (unsigned long) heap->st_size, (unsigned long) heap->st_count, + (void *) heap, + (const void *) str, + (unsigned long) blen, + (unsigned long) strhash, + (unsigned long) heap->st_size, + (unsigned long) heap->st_count, (double) heap->st_count / (double) heap->st_size)); DUK_ASSERT(heap != NULL); @@ -54881,7 +55940,7 @@ DUK_LOCAL duk_hstring *duk__strtable_do_intern(duk_heap *heap, const duk_uint8_t */ heap->pf_prevent_count++; - DUK_ASSERT(heap->pf_prevent_count != 0); /* Wrap. */ + DUK_ASSERT(heap->pf_prevent_count != 0); /* Wrap. */ #if defined(DUK_USE_STRTAB_TORTURE) && defined(DUK__STRTAB_RESIZE_CHECK) duk__strtable_resize_torture(heap); @@ -54908,7 +55967,8 @@ DUK_LOCAL duk_hstring *duk__strtable_do_intern(duk_heap *heap, const duk_uint8_t /* External string check (low memory optimization). */ #if defined(DUK_USE_HSTRING_EXTDATA) && defined(DUK_USE_EXTSTR_INTERN_CHECK) - extdata = (const duk_uint8_t *) DUK_USE_EXTSTR_INTERN_CHECK(heap->heap_udata, (void *) DUK_LOSE_CONST(str), (duk_size_t) blen); + extdata = + (const duk_uint8_t *) DUK_USE_EXTSTR_INTERN_CHECK(heap->heap_udata, (void *) DUK_LOSE_CONST(str), (duk_size_t) blen); #else extdata = (const duk_uint8_t *) NULL; #endif @@ -54946,7 +56006,7 @@ DUK_LOCAL duk_hstring *duk__strtable_do_intern(duk_heap *heap, const duk_uint8_t #else slot = heap->strtable + (strhash & heap->st_mask); #endif - DUK_ASSERT(res->hdr.h_next == NULL); /* This is the case now, but unnecessary zeroing/NULLing. */ + DUK_ASSERT(res->hdr.h_next == NULL); /* This is the case now, but unnecessary zeroing/NULLing. */ res->hdr.h_next = DUK__HEAPPTR_DEC16(heap, *slot); *slot = DUK__HEAPPTR_ENC16(heap, res); @@ -54993,11 +56053,12 @@ DUK_LOCAL duk_hstring *duk__strtab_romstring_lookup(duk_heap *heap, const duk_ui curr = (duk_hstring *) DUK_LOSE_CONST(duk_rom_strings_lookup[lookup_hash]); while (curr != NULL) { /* Unsafe memcmp() because for zero blen, str may be NULL. */ - if (strhash == DUK_HSTRING_GET_HASH(curr) && - blen == DUK_HSTRING_GET_BYTELEN(curr) && + if (strhash == DUK_HSTRING_GET_HASH(curr) && blen == DUK_HSTRING_GET_BYTELEN(curr) && duk_memcmp_unsafe((const void *) str, (const void *) DUK_HSTRING_GET_DATA(curr), blen) == 0) { DUK_DDD(DUK_DDDPRINT("intern check: rom string: %!O, computed hash 0x%08lx, rom hash 0x%08lx", - curr, (unsigned long) strhash, (unsigned long) DUK_HSTRING_GET_HASH(curr))); + curr, + (unsigned long) strhash, + (unsigned long) DUK_HSTRING_GET_HASH(curr))); return curr; } curr = curr->hdr.h_next; @@ -55005,7 +56066,7 @@ DUK_LOCAL duk_hstring *duk__strtab_romstring_lookup(duk_heap *heap, const duk_ui return NULL; } -#endif /* DUK_USE_ROM_STRINGS */ +#endif /* DUK_USE_ROM_STRINGS */ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern(duk_heap *heap, const duk_uint8_t *str, duk_uint32_t blen) { duk_uint32_t strhash; @@ -55018,7 +56079,7 @@ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern(duk_heap *heap, const duk_uin /* XXX: maybe just require 'str != NULL' even for zero size? */ DUK_ASSERT(heap != NULL); DUK_ASSERT(blen == 0 || str != NULL); - DUK_ASSERT(blen <= DUK_HSTRING_MAX_BYTELEN); /* Caller is responsible for ensuring this. */ + DUK_ASSERT(blen <= DUK_HSTRING_MAX_BYTELEN); /* Caller is responsible for ensuring this. */ strhash = duk_heap_hashstring(heap, str, (duk_size_t) blen); /* String table lookup. */ @@ -55032,8 +56093,7 @@ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern(duk_heap *heap, const duk_uin h = heap->strtable[strhash & heap->st_mask]; #endif while (h != NULL) { - if (DUK_HSTRING_GET_HASH(h) == strhash && - DUK_HSTRING_GET_BYTELEN(h) == blen && + if (DUK_HSTRING_GET_HASH(h) == strhash && DUK_HSTRING_GET_BYTELEN(h) == blen && duk_memcmp_unsafe((const void *) str, (const void *) DUK_HSTRING_GET_DATA(h), (size_t) blen) == 0) { /* Found existing entry. */ DUK_STATS_INC(heap, stats_strtab_intern_hit); @@ -55059,7 +56119,7 @@ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern(duk_heap *heap, const duk_uin DUK_STATS_INC(heap, stats_strtab_intern_miss); h = duk__strtable_do_intern(heap, str, blen, strhash); - return h; /* may be NULL */ + return h; /* may be NULL */ } /* @@ -55082,7 +56142,7 @@ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern_u32(duk_heap *heap, duk_uint3 p--; *p = duk_lc_digits[val % 10]; val = val / 10; - } while (val != 0); /* For val == 0, emit exactly one '0'. */ + } while (val != 0); /* For val == 0, emit exactly one '0'. */ DUK_ASSERT(p >= buf); return duk_heap_strtable_intern(heap, (const duk_uint8_t *) p, (duk_uint32_t) ((buf + sizeof(buf)) - p)); @@ -55120,7 +56180,7 @@ DUK_LOCAL duk_uint_t duk__strtable_litcache_key(const duk_uint8_t *str, duk_uint DUK_ASSERT(DUK_IS_POWER_OF_TWO((duk_uint_t) DUK_USE_LITCACHE_SIZE)); key = (duk_uintptr_t) blen ^ (duk_uintptr_t) str; - key &= (duk_uintptr_t) (DUK_USE_LITCACHE_SIZE - 1); /* Assumes size is power of 2. */ + key &= (duk_uintptr_t) (DUK_USE_LITCACHE_SIZE - 1); /* Assumes size is power of 2. */ /* Due to masking, cast is in 32-bit range. */ DUK_ASSERT(key <= DUK_UINT_MAX); return (duk_uint_t) key; @@ -55136,7 +56196,9 @@ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern_literal_checked(duk_hthread * ent = thr->heap->litcache + key; if (ent->addr == str) { DUK_DD(DUK_DDPRINT("intern check for cached, pinned literal: str=%p, blen=%ld -> duk_hstring %!O", - (const void *) str, (long) blen, (duk_heaphdr *) ent->h)); + (const void *) str, + (long) blen, + (duk_heaphdr *) ent->h)); DUK_ASSERT(ent->h != NULL); DUK_ASSERT(DUK_HSTRING_HAS_PINNED_LITERAL(ent->h)); DUK_STATS_INC(thr->heap, stats_strtab_litcache_hit); @@ -55166,7 +56228,7 @@ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern_literal_checked(duk_hthread * return h; } -#endif /* DUK_USE_LITCACHE_SIZE */ +#endif /* DUK_USE_LITCACHE_SIZE */ DUK_INTERNAL duk_hstring *duk_heap_strtable_intern_u32_checked(duk_hthread *thr, duk_uint32_t val) { duk_hstring *res; @@ -55201,7 +56263,8 @@ DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap *heap, duk_hstring *h) { duk_hstring *prev; DUK_DDD(DUK_DDDPRINT("remove: heap=%p, h=%p, blen=%lu, strhash=%lx", - (void *) heap, (void *) h, + (void *) heap, + (void *) h, (unsigned long) (h != NULL ? DUK_HSTRING_GET_BYTELEN(h) : 0), (unsigned long) (h != NULL ? DUK_HSTRING_GET_HASH(h) : 0))); @@ -55219,13 +56282,13 @@ DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap *heap, duk_hstring *h) { slot = heap->strtable + (DUK_HSTRING_GET_HASH(h) & heap->st_mask); #endif other = DUK__HEAPPTR_DEC16(heap, *slot); - DUK_ASSERT(other != NULL); /* At least argument string is in the chain. */ + DUK_ASSERT(other != NULL); /* At least argument string is in the chain. */ prev = NULL; while (other != h) { prev = other; other = other->hdr.h_next; - DUK_ASSERT(other != NULL); /* We'll eventually find 'h'. */ + DUK_ASSERT(other != NULL); /* We'll eventually find 'h'. */ } if (prev != NULL) { /* Middle of list. */ @@ -55239,7 +56302,7 @@ DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap *heap, duk_hstring *h) { * intern will do one. */ } -#endif /* DUK_USE_REFERENCE_COUNTING */ +#endif /* DUK_USE_REFERENCE_COUNTING */ /* Unlink with a 'prev' pointer. */ DUK_INTERNAL void duk_heap_strtable_unlink_prev(duk_heap *heap, duk_hstring *h, duk_hstring *prev) { @@ -55250,7 +56313,9 @@ DUK_INTERNAL void duk_heap_strtable_unlink_prev(duk_heap *heap, duk_hstring *h, #endif DUK_DDD(DUK_DDDPRINT("remove: heap=%p, prev=%p, h=%p, blen=%lu, strhash=%lx", - (void *) heap, (void *) prev, (void *) h, + (void *) heap, + (void *) prev, + (void *) h, (unsigned long) (h != NULL ? DUK_HSTRING_GET_BYTELEN(h) : 0), (unsigned long) (h != NULL ? DUK_HSTRING_GET_HASH(h) : 0))); @@ -55428,7 +56493,7 @@ DUK_INTERNAL void duk_heaphdr_assert_valid_subclassed(duk_heaphdr *h) { } } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* * Hobject allocation. * @@ -55452,7 +56517,7 @@ DUK_LOCAL void duk__init_object_parts(duk_heap *heap, duk_uint_t hobject_flags, /* Zeroed by caller. */ obj->hdr.h_flags = hobject_flags | DUK_HTYPE_OBJECT; - DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(&obj->hdr) == DUK_HTYPE_OBJECT); /* Assume zero shift. */ + DUK_ASSERT(DUK_HEAPHDR_GET_TYPE(&obj->hdr) == DUK_HTYPE_OBJECT); /* Assume zero shift. */ #if defined(DUK_USE_EXPLICIT_NULL_INIT) DUK_HOBJECT_SET_PROTOTYPE(heap, obj, NULL); @@ -55588,7 +56653,7 @@ DUK_INTERNAL duk_hbufobj *duk_hbufobj_alloc(duk_hthread *thr, duk_uint_t hobject DUK_HBUFOBJ_ASSERT_VALID(res); return res; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* Allocate a new thread. * @@ -55710,20 +56775,18 @@ DUK_INTERNAL duk_hproxy *duk_hproxy_alloc(duk_hthread *thr, duk_uint_t hobject_f DUK_INTERNAL void duk_hobject_assert_valid(duk_hobject *h) { DUK_ASSERT(h != NULL); - DUK_ASSERT(!DUK_HOBJECT_IS_CALLABLE(h) || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_FUNCTION); - DUK_ASSERT(!DUK_HOBJECT_IS_BUFOBJ(h) || - (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAYBUFFER || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_DATAVIEW || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_INT8ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT8ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_INT16ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT16ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_INT32ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT32ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_FLOAT32ARRAY || - DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_FLOAT64ARRAY)); + DUK_ASSERT(!DUK_HOBJECT_IS_CALLABLE(h) || DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_FUNCTION); + DUK_ASSERT(!DUK_HOBJECT_IS_BUFOBJ(h) || (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAYBUFFER || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_DATAVIEW || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_INT8ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT8ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT8CLAMPEDARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_INT16ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT16ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_INT32ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_UINT32ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_FLOAT32ARRAY || + DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_FLOAT64ARRAY)); /* Object is an Array <=> object has exotic array behavior */ DUK_ASSERT((DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY && DUK_HOBJECT_HAS_EXOTIC_ARRAY(h)) || (DUK_HOBJECT_GET_CLASS_NUMBER(h) != DUK_HOBJECT_CLASS_ARRAY && !DUK_HOBJECT_HAS_EXOTIC_ARRAY(h))); @@ -55739,8 +56802,7 @@ DUK_INTERNAL void duk_hboundfunc_assert_valid(duk_hboundfunc *h) { DUK_ASSERT(h != NULL); DUK_ASSERT(DUK_HOBJECT_IS_BOUNDFUNC((duk_hobject *) h)); DUK_ASSERT(DUK_TVAL_IS_LIGHTFUNC(&h->target) || - (DUK_TVAL_IS_OBJECT(&h->target) && - DUK_HOBJECT_IS_CALLABLE(DUK_TVAL_GET_OBJECT(&h->target)))); + (DUK_TVAL_IS_OBJECT(&h->target) && DUK_HOBJECT_IS_CALLABLE(DUK_TVAL_GET_OBJECT(&h->target)))); DUK_ASSERT(!DUK_TVAL_IS_UNUSED(&h->this_binding)); DUK_ASSERT(h->nargs == 0 || h->args != NULL); } @@ -55772,7 +56834,7 @@ DUK_INTERNAL void duk_hbufobj_assert_valid(duk_hbufobj *h) { DUK_ASSERT(h->offset + h->length >= h->offset); } } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ DUK_INTERNAL void duk_hcompfunc_assert_valid(duk_hcompfunc *h) { DUK_ASSERT(h != NULL); @@ -55826,7 +56888,7 @@ DUK_INTERNAL void duk_ctx_assert_valid(duk_hthread *thr) { DUK_ASSERT(thr->valstack_alloc_end >= thr->valstack_end); } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* * Object enumeration support. * @@ -55853,7 +56915,7 @@ DUK_INTERNAL void duk_ctx_assert_valid(duk_hthread *thr) { /* First enumerated key index in enumerator object, must match exactly the * number of control properties inserted to the enumerator. */ -#define DUK__ENUM_START_INDEX 2 +#define DUK__ENUM_START_INDEX 2 /* Current implementation suffices for ES2015 for now because there's no symbol * sorting, so commented out for now. @@ -55922,7 +56984,7 @@ DUK_LOCAL duk_bool_t duk__sort_compare_es6(duk_hstring *a, duk_hstring *b, duk__ DUK_ASSERT(a != NULL); DUK_ASSERT(b != NULL); - DUK_UNREF(b); /* Not actually needed now, val_b suffices. */ + DUK_UNREF(b); /* Not actually needed now, val_b suffices. */ val_a = duk__hstring_sort_key(a); @@ -55943,7 +57005,7 @@ DUK_LOCAL void duk__sort_enum_keys_es6(duk_hthread *thr, duk_hobject *h_obj, duk DUK_UNREF(thr); if (idx_end <= idx_start + 1) { - return; /* Zero or one element(s). */ + return; /* Zero or one element(s). */ } keys = DUK_HOBJECT_E_GET_KEY_BASE(thr->heap, h_obj); @@ -55961,7 +57023,7 @@ DUK_LOCAL void duk__sort_enum_keys_es6(duk_hthread *thr, duk_hobject *h_obj, duk * (and optimized for) case. */ - val_curr = duk__hstring_sort_key(h_curr); /* Remains same during scanning. */ + val_curr = duk__hstring_sort_key(h_curr); /* Remains same during scanning. */ for (idx_insert = idx - 1; idx_insert >= idx_start; idx_insert--) { duk_hstring *h_insert; h_insert = keys[idx_insert]; @@ -56034,7 +57096,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint duk_hobject *h_proxy_handler; duk_hobject *h_trap_result; #endif - duk_uint_fast32_t i, len; /* used for array, stack, and entry indices */ + duk_uint_fast32_t i, len; /* used for array, stack, and entry indices */ duk_uint_fast32_t sort_start_index; DUK_ASSERT(thr != NULL); @@ -56053,11 +57115,11 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint * real object to check against. */ duk_push_hobject(thr, enum_target); - duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_INT_TARGET); /* Target is bare, plain put OK. */ + duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_INT_TARGET); /* Target is bare, plain put OK. */ /* Initialize index so that we skip internal control keys. */ duk_push_int(thr, DUK__ENUM_START_INDEX); - duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_INT_NEXT); /* Target is bare, plain put OK. */ + duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_INT_NEXT); /* Target is bare, plain put OK. */ /* * Proxy object handling @@ -56067,9 +57129,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint if (DUK_LIKELY((enum_flags & DUK_ENUM_NO_PROXY_BEHAVIOR) != 0)) { goto skip_proxy; } - if (DUK_LIKELY(!duk_hobject_proxy_check(enum_target, - &h_proxy_target, - &h_proxy_handler))) { + if (DUK_LIKELY(!duk_hobject_proxy_check(enum_target, &h_proxy_target, &h_proxy_handler))) { goto skip_proxy; } @@ -56090,17 +57150,17 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint DUK_DDD(DUK_DDDPRINT("h_proxy_target=%!O", (duk_heaphdr *) h_proxy_target)); enum_target = h_proxy_target; - duk_push_hobject(thr, enum_target); /* -> [ ... enum_target res handler undefined target ] */ - duk_put_prop_stridx_short(thr, -4, DUK_STRIDX_INT_TARGET); /* Target is bare, plain put OK. */ + duk_push_hobject(thr, enum_target); /* -> [ ... enum_target res handler undefined target ] */ + duk_put_prop_stridx_short(thr, -4, DUK_STRIDX_INT_TARGET); /* Target is bare, plain put OK. */ - duk_pop_2(thr); /* -> [ ... enum_target res ] */ + duk_pop_2(thr); /* -> [ ... enum_target res ] */ goto skip_proxy; } /* [ ... enum_target res handler trap ] */ duk_insert(thr, -2); - duk_push_hobject(thr, h_proxy_target); /* -> [ ... enum_target res trap handler target ] */ - duk_call_method(thr, 1 /*nargs*/); /* -> [ ... enum_target res trap_result ] */ + duk_push_hobject(thr, h_proxy_target); /* -> [ ... enum_target res trap handler target ] */ + duk_call_method(thr, 1 /*nargs*/); /* -> [ ... enum_target res trap_result ] */ h_trap_result = duk_require_hobject(thr, -1); DUK_UNREF(h_trap_result); @@ -56113,7 +57173,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint len = (duk_uint_fast32_t) duk_get_length(thr, -1); for (i = 0; i < len; i++) { (void) duk_get_prop_index(thr, -1, (duk_uarridx_t) i); - DUK_ASSERT(duk_is_string(thr, -1)); /* postprocess cleaned up */ + DUK_ASSERT(duk_is_string(thr, -1)); /* postprocess cleaned up */ /* [ ... enum_target res trap_result keys_array val ] */ duk_push_true(thr); /* [ ... enum_target res trap_result keys_array val true ] */ @@ -56134,8 +57194,8 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint DUK_DDD(DUK_DDDPRINT("proxy enumeration, final res: %!O", (duk_heaphdr *) res)); goto compact_and_return; - skip_proxy: -#endif /* DUK_USE_ES6_PROXY */ +skip_proxy: +#endif /* DUK_USE_ES6_PROXY */ curr = enum_target; sort_start_index = DUK__ENUM_START_INDEX; @@ -56186,7 +57246,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint if (DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(curr)) { duk_hstring *h_val; h_val = duk_hobject_get_internal_value_string(thr->heap, curr); - DUK_ASSERT(h_val != NULL); /* string objects must not created without internal value */ + DUK_ASSERT(h_val != NULL); /* string objects must not created without internal value */ len = (duk_uint_fast32_t) DUK_HSTRING_GET_CHARLEN(h_val); } #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) @@ -56209,7 +57269,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint len = (duk_uint_fast32_t) (h_bufobj->length >> h_bufobj->shift); } } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ for (i = 0; i < len; i++) { duk_hstring *k; @@ -56249,7 +57309,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint if (DUK_TVAL_IS_UNUSED(tv)) { continue; } - k = duk_heap_strtable_intern_u32_checked(thr, (duk_uint32_t) i); /* Fragile reachability. */ + k = duk_heap_strtable_intern_u32_checked(thr, (duk_uint32_t) i); /* Fragile reachability. */ DUK_ASSERT(k); duk__add_enum_key(thr, k); @@ -56281,8 +57341,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint continue; } if (DUK_UNLIKELY(DUK_HSTRING_HAS_SYMBOL(k))) { - if (!(enum_flags & DUK_ENUM_INCLUDE_HIDDEN) && - DUK_HSTRING_HAS_HIDDEN(k)) { + if (!(enum_flags & DUK_ENUM_INCLUDE_HIDDEN) && DUK_HSTRING_HAS_HIDDEN(k)) { continue; } if (!(enum_flags & DUK_ENUM_INCLUDE_SYMBOLS)) { @@ -56292,7 +57351,7 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint need_sort = 1; #endif } else { - DUK_ASSERT(!DUK_HSTRING_HAS_HIDDEN(k)); /* would also have symbol flag */ + DUK_ASSERT(!DUK_HSTRING_HAS_HIDDEN(k)); /* would also have symbol flag */ if (enum_flags & DUK_ENUM_EXCLUDE_STRINGS) { continue; } @@ -56341,7 +57400,10 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint #else if (need_sort) { DUK_DDD(DUK_DDDPRINT("need to sort")); - duk__sort_enum_keys_es6(thr, res, (duk_int_fast32_t) sort_start_index, (duk_int_fast32_t) sort_end_index); + duk__sort_enum_keys_es6(thr, + res, + (duk_int_fast32_t) sort_start_index, + (duk_int_fast32_t) sort_end_index); } else { DUK_DDD(DUK_DDDPRINT("no need to sort")); } @@ -56374,11 +57436,14 @@ DUK_INTERNAL void duk_hobject_enumerator_create(duk_hthread *thr, duk_small_uint /* Sort to ES2015 order which works for pure array incides but * also for mixed keys. */ - duk__sort_enum_keys_es6(thr, res, (duk_int_fast32_t) DUK__ENUM_START_INDEX, (duk_int_fast32_t) DUK_HOBJECT_GET_ENEXT(res)); + duk__sort_enum_keys_es6(thr, + res, + (duk_int_fast32_t) DUK__ENUM_START_INDEX, + (duk_int_fast32_t) DUK_HOBJECT_GET_ENEXT(res)); } #if defined(DUK_USE_ES6_PROXY) - compact_and_return: +compact_and_return: #endif /* compact; no need to seal because object is internal */ duk_hobject_compact_props(thr, res); @@ -56426,10 +57491,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_enumerator_next(duk_hthread *thr, duk_bool_t #else check_existence = 1; #endif - duk_pop(thr); /* still reachable */ + duk_pop(thr); /* still reachable */ DUK_DDD(DUK_DDDPRINT("getting next enum value, enum_target=%!iO, enumerator=%!iT", - (duk_heaphdr *) enum_target, (duk_tval *) duk_get_tval(thr, -1))); + (duk_heaphdr *) enum_target, + (duk_tval *) duk_get_tval(thr, -1))); /* no array part */ for (;;) { @@ -56470,16 +57536,16 @@ DUK_INTERNAL duk_bool_t duk_hobject_enumerator_next(duk_hthread *thr, duk_bool_t duk_push_hstring(thr, res); if (get_value) { duk_push_hobject(thr, enum_target); - duk_dup_m2(thr); /* -> [... enum key enum_target key] */ + duk_dup_m2(thr); /* -> [... enum key enum_target key] */ duk_get_prop(thr, -2); /* -> [... enum key enum_target val] */ - duk_remove_m2(thr); /* -> [... enum key val] */ - duk_remove(thr, -3); /* -> [... key val] */ + duk_remove_m2(thr); /* -> [... enum key val] */ + duk_remove(thr, -3); /* -> [... key val] */ } else { - duk_remove_m2(thr); /* -> [... key] */ + duk_remove_m2(thr); /* -> [... key] */ } return 1; } else { - duk_pop(thr); /* -> [...] */ + duk_pop(thr); /* -> [...] */ return 0; } } @@ -56526,7 +57592,7 @@ DUK_INTERNAL duk_ret_t duk_hobject_get_enumerated_keys(duk_hthread *thr, duk_sma duk_hstring *k; k = *keys++; - DUK_ASSERT(k != NULL); /* enumerator must have no keys deleted */ + DUK_ASSERT(k != NULL); /* enumerator must have no keys deleted */ DUK_TVAL_SET_STRING(tv, k); tv++; @@ -56538,7 +57604,7 @@ DUK_INTERNAL duk_ret_t duk_hobject_get_enumerated_keys(duk_hthread *thr, duk_sma /* [enum_target res] */ - return 1; /* return 1 to allow callers to tail call */ + return 1; /* return 1 to allow callers to tail call */ } /* automatic undefs */ @@ -56549,7 +57615,10 @@ DUK_INTERNAL duk_ret_t duk_hobject_get_enumerated_keys(duk_hthread *thr, duk_sma /* #include duk_internal.h -> already included */ -DUK_INTERNAL duk_bool_t duk_hobject_prototype_chain_contains(duk_hthread *thr, duk_hobject *h, duk_hobject *p, duk_bool_t ignore_loop) { +DUK_INTERNAL duk_bool_t duk_hobject_prototype_chain_contains(duk_hthread *thr, + duk_hobject *h, + duk_hobject *p, + duk_bool_t ignore_loop) { duk_uint_t sanity; DUK_ASSERT(thr != NULL); @@ -56588,7 +57657,7 @@ DUK_INTERNAL void duk_hobject_set_prototype_updref(duk_hthread *thr, duk_hobject DUK_ASSERT(h); tmp = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h); DUK_HOBJECT_SET_PROTOTYPE(thr->heap, h, p); - DUK_HOBJECT_INCREF_ALLOWNULL(thr, p); /* avoid problems if p == h->prototype */ + DUK_HOBJECT_INCREF_ALLOWNULL(thr, p); /* avoid problems if p == h->prototype */ DUK_HOBJECT_DECREF_ALLOWNULL(thr, tmp); #else DUK_ASSERT(h); @@ -56633,7 +57702,7 @@ DUK_INTERNAL void duk_hobject_pc2line_pack(duk_hthread *thr, duk_compiler_instr hdr = (duk_uint32_t *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(thr->heap, h_buf); DUK_ASSERT(hdr != NULL); - hdr[0] = (duk_uint32_t) length; /* valid pc range is [0, length[ */ + hdr[0] = (duk_uint32_t) length; /* valid pc range is [0, length[ */ curr_pc = 0U; while (curr_pc < length) { @@ -56662,8 +57731,8 @@ DUK_INTERNAL void duk_hobject_pc2line_pack(duk_hthread *thr, duk_compiler_instr for (;;) { curr_pc++; - if ( ((curr_pc % DUK_PC2LINE_SKIP) == 0) || /* end of diff run */ - (curr_pc >= length) ) { /* end of bytecode */ + if (((curr_pc % DUK_PC2LINE_SKIP) == 0) || /* end of diff run */ + (curr_pc >= length)) { /* end of bytecode */ break; } DUK_ASSERT(curr_pc < length); @@ -56710,7 +57779,9 @@ DUK_INTERNAL void duk_hobject_pc2line_pack(duk_hthread *thr, duk_compiler_instr (void) duk_to_fixed_buffer(thr, -1, NULL); DUK_DDD(DUK_DDDPRINT("final pc2line data: pc_limit=%ld, length=%ld, %lf bits/opcode --> %!ixT", - (long) length, (long) new_size, (double) new_size * 8.0 / (double) length, + (long) length, + (long) new_size, + (double) new_size * 8.0 / (double) length, (duk_tval *) duk_get_tval(thr, -1))); } @@ -56750,8 +57821,7 @@ DUK_LOCAL duk_uint_fast32_t duk__hobject_pc2line_query_raw(duk_hthread *thr, duk pc_limit = hdr[0]; if (pc >= pc_limit) { /* Note: pc is unsigned and cannot be negative */ - DUK_DD(DUK_DDPRINT("pc2line lookup failed: pc out of bounds (pc=%ld, limit=%ld)", - (long) pc, (long) pc_limit)); + DUK_DD(DUK_DDPRINT("pc2line lookup failed: pc out of bounds (pc=%ld, limit=%ld)", (long) pc, (long) pc_limit)); goto pc2line_error; } @@ -56759,7 +57829,8 @@ DUK_LOCAL duk_uint_fast32_t duk__hobject_pc2line_query_raw(duk_hthread *thr, duk start_offset = hdr[1 + hdr_index * 2 + 1]; if ((duk_size_t) start_offset > DUK_HBUFFER_FIXED_GET_SIZE(buf)) { DUK_DD(DUK_DDPRINT("pc2line lookup failed: start_offset out of bounds (start_offset=%ld, buffer_size=%ld)", - (long) start_offset, (long) DUK_HBUFFER_GET_SIZE((duk_hbuffer *) buf))); + (long) start_offset, + (long) DUK_HBUFFER_GET_SIZE((duk_hbuffer *) buf))); goto pc2line_error; } @@ -56786,7 +57857,7 @@ DUK_LOCAL duk_uint_fast32_t duk__hobject_pc2line_query_raw(duk_hthread *thr, duk if (duk_bd_decode_flag(bd_ctx)) { /* 1 1 1 <32 bits> */ duk_uint_fast32_t t; - t = duk_bd_decode(bd_ctx, 16); /* workaround: max nbits = 24 now */ + t = duk_bd_decode(bd_ctx, 16); /* workaround: max nbits = 24 now */ t = (t << 16) + duk_bd_decode(bd_ctx, 16); curr_line = t; } else { @@ -56811,7 +57882,7 @@ DUK_LOCAL duk_uint_fast32_t duk__hobject_pc2line_query_raw(duk_hthread *thr, duk DUK_DDD(DUK_DDDPRINT("pc2line lookup result: pc %ld -> line %ld", (long) pc, (long) curr_line)); return curr_line; - pc2line_error: +pc2line_error: DUK_D(DUK_DPRINT("pc2line conversion failed for pc=%ld", (long) pc)); return 0; } @@ -56839,7 +57910,7 @@ DUK_INTERNAL duk_uint_fast32_t duk_hobject_pc2line_query(duk_hthread *thr, duk_i return line; } -#endif /* DUK_USE_PC2LINE */ +#endif /* DUK_USE_PC2LINE */ /* * duk_hobject property access functionality. * @@ -56888,35 +57959,56 @@ DUK_INTERNAL duk_uint_fast32_t duk_hobject_pc2line_query(duk_hthread *thr, duk_i * Local defines */ -#define DUK__NO_ARRAY_INDEX DUK_HSTRING_NO_ARRAY_INDEX +#define DUK__NO_ARRAY_INDEX DUK_HSTRING_NO_ARRAY_INDEX /* Marker values for hash part. */ -#define DUK__HASH_UNUSED DUK_HOBJECT_HASHIDX_UNUSED -#define DUK__HASH_DELETED DUK_HOBJECT_HASHIDX_DELETED +#define DUK__HASH_UNUSED DUK_HOBJECT_HASHIDX_UNUSED +#define DUK__HASH_DELETED DUK_HOBJECT_HASHIDX_DELETED /* Valstack space that suffices for all local calls, excluding any recursion * into ECMAScript or Duktape/C calls (Proxy, getters, etc). */ -#define DUK__VALSTACK_SPACE 10 +#define DUK__VALSTACK_SPACE 10 /* Valstack space allocated especially for proxy lookup which does a * recursive property lookup. */ -#define DUK__VALSTACK_PROXY_LOOKUP 20 +#define DUK__VALSTACK_PROXY_LOOKUP 20 /* * Local prototypes */ -DUK_LOCAL_DECL duk_bool_t duk__check_arguments_map_for_get(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *temp_desc); -DUK_LOCAL_DECL void duk__check_arguments_map_for_put(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *temp_desc, duk_bool_t throw_flag); -DUK_LOCAL_DECL void duk__check_arguments_map_for_delete(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *temp_desc); +DUK_LOCAL_DECL duk_bool_t duk__check_arguments_map_for_get(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_propdesc *temp_desc); +DUK_LOCAL_DECL void duk__check_arguments_map_for_put(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_propdesc *temp_desc, + duk_bool_t throw_flag); +DUK_LOCAL_DECL void duk__check_arguments_map_for_delete(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_propdesc *temp_desc); -DUK_LOCAL_DECL duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, duk_hobject *obj, duk_uint32_t old_len, duk_uint32_t new_len, duk_bool_t force_flag, duk_uint32_t *out_result_len); +DUK_LOCAL_DECL duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, + duk_hobject *obj, + duk_uint32_t old_len, + duk_uint32_t new_len, + duk_bool_t force_flag, + duk_uint32_t *out_result_len); DUK_LOCAL_DECL duk_bool_t duk__handle_put_array_length(duk_hthread *thr, duk_hobject *obj); -DUK_LOCAL_DECL duk_bool_t duk__get_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags); -DUK_LOCAL_DECL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_uint32_t arr_idx, duk_propdesc *out_desc, duk_small_uint_t flags); +DUK_LOCAL_DECL duk_bool_t +duk__get_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags); +DUK_LOCAL_DECL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_uint32_t arr_idx, + duk_propdesc *out_desc, + duk_small_uint_t flags); DUK_LOCAL_DECL void duk__abandon_array_part(duk_hthread *thr, duk_hobject *obj); DUK_LOCAL_DECL void duk__grow_props_for_array_item(duk_hthread *thr, duk_hobject *obj, duk_uint32_t highest_arr_idx); @@ -56945,7 +58037,7 @@ DUK_LOCAL duk_uint32_t duk__tval_number_to_arr_idx(duk_tval *tv) { dbl = DUK_TVAL_GET_NUMBER(tv); idx = (duk_uint32_t) dbl; if (duk_double_equals((duk_double_t) idx, dbl)) { - /* Is whole and within 32 bit range. If the value happens to be 0xFFFFFFFF, + /* Is whole and within 32 bit range. If the value happens to be 0xFFFFFFFF, * it's not a valid array index but will then match DUK__NO_ARRAY_INDEX. */ return idx; @@ -56972,7 +58064,7 @@ DUK_LOCAL duk_uint32_t duk__tval_fastint_to_arr_idx(duk_tval *tv) { */ return (duk_uint32_t) t; } -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ /* Convert a duk_tval on the value stack (in a trusted index we don't validate) * to a string or symbol using ES2015 ToPropertyKey(): @@ -56997,7 +58089,7 @@ DUK_LOCAL duk_uint32_t duk__to_property_key(duk_hthread *thr, duk_idx_t idx, duk * but still be compliant and share code. */ - tv_dst = DUK_GET_TVAL_NEGIDX(thr, idx); /* intentionally unvalidated */ + tv_dst = DUK_GET_TVAL_NEGIDX(thr, idx); /* intentionally unvalidated */ if (DUK_TVAL_IS_STRING(tv_dst)) { /* Most important path: strings and plain symbols are used as * is. For symbols the array index check below is unnecessary @@ -57017,7 +58109,7 @@ DUK_LOCAL duk_uint32_t duk__to_property_key(duk_hthread *thr, duk_idx_t idx, duk } DUK_LOCAL duk_uint32_t duk__push_tval_to_property_key(duk_hthread *thr, duk_tval *tv_key, duk_hstring **out_h) { - duk_push_tval(thr, tv_key); /* XXX: could use an unsafe push here */ + duk_push_tval(thr, tv_key); /* XXX: could use an unsafe push here */ return duk__to_property_key(thr, -1, out_h); } @@ -57057,7 +58149,7 @@ DUK_LOCAL duk_uint32_t duk__get_default_h_size(duk_uint32_t e_size) { * is relatively sparse. */ tmp = e_size; - res = 2; /* Result will be 2 ** (N + 1). */ + res = 2; /* Result will be 2 ** (N + 1). */ while (tmp >= 0x40) { tmp >>= 6; res <<= 6; @@ -57066,21 +58158,21 @@ DUK_LOCAL duk_uint32_t duk__get_default_h_size(duk_uint32_t e_size) { tmp >>= 1; res <<= 1; } - DUK_ASSERT((DUK_HOBJECT_MAX_PROPERTIES << 2U) > DUK_HOBJECT_MAX_PROPERTIES); /* Won't wrap, even shifted by 2. */ + DUK_ASSERT((DUK_HOBJECT_MAX_PROPERTIES << 2U) > DUK_HOBJECT_MAX_PROPERTIES); /* Won't wrap, even shifted by 2. */ DUK_ASSERT(res > e_size); return res; } else { return 0; } } -#endif /* USE_PROP_HASH_PART */ +#endif /* USE_PROP_HASH_PART */ /* Get minimum entry part growth for a certain size. */ DUK_LOCAL duk_uint32_t duk__get_min_grow_e(duk_uint32_t e_size) { duk_uint32_t res; res = (e_size + DUK_USE_HOBJECT_ENTRY_MINGROW_ADD) / DUK_USE_HOBJECT_ENTRY_MINGROW_DIVISOR; - DUK_ASSERT(res >= 1); /* important for callers */ + DUK_ASSERT(res >= 1); /* important for callers */ return res; } @@ -57089,7 +58181,7 @@ DUK_LOCAL duk_uint32_t duk__get_min_grow_a(duk_uint32_t a_size) { duk_uint32_t res; res = (a_size + DUK_USE_HOBJECT_ARRAY_MINGROW_ADD) / DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR; - DUK_ASSERT(res >= 1); /* important for callers */ + DUK_ASSERT(res >= 1); /* important for callers */ return res; } @@ -57119,7 +58211,7 @@ DUK_LOCAL duk_uint32_t duk__count_used_e_keys(duk_hthread *thr, duk_hobject *obj DUK_LOCAL void duk__compute_a_stats(duk_hthread *thr, duk_hobject *obj, duk_uint32_t *out_used, duk_uint32_t *out_min_size) { duk_uint_fast32_t i; duk_uint_fast32_t used = 0; - duk_uint_fast32_t highest_idx = (duk_uint_fast32_t) -1; /* see below */ + duk_uint_fast32_t highest_idx = (duk_uint_fast32_t) -1; /* see below */ duk_tval *a; DUK_ASSERT(obj != NULL); @@ -57142,7 +58234,7 @@ DUK_LOCAL void duk__compute_a_stats(duk_hthread *thr, duk_hobject *obj, duk_uint */ *out_used = (duk_uint32_t) used; - *out_min_size = (duk_uint32_t) (highest_idx + 1); /* 0 if no used entries */ + *out_min_size = (duk_uint32_t) (highest_idx + 1); /* 0 if no used entries */ } /* Check array density and indicate whether or not the array part should be abandoned. */ @@ -57209,7 +58301,9 @@ DUK_LOCAL duk_bool_t duk__abandon_array_check(duk_hthread *thr, duk_uint32_t arr duk__compute_a_stats(thr, obj, &old_used, &old_size); DUK_DDD(DUK_DDDPRINT("abandon check, array stats: old_used=%ld, old_size=%ld, arr_idx=%ld", - (long) old_used, (long) old_size, (long) arr_idx)); + (long) old_used, + (long) old_size, + (long) arr_idx)); min_size = arr_idx + 1; #if defined(DUK_USE_OBJSIZES16) @@ -57237,7 +58331,7 @@ DUK_LOCAL duk_bool_t duk__abandon_array_check(duk_hthread *thr, duk_uint32_t arr DUK_DDD(DUK_DDDPRINT("=> decided to keep array part")); return 0; - do_abandon: +do_abandon: duk__abandon_array_part(thr, obj); DUK_ASSERT(!DUK_HOBJECT_HAS_ARRAY_PART(obj)); return 1; @@ -57264,7 +58358,8 @@ DUK_LOCAL duk_tval *duk__obtain_arridx_slot_slowpath(duk_hthread *thr, duk_uint3 DUK_DDD(DUK_DDDPRINT("write to new array requires array resize, decide whether to do a " "fast resize without abandon check (arr_idx=%ld, old_size=%ld)", - (long) arr_idx, (long) DUK_HOBJECT_GET_ASIZE(obj))); + (long) arr_idx, + (long) DUK_HOBJECT_GET_ASIZE(obj))); if (DUK_UNLIKELY(duk__abandon_array_check(thr, arr_idx, obj) != 0)) { DUK_ASSERT(!DUK_HOBJECT_HAS_ARRAY_PART(obj)); @@ -57323,7 +58418,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_proxy_check(duk_hobject *obj, duk_hobject ** return 1; } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ /* Get Proxy target object. If the argument is not a Proxy, return it as is. * If a Proxy is revoked, an error is thrown. @@ -57349,10 +58444,14 @@ DUK_INTERNAL duk_hobject *duk_hobject_resolve_proxy_target(duk_hobject *obj) { DUK_ASSERT(obj != NULL); return obj; } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ #if defined(DUK_USE_ES6_PROXY) -DUK_LOCAL duk_bool_t duk__proxy_check_prop(duk_hthread *thr, duk_hobject *obj, duk_small_uint_t stridx_trap, duk_tval *tv_key, duk_hobject **out_target) { +DUK_LOCAL duk_bool_t duk__proxy_check_prop(duk_hthread *thr, + duk_hobject *obj, + duk_small_uint_t stridx_trap, + duk_tval *tv_key, + duk_hobject **out_target) { duk_hobject *h_handler; DUK_ASSERT(thr != NULL); @@ -57406,7 +58505,7 @@ DUK_LOCAL duk_bool_t duk__proxy_check_prop(duk_hthread *thr, duk_hobject *obj, d duk_push_hobject(thr, h_handler); if (duk_get_prop_stridx_short(thr, -1, stridx_trap)) { /* -> [ ... handler trap ] */ - duk_insert(thr, -2); /* -> [ ... trap handler ] */ + duk_insert(thr, -2); /* -> [ ... trap handler ] */ /* stack prepped for func call: [ ... trap handler ] */ return 1; @@ -57415,7 +58514,7 @@ DUK_LOCAL duk_bool_t duk__proxy_check_prop(duk_hthread *thr, duk_hobject *obj, d return 0; } } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ /* * Reallocate property allocation, moving properties to the new allocation. @@ -57470,11 +58569,12 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, DUK_ASSERT(thr != NULL); DUK_ASSERT(obj != NULL); - DUK_ASSERT(!abandon_array || new_a_size == 0); /* if abandon_array, new_a_size must be 0 */ - DUK_ASSERT(DUK_HOBJECT_GET_PROPS(thr->heap, obj) != NULL || (DUK_HOBJECT_GET_ESIZE(obj) == 0 && DUK_HOBJECT_GET_ASIZE(obj) == 0)); - DUK_ASSERT(new_h_size == 0 || new_h_size >= new_e_size); /* required to guarantee success of rehashing, - * intentionally use unadjusted new_e_size - */ + DUK_ASSERT(!abandon_array || new_a_size == 0); /* if abandon_array, new_a_size must be 0 */ + DUK_ASSERT(DUK_HOBJECT_GET_PROPS(thr->heap, obj) != NULL || + (DUK_HOBJECT_GET_ESIZE(obj) == 0 && DUK_HOBJECT_GET_ASIZE(obj) == 0)); + DUK_ASSERT(new_h_size == 0 || new_h_size >= new_e_size); /* required to guarantee success of rehashing, + * intentionally use unadjusted new_e_size + */ DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); DUK_ASSERT_VALSTACK_SPACE(thr, DUK__VALSTACK_SPACE); @@ -57504,10 +58604,12 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("using layout 1, but no need to pad e_size: %ld", (long) new_e_size)); new_e_size_adjusted = new_e_size; #elif defined(DUK_USE_HOBJECT_LAYOUT_1) && ((DUK_HOBJECT_ALIGN_TARGET == 4) || (DUK_HOBJECT_ALIGN_TARGET == 8)) - new_e_size_adjusted = (new_e_size + (duk_uint32_t) DUK_HOBJECT_ALIGN_TARGET - 1U) & - (~((duk_uint32_t) DUK_HOBJECT_ALIGN_TARGET - 1U)); + new_e_size_adjusted = + (new_e_size + (duk_uint32_t) DUK_HOBJECT_ALIGN_TARGET - 1U) & (~((duk_uint32_t) DUK_HOBJECT_ALIGN_TARGET - 1U)); DUK_DDD(DUK_DDDPRINT("using layout 1, and alignment target is %ld, adjusted e_size: %ld -> %ld", - (long) DUK_HOBJECT_ALIGN_TARGET, (long) new_e_size, (long) new_e_size_adjusted)); + (long) DUK_HOBJECT_ALIGN_TARGET, + (long) new_e_size, + (long) new_e_size_adjusted)); DUK_ASSERT(new_e_size_adjusted >= new_e_size); #else #error invalid hobject layout defines @@ -57517,23 +58619,22 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, * Debug logging after adjustment. */ - DUK_DDD(DUK_DDDPRINT("attempt to resize hobject %p props (%ld -> %ld bytes), from {p=%p,e_size=%ld,e_next=%ld,a_size=%ld,h_size=%ld} to " - "{e_size=%ld,a_size=%ld,h_size=%ld}, abandon_array=%ld, unadjusted new_e_size=%ld", - (void *) obj, - (long) DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), - DUK_HOBJECT_GET_ASIZE(obj), - DUK_HOBJECT_GET_HSIZE(obj)), - (long) DUK_HOBJECT_P_COMPUTE_SIZE(new_e_size_adjusted, new_a_size, new_h_size), - (void *) DUK_HOBJECT_GET_PROPS(thr->heap, obj), - (long) DUK_HOBJECT_GET_ESIZE(obj), - (long) DUK_HOBJECT_GET_ENEXT(obj), - (long) DUK_HOBJECT_GET_ASIZE(obj), - (long) DUK_HOBJECT_GET_HSIZE(obj), - (long) new_e_size_adjusted, - (long) new_a_size, - (long) new_h_size, - (long) abandon_array, - (long) new_e_size)); + DUK_DDD(DUK_DDDPRINT( + "attempt to resize hobject %p props (%ld -> %ld bytes), from {p=%p,e_size=%ld,e_next=%ld,a_size=%ld,h_size=%ld} to " + "{e_size=%ld,a_size=%ld,h_size=%ld}, abandon_array=%ld, unadjusted new_e_size=%ld", + (void *) obj, + (long) DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), DUK_HOBJECT_GET_ASIZE(obj), DUK_HOBJECT_GET_HSIZE(obj)), + (long) DUK_HOBJECT_P_COMPUTE_SIZE(new_e_size_adjusted, new_a_size, new_h_size), + (void *) DUK_HOBJECT_GET_PROPS(thr->heap, obj), + (long) DUK_HOBJECT_GET_ESIZE(obj), + (long) DUK_HOBJECT_GET_ENEXT(obj), + (long) DUK_HOBJECT_GET_ASIZE(obj), + (long) DUK_HOBJECT_GET_HSIZE(obj), + (long) new_e_size_adjusted, + (long) new_a_size, + (long) new_h_size, + (long) abandon_array, + (long) new_e_size)); /* * Property count check. This is the only point where we ensure that @@ -57576,9 +58677,9 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, #endif prev_ms_base_flags = thr->heap->ms_base_flags; thr->heap->ms_base_flags |= - DUK_MS_FLAG_NO_OBJECT_COMPACTION; /* Avoid attempt to compact the current object (all objects really). */ - thr->heap->pf_prevent_count++; /* Avoid finalizers. */ - DUK_ASSERT(thr->heap->pf_prevent_count != 0); /* Wrap. */ + DUK_MS_FLAG_NO_OBJECT_COMPACTION; /* Avoid attempt to compact the current object (all objects really). */ + thr->heap->pf_prevent_count++; /* Avoid finalizers. */ + DUK_ASSERT(thr->heap->pf_prevent_count != 0); /* Wrap. */ new_alloc_size = DUK_HOBJECT_P_COMPUTE_SIZE(new_e_size_adjusted, new_a_size, new_h_size); DUK_DDD(DUK_DDDPRINT("new hobject allocation size is %ld", (long) new_alloc_size)); @@ -57591,7 +58692,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, /* Alloc may trigger mark-and-sweep but no compaction, and * cannot throw. */ -#if 0 /* XXX: inject test */ +#if 0 /* XXX: inject test */ if (1) { new_p = NULL; goto alloc_failed; @@ -57609,19 +58710,28 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, /* Set up pointers to the new property area: this is hidden behind a macro * because it is memory layout specific. */ - DUK_HOBJECT_P_SET_REALLOC_PTRS(new_p, new_e_k, new_e_pv, new_e_f, new_a, new_h, - new_e_size_adjusted, new_a_size, new_h_size); - DUK_UNREF(new_h); /* happens when hash part dropped */ + DUK_HOBJECT_P_SET_REALLOC_PTRS(new_p, + new_e_k, + new_e_pv, + new_e_f, + new_a, + new_h, + new_e_size_adjusted, + new_a_size, + new_h_size); + DUK_UNREF(new_h); /* happens when hash part dropped */ new_e_next = 0; /* if new_p == NULL, all of these pointers are NULL */ - DUK_ASSERT((new_p != NULL) || - (new_e_k == NULL && new_e_pv == NULL && new_e_f == NULL && - new_a == NULL && new_h == NULL)); + DUK_ASSERT((new_p != NULL) || (new_e_k == NULL && new_e_pv == NULL && new_e_f == NULL && new_a == NULL && new_h == NULL)); DUK_DDD(DUK_DDDPRINT("new alloc size %ld, new_e_k=%p, new_e_pv=%p, new_e_f=%p, new_a=%p, new_h=%p", - (long) new_alloc_size, (void *) new_e_k, (void *) new_e_pv, (void *) new_e_f, - (void *) new_a, (void *) new_h)); + (long) new_alloc_size, + (void *) new_e_k, + (void *) new_e_pv, + (void *) new_e_f, + (void *) new_a, + (void *) new_h)); /* * Migrate array part to start of entries if requested. @@ -57662,8 +58772,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, continue; } - DUK_ASSERT(new_p != NULL && new_e_k != NULL && - new_e_pv != NULL && new_e_f != NULL); + DUK_ASSERT(new_p != NULL && new_e_k != NULL && new_e_pv != NULL && new_e_f != NULL); /* * Intern key via the valstack to ensure reachability behaves @@ -57675,7 +58784,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, * must be careful. */ -#if 0 /* XXX: inject test */ +#if 0 /* XXX: inject test */ if (1) { goto abandon_error; } @@ -57691,7 +58800,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, if (key == NULL) { goto abandon_error; } - duk_push_hstring(thr, key); /* keep key reachable for GC etc; guaranteed not to fail */ + duk_push_hstring(thr, key); /* keep key reachable for GC etc; guaranteed not to fail */ /* Key is now reachable in the valstack, don't INCREF * the new allocation yet (we'll steal the refcounts @@ -57699,11 +58808,10 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, */ new_e_k[new_e_next] = key; - tv2 = &new_e_pv[new_e_next].v; /* array entries are all plain values */ + tv2 = &new_e_pv[new_e_next].v; /* array entries are all plain values */ DUK_TVAL_SET_TVAL(tv2, tv1); - new_e_f[new_e_next] = DUK_PROPDESC_FLAG_WRITABLE | - DUK_PROPDESC_FLAG_ENUMERABLE | - DUK_PROPDESC_FLAG_CONFIGURABLE; + new_e_f[new_e_next] = + DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE | DUK_PROPDESC_FLAG_CONFIGURABLE; new_e_next++; /* Note: new_e_next matches pushed temp key count, and nothing can @@ -57730,8 +58838,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, continue; } - DUK_ASSERT(new_p != NULL && new_e_k != NULL && - new_e_pv != NULL && new_e_f != NULL); + DUK_ASSERT(new_p != NULL && new_e_k != NULL && new_e_pv != NULL && new_e_f != NULL); new_e_k[new_e_next] = key; new_e_pv[new_e_next] = DUK_HOBJECT_E_GET_VALUE(thr->heap, obj, i); @@ -57765,9 +58872,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, DUK_ASSERT(new_a != NULL || array_copy_size == 0U); DUK_ASSERT(DUK_HOBJECT_GET_PROPS(thr->heap, obj) != NULL || array_copy_size == 0U); DUK_ASSERT(DUK_HOBJECT_GET_ASIZE(obj) > 0 || array_copy_size == 0U); - duk_memcpy_unsafe((void *) new_a, - (const void *) DUK_HOBJECT_A_GET_BASE(thr->heap, obj), - array_copy_size); + duk_memcpy_unsafe((void *) new_a, (const void *) DUK_HOBJECT_A_GET_BASE(thr->heap, obj), array_copy_size); for (i = DUK_HOBJECT_GET_ASIZE(obj); i < new_a_size; i++) { duk_tval *tv = &new_a[i]; @@ -57795,7 +58900,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, DUK_ASSERT(new_h_size > 0); duk_memset(new_h, 0xff, sizeof(duk_uint32_t) * new_h_size); - DUK_ASSERT(new_e_next <= new_h_size); /* equality not actually possible */ + DUK_ASSERT(new_e_next <= new_h_size); /* equality not actually possible */ mask = new_h_size - 1; for (i = 0; i < new_e_next; i++) { @@ -57804,10 +58909,10 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, DUK_ASSERT(key != NULL); j = DUK_HSTRING_GET_HASH(key) & mask; - step = 1; /* Cache friendly but clustering prone. */ + step = 1; /* Cache friendly but clustering prone. */ for (;;) { - DUK_ASSERT(new_h[j] != DUK__HASH_DELETED); /* should never happen */ + DUK_ASSERT(new_h[j] != DUK__HASH_DELETED); /* should never happen */ if (new_h[j] == DUK__HASH_UNUSED) { DUK_DDD(DUK_DDDPRINT("rebuild hit %ld -> %ld", (long) j, (long) i)); new_h[j] = (duk_uint32_t) i; @@ -57820,37 +58925,36 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, } } } -#endif /* DUK_USE_HOBJECT_HASH_PART */ +#endif /* DUK_USE_HOBJECT_HASH_PART */ /* * Nice debug log. */ - DUK_DD(DUK_DDPRINT("resized hobject %p props (%ld -> %ld bytes), from {p=%p,e_size=%ld,e_next=%ld,a_size=%ld,h_size=%ld} to " - "{p=%p,e_size=%ld,e_next=%ld,a_size=%ld,h_size=%ld}, abandon_array=%ld, unadjusted new_e_size=%ld", - (void *) obj, - (long) DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), - DUK_HOBJECT_GET_ASIZE(obj), - DUK_HOBJECT_GET_HSIZE(obj)), - (long) new_alloc_size, - (void *) DUK_HOBJECT_GET_PROPS(thr->heap, obj), - (long) DUK_HOBJECT_GET_ESIZE(obj), - (long) DUK_HOBJECT_GET_ENEXT(obj), - (long) DUK_HOBJECT_GET_ASIZE(obj), - (long) DUK_HOBJECT_GET_HSIZE(obj), - (void *) new_p, - (long) new_e_size_adjusted, - (long) new_e_next, - (long) new_a_size, - (long) new_h_size, - (long) abandon_array, - (long) new_e_size)); + DUK_DD(DUK_DDPRINT( + "resized hobject %p props (%ld -> %ld bytes), from {p=%p,e_size=%ld,e_next=%ld,a_size=%ld,h_size=%ld} to " + "{p=%p,e_size=%ld,e_next=%ld,a_size=%ld,h_size=%ld}, abandon_array=%ld, unadjusted new_e_size=%ld", + (void *) obj, + (long) DUK_HOBJECT_P_COMPUTE_SIZE(DUK_HOBJECT_GET_ESIZE(obj), DUK_HOBJECT_GET_ASIZE(obj), DUK_HOBJECT_GET_HSIZE(obj)), + (long) new_alloc_size, + (void *) DUK_HOBJECT_GET_PROPS(thr->heap, obj), + (long) DUK_HOBJECT_GET_ESIZE(obj), + (long) DUK_HOBJECT_GET_ENEXT(obj), + (long) DUK_HOBJECT_GET_ASIZE(obj), + (long) DUK_HOBJECT_GET_HSIZE(obj), + (void *) new_p, + (long) new_e_size_adjusted, + (long) new_e_next, + (long) new_a_size, + (long) new_h_size, + (long) abandon_array, + (long) new_e_size)); /* * All done, switch properties ('p') allocation to new one. */ - DUK_FREE_CHECKED(thr, DUK_HOBJECT_GET_PROPS(thr->heap, obj)); /* NULL obj->p is OK */ + DUK_FREE_CHECKED(thr, DUK_HOBJECT_GET_PROPS(thr->heap, obj)); /* NULL obj->p is OK */ DUK_HOBJECT_SET_PROPS(thr->heap, obj, new_p); DUK_HOBJECT_SET_ESIZE(obj, new_e_size_adjusted); DUK_HOBJECT_SET_ENEXT(obj, new_e_next); @@ -57889,11 +58993,11 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, * unwind. */ - abandon_error: - alloc_failed: +abandon_error: +alloc_failed: DUK_D(DUK_DPRINT("object property table resize failed")); - DUK_FREE_CHECKED(thr, new_p); /* OK for NULL. */ + DUK_FREE_CHECKED(thr, new_p); /* OK for NULL. */ thr->heap->pf_prevent_count--; thr->heap->ms_base_flags = prev_ms_base_flags; @@ -57910,9 +59014,7 @@ DUK_INTERNAL void duk_hobject_realloc_props(duk_hthread *thr, * Helpers to resize properties allocation on specific needs. */ -DUK_INTERNAL void duk_hobject_resize_entrypart(duk_hthread *thr, - duk_hobject *obj, - duk_uint32_t new_e_size) { +DUK_INTERNAL void duk_hobject_resize_entrypart(duk_hthread *thr, duk_hobject *obj, duk_uint32_t new_e_size) { duk_uint32_t old_e_size; duk_uint32_t new_a_size; duk_uint32_t new_h_size; @@ -57936,7 +59038,7 @@ DUK_INTERNAL void duk_hobject_resize_entrypart(duk_hthread *thr, /* Grow entry part allocation for one additional entry. */ DUK_LOCAL void duk__grow_props_for_new_entry_item(duk_hthread *thr, duk_hobject *obj) { - duk_uint32_t old_e_used; /* actually used, non-NULL entries */ + duk_uint32_t old_e_used; /* actually used, non-NULL entries */ duk_uint32_t new_e_size_minimum; duk_uint32_t new_e_size; duk_uint32_t new_a_size; @@ -57998,7 +59100,7 @@ DUK_LOCAL void duk__grow_props_for_array_item(duk_hthread *thr, duk_hobject *obj new_h_size = DUK_HOBJECT_GET_HSIZE(obj); new_a_size_minimum = highest_arr_idx + 1; new_a_size = highest_arr_idx + duk__get_min_grow_a(highest_arr_idx); - DUK_ASSERT(new_a_size >= highest_arr_idx + 1); /* duk__get_min_grow_a() is always >= 1 */ + DUK_ASSERT(new_a_size >= highest_arr_idx + 1); /* duk__get_min_grow_a() is always >= 1 */ #if defined(DUK_USE_OBJSIZES16) if (new_e_size > DUK_UINT16_MAX) { @@ -58030,7 +59132,7 @@ DUK_LOCAL void duk__abandon_array_part(duk_hthread *thr, duk_hobject *obj) { duk_uint32_t new_e_size; duk_uint32_t new_a_size; duk_uint32_t new_h_size; - duk_uint32_t e_used; /* actually used, non-NULL keys */ + duk_uint32_t e_used; /* actually used, non-NULL keys */ duk_uint32_t a_used; duk_uint32_t a_size; @@ -58075,8 +59177,13 @@ DUK_LOCAL void duk__abandon_array_part(duk_hthread *thr, duk_hobject *obj) { DUK_DD(DUK_DDPRINT("abandon array part for hobject %p, " "array stats before: e_used=%ld, a_used=%ld, a_size=%ld; " "resize to e_size=%ld, a_size=%ld, h_size=%ld", - (void *) obj, (long) e_used, (long) a_used, (long) a_size, - (long) new_e_size, (long) new_a_size, (long) new_h_size)); + (void *) obj, + (long) e_used, + (long) a_used, + (long) a_size, + (long) new_e_size, + (long) new_a_size, + (long) new_h_size)); duk_hobject_realloc_props(thr, obj, new_e_size, new_a_size, new_h_size, 1); } @@ -58094,9 +59201,9 @@ DUK_LOCAL void duk__abandon_array_part(duk_hthread *thr, duk_hobject *obj) { */ DUK_INTERNAL void duk_hobject_compact_props(duk_hthread *thr, duk_hobject *obj) { - duk_uint32_t e_size; /* currently used -> new size */ - duk_uint32_t a_size; /* currently required */ - duk_uint32_t a_used; /* actually used */ + duk_uint32_t e_size; /* currently used -> new size */ + duk_uint32_t a_size; /* currently required */ + duk_uint32_t a_used; /* actually used */ duk_uint32_t h_size; duk_bool_t abandon_array; @@ -58115,13 +59222,17 @@ DUK_INTERNAL void duk_hobject_compact_props(duk_hthread *thr, duk_hobject *obj) DUK_DD(DUK_DDPRINT("compacting hobject, used e keys %ld, used a keys %ld, min a size %ld, " "resized array density would be: %ld/%ld = %lf", - (long) e_size, (long) a_used, (long) a_size, - (long) a_used, (long) a_size, + (long) e_size, + (long) a_used, + (long) a_size, + (long) a_used, + (long) a_size, (double) a_used / (double) a_size)); if (duk__abandon_array_density_check(a_used, a_size)) { DUK_DD(DUK_DDPRINT("decided to abandon array during compaction, a_used=%ld, a_size=%ld", - (long) a_used, (long) a_size)); + (long) a_used, + (long) a_size)); abandon_array = 1; e_size += a_used; a_size = 0; @@ -58141,7 +59252,10 @@ DUK_INTERNAL void duk_hobject_compact_props(duk_hthread *thr, duk_hobject *obj) #endif DUK_DD(DUK_DDPRINT("compacting hobject -> new e_size %ld, new a_size=%ld, new h_size=%ld, abandon_array=%ld", - (long) e_size, (long) a_size, (long) h_size, (long) abandon_array)); + (long) e_size, + (long) a_size, + (long) h_size, + (long) abandon_array)); duk_hobject_realloc_props(thr, obj, e_size, a_size, h_size, abandon_array); } @@ -58156,15 +59270,15 @@ DUK_INTERNAL void duk_hobject_compact_props(duk_hthread *thr, duk_hobject *obj) * but there is no hash part, h_idx is set to -1. */ -DUK_INTERNAL duk_bool_t duk_hobject_find_entry(duk_heap *heap, duk_hobject *obj, duk_hstring *key, duk_int_t *e_idx, duk_int_t *h_idx) { +DUK_INTERNAL duk_bool_t +duk_hobject_find_entry(duk_heap *heap, duk_hobject *obj, duk_hstring *key, duk_int_t *e_idx, duk_int_t *h_idx) { DUK_ASSERT(obj != NULL); DUK_ASSERT(key != NULL); DUK_ASSERT(e_idx != NULL); DUK_ASSERT(h_idx != NULL); DUK_UNREF(heap); - if (DUK_LIKELY(DUK_HOBJECT_GET_HSIZE(obj) == 0)) - { + if (DUK_LIKELY(DUK_HOBJECT_GET_HSIZE(obj) == 0)) { /* Linear scan: more likely because most objects are small. * This is an important fast path. * @@ -58186,8 +59300,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_find_entry(duk_heap *heap, duk_hobject *obj, } } #if defined(DUK_USE_HOBJECT_HASH_PART) - else - { + else { /* hash lookup */ duk_uint32_t n; duk_uint32_t i, step; @@ -58200,40 +59313,38 @@ DUK_INTERNAL duk_bool_t duk_hobject_find_entry(duk_heap *heap, duk_hobject *obj, n = DUK_HOBJECT_GET_HSIZE(obj); mask = n - 1; i = DUK_HSTRING_GET_HASH(key) & mask; - step = 1; /* Cache friendly but clustering prone. */ + step = 1; /* Cache friendly but clustering prone. */ for (;;) { duk_uint32_t t; - DUK_ASSERT_DISABLE(i >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(i >= 0); /* unsigned */ DUK_ASSERT(i < DUK_HOBJECT_GET_HSIZE(obj)); t = h_base[i]; DUK_ASSERT(t == DUK__HASH_UNUSED || t == DUK__HASH_DELETED || - (t < DUK_HOBJECT_GET_ESIZE(obj))); /* t >= 0 always true, unsigned */ + (t < DUK_HOBJECT_GET_ESIZE(obj))); /* t >= 0 always true, unsigned */ if (t == DUK__HASH_UNUSED) { break; } else if (t == DUK__HASH_DELETED) { - DUK_DDD(DUK_DDDPRINT("lookup miss (deleted) i=%ld, t=%ld", - (long) i, (long) t)); + DUK_DDD(DUK_DDDPRINT("lookup miss (deleted) i=%ld, t=%ld", (long) i, (long) t)); } else { DUK_ASSERT(t < DUK_HOBJECT_GET_ESIZE(obj)); if (DUK_HOBJECT_E_GET_KEY(heap, obj, t) == key) { - DUK_DDD(DUK_DDDPRINT("lookup hit i=%ld, t=%ld -> key %p", - (long) i, (long) t, (void *) key)); + DUK_DDD( + DUK_DDDPRINT("lookup hit i=%ld, t=%ld -> key %p", (long) i, (long) t, (void *) key)); *e_idx = (duk_int_t) t; *h_idx = (duk_int_t) i; return 1; } - DUK_DDD(DUK_DDDPRINT("lookup miss i=%ld, t=%ld", - (long) i, (long) t)); + DUK_DDD(DUK_DDDPRINT("lookup miss i=%ld, t=%ld", (long) i, (long) t)); } i = (i + step) & mask; /* Guaranteed to finish (hash is larger than #props). */ } } -#endif /* DUK_USE_HOBJECT_HASH_PART */ +#endif /* DUK_USE_HOBJECT_HASH_PART */ /* Not found, leave e_idx and h_idx unset. */ return 0; @@ -58262,7 +59373,10 @@ DUK_INTERNAL duk_tval *duk_hobject_find_entry_tval_ptr_stridx(duk_heap *heap, du } /* For internal use: get non-accessor entry value and attributes */ -DUK_INTERNAL duk_tval *duk_hobject_find_entry_tval_ptr_and_attrs(duk_heap *heap, duk_hobject *obj, duk_hstring *key, duk_uint_t *out_attrs) { +DUK_INTERNAL duk_tval *duk_hobject_find_entry_tval_ptr_and_attrs(duk_heap *heap, + duk_hobject *obj, + duk_hstring *key, + duk_uint_t *out_attrs) { duk_int_t e_idx; duk_int_t h_idx; @@ -58347,14 +59461,15 @@ DUK_LOCAL duk_int_t duk__hobject_alloc_entry_checked(duk_hthread *thr, duk_hobje n = DUK_HOBJECT_GET_HSIZE(obj); mask = n - 1; i = DUK_HSTRING_GET_HASH(key) & mask; - step = 1; /* Cache friendly but clustering prone. */ + step = 1; /* Cache friendly but clustering prone. */ for (;;) { duk_uint32_t t = h_base[i]; if (t == DUK__HASH_UNUSED || t == DUK__HASH_DELETED) { DUK_DDD(DUK_DDDPRINT("duk__hobject_alloc_entry_checked() inserted key into hash part, %ld -> %ld", - (long) i, (long) idx)); - DUK_ASSERT_DISABLE(i >= 0); /* unsigned */ + (long) i, + (long) idx)); + DUK_ASSERT_DISABLE(i >= 0); /* unsigned */ DUK_ASSERT(i < DUK_HOBJECT_GET_HSIZE(obj)); DUK_ASSERT_DISABLE(idx >= 0); DUK_ASSERT(idx < DUK_HOBJECT_GET_ESIZE(obj)); @@ -58367,7 +59482,7 @@ DUK_LOCAL duk_int_t duk__hobject_alloc_entry_checked(duk_hthread *thr, duk_hobje /* Guaranteed to finish (hash is larger than #props). */ } } -#endif /* DUK_USE_HOBJECT_HASH_PART */ +#endif /* DUK_USE_HOBJECT_HASH_PART */ /* Note: we could return the hash index here too, but it's not * needed right now. @@ -58475,8 +59590,12 @@ duk_bool_t duk__lookup_arguments_map(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("arguments map lookup: thr=%p, obj=%p, key=%p, temp_desc=%p " "(obj -> %!O, key -> %!O)", - (void *) thr, (void *) obj, (void *) key, (void *) temp_desc, - (duk_heaphdr *) obj, (duk_heaphdr *) key)); + (void *) thr, + (void *) obj, + (void *) key, + (void *) temp_desc, + (duk_heaphdr *) obj, + (duk_heaphdr *) key)); if (!duk_hobject_get_own_propdesc(thr, obj, DUK_HTHREAD_STRING_INT_MAP(thr), temp_desc, DUK_GETDESC_FLAG_PUSH_VALUE)) { DUK_DDD(DUK_DDDPRINT("-> no 'map'")); @@ -58485,7 +59604,7 @@ duk_bool_t duk__lookup_arguments_map(duk_hthread *thr, map = duk_require_hobject(thr, -1); DUK_ASSERT(map != NULL); - duk_pop_unsafe(thr); /* map is reachable through obj */ + duk_pop_unsafe(thr); /* map is reachable through obj */ if (!duk_hobject_get_own_propdesc(thr, map, key, temp_desc, DUK_GETDESC_FLAG_PUSH_VALUE)) { DUK_DDD(DUK_DDDPRINT("-> 'map' exists, but key not in map")); @@ -58495,29 +59614,32 @@ duk_bool_t duk__lookup_arguments_map(duk_hthread *thr, /* [... varname] */ DUK_DDD(DUK_DDDPRINT("-> 'map' exists, and contains key, key is mapped to argument/variable binding %!T", (duk_tval *) duk_get_tval(thr, -1))); - DUK_ASSERT(duk_is_string(thr, -1)); /* guaranteed when building arguments */ + DUK_ASSERT(duk_is_string(thr, -1)); /* guaranteed when building arguments */ /* get varenv for varname (callee's declarative lexical environment) */ rc = duk_hobject_get_own_propdesc(thr, obj, DUK_HTHREAD_STRING_INT_VARENV(thr), temp_desc, DUK_GETDESC_FLAG_PUSH_VALUE); DUK_UNREF(rc); - DUK_ASSERT(rc != 0); /* arguments MUST have an initialized lexical environment reference */ + DUK_ASSERT(rc != 0); /* arguments MUST have an initialized lexical environment reference */ varenv = duk_require_hobject(thr, -1); DUK_ASSERT(varenv != NULL); - duk_pop_unsafe(thr); /* varenv remains reachable through 'obj' */ + duk_pop_unsafe(thr); /* varenv remains reachable through 'obj' */ DUK_DDD(DUK_DDDPRINT("arguments varenv is: %!dO", (duk_heaphdr *) varenv)); /* success: leave varname in stack */ *out_map = map; *out_varenv = varenv; - return 1; /* [... varname] */ + return 1; /* [... varname] */ } /* Lookup 'key' from arguments internal 'map', and leave replacement value * on stack top if mapped (and return non-zero). * Used in E5 Section 10.6 algorithm for [[GetOwnProperty]] (used by [[Get]]). */ -DUK_LOCAL duk_bool_t duk__check_arguments_map_for_get(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *temp_desc) { +DUK_LOCAL duk_bool_t duk__check_arguments_map_for_get(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_propdesc *temp_desc) { duk_hobject *map; duk_hobject *varenv; duk_hstring *varname; @@ -58533,7 +59655,7 @@ DUK_LOCAL duk_bool_t duk__check_arguments_map_for_get(duk_hthread *thr, duk_hobj varname = duk_require_hstring(thr, -1); DUK_ASSERT(varname != NULL); - duk_pop_unsafe(thr); /* varname is still reachable */ + duk_pop_unsafe(thr); /* varname is still reachable */ DUK_DDD(DUK_DDDPRINT("arguments object automatic getvar for a bound variable; " "key=%!O, varname=%!O", @@ -58554,7 +59676,11 @@ DUK_LOCAL duk_bool_t duk__check_arguments_map_for_get(duk_hthread *thr, duk_hobj * Used in E5 Section 10.6 algorithm for [[DefineOwnProperty]] (used by [[Put]]). * Assumes stack top contains 'put' value (which is NOT popped). */ -DUK_LOCAL void duk__check_arguments_map_for_put(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *temp_desc, duk_bool_t throw_flag) { +DUK_LOCAL void duk__check_arguments_map_for_put(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_propdesc *temp_desc, + duk_bool_t throw_flag) { duk_hobject *map; duk_hobject *varenv; duk_hstring *varname; @@ -58570,7 +59696,7 @@ DUK_LOCAL void duk__check_arguments_map_for_put(duk_hthread *thr, duk_hobject *o varname = duk_require_hstring(thr, -1); DUK_ASSERT(varname != NULL); - duk_pop_unsafe(thr); /* varname is still reachable */ + duk_pop_unsafe(thr); /* varname is still reachable */ DUK_DDD(DUK_DDDPRINT("arguments object automatic putvar for a bound variable; " "key=%!O, varname=%!O, value=%!T", @@ -58609,15 +59735,14 @@ DUK_LOCAL void duk__check_arguments_map_for_delete(duk_hthread *thr, duk_hobject map = duk_require_hobject(thr, -1); DUK_ASSERT(map != NULL); - duk_pop_unsafe(thr); /* map is reachable through obj */ + duk_pop_unsafe(thr); /* map is reachable through obj */ - DUK_DDD(DUK_DDDPRINT("-> have 'map', delete key %!O from map (if exists)); ignore result", - (duk_heaphdr *) key)); + DUK_DDD(DUK_DDDPRINT("-> have 'map', delete key %!O from map (if exists)); ignore result", (duk_heaphdr *) key)); /* Note: no recursion issue, we can trust 'map' to behave */ DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_BEHAVIOR(map)); DUK_DDD(DUK_DDDPRINT("map before deletion: %!O", (duk_heaphdr *) map)); - (void) duk_hobject_delprop_raw(thr, map, key, 0); /* ignore result */ + (void) duk_hobject_delprop_raw(thr, map, key, 0); /* ignore result */ DUK_DDD(DUK_DDDPRINT("map after deletion: %!O", (duk_heaphdr *) map)); } @@ -58660,14 +59785,24 @@ DUK_LOCAL void duk__check_arguments_map_for_delete(duk_hthread *thr, duk_hobject * accessor properties later, this would need to change. */ -DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_uint32_t arr_idx, duk_propdesc *out_desc, duk_small_uint_t flags) { +DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_uint32_t arr_idx, + duk_propdesc *out_desc, + duk_small_uint_t flags) { duk_tval *tv; DUK_DDD(DUK_DDDPRINT("duk_hobject_get_own_propdesc: thr=%p, obj=%p, key=%p, out_desc=%p, flags=%lx, " "arr_idx=%ld (obj -> %!O, key -> %!O)", - (void *) thr, (void *) obj, (void *) key, (void *) out_desc, - (long) flags, (long) arr_idx, - (duk_heaphdr *) obj, (duk_heaphdr *) key)); + (void *) thr, + (void *) obj, + (void *) key, + (void *) out_desc, + (long) flags, + (long) arr_idx, + (duk_heaphdr *) obj, + (duk_heaphdr *) key)); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -58741,14 +59876,13 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob duk_push_tval(thr, tv); } /* implicit attributes */ - out_desc->flags = DUK_PROPDESC_FLAG_WRITABLE | - DUK_PROPDESC_FLAG_CONFIGURABLE | - DUK_PROPDESC_FLAG_ENUMERABLE; + out_desc->flags = + DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_CONFIGURABLE | DUK_PROPDESC_FLAG_ENUMERABLE; out_desc->get = NULL; out_desc->set = NULL; out_desc->e_idx = -1; out_desc->h_idx = -1; - out_desc->a_idx = (duk_int_t) arr_idx; /* XXX: limit 2G due to being signed */ + out_desc->a_idx = (duk_int_t) arr_idx; /* XXX: limit 2G due to being signed */ goto prop_found; } } @@ -58769,7 +59903,8 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob duk_harray *a; DUK_DDD(DUK_DDDPRINT("array object exotic property get for key: %!O, arr_idx: %ld", - (duk_heaphdr *) key, (long) arr_idx)); + (duk_heaphdr *) key, + (long) arr_idx)); a = (duk_harray *) obj; DUK_HARRAY_ASSERT_VALID(a); @@ -58791,11 +59926,12 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob out_desc->a_idx = -1; DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj)); - goto prop_found_noexotic; /* cannot be arguments exotic */ + goto prop_found_noexotic; /* cannot be arguments exotic */ } } else if (DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(obj)) { DUK_DDD(DUK_DDDPRINT("string object exotic property get for key: %!O, arr_idx: %ld", - (duk_heaphdr *) key, (long) arr_idx)); + (duk_heaphdr *) key, + (long) arr_idx)); /* XXX: charlen; avoid multiple lookups? */ @@ -58810,9 +59946,9 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob DUK_DDD(DUK_DDDPRINT("-> found, array index inside string")); if (flags & DUK_GETDESC_FLAG_PUSH_VALUE) { duk_push_hstring(thr, h_val); - duk_substring(thr, -1, arr_idx, arr_idx + 1); /* [str] -> [substr] */ + duk_substring(thr, -1, arr_idx, arr_idx + 1); /* [str] -> [substr] */ } - out_desc->flags = DUK_PROPDESC_FLAG_ENUMERABLE | /* E5 Section 15.5.5.2 */ + out_desc->flags = DUK_PROPDESC_FLAG_ENUMERABLE | /* E5 Section 15.5.5.2 */ DUK_PROPDESC_FLAG_VIRTUAL; out_desc->get = NULL; out_desc->set = NULL; @@ -58821,7 +59957,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob out_desc->a_idx = -1; DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj)); - goto prop_found_noexotic; /* cannot be arguments exotic */ + goto prop_found_noexotic; /* cannot be arguments exotic */ } else { /* index is above internal string length -> property is fully normal */ DUK_DDD(DUK_DDDPRINT("array index outside string -> normal property")); @@ -58836,7 +59972,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob if (flags & DUK_GETDESC_FLAG_PUSH_VALUE) { duk_push_uint(thr, (duk_uint_t) DUK_HSTRING_GET_CHARLEN(h_val)); } - out_desc->flags = DUK_PROPDESC_FLAG_VIRTUAL; /* E5 Section 15.5.5.1 */ + out_desc->flags = DUK_PROPDESC_FLAG_VIRTUAL; /* E5 Section 15.5.5.1 */ out_desc->get = NULL; out_desc->set = NULL; out_desc->e_idx = -1; @@ -58844,7 +59980,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob out_desc->a_idx = -1; DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj)); - goto prop_found_noexotic; /* cannot be arguments exotic */ + goto prop_found_noexotic; /* cannot be arguments exotic */ } } #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) @@ -58855,8 +59991,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob h_bufobj = (duk_hbufobj *) obj; DUK_HBUFOBJ_ASSERT_VALID(h_bufobj); - DUK_DDD(DUK_DDDPRINT("bufobj property get for key: %!O, arr_idx: %ld", - (duk_heaphdr *) key, (long) arr_idx)); + DUK_DDD(DUK_DDDPRINT("bufobj property get for key: %!O, arr_idx: %ld", (duk_heaphdr *) key, (long) arr_idx)); if (arr_idx != DUK__NO_ARRAY_INDEX && DUK_HBUFOBJ_HAS_VIRTUAL_INDICES(h_bufobj)) { DUK_DDD(DUK_DDDPRINT("array index exists")); @@ -58865,21 +60000,22 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob * length downshift won't. */ if (arr_idx < (h_bufobj->length >> h_bufobj->shift)) { - byte_off = arr_idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ + byte_off = arr_idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ elem_size = (duk_small_uint_t) (1U << h_bufobj->shift); if (flags & DUK_GETDESC_FLAG_PUSH_VALUE) { duk_uint8_t *data; - if (h_bufobj->buf != NULL && DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_bufobj, byte_off + elem_size)) { - data = (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufobj->buf) + h_bufobj->offset + byte_off; + if (h_bufobj->buf != NULL && + DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_bufobj, byte_off + elem_size)) { + data = (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufobj->buf) + + h_bufobj->offset + byte_off; duk_hbufobj_push_validated_read(thr, h_bufobj, data, elem_size); } else { DUK_D(DUK_DPRINT("bufobj access out of underlying buffer, ignoring (read zero)")); duk_push_uint(thr, 0); } } - out_desc->flags = DUK_PROPDESC_FLAG_WRITABLE | - DUK_PROPDESC_FLAG_VIRTUAL; + out_desc->flags = DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_VIRTUAL; if (DUK_HOBJECT_GET_CLASS_NUMBER(obj) != DUK_HOBJECT_CLASS_ARRAYBUFFER) { /* ArrayBuffer indices are non-standard and are * non-enumerable to avoid their serialization. @@ -58893,7 +60029,8 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob out_desc->a_idx = -1; DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj)); - goto prop_found_noexotic; /* cannot be e.g. arguments exotic, since exotic 'traits' are mutually exclusive */ + goto prop_found_noexotic; /* cannot be e.g. arguments exotic, since exotic 'traits' are mutually + exclusive */ } else { /* index is above internal buffer length -> property is fully normal */ DUK_DDD(DUK_DDDPRINT("array index outside buffer -> normal property")); @@ -58915,10 +60052,10 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob out_desc->a_idx = -1; DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj)); - goto prop_found_noexotic; /* cannot be arguments exotic */ + goto prop_found_noexotic; /* cannot be arguments exotic */ } } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* Array properties have exotic behavior but they are concrete, * so no special handling here. @@ -58932,7 +60069,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob * Not found as concrete or virtual. */ - prop_not_found: +prop_not_found: DUK_DDD(DUK_DDDPRINT("-> not found (virtual, entry part, or array part)")); DUK_STATS_INC(thr->heap, stats_getownpropdesc_miss); return 0; @@ -58944,7 +60081,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob * description of [[GetOwnProperty]] variant for arguments. */ - prop_found: +prop_found: DUK_DDD(DUK_DDDPRINT("-> property found, checking for arguments exotic post-behavior")); /* Notes: @@ -58954,8 +60091,7 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob * DUK_GETDESC_FLAG_PUSH_VALUE is not set. */ - if (DUK_UNLIKELY(DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj) && - arr_idx != DUK__NO_ARRAY_INDEX && + if (DUK_UNLIKELY(DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj) && arr_idx != DUK__NO_ARRAY_INDEX && (flags & DUK_GETDESC_FLAG_PUSH_VALUE))) { duk_propdesc temp_desc; @@ -58981,12 +60117,13 @@ DUK_LOCAL duk_bool_t duk__get_own_propdesc_raw(duk_hthread *thr, duk_hobject *ob } } - prop_found_noexotic: +prop_found_noexotic: DUK_STATS_INC(thr->heap, stats_getownpropdesc_hit); return 1; } -DUK_INTERNAL duk_bool_t duk_hobject_get_own_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags) { +DUK_INTERNAL duk_bool_t +duk_hobject_get_own_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags) { DUK_ASSERT(thr != NULL); DUK_ASSERT(obj != NULL); DUK_ASSERT(key != NULL); @@ -59015,7 +60152,8 @@ DUK_INTERNAL duk_bool_t duk_hobject_get_own_propdesc(duk_hthread *thr, duk_hobje * pointers. */ -DUK_LOCAL duk_bool_t duk__get_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags) { +DUK_LOCAL duk_bool_t +duk__get_propdesc(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_propdesc *out_desc, duk_small_uint_t flags) { duk_hobject *curr; duk_uint32_t arr_idx; duk_uint_t sanity; @@ -59033,9 +60171,14 @@ DUK_LOCAL duk_bool_t duk__get_propdesc(duk_hthread *thr, duk_hobject *obj, duk_h DUK_DDD(DUK_DDDPRINT("duk__get_propdesc: thr=%p, obj=%p, key=%p, out_desc=%p, flags=%lx, " "arr_idx=%ld (obj -> %!O, key -> %!O)", - (void *) thr, (void *) obj, (void *) key, (void *) out_desc, - (long) flags, (long) arr_idx, - (duk_heaphdr *) obj, (duk_heaphdr *) key)); + (void *) thr, + (void *) obj, + (void *) key, + (void *) out_desc, + (long) flags, + (long) arr_idx, + (duk_heaphdr *) obj, + (duk_heaphdr *) key)); curr = obj; DUK_ASSERT(curr != NULL); @@ -59095,11 +60238,8 @@ DUK_LOCAL duk_tval *duk__getprop_shallow_fastpath_array_tval(duk_hthread *thr, d DUK_UNREF(thr); - if (!(DUK_HOBJECT_HAS_ARRAY_PART(obj) && - !DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj) && - !DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(obj) && - !DUK_HOBJECT_IS_BUFOBJ(obj) && - !DUK_HOBJECT_IS_PROXY(obj))) { + if (!(DUK_HOBJECT_HAS_ARRAY_PART(obj) && !DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(obj) && !DUK_HOBJECT_HAS_EXOTIC_STRINGOBJ(obj) && + !DUK_HOBJECT_IS_BUFOBJ(obj) && !DUK_HOBJECT_IS_PROXY(obj))) { /* Must have array part and no conflicting exotic behaviors. * Doesn't need to have array special behavior, e.g. Arguments * object has array part. @@ -59117,7 +60257,7 @@ DUK_LOCAL duk_tval *duk__getprop_shallow_fastpath_array_tval(duk_hthread *thr, d idx = duk__tval_fastint_to_arr_idx(tv_key); } else #endif - if (DUK_TVAL_IS_DOUBLE(tv_key)) { + if (DUK_TVAL_IS_DOUBLE(tv_key)) { idx = duk__tval_number_to_arr_idx(tv_key); } else { DUK_DDD(DUK_DDDPRINT("key is not a number")); @@ -59151,18 +60291,19 @@ DUK_LOCAL duk_tval *duk__getprop_shallow_fastpath_array_tval(duk_hthread *thr, d return NULL; } -DUK_LOCAL duk_bool_t duk__putprop_shallow_fastpath_array_tval(duk_hthread *thr, duk_hobject *obj, duk_tval *tv_key, duk_tval *tv_val) { +DUK_LOCAL duk_bool_t duk__putprop_shallow_fastpath_array_tval(duk_hthread *thr, + duk_hobject *obj, + duk_tval *tv_key, + duk_tval *tv_val) { duk_tval *tv; duk_harray *a; duk_uint32_t idx; duk_uint32_t old_len, new_len; - if (!(DUK_HOBJECT_HAS_EXOTIC_ARRAY(obj) && - DUK_HOBJECT_HAS_ARRAY_PART(obj) && - DUK_HOBJECT_HAS_EXTENSIBLE(obj))) { + if (!(DUK_HOBJECT_HAS_EXOTIC_ARRAY(obj) && DUK_HOBJECT_HAS_ARRAY_PART(obj) && DUK_HOBJECT_HAS_EXTENSIBLE(obj))) { return 0; } - DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); /* caller ensures */ + DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); /* caller ensures */ a = (duk_harray *) obj; DUK_HARRAY_ASSERT_VALID(a); @@ -59172,7 +60313,7 @@ DUK_LOCAL duk_bool_t duk__putprop_shallow_fastpath_array_tval(duk_hthread *thr, idx = duk__tval_fastint_to_arr_idx(tv_key); } else #endif - if (DUK_TVAL_IS_DOUBLE(tv_key)) { + if (DUK_TVAL_IS_DOUBLE(tv_key)) { idx = duk__tval_number_to_arr_idx(tv_key); } else { DUK_DDD(DUK_DDDPRINT("key is not a number")); @@ -59184,7 +60325,7 @@ DUK_LOCAL duk_bool_t duk__putprop_shallow_fastpath_array_tval(duk_hthread *thr, * because 0xffffffffUL will never be inside object 'a_size'. */ - if (idx >= DUK_HOBJECT_GET_ASIZE(obj)) { /* for resizing of array part, use slow path */ + if (idx >= DUK_HOBJECT_GET_ASIZE(obj)) { /* for resizing of array part, use slow path */ return 0; } DUK_ASSERT(idx != 0xffffffffUL); @@ -59195,7 +60336,8 @@ DUK_LOCAL duk_bool_t duk__putprop_shallow_fastpath_array_tval(duk_hthread *thr, if (idx >= old_len) { DUK_DDD(DUK_DDDPRINT("write new array entry requires length update " "(arr_idx=%ld, old_len=%ld)", - (long) idx, (long) old_len)); + (long) idx, + (long) old_len)); if (DUK_HARRAY_LENGTH_NONWRITABLE(a)) { /* The correct behavior here is either a silent error * or a TypeError, depending on strictness. Fall back @@ -59209,12 +60351,12 @@ DUK_LOCAL duk_bool_t duk__putprop_shallow_fastpath_array_tval(duk_hthread *thr, } tv = DUK_HOBJECT_A_GET_VALUE_PTR(thr->heap, obj, idx); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv_val); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv_val); /* side effects */ DUK_DDD(DUK_DDDPRINT("array fast path success for index %ld", (long) idx)); return 1; } -#endif /* DUK_USE_ARRAY_PROP_FASTPATH */ +#endif /* DUK_USE_ARRAY_PROP_FASTPATH */ /* * Fast path for bufobj getprop/putprop @@ -59241,7 +60383,7 @@ DUK_LOCAL duk_bool_t duk__getprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob idx = duk__tval_fastint_to_arr_idx(tv_key); } else #endif - if (DUK_TVAL_IS_DOUBLE(tv_key)) { + if (DUK_TVAL_IS_DOUBLE(tv_key)) { idx = duk__tval_number_to_arr_idx(tv_key); } else { return 0; @@ -59258,7 +60400,7 @@ DUK_LOCAL duk_bool_t duk__getprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob } DUK_ASSERT(idx != DUK__NO_ARRAY_INDEX); - byte_off = idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ + byte_off = idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ elem_size = (duk_small_uint_t) (1U << h_bufobj->shift); if (h_bufobj->buf != NULL && DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_bufobj, byte_off + elem_size)) { @@ -59271,7 +60413,7 @@ DUK_LOCAL duk_bool_t duk__getprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ #if defined(DUK_USE_BUFFEROBJECT_SUPPORT) DUK_LOCAL duk_bool_t duk__putprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hobject *obj, duk_tval *tv_key, duk_tval *tv_val) { @@ -59281,11 +60423,10 @@ DUK_LOCAL duk_bool_t duk__putprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob duk_small_uint_t elem_size; duk_uint8_t *data; - if (!(DUK_HOBJECT_IS_BUFOBJ(obj) && - DUK_TVAL_IS_NUMBER(tv_val))) { + if (!(DUK_HOBJECT_IS_BUFOBJ(obj) && DUK_TVAL_IS_NUMBER(tv_val))) { return 0; } - DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); /* caller ensures; rom objects are never bufobjs now */ + DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); /* caller ensures; rom objects are never bufobjs now */ h_bufobj = (duk_hbufobj *) obj; if (!DUK_HBUFOBJ_HAS_VIRTUAL_INDICES(h_bufobj)) { @@ -59297,7 +60438,7 @@ DUK_LOCAL duk_bool_t duk__putprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob idx = duk__tval_fastint_to_arr_idx(tv_key); } else #endif - if (DUK_TVAL_IS_DOUBLE(tv_key)) { + if (DUK_TVAL_IS_DOUBLE(tv_key)) { idx = duk__tval_number_to_arr_idx(tv_key); } else { return 0; @@ -59314,7 +60455,7 @@ DUK_LOCAL duk_bool_t duk__putprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob } DUK_ASSERT(idx != DUK__NO_ARRAY_INDEX); - byte_off = idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ + byte_off = idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ elem_size = (duk_small_uint_t) (1U << h_bufobj->shift); /* Value is required to be a number in the fast path so there @@ -59333,7 +60474,7 @@ DUK_LOCAL duk_bool_t duk__putprop_fastpath_bufobj_tval(duk_hthread *thr, duk_hob duk_pop_unsafe(thr); return 1; } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ /* * GETPROP: ECMAScript property read. @@ -59349,8 +60490,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, duk_uint_t sanity; DUK_DDD(DUK_DDDPRINT("getprop: thr=%p, obj=%p, key=%p (obj -> %!T, key -> %!T)", - (void *) thr, (void *) tv_obj, (void *) tv_key, - (duk_tval *) tv_obj, (duk_tval *) tv_key)); + (void *) thr, + (void *) tv_obj, + (void *) tv_key, + (duk_tval *) tv_obj, + (duk_tval *) tv_key)); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -59387,8 +60531,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, #if defined(DUK_USE_PARANOID_ERRORS) DUK_ERROR_TYPE(thr, DUK_STR_INVALID_BASE); #else - DUK_ERROR_FMT2(thr, DUK_ERR_TYPE_ERROR, "cannot read property %s of %s", - duk_push_string_tval_readable(thr, tv_key), duk_push_string_tval_readable(thr, tv_obj)); + DUK_ERROR_FMT2(thr, + DUK_ERR_TYPE_ERROR, + "cannot read property %s of %s", + duk_push_string_tval_readable(thr, tv_key), + duk_push_string_tval_readable(thr, tv_obj)); #endif DUK_WO_NORETURN(return 0;); break; @@ -59418,7 +60565,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, pop_count = 0; } else #endif - if (DUK_TVAL_IS_NUMBER(tv_key)) { + if (DUK_TVAL_IS_NUMBER(tv_key)) { arr_idx = duk__tval_number_to_arr_idx(tv_key); DUK_DDD(DUK_DDDPRINT("base object string, key is a fast-path number; arr_idx %ld", (long) arr_idx)); pop_count = 0; @@ -59427,15 +60574,15 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); DUK_DDD(DUK_DDDPRINT("base object string, key is a non-fast-path number; after " "coercion key is %!T, arr_idx %ld", - (duk_tval *) duk_get_tval(thr, -1), (long) arr_idx)); + (duk_tval *) duk_get_tval(thr, -1), + (long) arr_idx)); pop_count = 1; } - if (arr_idx != DUK__NO_ARRAY_INDEX && - arr_idx < DUK_HSTRING_GET_CHARLEN(h)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && arr_idx < DUK_HSTRING_GET_CHARLEN(h)) { duk_pop_n_unsafe(thr, pop_count); duk_push_hstring(thr, h); - duk_substring(thr, -1, arr_idx, arr_idx + 1); /* [str] -> [substr] */ + duk_substring(thr, -1, arr_idx, arr_idx + 1); /* [str] -> [substr] */ DUK_STATS_INC(thr->heap, stats_getprop_stringidx); DUK_DDD(DUK_DDDPRINT("-> %!T (base is string, key is an index inside string length " @@ -59452,12 +60599,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); DUK_DDD(DUK_DDDPRINT("base object string, key is a non-fast-path number; after " "coercion key is %!T, arr_idx %ld", - (duk_tval *) duk_get_tval(thr, -1), (long) arr_idx)); + (duk_tval *) duk_get_tval(thr, -1), + (long) arr_idx)); } if (key == DUK_HTHREAD_STRING_LENGTH(thr)) { - duk_pop_unsafe(thr); /* [key] -> [] */ - duk_push_uint(thr, (duk_uint_t) DUK_HSTRING_GET_CHARLEN(h)); /* [] -> [res] */ + duk_pop_unsafe(thr); /* [key] -> [] */ + duk_push_uint(thr, (duk_uint_t) DUK_HSTRING_GET_CHARLEN(h)); /* [] -> [res] */ DUK_STATS_INC(thr->heap, stats_getprop_stringlen); DUK_DDD(DUK_DDDPRINT("-> %!T (base is string, key is 'length' after coercion -> " @@ -59468,7 +60616,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_DDD(DUK_DDDPRINT("base object is a string, start lookup from string prototype")); curr = thr->builtins[DUK_BIDX_STRING_PROTOTYPE]; - goto lookup; /* avoid double coercion */ + goto lookup; /* avoid double coercion */ } case DUK_TAG_OBJECT: { @@ -59513,9 +60661,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, /* -> [ ... trap handler ] */ DUK_DDD(DUK_DDDPRINT("-> proxy object 'get' for key %!T", (duk_tval *) tv_key)); DUK_STATS_INC(thr->heap, stats_getprop_proxy); - duk_push_hobject(thr, h_target); /* target */ - duk_push_tval(thr, tv_key); /* P */ - duk_push_tval(thr, tv_obj); /* Receiver: Proxy object */ + duk_push_hobject(thr, h_target); /* target */ + duk_push_tval(thr, tv_key); /* P */ + duk_push_tval(thr, tv_obj); /* Receiver: Proxy object */ duk_call_method(thr, 3 /*nargs*/); /* Target object must be checked for a conflicting @@ -59525,25 +60673,27 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); if (duk__get_own_propdesc_raw(thr, h_target, key, arr_idx, &desc, DUK_GETDESC_FLAG_PUSH_VALUE)) { - duk_tval *tv_hook = duk_require_tval(thr, -3); /* value from hook */ - duk_tval *tv_targ = duk_require_tval(thr, -1); /* value from target */ + duk_tval *tv_hook = duk_require_tval(thr, -3); /* value from hook */ + duk_tval *tv_targ = duk_require_tval(thr, -1); /* value from target */ duk_bool_t datadesc_reject; duk_bool_t accdesc_reject; DUK_DDD(DUK_DDDPRINT("proxy 'get': target has matching property %!O, check for " "conflicting property; tv_hook=%!T, tv_targ=%!T, desc.flags=0x%08lx, " "desc.get=%p, desc.set=%p", - (duk_heaphdr *) key, (duk_tval *) tv_hook, (duk_tval *) tv_targ, + (duk_heaphdr *) key, + (duk_tval *) tv_hook, + (duk_tval *) tv_targ, (unsigned long) desc.flags, - (void *) desc.get, (void *) desc.set)); + (void *) desc.get, + (void *) desc.set)); datadesc_reject = !(desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) && !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && !(desc.flags & DUK_PROPDESC_FLAG_WRITABLE) && !duk_js_samevalue(tv_hook, tv_targ); accdesc_reject = (desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) && - !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && - (desc.get == NULL) && + !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && (desc.get == NULL) && !DUK_TVAL_IS_UNDEFINED(tv_hook); if (datadesc_reject || accdesc_reject) { DUK_ERROR_TYPE(thr, DUK_STR_PROXY_REJECTED); @@ -59554,13 +60704,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, } else { duk_pop_unsafe(thr); } - return 1; /* return value */ + return 1; /* return value */ } - curr = h_target; /* resume lookup from target */ + curr = h_target; /* resume lookup from target */ DUK_TVAL_SET_OBJECT(tv_obj, curr); } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ if (DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(curr)) { arr_idx = duk__push_tval_to_property_key(thr, tv_key, &key); @@ -59575,11 +60725,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, /* no need for 'caller' post-check, because 'key' must be an array index */ - duk_remove_m2(thr); /* [key result] -> [result] */ + duk_remove_m2(thr); /* [key result] -> [result] */ return 1; } - goto lookup; /* avoid double coercion */ + goto lookup; /* avoid double coercion */ } break; } @@ -59601,10 +60751,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, arr_idx = duk__tval_fastint_to_arr_idx(tv_key); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a fast-path fastint; arr_idx %ld", (long) arr_idx)); pop_count = 0; - } - else + } else #endif - if (DUK_TVAL_IS_NUMBER(tv_key)) { + if (DUK_TVAL_IS_NUMBER(tv_key)) { arr_idx = duk__tval_number_to_arr_idx(tv_key); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a fast-path number; arr_idx %ld", (long) arr_idx)); pop_count = 0; @@ -59613,12 +60762,12 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a non-fast-path number; after " "coercion key is %!T, arr_idx %ld", - (duk_tval *) duk_get_tval(thr, -1), (long) arr_idx)); + (duk_tval *) duk_get_tval(thr, -1), + (long) arr_idx)); pop_count = 1; } - if (arr_idx != DUK__NO_ARRAY_INDEX && - arr_idx < DUK_HBUFFER_GET_SIZE(h)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && arr_idx < DUK_HBUFFER_GET_SIZE(h)) { duk_pop_n_unsafe(thr, pop_count); duk_push_uint(thr, ((duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h))[arr_idx]); DUK_STATS_INC(thr->heap, stats_getprop_bufferidx); @@ -59636,12 +60785,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a non-fast-path number; after " "coercion key is %!T, arr_idx %ld", - (duk_tval *) duk_get_tval(thr, -1), (long) arr_idx)); + (duk_tval *) duk_get_tval(thr, -1), + (long) arr_idx)); } if (key == DUK_HTHREAD_STRING_LENGTH(thr)) { - duk_pop_unsafe(thr); /* [key] -> [] */ - duk_push_uint(thr, (duk_uint_t) DUK_HBUFFER_GET_SIZE(h)); /* [] -> [res] */ + duk_pop_unsafe(thr); /* [key] -> [] */ + duk_push_uint(thr, (duk_uint_t) DUK_HBUFFER_GET_SIZE(h)); /* [] -> [res] */ DUK_STATS_INC(thr->heap, stats_getprop_bufferlen); DUK_DDD(DUK_DDDPRINT("-> %!T (base is buffer, key is 'length' " @@ -59652,7 +60802,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, DUK_DDD(DUK_DDDPRINT("base object is a buffer, start lookup from Uint8Array prototype")); curr = thr->builtins[DUK_BIDX_UINT8ARRAY_PROTOTYPE]; - goto lookup; /* avoid double coercion */ + goto lookup; /* avoid double coercion */ } case DUK_TAG_POINTER: { @@ -59689,7 +60839,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, * Property lookup */ - lookup: +lookup: /* [key] (coerced) */ DUK_ASSERT(curr != NULL); DUK_ASSERT(key != NULL); @@ -59704,25 +60854,23 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, /* accessor with defined getter */ DUK_ASSERT((desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) != 0); - duk_pop_unsafe(thr); /* [key undefined] -> [key] */ + duk_pop_unsafe(thr); /* [key undefined] -> [key] */ duk_push_hobject(thr, desc.get); - duk_push_tval(thr, tv_obj); /* note: original, uncoerced base */ + duk_push_tval(thr, tv_obj); /* note: original, uncoerced base */ #if defined(DUK_USE_NONSTD_GETTER_KEY_ARGUMENT) duk_dup_m3(thr); - duk_call_method(thr, 1); /* [key getter this key] -> [key retval] */ + duk_call_method(thr, 1); /* [key getter this key] -> [key retval] */ #else - duk_call_method(thr, 0); /* [key getter this] -> [key retval] */ + duk_call_method(thr, 0); /* [key getter this] -> [key retval] */ #endif } else { /* [key value] or [key undefined] */ /* data property or accessor without getter */ - DUK_ASSERT(((desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) == 0) || - (desc.get == NULL)); + DUK_ASSERT(((desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) == 0) || (desc.get == NULL)); /* if accessor without getter, return value is undefined */ - DUK_ASSERT(((desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) == 0) || - duk_is_undefined(thr, -1)); + DUK_ASSERT(((desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) == 0) || duk_is_undefined(thr, -1)); /* Note: for an accessor without getter, falling through to * check for "caller" exotic behavior is unnecessary as @@ -59731,9 +60879,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, */ } - goto found; /* [key result] */ + goto found; /* [key result] */ - next_in_chain: + next_in_chain: /* XXX: option to pretend property doesn't exist if sanity limit is * hit might be useful. */ @@ -59748,7 +60896,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, * Not found */ - duk_to_undefined(thr, -1); /* [key] -> [undefined] (default value) */ + duk_to_undefined(thr, -1); /* [key] -> [undefined] (default value) */ DUK_DDD(DUK_DDDPRINT("-> %!T (not found)", (duk_tval *) duk_get_tval(thr, -1))); return 0; @@ -59757,7 +60905,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, * Found; post-processing (Function and arguments objects) */ - found: +found: /* [key result] */ #if !defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) @@ -59787,13 +60935,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, * This exotic behavior is disabled when the non-standard 'caller' property * is enabled, as it conflicts with the free use of 'caller'. */ - if (key == DUK_HTHREAD_STRING_CALLER(thr) && - DUK_TVAL_IS_OBJECT(tv_obj)) { + if (key == DUK_HTHREAD_STRING_CALLER(thr) && DUK_TVAL_IS_OBJECT(tv_obj)) { duk_hobject *orig = DUK_TVAL_GET_OBJECT(tv_obj); DUK_ASSERT(orig != NULL); - if (DUK_HOBJECT_IS_NONBOUND_FUNCTION(orig) || - DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(orig)) { + if (DUK_HOBJECT_IS_NONBOUND_FUNCTION(orig) || DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(orig)) { duk_hobject *h; /* XXX: The TypeError is currently not applied to bound @@ -59804,19 +60950,17 @@ DUK_INTERNAL duk_bool_t duk_hobject_getprop(duk_hthread *thr, duk_tval *tv_obj, */ DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(orig)); - h = duk_get_hobject(thr, -1); /* NULL if not an object */ - if (h && - DUK_HOBJECT_IS_FUNCTION(h) && - DUK_HOBJECT_HAS_STRICT(h)) { + h = duk_get_hobject(thr, -1); /* NULL if not an object */ + if (h && DUK_HOBJECT_IS_FUNCTION(h) && DUK_HOBJECT_HAS_STRICT(h)) { /* XXX: sufficient to check 'strict', assert for 'is function' */ DUK_ERROR_TYPE(thr, DUK_STR_STRICT_CALLER_READ); DUK_WO_NORETURN(return 0;); } } } -#endif /* !DUK_USE_NONSTD_FUNC_CALLER_PROPERTY */ +#endif /* !DUK_USE_NONSTD_FUNC_CALLER_PROPERTY */ - duk_remove_m2(thr); /* [key result] -> [result] */ + duk_remove_m2(thr); /* [key result] -> [result] */ DUK_DDD(DUK_DDDPRINT("-> %!T (found)", (duk_tval *) duk_get_tval(thr, -1))); return 1; @@ -59838,8 +60982,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_hasprop(duk_hthread *thr, duk_tval *tv_obj, duk_propdesc desc; DUK_DDD(DUK_DDDPRINT("hasprop: thr=%p, obj=%p, key=%p (obj -> %!T, key -> %!T)", - (void *) thr, (void *) tv_obj, (void *) tv_key, - (duk_tval *) tv_obj, (duk_tval *) tv_key)); + (void *) thr, + (void *) tv_obj, + (void *) tv_key, + (duk_tval *) tv_obj, + (duk_tval *) tv_key)); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -59911,8 +61058,8 @@ DUK_INTERNAL duk_bool_t duk_hobject_hasprop(duk_hthread *thr, duk_tval *tv_obj, if (duk__proxy_check_prop(thr, obj, DUK_STRIDX_HAS, tv_key, &h_target)) { /* [ ... key trap handler ] */ DUK_DDD(DUK_DDDPRINT("-> proxy object 'has' for key %!T", (duk_tval *) tv_key)); - duk_push_hobject(thr, h_target); /* target */ - duk_push_tval(thr, tv_key); /* P */ + duk_push_hobject(thr, h_target); /* target */ + duk_push_tval(thr, tv_key); /* P */ duk_call_method(thr, 2 /*nargs*/); tmp_bool = duk_to_boolean_top_pop(thr); if (!tmp_bool) { @@ -59920,39 +61067,42 @@ DUK_INTERNAL duk_bool_t duk_hobject_hasprop(duk_hthread *thr, duk_tval *tv_obj, * non-configurable property. */ - if (duk__get_own_propdesc_raw(thr, h_target, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ + if (duk__get_own_propdesc_raw(thr, h_target, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push + value */ DUK_DDD(DUK_DDDPRINT("proxy 'has': target has matching property %!O, check for " "conflicting property; desc.flags=0x%08lx, " "desc.get=%p, desc.set=%p", - (duk_heaphdr *) key, (unsigned long) desc.flags, - (void *) desc.get, (void *) desc.set)); + (duk_heaphdr *) key, + (unsigned long) desc.flags, + (void *) desc.get, + (void *) desc.set)); /* XXX: Extensibility check for target uses IsExtensible(). If we * implemented the isExtensible trap and didn't reject proxies as * proxy targets, it should be respected here. */ - if (!((desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && /* property is configurable and */ - DUK_HOBJECT_HAS_EXTENSIBLE(h_target))) { /* ... target is extensible */ + if (!((desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && /* property is configurable and */ + DUK_HOBJECT_HAS_EXTENSIBLE(h_target))) { /* ... target is extensible */ DUK_ERROR_TYPE(thr, DUK_STR_PROXY_REJECTED); DUK_WO_NORETURN(return 0;); } } } - duk_pop_unsafe(thr); /* [ key ] -> [] */ + duk_pop_unsafe(thr); /* [ key ] -> [] */ return tmp_bool; } - obj = h_target; /* resume check from proxy target */ + obj = h_target; /* resume check from proxy target */ } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ /* XXX: inline into a prototype walking loop? */ - rc = duk__get_propdesc(thr, obj, key, &desc, 0 /*flags*/); /* don't push value */ + rc = duk__get_propdesc(thr, obj, key, &desc, 0 /*flags*/); /* don't push value */ /* fall through */ - pop_and_return: - duk_pop_unsafe(thr); /* [ key ] -> [] */ +pop_and_return: + duk_pop_unsafe(thr); /* [ key ] -> [] */ return rc; } @@ -59978,7 +61128,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_hasprop_raw(duk_hthread *thr, duk_hobject *o DUK_ASSERT_VALSTACK_SPACE(thr, DUK__VALSTACK_SPACE); - return duk__get_propdesc(thr, obj, key, &dummy, DUK_GETDESC_FLAG_IGNORE_PROTOLOOP); /* don't push value */ + return duk__get_propdesc(thr, obj, key, &dummy, DUK_GETDESC_FLAG_IGNORE_PROTOLOOP); /* don't push value */ } /* @@ -60010,16 +61160,16 @@ DUK_LOCAL duk_uint32_t duk__to_new_array_length_checked(duk_hthread *thr, duk_tv } return (duk_uint32_t) fi; } -#else /* DUK_USE_FASTINT */ +#else /* DUK_USE_FASTINT */ /* When fastints are not enabled, the most interesting case is any * number. */ if (DUK_TVAL_IS_DOUBLE(tv)) { d = DUK_TVAL_GET_NUMBER(tv); } -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ else -#endif /* !DUK_USE_PREFER_SIZE */ +#endif /* !DUK_USE_PREFER_SIZE */ { /* In all other cases, and when doing a size optimized build, * fall back to the comprehensive handler. @@ -60037,7 +61187,7 @@ DUK_LOCAL duk_uint32_t duk__to_new_array_length_checked(duk_hthread *thr, duk_tv return res; - fail_range: +fail_range: DUK_ERROR_RANGE(thr, DUK_STR_INVALID_ARRAY_LENGTH); DUK_WO_NORETURN(return 0;); } @@ -60065,7 +61215,8 @@ duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("new array length smaller than old (%ld -> %ld), " "probably need to remove elements", - (long) old_len, (long) new_len)); + (long) old_len, + (long) new_len)); /* * New length is smaller than old length, need to delete properties above @@ -60111,7 +61262,7 @@ duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, while (i > new_len) { i--; tv = DUK_HOBJECT_A_GET_VALUE_PTR(thr->heap, obj, i); - DUK_TVAL_SET_UNUSED_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_UNUSED_UPDREF(thr, tv); /* side effects */ } *out_result_len = new_len; @@ -60146,19 +61297,22 @@ duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, continue; } - DUK_ASSERT(DUK_HSTRING_HAS_ARRIDX(key)); /* XXX: macro checks for array index flag, which is unnecessary here */ + DUK_ASSERT( + DUK_HSTRING_HAS_ARRIDX(key)); /* XXX: macro checks for array index flag, which is unnecessary here */ arr_idx = DUK_HSTRING_GET_ARRIDX_SLOW(key); DUK_ASSERT(arr_idx != DUK__NO_ARRAY_INDEX); - DUK_ASSERT(arr_idx < old_len); /* consistency requires this */ + DUK_ASSERT(arr_idx < old_len); /* consistency requires this */ if (arr_idx < new_len) { DUK_DDD(DUK_DDDPRINT("skip entry index %ld: key is array index %ld, below new_len", - (long) i, (long) arr_idx)); + (long) i, + (long) arr_idx)); continue; } if (DUK_HOBJECT_E_SLOT_IS_CONFIGURABLE(thr->heap, obj, i)) { DUK_DDD(DUK_DDDPRINT("skip entry index %ld: key is a relevant array index %ld, but configurable", - (long) i, (long) arr_idx)); + (long) i, + (long) arr_idx)); continue; } @@ -60166,17 +61320,19 @@ duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, if (arr_idx >= target_len) { DUK_DDD(DUK_DDDPRINT("entry at index %ld has arr_idx %ld, is not configurable, " "update target_len %ld -> %ld", - (long) i, (long) arr_idx, (long) target_len, + (long) i, + (long) arr_idx, + (long) target_len, (long) (arr_idx + 1))); target_len = arr_idx + 1; } } - skip_stage1: + skip_stage1: /* stage 2: delete configurable entries above target length */ - DUK_DDD(DUK_DDDPRINT("old_len=%ld, new_len=%ld, target_len=%ld", - (long) old_len, (long) new_len, (long) target_len)); + DUK_DDD( + DUK_DDDPRINT("old_len=%ld, new_len=%ld, target_len=%ld", (long) old_len, (long) new_len, (long) target_len)); DUK_DDD(DUK_DDDPRINT("array length write, no array part, stage 2: remove " "entries >= target_len")); @@ -60192,20 +61348,21 @@ duk_bool_t duk__handle_put_array_length_smaller(duk_hthread *thr, continue; } - DUK_ASSERT(DUK_HSTRING_HAS_ARRIDX(key)); /* XXX: macro checks for array index flag, which is unnecessary here */ + DUK_ASSERT( + DUK_HSTRING_HAS_ARRIDX(key)); /* XXX: macro checks for array index flag, which is unnecessary here */ arr_idx = DUK_HSTRING_GET_ARRIDX_SLOW(key); DUK_ASSERT(arr_idx != DUK__NO_ARRAY_INDEX); - DUK_ASSERT(arr_idx < old_len); /* consistency requires this */ + DUK_ASSERT(arr_idx < old_len); /* consistency requires this */ if (arr_idx < target_len) { DUK_DDD(DUK_DDDPRINT("skip entry index %ld: key is array index %ld, below target_len", - (long) i, (long) arr_idx)); + (long) i, + (long) arr_idx)); continue; } - DUK_ASSERT(force_flag || DUK_HOBJECT_E_SLOT_IS_CONFIGURABLE(thr->heap, obj, i)); /* stage 1 guarantees */ + DUK_ASSERT(force_flag || DUK_HOBJECT_E_SLOT_IS_CONFIGURABLE(thr->heap, obj, i)); /* stage 1 guarantees */ - DUK_DDD(DUK_DDDPRINT("delete entry index %ld: key is array index %ld", - (long) i, (long) arr_idx)); + DUK_DDD(DUK_DDDPRINT("delete entry index %ld: key is array index %ld", (long) i, (long) arr_idx)); /* * Slow delete, but we don't care as we're already in a very slow path. @@ -60336,11 +61493,12 @@ DUK_LOCAL duk_bool_t duk__handle_put_array_length(duk_hthread *thr, duk_hobject * (We currently make a copy of all of the input values to avoid issues.) */ -DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key, duk_tval *tv_val, duk_bool_t throw_flag) { +DUK_INTERNAL duk_bool_t +duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, duk_tval *tv_key, duk_tval *tv_val, duk_bool_t throw_flag) { duk_tval tv_obj_copy; duk_tval tv_key_copy; duk_tval tv_val_copy; - duk_hobject *orig = NULL; /* NULL if tv_obj is primitive */ + duk_hobject *orig = NULL; /* NULL if tv_obj is primitive */ duk_hobject *curr; duk_hstring *key = NULL; duk_propdesc desc; @@ -60349,12 +61507,18 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, duk_bool_t rc; duk_int_t e_idx; duk_uint_t sanity; - duk_uint32_t new_array_length = 0; /* 0 = no update */ + duk_uint32_t new_array_length = 0; /* 0 = no update */ DUK_DDD(DUK_DDDPRINT("putprop: thr=%p, obj=%p, key=%p, val=%p, throw=%ld " "(obj -> %!T, key -> %!T, val -> %!T)", - (void *) thr, (void *) tv_obj, (void *) tv_key, (void *) tv_val, - (long) throw_flag, (duk_tval *) tv_obj, (duk_tval *) tv_key, (duk_tval *) tv_val)); + (void *) thr, + (void *) tv_obj, + (void *) tv_key, + (void *) tv_val, + (long) throw_flag, + (duk_tval *) tv_obj, + (duk_tval *) tv_key, + (duk_tval *) tv_val)); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -60389,13 +61553,15 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, case DUK_TAG_UNDEFINED: case DUK_TAG_NULL: { /* Note: unconditional throw */ - DUK_DDD(DUK_DDDPRINT("base object is undefined or null -> reject (object=%!iT)", - (duk_tval *) tv_obj)); + DUK_DDD(DUK_DDDPRINT("base object is undefined or null -> reject (object=%!iT)", (duk_tval *) tv_obj)); #if defined(DUK_USE_PARANOID_ERRORS) DUK_ERROR_TYPE(thr, DUK_STR_INVALID_BASE); #else - DUK_ERROR_FMT2(thr, DUK_ERR_TYPE_ERROR, "cannot write property %s of %s", - duk_push_string_tval_readable(thr, tv_key), duk_push_string_tval_readable(thr, tv_obj)); + DUK_ERROR_FMT2(thr, + DUK_ERR_TYPE_ERROR, + "cannot write property %s of %s", + duk_push_string_tval_readable(thr, tv_key), + duk_push_string_tval_readable(thr, tv_obj)); #endif DUK_WO_NORETURN(return 0;); break; @@ -60429,14 +61595,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, goto fail_not_writable; } - if (arr_idx != DUK__NO_ARRAY_INDEX && - arr_idx < DUK_HSTRING_GET_CHARLEN(h)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && arr_idx < DUK_HSTRING_GET_CHARLEN(h)) { goto fail_not_writable; } DUK_DDD(DUK_DDDPRINT("base object is a string, start lookup from string prototype")); curr = thr->builtins[DUK_BIDX_STRING_PROTOTYPE]; - goto lookup; /* avoid double coercion */ + goto lookup; /* avoid double coercion */ } case DUK_TAG_OBJECT: { @@ -60451,7 +61616,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, */ if (DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) orig)) { DUK_DD(DUK_DDPRINT("attempt to putprop on read-only target object")); - goto fail_not_writable_no_pop; /* Must avoid duk_pop() in exit path */ + goto fail_not_writable_no_pop; /* Must avoid duk_pop() in exit path */ } #endif @@ -60497,10 +61662,10 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, /* -> [ ... trap handler ] */ DUK_DDD(DUK_DDDPRINT("-> proxy object 'set' for key %!T", (duk_tval *) tv_key)); DUK_STATS_INC(thr->heap, stats_putprop_proxy); - duk_push_hobject(thr, h_target); /* target */ - duk_push_tval(thr, tv_key); /* P */ - duk_push_tval(thr, tv_val); /* V */ - duk_push_tval(thr, tv_obj); /* Receiver: Proxy object */ + duk_push_hobject(thr, h_target); /* target */ + duk_push_tval(thr, tv_key); /* P */ + duk_push_tval(thr, tv_val); /* V */ + duk_push_tval(thr, tv_obj); /* Receiver: Proxy object */ duk_call_method(thr, 4 /*nargs*/); tmp_bool = duk_to_boolean_top_pop(thr); if (!tmp_bool) { @@ -60521,17 +61686,19 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_DDD(DUK_DDDPRINT("proxy 'set': target has matching property %!O, check for " "conflicting property; tv_val=%!T, tv_targ=%!T, desc.flags=0x%08lx, " "desc.get=%p, desc.set=%p", - (duk_heaphdr *) key, (duk_tval *) tv_val, (duk_tval *) tv_targ, + (duk_heaphdr *) key, + (duk_tval *) tv_val, + (duk_tval *) tv_targ, (unsigned long) desc.flags, - (void *) desc.get, (void *) desc.set)); + (void *) desc.get, + (void *) desc.set)); datadesc_reject = !(desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) && !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && !(desc.flags & DUK_PROPDESC_FLAG_WRITABLE) && !duk_js_samevalue(tv_val, tv_targ); accdesc_reject = (desc.flags & DUK_PROPDESC_FLAG_ACCESSOR) && - !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && - (desc.set == NULL); + !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE) && (desc.set == NULL); if (datadesc_reject || accdesc_reject) { DUK_ERROR_TYPE(thr, DUK_STR_PROXY_REJECTED); DUK_WO_NORETURN(return 0;); @@ -60541,13 +61708,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, } else { duk_pop_unsafe(thr); } - return 1; /* success */ + return 1; /* success */ } - orig = h_target; /* resume write to target */ + orig = h_target; /* resume write to target */ DUK_TVAL_SET_OBJECT(tv_obj, orig); } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ curr = orig; break; @@ -60569,7 +61736,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, pop_count = 0; } else #endif - if (DUK_TVAL_IS_NUMBER(tv_key)) { + if (DUK_TVAL_IS_NUMBER(tv_key)) { arr_idx = duk__tval_number_to_arr_idx(tv_key); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a fast-path number; arr_idx %ld", (long) arr_idx)); pop_count = 0; @@ -60578,12 +61745,12 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a non-fast-path number; after " "coercion key is %!T, arr_idx %ld", - (duk_tval *) duk_get_tval(thr, -1), (long) arr_idx)); + (duk_tval *) duk_get_tval(thr, -1), + (long) arr_idx)); pop_count = 1; } - if (arr_idx != DUK__NO_ARRAY_INDEX && - arr_idx < DUK_HBUFFER_GET_SIZE(h)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && arr_idx < DUK_HBUFFER_GET_SIZE(h)) { duk_uint8_t *data; DUK_DDD(DUK_DDDPRINT("writing to buffer data at index %ld", (long) arr_idx)); data = (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h); @@ -60595,8 +61762,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, /* Buffer writes are often integers. */ if (DUK_TVAL_IS_FASTINT(tv_val)) { data[arr_idx] = (duk_uint8_t) DUK_TVAL_GET_FASTINT_U32(tv_val); - } - else + } else #endif { duk_push_tval(thr, tv_val); @@ -60618,7 +61784,8 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(key != NULL); DUK_DDD(DUK_DDDPRINT("base object buffer, key is a non-fast-path number; after " "coercion key is %!T, arr_idx %ld", - (duk_tval *) duk_get_tval(thr, -1), (long) arr_idx)); + (duk_tval *) duk_get_tval(thr, -1), + (long) arr_idx)); } if (key == DUK_HTHREAD_STRING_LENGTH(thr)) { @@ -60627,7 +61794,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_DDD(DUK_DDDPRINT("base object is a buffer, start lookup from Uint8Array prototype")); curr = thr->builtins[DUK_BIDX_UINT8ARRAY_PROTOTYPE]; - goto lookup; /* avoid double coercion */ + goto lookup; /* avoid double coercion */ } case DUK_TAG_POINTER: { @@ -60662,7 +61829,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, arr_idx = duk__push_tval_to_property_key(thr, tv_key, &key); DUK_ASSERT(key != NULL); - lookup: +lookup: /* * Check whether the property already exists in the prototype chain. @@ -60675,7 +61842,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(curr != NULL); sanity = DUK_HOBJECT_PROTOTYPE_CHAIN_SANITY; do { - if (!duk__get_own_propdesc_raw(thr, curr, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ + if (!duk__get_own_propdesc_raw(thr, curr, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ goto next_in_chain; } @@ -60698,15 +61865,15 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, goto fail_no_setter; } duk_push_hobject(thr, setter); - duk_push_tval(thr, tv_obj); /* note: original, uncoerced base */ - duk_push_tval(thr, tv_val); /* [key setter this val] */ + duk_push_tval(thr, tv_obj); /* note: original, uncoerced base */ + duk_push_tval(thr, tv_val); /* [key setter this val] */ #if defined(DUK_USE_NONSTD_SETTER_KEY_ARGUMENT) duk_dup_m4(thr); - duk_call_method(thr, 2); /* [key setter this val key] -> [key retval] */ + duk_call_method(thr, 2); /* [key setter this val key] -> [key retval] */ #else - duk_call_method(thr, 1); /* [key setter this val] -> [key retval] */ + duk_call_method(thr, 1); /* [key setter this val] -> [key retval] */ #endif - duk_pop_unsafe(thr); /* ignore retval -> [key] */ + duk_pop_unsafe(thr); /* ignore retval -> [key] */ goto success_no_arguments_exotic; } @@ -60726,11 +61893,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, * new property to 'orig'. */ if (!DUK_HOBJECT_HAS_EXTENSIBLE(orig)) { - DUK_DD(DUK_DDPRINT("found existing inherited plain property, but original object is not extensible")); + DUK_DD( + DUK_DDPRINT("found existing inherited plain property, but original object is not extensible")); goto fail_not_extensible; } if (!(desc.flags & DUK_PROPDESC_FLAG_WRITABLE)) { - DUK_DD(DUK_DDPRINT("found existing inherited plain property, original object is extensible, but inherited property is not writable")); + DUK_DD(DUK_DDPRINT("found existing inherited plain property, original object is extensible, but " + "inherited property is not writable")); goto fail_not_writable; } DUK_DD(DUK_DDPRINT("put to new property, object extensible, inherited property found and is writable")); @@ -60742,7 +61911,8 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, */ if (!(desc.flags & DUK_PROPDESC_FLAG_WRITABLE)) { - DUK_DD(DUK_DDPRINT("found existing own (non-inherited) plain property, but property is not writable")); + DUK_DD( + DUK_DDPRINT("found existing own (non-inherited) plain property, but property is not writable")); goto fail_not_writable; } if (desc.flags & DUK_PROPDESC_FLAG_VIRTUAL) { @@ -60759,18 +61929,19 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, * Note: the helper has an unnecessary writability check * for 'length', we already know it is writable. */ - DUK_ASSERT(key == DUK_HTHREAD_STRING_LENGTH(thr)); /* only virtual array property */ + DUK_ASSERT(key == DUK_HTHREAD_STRING_LENGTH(thr)); /* only virtual array property */ - DUK_DDD(DUK_DDDPRINT("writing existing 'length' property to array exotic, invoke complex helper")); + DUK_DDD(DUK_DDDPRINT( + "writing existing 'length' property to array exotic, invoke complex helper")); /* XXX: the helper currently assumes stack top contains new * 'length' value and the whole calling convention is not very * compatible with what we need. */ - duk_push_tval(thr, tv_val); /* [key val] */ + duk_push_tval(thr, tv_val); /* [key val] */ rc = duk__handle_put_array_length(thr, orig); - duk_pop_unsafe(thr); /* [key val] -> [key] */ + duk_pop_unsafe(thr); /* [key val] -> [key] */ if (!rc) { goto fail_array_length_partial; } @@ -60792,12 +61963,14 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, /* Careful with wrapping: arr_idx upshift may easily wrap, whereas * length downshift won't. */ - if (arr_idx < (h_bufobj->length >> h_bufobj->shift) && DUK_HBUFOBJ_HAS_VIRTUAL_INDICES(h_bufobj)) { + if (arr_idx < (h_bufobj->length >> h_bufobj->shift) && + DUK_HBUFOBJ_HAS_VIRTUAL_INDICES(h_bufobj)) { duk_uint8_t *data; DUK_DDD(DUK_DDDPRINT("writing to buffer data at index %ld", (long) arr_idx)); - DUK_ASSERT(arr_idx != DUK__NO_ARRAY_INDEX); /* index/length check guarantees */ - byte_off = arr_idx << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ + DUK_ASSERT(arr_idx != DUK__NO_ARRAY_INDEX); /* index/length check guarantees */ + byte_off = arr_idx + << h_bufobj->shift; /* no wrap assuming h_bufobj->length is valid */ elem_size = (duk_small_uint_t) (1U << h_bufobj->shift); /* Coerce to number before validating pointers etc so that the @@ -60808,27 +61981,30 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, duk_push_tval(thr, tv_val); (void) duk_to_number_m1(thr); - if (h_bufobj->buf != NULL && DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_bufobj, byte_off + elem_size)) { - data = (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufobj->buf) + h_bufobj->offset + byte_off; + if (h_bufobj->buf != NULL && + DUK_HBUFOBJ_VALID_BYTEOFFSET_EXCL(h_bufobj, byte_off + elem_size)) { + data = (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufobj->buf) + + h_bufobj->offset + byte_off; duk_hbufobj_validated_write(thr, h_bufobj, data, elem_size); } else { - DUK_D(DUK_DPRINT("bufobj access out of underlying buffer, ignoring (write skipped)")); + DUK_D(DUK_DPRINT( + "bufobj access out of underlying buffer, ignoring (write skipped)")); } duk_pop_unsafe(thr); goto success_no_arguments_exotic; } } -#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ +#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */ DUK_D(DUK_DPRINT("should not happen, key %!O", key)); - goto fail_internal; /* should not happen */ + goto fail_internal; /* should not happen */ } DUK_DD(DUK_DDPRINT("put to existing own plain property, property is writable")); goto update_old; } DUK_UNREACHABLE(); - next_in_chain: + next_in_chain: /* XXX: option to pretend property doesn't exist if sanity limit is * hit might be useful. */ @@ -60857,7 +62033,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, goto create_new; - update_old: +update_old: /* * Update an existing property of the base object. @@ -60890,10 +62066,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, if (desc.e_idx >= 0) { tv = DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(thr->heap, orig, desc.e_idx); DUK_DDD(DUK_DDDPRINT("previous entry value: %!iT", (duk_tval *) tv)); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv_val); /* side effects; e_idx may be invalidated */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv_val); /* side effects; e_idx may be invalidated */ /* don't touch property attributes or hash part */ - DUK_DD(DUK_DDPRINT("put to an existing entry at index %ld -> new value %!iT", - (long) desc.e_idx, (duk_tval *) tv)); + DUK_DD(DUK_DDPRINT("put to an existing entry at index %ld -> new value %!iT", (long) desc.e_idx, (duk_tval *) tv)); } else { /* Note: array entries are always writable, so the writability check * above is pointless for them. The check could be avoided with some @@ -60903,9 +62078,10 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(desc.a_idx >= 0); tv = DUK_HOBJECT_A_GET_VALUE_PTR(thr->heap, orig, desc.a_idx); DUK_DDD(DUK_DDDPRINT("previous array value: %!iT", (duk_tval *) tv)); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv_val); /* side effects; a_idx may be invalidated */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv_val); /* side effects; a_idx may be invalidated */ DUK_DD(DUK_DDPRINT("put to an existing array entry at index %ld -> new value %!iT", - (long) desc.a_idx, (duk_tval *) tv)); + (long) desc.a_idx, + (duk_tval *) tv)); } /* Regardless of whether property is found in entry or array part, @@ -60914,7 +62090,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, */ goto success_with_arguments_exotic; - create_new: +create_new: /* * Create a new property in the original object. @@ -60947,11 +62123,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, * from its creation and cannot be deleted, and is thus * caught as an existing property above. */ - DUK_ASSERT(!(DUK_HOBJECT_HAS_EXOTIC_ARRAY(orig) && - key == DUK_HTHREAD_STRING_LENGTH(thr))); + DUK_ASSERT(!(DUK_HOBJECT_HAS_EXOTIC_ARRAY(orig) && key == DUK_HTHREAD_STRING_LENGTH(thr))); - if (DUK_HOBJECT_HAS_EXOTIC_ARRAY(orig) && - arr_idx != DUK__NO_ARRAY_INDEX) { + if (DUK_HOBJECT_HAS_EXOTIC_ARRAY(orig) && arr_idx != DUK__NO_ARRAY_INDEX) { /* automatic length update */ duk_uint32_t old_len; duk_harray *a; @@ -60964,7 +62138,8 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, if (arr_idx >= old_len) { DUK_DDD(DUK_DDDPRINT("write new array entry requires length update " "(arr_idx=%ld, old_len=%ld)", - (long) arr_idx, (long) old_len)); + (long) arr_idx, + (long) old_len)); if (DUK_HARRAY_LENGTH_NONWRITABLE(a)) { DUK_DD(DUK_DDPRINT("attempt to extend array, but array 'length' is not writable")); @@ -60978,15 +62153,16 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, */ DUK_ASSERT(arr_idx != 0xffffffffUL); - new_array_length = arr_idx + 1; /* flag for later write */ + new_array_length = arr_idx + 1; /* flag for later write */ } else { DUK_DDD(DUK_DDDPRINT("write new array entry does not require length update " "(arr_idx=%ld, old_len=%ld)", - (long) arr_idx, (long) old_len)); + (long) arr_idx, + (long) old_len)); } } - /* write_to_array_part: */ + /* write_to_array_part: */ /* * Write to array part? @@ -61008,8 +62184,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(DUK_TVAL_IS_UNUSED(tv)); DUK_TVAL_SET_TVAL(tv, tv_val); DUK_TVAL_INCREF(thr, tv); - DUK_DD(DUK_DDPRINT("put to new array entry: %ld -> %!T", - (long) arr_idx, (duk_tval *) tv)); + DUK_DD(DUK_DDPRINT("put to new array entry: %ld -> %!T", (long) arr_idx, (duk_tval *) tv)); /* Note: array part values are [[Writable]], [[Enumerable]], * and [[Configurable]] which matches the required attributes @@ -61018,7 +62193,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, goto entry_updated; } - write_to_entry_part: +write_to_entry_part: /* * Write to entry part @@ -61038,7 +62213,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_HOBJECT_E_SET_FLAGS(thr->heap, orig, e_idx, DUK_PROPDESC_FLAGS_WEC); goto entry_updated; - entry_updated: +entry_updated: /* * Possible pending array length update, which must only be done @@ -61052,8 +62227,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, DUK_ASSERT(DUK_HOBJECT_HAS_EXOTIC_ARRAY(orig)); - DUK_DDD(DUK_DDDPRINT("write successful, pending array length update to: %ld", - (long) new_array_length)); + DUK_DDD(DUK_DDDPRINT("write successful, pending array length update to: %ld", (long) new_array_length)); ((duk_harray *) orig)->length = new_array_length; } @@ -61067,7 +62241,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, goto success_no_arguments_exotic; - success_with_arguments_exotic: +success_with_arguments_exotic: /* * Arguments objects have exotic [[DefineOwnProperty]] which updates @@ -61082,8 +62256,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, * we end up in step 5.b.i. */ - if (arr_idx != DUK__NO_ARRAY_INDEX && - DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(orig)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && DUK_HOBJECT_HAS_EXOTIC_ARGUMENTS(orig)) { /* Note: only numbered indices are relevant, so arr_idx fast reject * is good (this is valid unless there are more than 4**32-1 arguments). */ @@ -61102,14 +62275,14 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, } /* fall thru */ - success_no_arguments_exotic: +success_no_arguments_exotic: /* shared exit path now */ DUK_DDD(DUK_DDDPRINT("result: success")); - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 1; #if defined(DUK_USE_ES6_PROXY) - fail_proxy_rejected: +fail_proxy_rejected: DUK_DDD(DUK_DDDPRINT("result: error, proxy rejects")); if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_PROXY_REJECTED); @@ -61119,40 +62292,43 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, return 0; #endif - fail_base_primitive: +fail_base_primitive: DUK_DDD(DUK_DDDPRINT("result: error, base primitive")); if (throw_flag) { #if defined(DUK_USE_PARANOID_ERRORS) DUK_ERROR_TYPE(thr, DUK_STR_INVALID_BASE); #else - DUK_ERROR_FMT2(thr, DUK_ERR_TYPE_ERROR, "cannot write property %s of %s", - duk_push_string_tval_readable(thr, tv_key), duk_push_string_tval_readable(thr, tv_obj)); + DUK_ERROR_FMT2(thr, + DUK_ERR_TYPE_ERROR, + "cannot write property %s of %s", + duk_push_string_tval_readable(thr, tv_key), + duk_push_string_tval_readable(thr, tv_obj)); #endif DUK_WO_NORETURN(return 0;); } - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 0; - fail_not_extensible: +fail_not_extensible: DUK_DDD(DUK_DDDPRINT("result: error, not extensible")); if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_EXTENSIBLE); DUK_WO_NORETURN(return 0;); } - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 0; - fail_not_writable: +fail_not_writable: DUK_DDD(DUK_DDDPRINT("result: error, not writable")); if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_WRITABLE); DUK_WO_NORETURN(return 0;); } - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 0; #if defined(DUK_USE_ROM_OBJECTS) - fail_not_writable_no_pop: +fail_not_writable_no_pop: DUK_DDD(DUK_DDDPRINT("result: error, not writable")); if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_WRITABLE); @@ -61161,31 +62337,31 @@ DUK_INTERNAL duk_bool_t duk_hobject_putprop(duk_hthread *thr, duk_tval *tv_obj, return 0; #endif - fail_array_length_partial: +fail_array_length_partial: DUK_DD(DUK_DDPRINT("result: error, array length write only partially successful")); if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); DUK_WO_NORETURN(return 0;); } - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 0; - fail_no_setter: +fail_no_setter: DUK_DDD(DUK_DDDPRINT("result: error, accessor property without setter")); if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_SETTER_UNDEFINED); DUK_WO_NORETURN(return 0;); } - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 0; - fail_internal: +fail_internal: DUK_DDD(DUK_DDDPRINT("result: error, internal")); if (throw_flag) { DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return 0;); } - duk_pop_unsafe(thr); /* remove key */ + duk_pop_unsafe(thr); /* remove key */ return 0; } @@ -61204,8 +62380,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o force_flag = (flags & DUK_DELPROP_FLAG_FORCE); DUK_DDD(DUK_DDDPRINT("delprop_raw: thr=%p, obj=%p, key=%p, throw=%ld, force=%ld (obj -> %!O, key -> %!O)", - (void *) thr, (void *) obj, (void *) key, (long) throw_flag, (long) force_flag, - (duk_heaphdr *) obj, (duk_heaphdr *) key)); + (void *) thr, + (void *) obj, + (void *) key, + (long) throw_flag, + (long) force_flag, + (duk_heaphdr *) obj, + (duk_heaphdr *) key)); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -61217,7 +62398,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o arr_idx = DUK_HSTRING_GET_ARRIDX_FAST(key); /* 0 = don't push current value */ - if (!duk__get_own_propdesc_raw(thr, obj, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ + if (!duk__get_own_propdesc_raw(thr, obj, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ DUK_DDD(DUK_DDDPRINT("property not found, succeed always")); goto success; } @@ -61244,7 +62425,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o DUK_ASSERT(desc.e_idx < 0); tv = DUK_HOBJECT_A_GET_VALUE_PTR(thr->heap, obj, desc.a_idx); - DUK_TVAL_SET_UNUSED_UPDREF(thr, tv); /* side effects */ + DUK_TVAL_SET_UNUSED_UPDREF(thr, tv); /* side effects */ goto success; } else { DUK_ASSERT(desc.a_idx < 0); @@ -61270,7 +62451,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o * invalidated. */ DUK_DDD(DUK_DDDPRINT("before removing value, e_idx %ld, key %p, key at slot %p", - (long) desc.e_idx, (void *) key, (void *) DUK_HOBJECT_E_GET_KEY(thr->heap, obj, desc.e_idx))); + (long) desc.e_idx, + (void *) key, + (void *) DUK_HOBJECT_E_GET_KEY(thr->heap, obj, desc.e_idx))); DUK_DDD(DUK_DDDPRINT("removing value at e_idx %ld", (long) desc.e_idx)); if (DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, obj, desc.e_idx)) { duk_hobject *tmp; @@ -61295,7 +62478,9 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o /* Remove key. */ DUK_DDD(DUK_DDDPRINT("before removing key, e_idx %ld, key %p, key at slot %p", - (long) desc.e_idx, (void *) key, (void *) DUK_HOBJECT_E_GET_KEY(thr->heap, obj, desc.e_idx))); + (long) desc.e_idx, + (void *) key, + (void *) DUK_HOBJECT_E_GET_KEY(thr->heap, obj, desc.e_idx))); DUK_DDD(DUK_DDDPRINT("removing key at e_idx %ld", (long) desc.e_idx)); DUK_ASSERT(key == DUK_HOBJECT_E_GET_KEY(thr->heap, obj, desc.e_idx)); DUK_HOBJECT_E_SET_KEY(thr->heap, obj, desc.e_idx, NULL); @@ -61311,7 +62496,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o DUK_UNREACHABLE(); - success: +success: /* * Argument exotic [[Delete]] behavior (E5 Section 10.6) is * a post-check, keeping arguments internal 'map' in sync with @@ -61338,8 +62523,8 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop_raw(duk_hthread *thr, duk_hobject *o DUK_DDD(DUK_DDDPRINT("delete successful")); return 1; - fail_virtual: /* just use the same "not configurable" error message */ - fail_not_configurable: +fail_virtual: /* just use the same "not configurable" error message */ +fail_not_configurable: DUK_DDD(DUK_DDDPRINT("delete failed: property found, not configurable")); if (throw_flag) { @@ -61363,8 +62548,11 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, duk_bool_t rc; DUK_DDD(DUK_DDDPRINT("delprop: thr=%p, obj=%p, key=%p (obj -> %!T, key -> %!T)", - (void *) thr, (void *) tv_obj, (void *) tv_key, - (duk_tval *) tv_obj, (duk_tval *) tv_key)); + (void *) thr, + (void *) tv_obj, + (void *) tv_key, + (duk_tval *) tv_obj, + (duk_tval *) tv_key)); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -61378,8 +62566,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, */ entry_top = duk_get_top(thr); - if (DUK_TVAL_IS_UNDEFINED(tv_obj) || - DUK_TVAL_IS_NULL(tv_obj)) { + if (DUK_TVAL_IS_UNDEFINED(tv_obj) || DUK_TVAL_IS_NULL(tv_obj)) { DUK_DDD(DUK_DDDPRINT("base object is undefined or null -> reject")); goto fail_invalid_base_uncond; } @@ -61402,12 +62589,12 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, if (duk__proxy_check_prop(thr, obj, DUK_STRIDX_DELETE_PROPERTY, tv_key, &h_target)) { /* -> [ ... obj key trap handler ] */ DUK_DDD(DUK_DDDPRINT("-> proxy object 'deleteProperty' for key %!T", (duk_tval *) tv_key)); - duk_push_hobject(thr, h_target); /* target */ - duk_dup_m4(thr); /* P */ + duk_push_hobject(thr, h_target); /* target */ + duk_dup_m4(thr); /* P */ duk_call_method(thr, 2 /*nargs*/); tmp_bool = duk_to_boolean_top_pop(thr); if (!tmp_bool) { - goto fail_proxy_rejected; /* retval indicates delete failed */ + goto fail_proxy_rejected; /* retval indicates delete failed */ } /* Target object must be checked for a conflicting @@ -61417,14 +62604,17 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, arr_idx = duk__push_tval_to_property_key(thr, tv_key, &key); DUK_ASSERT(key != NULL); - if (duk__get_own_propdesc_raw(thr, h_target, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ + if (duk__get_own_propdesc_raw(thr, h_target, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push + value */ duk_small_int_t desc_reject; DUK_DDD(DUK_DDDPRINT("proxy 'deleteProperty': target has matching property %!O, check for " "conflicting property; desc.flags=0x%08lx, " "desc.get=%p, desc.set=%p", - (duk_heaphdr *) key, (unsigned long) desc.flags, - (void *) desc.get, (void *) desc.set)); + (duk_heaphdr *) key, + (unsigned long) desc.flags, + (void *) desc.get, + (void *) desc.set)); desc_reject = !(desc.flags & DUK_PROPDESC_FLAG_CONFIGURABLE); if (desc_reject) { @@ -61433,13 +62623,13 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, DUK_WO_NORETURN(return 0;); } } - rc = 1; /* success */ + rc = 1; /* success */ goto done_rc; } - obj = h_target; /* resume delete to target */ + obj = h_target; /* resume delete to target */ } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ arr_idx = duk__to_property_key(thr, -1, &key); DUK_ASSERT(key != NULL); @@ -61464,8 +62654,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, goto fail_not_configurable; } - if (arr_idx != DUK__NO_ARRAY_INDEX && - arr_idx < DUK_HSTRING_GET_CHARLEN(h)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && arr_idx < DUK_HSTRING_GET_CHARLEN(h)) { goto fail_not_configurable; } } else if (DUK_TVAL_IS_BUFFER(tv_obj)) { @@ -61483,8 +62672,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, goto fail_not_configurable; } - if (arr_idx != DUK__NO_ARRAY_INDEX && - arr_idx < DUK_HBUFFER_GET_SIZE(h)) { + if (arr_idx != DUK__NO_ARRAY_INDEX && arr_idx < DUK_HBUFFER_GET_SIZE(h)) { goto fail_not_configurable; } } else if (DUK_TVAL_IS_LIGHTFUNC(tv_obj)) { @@ -61501,23 +62689,26 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, rc = 1; goto done_rc; - done_rc: +done_rc: duk_set_top_unsafe(thr, entry_top); return rc; - fail_invalid_base_uncond: +fail_invalid_base_uncond: /* Note: unconditional throw */ DUK_ASSERT(duk_get_top(thr) == entry_top); #if defined(DUK_USE_PARANOID_ERRORS) DUK_ERROR_TYPE(thr, DUK_STR_INVALID_BASE); #else - DUK_ERROR_FMT2(thr, DUK_ERR_TYPE_ERROR, "cannot delete property %s of %s", - duk_push_string_tval_readable(thr, tv_key), duk_push_string_tval_readable(thr, tv_obj)); + DUK_ERROR_FMT2(thr, + DUK_ERR_TYPE_ERROR, + "cannot delete property %s of %s", + duk_push_string_tval_readable(thr, tv_key), + duk_push_string_tval_readable(thr, tv_obj)); #endif DUK_WO_NORETURN(return 0;); #if defined(DUK_USE_ES6_PROXY) - fail_proxy_rejected: +fail_proxy_rejected: if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_PROXY_REJECTED); DUK_WO_NORETURN(return 0;); @@ -61526,7 +62717,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, return 0; #endif - fail_not_configurable: +fail_not_configurable: if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); DUK_WO_NORETURN(return 0;); @@ -61554,17 +62745,23 @@ DUK_INTERNAL duk_bool_t duk_hobject_delprop(duk_hthread *thr, duk_tval *tv_obj, * operations. */ -DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hobject *obj, duk_hstring *key, duk_small_uint_t flags) { +DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, + duk_hobject *obj, + duk_hstring *key, + duk_small_uint_t flags) { duk_propdesc desc; duk_uint32_t arr_idx; duk_int_t e_idx; duk_tval *tv1 = NULL; duk_tval *tv2 = NULL; - duk_small_uint_t propflags = flags & DUK_PROPDESC_FLAGS_MASK; /* mask out flags not actually stored */ + duk_small_uint_t propflags = flags & DUK_PROPDESC_FLAGS_MASK; /* mask out flags not actually stored */ DUK_DDD(DUK_DDDPRINT("define new property (internal): thr=%p, obj=%!O, key=%!O, flags=0x%02lx, val=%!T", - (void *) thr, (duk_heaphdr *) obj, (duk_heaphdr *) key, - (unsigned long) flags, (duk_tval *) duk_get_tval(thr, -1))); + (void *) thr, + (duk_heaphdr *) obj, + (duk_heaphdr *) key, + (unsigned long) flags, + (duk_tval *) duk_get_tval(thr, -1))); DUK_ASSERT(thr != NULL); DUK_ASSERT(thr->heap != NULL); @@ -61572,11 +62769,11 @@ DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hob DUK_ASSERT(key != NULL); DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); DUK_ASSERT_VALSTACK_SPACE(thr, DUK__VALSTACK_SPACE); - DUK_ASSERT(duk_is_valid_index(thr, -1)); /* contains value */ + DUK_ASSERT(duk_is_valid_index(thr, -1)); /* contains value */ arr_idx = DUK_HSTRING_GET_ARRIDX_SLOW(key); - if (duk__get_own_propdesc_raw(thr, obj, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ + if (duk__get_own_propdesc_raw(thr, obj, key, arr_idx, &desc, 0 /*flags*/)) { /* don't push value */ if (desc.e_idx >= 0) { if (flags & DUK_PROPDESC_FLAG_NO_OVERWRITE) { DUK_DDD(DUK_DDDPRINT("property already exists in the entry part -> skip as requested")); @@ -61617,7 +62814,8 @@ DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hob new_len = duk__to_new_array_length_checked(thr, DUK_GET_TVAL_NEGIDX(thr, -1)); ((duk_harray *) obj)->length = new_len; DUK_DD(DUK_DDPRINT("internal define property for array .length: %ld -> %ld", - (long) prev_len, (long) ((duk_harray *) obj)->length)); + (long) prev_len, + (long) ((duk_harray *) obj)->length)); goto pop_exit; } DUK_DD(DUK_DDPRINT("property already exists but is virtual -> failure")); @@ -61629,7 +62827,8 @@ DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hob if (DUK_HOBJECT_HAS_ARRAY_PART(obj)) { if (arr_idx != DUK__NO_ARRAY_INDEX) { - DUK_DDD(DUK_DDDPRINT("property does not exist, object has array part -> possibly extend array part and write value (assert attributes)")); + DUK_DDD(DUK_DDDPRINT("property does not exist, object has array part -> possibly extend array part and " + "write value (assert attributes)")); DUK_ASSERT(propflags == DUK_PROPDESC_FLAGS_WEC); tv1 = duk__obtain_arridx_slot(thr, arr_idx, obj); @@ -61643,9 +62842,10 @@ DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hob } } - write_to_entry_part: - DUK_DDD(DUK_DDDPRINT("property does not exist, object belongs in entry part -> allocate new entry and write value and attributes")); - e_idx = duk__hobject_alloc_entry_checked(thr, obj, key); /* increases key refcount */ +write_to_entry_part: + DUK_DDD(DUK_DDDPRINT( + "property does not exist, object belongs in entry part -> allocate new entry and write value and attributes")); + e_idx = duk__hobject_alloc_entry_checked(thr, obj, key); /* increases key refcount */ DUK_ASSERT(e_idx >= 0); DUK_HOBJECT_E_SET_FLAGS(thr->heap, obj, e_idx, propflags); tv1 = DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(thr->heap, obj, e_idx); @@ -61653,22 +62853,21 @@ DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hob DUK_TVAL_SET_UNDEFINED(tv1); goto write_value; - write_value: +write_value: /* tv1 points to value storage */ - tv2 = duk_require_tval(thr, -1); /* late lookup, avoid side effects */ - DUK_DDD(DUK_DDDPRINT("writing/updating value: %!T -> %!T", - (duk_tval *) tv1, (duk_tval *) tv2)); + tv2 = duk_require_tval(thr, -1); /* late lookup, avoid side effects */ + DUK_DDD(DUK_DDDPRINT("writing/updating value: %!T -> %!T", (duk_tval *) tv1, (duk_tval *) tv2)); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ goto pop_exit; - pop_exit: - duk_pop_unsafe(thr); /* remove in_val */ +pop_exit: + duk_pop_unsafe(thr); /* remove in_val */ return; - error_virtual: /* share error message */ - error_internal: +error_virtual: /* share error message */ +error_internal: DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return;); } @@ -61679,13 +62878,19 @@ DUK_INTERNAL void duk_hobject_define_property_internal(duk_hthread *thr, duk_hob * must avoid interning. */ -DUK_INTERNAL void duk_hobject_define_property_internal_arridx(duk_hthread *thr, duk_hobject *obj, duk_uarridx_t arr_idx, duk_small_uint_t flags) { +DUK_INTERNAL void duk_hobject_define_property_internal_arridx(duk_hthread *thr, + duk_hobject *obj, + duk_uarridx_t arr_idx, + duk_small_uint_t flags) { duk_hstring *key; duk_tval *tv1, *tv2; DUK_DDD(DUK_DDDPRINT("define new property (internal) arr_idx fast path: thr=%p, obj=%!O, " "arr_idx=%ld, flags=0x%02lx, val=%!T", - (void *) thr, obj, (long) arr_idx, (unsigned long) flags, + (void *) thr, + obj, + (long) arr_idx, + (unsigned long) flags, (duk_tval *) duk_get_tval(thr, -1))); DUK_ASSERT(thr != NULL); @@ -61693,10 +62898,8 @@ DUK_INTERNAL void duk_hobject_define_property_internal_arridx(duk_hthread *thr, DUK_ASSERT(obj != NULL); DUK_ASSERT(!DUK_HEAPHDR_HAS_READONLY((duk_heaphdr *) obj)); - if (DUK_HOBJECT_HAS_ARRAY_PART(obj) && - arr_idx != DUK__NO_ARRAY_INDEX && - flags == DUK_PROPDESC_FLAGS_WEC) { - DUK_ASSERT((flags & DUK_PROPDESC_FLAG_NO_OVERWRITE) == 0); /* covered by comparison */ + if (DUK_HOBJECT_HAS_ARRAY_PART(obj) && arr_idx != DUK__NO_ARRAY_INDEX && flags == DUK_PROPDESC_FLAGS_WEC) { + DUK_ASSERT((flags & DUK_PROPDESC_FLAG_NO_OVERWRITE) == 0); /* covered by comparison */ DUK_DDD(DUK_DDDPRINT("define property to array part (property may or may not exist yet)")); @@ -61707,22 +62910,22 @@ DUK_INTERNAL void duk_hobject_define_property_internal_arridx(duk_hthread *thr, } tv2 = duk_require_tval(thr, -1); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ - duk_pop_unsafe(thr); /* [ ...val ] -> [ ... ] */ + duk_pop_unsafe(thr); /* [ ...val ] -> [ ... ] */ return; } - write_slow: +write_slow: DUK_DDD(DUK_DDDPRINT("define property fast path didn't work, use slow path")); key = duk_push_uint_to_hstring(thr, (duk_uint_t) arr_idx); DUK_ASSERT(key != NULL); - duk_insert(thr, -2); /* [ ... val key ] -> [ ... key val ] */ + duk_insert(thr, -2); /* [ ... val key ] -> [ ... key val ] */ duk_hobject_define_property_internal(thr, obj, key, flags); - duk_pop_unsafe(thr); /* [ ... key ] -> [ ... ] */ + duk_pop_unsafe(thr); /* [ ... key ] -> [ ... ] */ } /* @@ -61743,9 +62946,7 @@ DUK_INTERNAL duk_size_t duk_hobject_get_length(duk_hthread *thr, duk_hobject *ob /* Slow path, .length can be e.g. accessor, obj can be a Proxy, etc. */ duk_push_hobject(thr, obj); duk_push_hstring_stridx(thr, DUK_STRIDX_LENGTH); - (void) duk_hobject_getprop(thr, - DUK_GET_TVAL_NEGIDX(thr, -2), - DUK_GET_TVAL_NEGIDX(thr, -1)); + (void) duk_hobject_getprop(thr, DUK_GET_TVAL_NEGIDX(thr, -2), DUK_GET_TVAL_NEGIDX(thr, -1)); val = duk_to_number_m1(thr); duk_pop_3_unsafe(thr); @@ -61786,7 +62987,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_has_finalizer_fast_raw(duk_hobject *obj) { DUK_ASSERT(heap != NULL); obj = DUK_HOBJECT_GET_PROTOTYPE(heap, obj); #else - obj = DUK_HOBJECT_GET_PROTOTYPE(NULL, obj); /* 'heap' arg ignored */ + obj = DUK_HOBJECT_GET_PROTOTYPE(NULL, obj); /* 'heap' arg ignored */ #endif } while (obj != NULL); @@ -61853,7 +63054,7 @@ DUK_INTERNAL void duk_hobject_object_get_own_property_descriptor(duk_hthread *th /* [ ... key value desc ] */ duk_replace(thr, -3); - duk_pop_unsafe(thr); /* -> [ ... desc ] */ + duk_pop_unsafe(thr); /* -> [ ... desc ] */ } /* @@ -61890,7 +63091,7 @@ void duk_hobject_prepare_property_descriptor(duk_hthread *thr, DUK_ASSERT(out_idx_value != NULL); DUK_ASSERT(out_getter != NULL); DUK_ASSERT(out_setter != NULL); - DUK_ASSERT(idx_in <= 0x7fffL); /* short variants would be OK, but not used to avoid shifts */ + DUK_ASSERT(idx_in <= 0x7fffL); /* short variants would be OK, but not used to avoid shifts */ /* Must be an object, otherwise TypeError (E5.1 Section 8.10.5, step 1). */ idx_in = duk_require_normalize_index(thr, idx_in); @@ -61946,7 +63147,7 @@ void duk_hobject_prepare_property_descriptor(duk_hthread *thr, if (DUK_TVAL_IS_UNDEFINED(tv)) { /* undefined is accepted */ DUK_ASSERT(setter == NULL); - } else { + } else { /* NOTE: lightfuncs are coerced to full functions because * lightfuncs don't fit into a property value slot. This * has some side effects, see test-dev-lightfunc-accessor.js. @@ -61989,7 +63190,7 @@ void duk_hobject_prepare_property_descriptor(duk_hthread *thr, /* [ ... [multiple values] ] */ return; - type_error: +type_error: DUK_ERROR_TYPE(thr, DUK_STR_INVALID_DESCRIPTOR); DUK_WO_NORETURN(return;); } @@ -62037,7 +63238,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, duk_bool_t force_flag; duk_small_uint_t new_flags; duk_propdesc curr; - duk_uint32_t arridx_new_array_length; /* != 0 => post-update for array 'length' (used when key is an array index) */ + duk_uint32_t arridx_new_array_length; /* != 0 => post-update for array 'length' (used when key is an array index) */ duk_uint32_t arrlen_old_len; duk_uint32_t arrlen_new_len; duk_bool_t pending_write_protect; @@ -62077,13 +63278,22 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, "has_get=%ld get=%p=%!O " "has_set=%ld set=%p=%!O " "arr_idx=%ld throw_flag=!%ld", - (long) has_enumerable, (long) is_enumerable, - (long) has_configurable, (long) is_configurable, - (long) has_writable, (long) is_writable, - (long) has_value, (duk_tval *) (idx_value >= 0 ? duk_get_tval(thr, idx_value) : NULL), - (long) has_get, (void *) get, (duk_heaphdr *) get, - (long) has_set, (void *) set, (duk_heaphdr *) set, - (long) arr_idx, (long) throw_flag)); + (long) has_enumerable, + (long) is_enumerable, + (long) has_configurable, + (long) is_configurable, + (long) has_writable, + (long) is_writable, + (long) has_value, + (duk_tval *) (idx_value >= 0 ? duk_get_tval(thr, idx_value) : NULL), + (long) has_get, + (void *) get, + (duk_heaphdr *) get, + (long) has_set, + (void *) set, + (duk_heaphdr *) set, + (long) arr_idx, + (long) throw_flag)); /* * Array exotic behaviors can be implemented at this point. The local variables @@ -62117,7 +63327,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_ASSERT(idx_value >= 0); arrlen_new_len = duk__to_new_array_length_checked(thr, DUK_GET_TVAL_POSIDX(thr, idx_value)); duk_push_u32(thr, arrlen_new_len); - duk_replace(thr, idx_value); /* step 3.e: replace 'Desc.[[Value]]' */ + duk_replace(thr, idx_value); /* step 3.e: replace 'Desc.[[Value]]' */ DUK_DDD(DUK_DDDPRINT("old_len=%ld, new_len=%ld", (long) arrlen_old_len, (long) arrlen_new_len)); @@ -62159,7 +63369,8 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, if (arr_idx >= old_len) { DUK_DDD(DUK_DDDPRINT("defineProperty requires array length update " "(arr_idx=%ld, old_len=%ld)", - (long) arr_idx, (long) old_len)); + (long) arr_idx, + (long) old_len)); if (DUK_HARRAY_LENGTH_NONWRITABLE(a) && !force_flag) { /* Array .length is always non-configurable, so @@ -62177,10 +63388,11 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, } else { DUK_DDD(DUK_DDDPRINT("defineProperty does not require length update " "(arr_idx=%ld, old_len=%ld) -> standard behavior", - (long) arr_idx, (long) old_len)); + (long) arr_idx, + (long) old_len)); } } - skip_array_exotic: +skip_array_exotic: /* XXX: There is currently no support for writing buffer object * indexed elements here. Attempt to do so will succeed and @@ -62232,7 +63444,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_ASSERT(!has_value); DUK_ASSERT(!has_writable); - new_flags = DUK_PROPDESC_FLAG_ACCESSOR; /* defaults, E5 Section 8.6.1, Table 7 */ + new_flags = DUK_PROPDESC_FLAG_ACCESSOR; /* defaults, E5 Section 8.6.1, Table 7 */ if (has_enumerable && is_enumerable) { new_flags |= DUK_PROPDESC_FLAG_ENUMERABLE; } @@ -62265,7 +63477,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_ASSERT(!has_set); DUK_ASSERT(!has_get); - new_flags = 0; /* defaults, E5 Section 8.6.1, Table 7 */ + new_flags = 0; /* defaults, E5 Section 8.6.1, Table 7 */ if (has_writable && is_writable) { new_flags |= DUK_PROPDESC_FLAG_WRITABLE; } @@ -62279,12 +63491,13 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, duk_tval *tv_tmp = duk_require_tval(thr, idx_value); DUK_TVAL_SET_TVAL(&tv, tv_tmp); } else { - DUK_TVAL_SET_UNDEFINED(&tv); /* default value */ + DUK_TVAL_SET_UNDEFINED(&tv); /* default value */ } if (arr_idx != DUK__NO_ARRAY_INDEX && DUK_HOBJECT_HAS_ARRAY_PART(obj)) { if (new_flags == DUK_PROPDESC_FLAGS_WEC) { - DUK_DDD(DUK_DDDPRINT("new data property attributes match array defaults, attempt to write to array part")); + DUK_DDD(DUK_DDDPRINT( + "new data property attributes match array defaults, attempt to write to array part")); tv2 = duk__obtain_arridx_slot(thr, arr_idx, obj); if (tv2 == NULL) { DUK_DDD(DUK_DDDPRINT("failed writing to array part, abandoned array")); @@ -62357,8 +63570,8 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, goto need_check; } - tmp1 = duk_require_tval(thr, -1); /* curr value */ - tmp2 = duk_require_tval(thr, idx_value); /* new value */ + tmp1 = duk_require_tval(thr, -1); /* curr value */ + tmp2 = duk_require_tval(thr, idx_value); /* new value */ if (!duk_js_samevalue(tmp1, tmp2)) { goto need_check; } @@ -62403,7 +63616,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, */ goto success_no_exotics; - need_check: +need_check: /* * Some change(s) need to be made. Steps 7-11. @@ -62475,9 +63688,10 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("convert property to accessor property")); if (curr.a_idx >= 0) { - DUK_DDD(DUK_DDDPRINT("property to convert is stored in an array entry, abandon array and re-lookup")); + DUK_DDD( + DUK_DDDPRINT("property to convert is stored in an array entry, abandon array and re-lookup")); duk__abandon_array_part(thr, obj); - duk_pop_unsafe(thr); /* remove old value */ + duk_pop_unsafe(thr); /* remove old value */ rc = duk__get_own_propdesc_raw(thr, obj, key, arr_idx, &curr, DUK_GETDESC_FLAG_PUSH_VALUE); DUK_UNREF(rc); DUK_ASSERT(rc != 0); @@ -62485,14 +63699,14 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, } if (curr.e_idx < 0) { DUK_ASSERT(curr.a_idx < 0 && curr.e_idx < 0); - goto fail_virtual; /* safeguard for virtual property */ + goto fail_virtual; /* safeguard for virtual property */ } DUK_ASSERT(curr.e_idx >= 0); DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, obj, curr.e_idx)); tv1 = DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(thr->heap, obj, curr.e_idx); - DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ(thr, tv1); /* XXX: just decref */ + DUK_TVAL_SET_UNDEFINED_UPDREF_NORZ(thr, tv1); /* XXX: just decref */ DUK_HOBJECT_E_SET_VALUE_GETTER(thr->heap, obj, curr.e_idx, NULL); DUK_HOBJECT_E_SET_VALUE_SETTER(thr->heap, obj, curr.e_idx, NULL); @@ -62521,7 +63735,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, /* curr is accessor -> cannot be in array part. */ DUK_ASSERT(curr.a_idx < 0); if (curr.e_idx < 0) { - goto fail_virtual; /* safeguard; no virtual accessors now */ + goto fail_virtual; /* safeguard; no virtual accessors now */ } DUK_DDD(DUK_DDDPRINT("convert property to data property")); @@ -62553,8 +63767,8 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, } /* Note: changing from writable to non-writable is OK */ if (!(curr.flags & DUK_PROPDESC_FLAG_WRITABLE) && has_value) { - duk_tval *tmp1 = duk_require_tval(thr, -1); /* curr value */ - duk_tval *tmp2 = duk_require_tval(thr, idx_value); /* new value */ + duk_tval *tmp1 = duk_require_tval(thr, -1); /* curr value */ + duk_tval *tmp2 = duk_require_tval(thr, idx_value); /* new value */ if (!duk_js_samevalue(tmp1, tmp2)) { goto fail_not_configurable; } @@ -62603,8 +63817,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, /* XXX: write protect after flag? -> any chance of handling it here? */ - DUK_DDD(DUK_DDDPRINT("new flags that we want to write: 0x%02lx", - (unsigned long) new_flags)); + DUK_DDD(DUK_DDDPRINT("new flags that we want to write: 0x%02lx", (unsigned long) new_flags)); /* * Check whether we need to abandon an array part (if it exists) @@ -62620,20 +63833,23 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("array index, new property attributes match array defaults, update in-place")); - DUK_ASSERT(curr.flags == DUK_PROPDESC_FLAGS_WEC); /* must have been, since in array part */ + DUK_ASSERT(curr.flags == DUK_PROPDESC_FLAGS_WEC); /* must have been, since in array part */ DUK_ASSERT(!has_set); DUK_ASSERT(!has_get); - DUK_ASSERT(idx_value >= 0); /* must be: if attributes match and we get here the value must differ (otherwise no change) */ + DUK_ASSERT( + idx_value >= + 0); /* must be: if attributes match and we get here the value must differ (otherwise no change) */ tv2 = duk_require_tval(thr, idx_value); tv1 = DUK_HOBJECT_A_GET_VALUE_PTR(thr->heap, obj, curr.a_idx); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects; may invalidate a_idx */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects; may invalidate a_idx */ goto success_exotics; } - DUK_DDD(DUK_DDDPRINT("array index, new property attributes do not match array defaults, abandon array and re-lookup")); + DUK_DDD( + DUK_DDDPRINT("array index, new property attributes do not match array defaults, abandon array and re-lookup")); duk__abandon_array_part(thr, obj); - duk_pop_unsafe(thr); /* remove old value */ + duk_pop_unsafe(thr); /* remove old value */ rc = duk__get_own_propdesc_raw(thr, obj, key, arr_idx, &curr, DUK_GETDESC_FLAG_PUSH_VALUE); DUK_UNREF(rc); DUK_ASSERT(rc != 0); @@ -62657,10 +63873,12 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, if (key == DUK_HTHREAD_STRING_LENGTH(thr) && DUK_HOBJECT_HAS_EXOTIC_ARRAY(obj)) { duk_harray *a; a = (duk_harray *) obj; - DUK_DD(DUK_DDPRINT("Object.defineProperty() attribute update for duk_harray .length -> %02lx", (unsigned long) new_flags)); + DUK_DD(DUK_DDPRINT("Object.defineProperty() attribute update for duk_harray .length -> %02lx", + (unsigned long) new_flags)); DUK_HARRAY_ASSERT_VALID(a); if ((new_flags & DUK_PROPDESC_FLAGS_EC) != (curr.flags & DUK_PROPDESC_FLAGS_EC)) { - DUK_D(DUK_DPRINT("Object.defineProperty() attempt to change virtual array .length enumerable or configurable attribute, fail")); + DUK_D(DUK_DPRINT("Object.defineProperty() attempt to change virtual array .length enumerable or " + "configurable attribute, fail")); goto fail_virtual; } if (new_flags & DUK_PROPDESC_FLAG_WRITABLE) { @@ -62688,7 +63906,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_UNREF(tmp); DUK_HOBJECT_E_SET_VALUE_SETTER(thr->heap, obj, curr.e_idx, set); DUK_HOBJECT_INCREF_ALLOWNULL(thr, set); - DUK_HOBJECT_DECREF_ALLOWNULL(thr, tmp); /* side effects; may invalidate e_idx */ + DUK_HOBJECT_DECREF_ALLOWNULL(thr, tmp); /* side effects; may invalidate e_idx */ } if (has_get) { duk_hobject *tmp; @@ -62704,7 +63922,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_UNREF(tmp); DUK_HOBJECT_E_SET_VALUE_GETTER(thr->heap, obj, curr.e_idx, get); DUK_HOBJECT_INCREF_ALLOWNULL(thr, get); - DUK_HOBJECT_DECREF_ALLOWNULL(thr, tmp); /* side effects; may invalidate e_idx */ + DUK_HOBJECT_DECREF_ALLOWNULL(thr, tmp); /* side effects; may invalidate e_idx */ } if (has_value) { duk_tval *tv1, *tv2; @@ -62715,9 +63933,9 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, obj, curr.e_idx)); tv2 = duk_require_tval(thr, idx_value); tv1 = DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(thr->heap, obj, curr.e_idx); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects; may invalidate e_idx */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects; may invalidate e_idx */ } else { - DUK_ASSERT(curr.a_idx < 0); /* array part case handled comprehensively previously */ + DUK_ASSERT(curr.a_idx < 0); /* array part case handled comprehensively previously */ DUK_DD(DUK_DDPRINT("Object.defineProperty(), value update for virtual property")); /* XXX: Uint8Array and other typed array virtual writes not currently @@ -62726,11 +63944,12 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, if (key == DUK_HTHREAD_STRING_LENGTH(thr) && DUK_HOBJECT_HAS_EXOTIC_ARRAY(obj)) { duk_harray *a; a = (duk_harray *) obj; - DUK_DD(DUK_DDPRINT("Object.defineProperty() value update for duk_harray .length -> %ld", (long) arrlen_new_len)); + DUK_DD(DUK_DDPRINT("Object.defineProperty() value update for duk_harray .length -> %ld", + (long) arrlen_new_len)); DUK_HARRAY_ASSERT_VALID(a); a->length = arrlen_new_len; } else { - goto fail_virtual; /* should not happen */ + goto fail_virtual; /* should not happen */ } } } @@ -62747,7 +63966,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, * - for 'length' key the element deletion and 'length' update occurs here */ - success_exotics: +success_exotics: /* curr.a_idx or curr.e_idx may have been invalidated by side effects * above. @@ -62791,7 +64010,8 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("defineProperty successful, key is 'length', exotic array behavior, " "doing array element deletion and length update")); - rc = duk__handle_put_array_length_smaller(thr, obj, arrlen_old_len, arrlen_new_len, force_flag, &result_len); + rc = + duk__handle_put_array_length_smaller(thr, obj, arrlen_old_len, arrlen_new_len, force_flag, &result_len); /* update length (curr points to length, and we assume it's still valid) */ DUK_ASSERT(result_len >= arrlen_new_len && result_len <= arrlen_old_len); @@ -62814,7 +64034,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, duk_hobject *varenv; DUK_ASSERT(arridx_new_array_length == 0); - DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARRAY(obj)); /* traits are separate; in particular, arguments not an array */ + DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARRAY(obj)); /* traits are separate; in particular, arguments not an array */ map = NULL; varenv = NULL; @@ -62831,7 +64051,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("defineProperty successful, key mapped to arguments 'map' " "changed to an accessor, delete arguments binding")); - (void) duk_hobject_delprop_raw(thr, map, key, 0); /* ignore result */ + (void) duk_hobject_delprop_raw(thr, map, key, 0); /* ignore result */ } else { /* Note: this order matters (final value before deleting map entry must be done) */ DUK_DDD(DUK_DDDPRINT("defineProperty successful, key mapped to arguments 'map', " @@ -62859,7 +64079,7 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("defineProperty successful, key mapped to arguments 'map', " "changed to non-writable, delete arguments binding")); - (void) duk_hobject_delprop_raw(thr, map, key, 0); /* ignore result */ + (void) duk_hobject_delprop_raw(thr, map, key, 0); /* ignore result */ } } @@ -62868,22 +64088,22 @@ duk_bool_t duk_hobject_define_property_helper(duk_hthread *thr, */ } - success_no_exotics: +success_no_exotics: /* Some code paths use NORZ macros for simplicity, ensure refzero * handling is completed. */ DUK_REFZERO_CHECK_SLOW(thr); return 1; - fail_not_extensible: +fail_not_extensible: if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_EXTENSIBLE); DUK_WO_NORETURN(return 0;); } return 0; - fail_virtual: /* just use the same "not configurable" error message" */ - fail_not_configurable: +fail_virtual: /* just use the same "not configurable" error message" */ +fail_not_configurable: if (throw_flag) { DUK_ERROR_TYPE(thr, DUK_STR_NOT_CONFIGURABLE); DUK_WO_NORETURN(return 0;); @@ -62908,7 +64128,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_object_ownprop_helper(duk_hthread *thr, duk_ h_obj = duk_push_this_coercible_to_object(thr); DUK_ASSERT(h_obj != NULL); - ret = duk_hobject_get_own_propdesc(thr, h_obj, h_v, &desc, 0 /*flags*/); /* don't push value */ + ret = duk_hobject_get_own_propdesc(thr, h_obj, h_v, &desc, 0 /*flags*/); /* don't push value */ duk_push_boolean(thr, ret && ((desc.flags & required_desc_flags) == required_desc_flags)); return 1; @@ -63022,9 +64242,7 @@ DUK_INTERNAL duk_bool_t duk_hobject_object_is_sealed_frozen_helper(duk_hthread * if (flags & DUK_PROPDESC_FLAG_CONFIGURABLE) { return 0; } - if (is_frozen && - !(flags & DUK_PROPDESC_FLAG_ACCESSOR) && - (flags & DUK_PROPDESC_FLAG_WRITABLE)) { + if (is_frozen && !(flags & DUK_PROPDESC_FLAG_ACCESSOR) && (flags & DUK_PROPDESC_FLAG_WRITABLE)) { return 0; } } @@ -63067,7 +64285,7 @@ DUK_INTERNAL void duk_hstring_assert_valid(duk_hstring *h) { DUK_ASSERT(h != NULL); } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* * Misc support functions */ @@ -63078,7 +64296,10 @@ DUK_INTERNAL void duk_hstring_assert_valid(duk_hstring *h) { * duk_hstring charCodeAt, with and without surrogate awareness */ -DUK_INTERNAL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk_hstring *h, duk_uint_t pos, duk_bool_t surrogate_aware) { +DUK_INTERNAL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, + duk_hstring *h, + duk_uint_t pos, + duk_bool_t surrogate_aware) { duk_uint32_t boff; const duk_uint8_t *p, *p_start, *p_end; duk_ucodepoint_t cp1; @@ -63087,21 +64308,18 @@ DUK_INTERNAL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk /* Caller must check character offset to be inside the string. */ DUK_ASSERT(thr != NULL); DUK_ASSERT(h != NULL); - DUK_ASSERT_DISABLE(pos >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(pos >= 0); /* unsigned */ DUK_ASSERT(pos < (duk_uint_t) DUK_HSTRING_GET_CHARLEN(h)); boff = (duk_uint32_t) duk_heap_strcache_offset_char2byte(thr, h, (duk_uint32_t) pos); - DUK_DDD(DUK_DDDPRINT("charCodeAt: pos=%ld -> boff=%ld, str=%!O", - (long) pos, (long) boff, (duk_heaphdr *) h)); + DUK_DDD(DUK_DDDPRINT("charCodeAt: pos=%ld -> boff=%ld, str=%!O", (long) pos, (long) boff, (duk_heaphdr *) h)); DUK_ASSERT_DISABLE(boff >= 0); DUK_ASSERT(boff < DUK_HSTRING_GET_BYTELEN(h)); p_start = DUK_HSTRING_GET_DATA(h); p_end = p_start + DUK_HSTRING_GET_BYTELEN(h); p = p_start + boff; - DUK_DDD(DUK_DDDPRINT("p_start=%p, p_end=%p, p=%p", - (const void *) p_start, (const void *) p_end, - (const void *) p)); + DUK_DDD(DUK_DDDPRINT("p_start=%p, p_end=%p, p=%p", (const void *) p_start, (const void *) p_end, (const void *) p)); /* For invalid UTF-8 (never happens for standard ECMAScript strings) * return U+FFFD replacement character. @@ -63112,7 +64330,7 @@ DUK_INTERNAL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk * decoded at the end of the string and 'p' is no longer * within string memory range. */ - cp2 = 0; /* If call fails, this is left untouched and won't match cp2 check. */ + cp2 = 0; /* If call fails, this is left untouched and won't match cp2 check. */ (void) duk_unicode_decode_xutf8(thr, &p, p_start, p_end, &cp2); if (cp2 >= 0xdc00UL && cp2 <= 0xdfffUL) { cp1 = (duk_ucodepoint_t) (((cp1 - 0xd800UL) << 10) + (cp2 - 0xdc00UL) + 0x10000UL); @@ -63142,7 +64360,7 @@ DUK_INTERNAL void duk_hstring_init_charlen(duk_hstring *h) { clen = duk_unicode_unvalidated_utf8_length(DUK_HSTRING_GET_DATA(h), DUK_HSTRING_GET_BYTELEN(h)); #if defined(DUK_USE_STRLEN16) - DUK_ASSERT(clen <= 0xffffUL); /* Bytelength checked during interning. */ + DUK_ASSERT(clen <= 0xffffUL); /* Bytelength checked during interning. */ h->clen16 = (duk_uint16_t) clen; #else h->clen = (duk_uint32_t) clen; @@ -63159,7 +64377,7 @@ DUK_INTERNAL DUK_HOT duk_size_t duk_hstring_get_charlen(duk_hstring *h) { return h->clen; #endif } -#endif /* !DUK_USE_HSTRING_LAZY_CLEN */ +#endif /* !DUK_USE_HSTRING_LAZY_CLEN */ /* * duk_hstring charlen, when lazy charlen enabled @@ -63170,7 +64388,7 @@ DUK_INTERNAL DUK_HOT duk_size_t duk_hstring_get_charlen(duk_hstring *h) { DUK_LOCAL DUK_COLD duk_size_t duk__hstring_get_charlen_slowpath(duk_hstring *h) { duk_size_t res; - DUK_ASSERT(h->clen == 0); /* Checked by caller. */ + DUK_ASSERT(h->clen == 0); /* Checked by caller. */ #if defined(DUK_USE_ROM_STRINGS) /* ROM strings have precomputed clen, but if the computed clen is zero @@ -63183,7 +64401,7 @@ DUK_LOCAL DUK_COLD duk_size_t duk__hstring_get_charlen_slowpath(duk_hstring *h) res = duk_unicode_unvalidated_utf8_length(DUK_HSTRING_GET_DATA(h), DUK_HSTRING_GET_BYTELEN(h)); #if defined(DUK_USE_STRLEN16) - DUK_ASSERT(res <= 0xffffUL); /* Bytelength checked during interning. */ + DUK_ASSERT(res <= 0xffffUL); /* Bytelength checked during interning. */ h->clen16 = (duk_uint16_t) res; #else h->clen = (duk_uint32_t) res; @@ -63193,7 +64411,7 @@ DUK_LOCAL DUK_COLD duk_size_t duk__hstring_get_charlen_slowpath(duk_hstring *h) } return res; } -#else /* DUK_USE_HSTRING_CLEN */ +#else /* DUK_USE_HSTRING_CLEN */ DUK_LOCAL duk_size_t duk__hstring_get_charlen_slowpath(duk_hstring *h) { if (DUK_LIKELY(DUK_HSTRING_HAS_ASCII(h))) { /* Most practical strings will go here. */ @@ -63222,7 +64440,7 @@ DUK_LOCAL duk_size_t duk__hstring_get_charlen_slowpath(duk_hstring *h) { return res; } } -#endif /* DUK_USE_HSTRING_CLEN */ +#endif /* DUK_USE_HSTRING_CLEN */ #if defined(DUK_USE_HSTRING_CLEN) DUK_INTERNAL DUK_HOT duk_size_t duk_hstring_get_charlen(duk_hstring *h) { @@ -63237,13 +64455,13 @@ DUK_INTERNAL DUK_HOT duk_size_t duk_hstring_get_charlen(duk_hstring *h) { #endif return duk__hstring_get_charlen_slowpath(h); } -#else /* DUK_USE_HSTRING_CLEN */ +#else /* DUK_USE_HSTRING_CLEN */ DUK_INTERNAL DUK_HOT duk_size_t duk_hstring_get_charlen(duk_hstring *h) { /* Always use slow path. */ return duk__hstring_get_charlen_slowpath(h); } -#endif /* DUK_USE_HSTRING_CLEN */ -#endif /* DUK_USE_HSTRING_LAZY_CLEN */ +#endif /* DUK_USE_HSTRING_CLEN */ +#endif /* DUK_USE_HSTRING_LAZY_CLEN */ /* * Compare duk_hstring to an ASCII cstring. @@ -63308,7 +64526,7 @@ DUK_INTERNAL duk_bool_t duk_hthread_init_stacks(duk_heap *heap, duk_hthread *thr return 1; - fail: +fail: DUK_FREE(heap, thr->valstack); DUK_ASSERT(thr->callstack_curr == NULL); @@ -63335,21 +64553,21 @@ DUK_INTERNAL void *duk_hthread_get_valstack_ptr(duk_heap *heap, void *ud) { * Encoding constants, must match genbuiltins.py */ -#define DUK__PROP_FLAGS_BITS 3 -#define DUK__LENGTH_PROP_BITS 3 -#define DUK__NARGS_BITS 3 -#define DUK__PROP_TYPE_BITS 3 +#define DUK__PROP_FLAGS_BITS 3 +#define DUK__LENGTH_PROP_BITS 3 +#define DUK__NARGS_BITS 3 +#define DUK__PROP_TYPE_BITS 3 -#define DUK__NARGS_VARARGS_MARKER 0x07 +#define DUK__NARGS_VARARGS_MARKER 0x07 -#define DUK__PROP_TYPE_DOUBLE 0 -#define DUK__PROP_TYPE_STRING 1 -#define DUK__PROP_TYPE_STRIDX 2 -#define DUK__PROP_TYPE_BUILTIN 3 -#define DUK__PROP_TYPE_UNDEFINED 4 -#define DUK__PROP_TYPE_BOOLEAN_TRUE 5 -#define DUK__PROP_TYPE_BOOLEAN_FALSE 6 -#define DUK__PROP_TYPE_ACCESSOR 7 +#define DUK__PROP_TYPE_DOUBLE 0 +#define DUK__PROP_TYPE_STRING 1 +#define DUK__PROP_TYPE_STRIDX 2 +#define DUK__PROP_TYPE_BUILTIN 3 +#define DUK__PROP_TYPE_UNDEFINED 4 +#define DUK__PROP_TYPE_BOOLEAN_TRUE 5 +#define DUK__PROP_TYPE_BOOLEAN_FALSE 6 +#define DUK__PROP_TYPE_ACCESSOR 7 /* * Create built-in objects by parsing an init bitstream generated @@ -63372,9 +64590,8 @@ DUK_LOCAL void duk__duplicate_ram_global_object(duk_hthread *thr) { #if defined(DUK_USE_ROM_GLOBAL_INHERIT) /* Inherit from ROM-based global object: less RAM usage, less transparent. */ h_global = duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_GLOBAL), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_GLOBAL), DUK_BIDX_GLOBAL); DUK_ASSERT(h_global != NULL); #elif defined(DUK_USE_ROM_GLOBAL_CLONE) @@ -63383,9 +64600,8 @@ DUK_LOCAL void duk__duplicate_ram_global_object(duk_hthread *thr) { * model but more compliant. */ h_global = duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_GLOBAL), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_GLOBAL), DUK_BIDX_OBJECT_PROTOTYPE); DUK_ASSERT(h_global != NULL); h_oldglobal = thr->builtins[DUK_BIDX_GLOBAL]; @@ -63419,7 +64635,8 @@ DUK_LOCAL void duk__duplicate_ram_global_object(duk_hthread *thr) { duk_hobject_compact_props(thr, h_global); DUK_ASSERT(thr->builtins[DUK_BIDX_GLOBAL] != NULL); - DUK_ASSERT(!DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE((duk_heaphdr *) thr->builtins[DUK_BIDX_GLOBAL])); /* no need to decref: ROM object */ + DUK_ASSERT( + !DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE((duk_heaphdr *) thr->builtins[DUK_BIDX_GLOBAL])); /* no need to decref: ROM object */ thr->builtins[DUK_BIDX_GLOBAL] = h_global; DUK_HOBJECT_INCREF(thr, h_global); DUK_D(DUK_DPRINT("duplicated global object: %!O", h_global)); @@ -63428,9 +64645,9 @@ DUK_LOCAL void duk__duplicate_ram_global_object(duk_hthread *thr) { * needed so that the global scope points to the newly created RAM-based * global object. */ - h_objenv = (duk_hobject *) duk_hobjenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); + h_objenv = + (duk_hobject *) duk_hobjenv_alloc(thr, + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); DUK_ASSERT(h_objenv != NULL); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_objenv) == NULL); duk_push_hobject(thr, h_objenv); @@ -63441,16 +64658,17 @@ DUK_LOCAL void duk__duplicate_ram_global_object(duk_hthread *thr) { DUK_ASSERT(((duk_hobjenv *) h_objenv)->has_this == 0); DUK_ASSERT(thr->builtins[DUK_BIDX_GLOBAL_ENV] != NULL); - DUK_ASSERT(!DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE((duk_heaphdr *) thr->builtins[DUK_BIDX_GLOBAL_ENV])); /* no need to decref: ROM object */ + DUK_ASSERT(!DUK_HEAPHDR_NEEDS_REFCOUNT_UPDATE( + (duk_heaphdr *) thr->builtins[DUK_BIDX_GLOBAL_ENV])); /* no need to decref: ROM object */ thr->builtins[DUK_BIDX_GLOBAL_ENV] = h_objenv; DUK_HOBJECT_INCREF(thr, h_objenv); DUK_D(DUK_DPRINT("duplicated global env: %!O", h_objenv)); DUK_HOBJENV_ASSERT_VALID((duk_hobjenv *) h_objenv); - duk_pop_2(thr); /* Pop global object and global env. */ + duk_pop_2(thr); /* Pop global object and global env. */ } -#endif /* DUK_USE_ROM_GLOBAL_CLONE || DUK_USE_ROM_GLOBAL_INHERIT */ +#endif /* DUK_USE_ROM_GLOBAL_CLONE || DUK_USE_ROM_GLOBAL_INHERIT */ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { /* Setup builtins from ROM objects. All heaps/threads will share @@ -63474,12 +64692,12 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { duk__duplicate_ram_global_object(thr); #endif } -#else /* DUK_USE_ROM_OBJECTS */ +#else /* DUK_USE_ROM_OBJECTS */ DUK_LOCAL void duk__push_stridx(duk_hthread *thr, duk_bitdecoder_ctx *bd) { duk_small_uint_t n; n = (duk_small_uint_t) duk_bd_decode_varuint(bd); - DUK_ASSERT_DISABLE(n >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(n >= 0); /* unsigned */ DUK_ASSERT(n < DUK_HEAP_NUM_STRINGS); duk_push_hstring_stridx(thr, n); } @@ -63516,16 +64734,18 @@ DUK_LOCAL void duk__push_double(duk_hthread *thr, duk_bitdecoder_ctx *bd) { du.uc[i] = (duk_uint8_t) duk_bd_decode(bd, 8); } - duk_push_number(thr, du.d); /* push operation normalizes NaNs */ + duk_push_number(thr, du.d); /* push operation normalizes NaNs */ } DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { duk_bitdecoder_ctx bd_ctx; - duk_bitdecoder_ctx *bd = &bd_ctx; /* convenience */ + duk_bitdecoder_ctx *bd = &bd_ctx; /* convenience */ duk_hobject *h; duk_small_uint_t i, j; - DUK_D(DUK_DPRINT("INITBUILTINS BEGIN: DUK_NUM_BUILTINS=%d, DUK_NUM_BUILTINS_ALL=%d", (int) DUK_NUM_BUILTINS, (int) DUK_NUM_ALL_BUILTINS)); + DUK_D(DUK_DPRINT("INITBUILTINS BEGIN: DUK_NUM_BUILTINS=%d, DUK_NUM_BUILTINS_ALL=%d", + (int) DUK_NUM_BUILTINS, + (int) DUK_NUM_ALL_BUILTINS)); duk_memzero(&bd_ctx, sizeof(bd_ctx)); bd->data = (const duk_uint8_t *) duk_builtins_data; @@ -63552,14 +64772,14 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { DUK_ASSERT_TOP(thr, 0); for (i = 0; i < DUK_NUM_ALL_BUILTINS; i++) { duk_small_uint_t class_num; - duk_small_int_t len = -1; /* must be signed */ + duk_small_int_t len = -1; /* must be signed */ class_num = (duk_small_uint_t) duk_bd_decode_varuint(bd); len = (duk_small_int_t) duk_bd_decode_flagged_signed(bd, DUK__LENGTH_PROP_BITS, (duk_int32_t) -1 /*def_value*/); if (class_num == DUK_HOBJECT_CLASS_FUNCTION) { duk_small_uint_t natidx; - duk_small_int_t c_nargs; /* must hold DUK_VARARGS */ + duk_small_int_t c_nargs; /* must hold DUK_VARARGS */ duk_c_function c_func; duk_int16_t magic; @@ -63590,12 +64810,9 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { duk__push_stridx_or_string(thr, bd); #if defined(DUK_USE_FUNC_NAME_PROPERTY) - duk_xdef_prop_stridx_short(thr, - -2, - DUK_STRIDX_NAME, - DUK_PROPDESC_FLAGS_C); + duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_NAME, DUK_PROPDESC_FLAGS_C); #else - duk_pop(thr); /* Not very ideal but good enough for now. */ + duk_pop(thr); /* Not very ideal but good enough for now. */ #endif /* Almost all global level Function objects are constructable @@ -63621,8 +64838,7 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { DUK_ASSERT(DUK_BIDX_GLOBAL_ENV > DUK_BIDX_GLOBAL); env = duk_hobjenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); DUK_ASSERT(env->target == NULL); duk_push_hobject(thr, (duk_hobject *) env); @@ -63637,10 +64853,8 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { DUK_ASSERT(class_num != DUK_HOBJECT_CLASS_DECENV); (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_EXTENSIBLE, - -1); /* no prototype or class yet */ - + DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_EXTENSIBLE, + -1); /* no prototype or class yet */ } h = duk_known_hobject(thr, -1); @@ -63662,18 +64876,15 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { * not encoded explicitly in init data. */ - DUK_ASSERT(class_num != DUK_HOBJECT_CLASS_ARRAY); /* .length is virtual */ + DUK_ASSERT(class_num != DUK_HOBJECT_CLASS_ARRAY); /* .length is virtual */ duk_push_int(thr, len); - duk_xdef_prop_stridx_short(thr, - -2, - DUK_STRIDX_LENGTH, - DUK_PROPDESC_FLAGS_C); + duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_C); } /* enable exotic behaviors last */ if (class_num == DUK_HOBJECT_CLASS_ARRAY) { - DUK_ASSERT(DUK_HOBJECT_HAS_EXOTIC_ARRAY(h)); /* set by duk_push_array() */ + DUK_ASSERT(DUK_HOBJECT_HAS_EXOTIC_ARRAY(h)); /* set by duk_push_array() */ } if (class_num == DUK_HOBJECT_CLASS_STRING) { DUK_HOBJECT_SET_EXOTIC_STRINGOBJ(h); @@ -63690,7 +64901,7 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { DUK_ASSERT(!DUK_HOBJECT_IS_PROXY(h)); DUK_ASSERT(!DUK_HOBJECT_HAS_ARRAY_PART(h) || class_num == DUK_HOBJECT_CLASS_ARRAY); /* DUK_HOBJECT_FLAG_STRICT varies */ - DUK_ASSERT(!DUK_HOBJECT_HAS_NATFUNC(h) || /* all native functions have NEWENV */ + DUK_ASSERT(!DUK_HOBJECT_HAS_NATFUNC(h) || /* all native functions have NEWENV */ DUK_HOBJECT_HAS_NEWENV(h)); DUK_ASSERT(!DUK_HOBJECT_HAS_NAMEBINDING(h)); DUK_ASSERT(!DUK_HOBJECT_HAS_CREATEARGS(h)); @@ -63773,11 +64984,9 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { defprop_flags = (duk_small_uint_t) duk_bd_decode_flagged(bd, DUK__PROP_FLAGS_BITS, (duk_uint32_t) DUK_PROPDESC_FLAGS_WC); - defprop_flags |= DUK_DEFPROP_FORCE | - DUK_DEFPROP_HAVE_VALUE | - DUK_DEFPROP_HAVE_WRITABLE | + defprop_flags |= DUK_DEFPROP_FORCE | DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE | - DUK_DEFPROP_HAVE_CONFIGURABLE; /* Defaults for data properties. */ + DUK_DEFPROP_HAVE_CONFIGURABLE; /* Defaults for data properties. */ /* The writable, enumerable, configurable flags in prop_flags * match both duk_def_prop() and internal property flags. @@ -63789,7 +64998,11 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { t = (duk_small_uint_t) duk_bd_decode(bd, DUK__PROP_TYPE_BITS); DUK_DDD(DUK_DDDPRINT("built-in %ld, normal-valued property %ld, key %!T, flags 0x%02lx, type %ld", - (long) i, (long) j, duk_get_tval(thr, -1), (unsigned long) defprop_flags, (long) t)); + (long) i, + (long) j, + duk_get_tval(thr, -1), + (unsigned long) defprop_flags, + (long) t)); switch (t) { case DUK__PROP_TYPE_DOUBLE: { @@ -63830,24 +65043,29 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { duk_c_function c_func_getter; duk_c_function c_func_setter; - DUK_DDD(DUK_DDDPRINT("built-in accessor property: objidx=%ld, key=%!T, getteridx=%ld, setteridx=%ld, flags=0x%04lx", - (long) i, duk_get_tval(thr, -1), (long) natidx_getter, (long) natidx_setter, (unsigned long) defprop_flags)); + DUK_DDD(DUK_DDDPRINT( + "built-in accessor property: objidx=%ld, key=%!T, getteridx=%ld, setteridx=%ld, flags=0x%04lx", + (long) i, + duk_get_tval(thr, -1), + (long) natidx_getter, + (long) natidx_setter, + (unsigned long) defprop_flags)); c_func_getter = duk_bi_native_functions[natidx_getter]; if (c_func_getter != NULL) { - duk_push_c_function_builtin_noconstruct(thr, c_func_getter, 0); /* always 0 args */ + duk_push_c_function_builtin_noconstruct(thr, c_func_getter, 0); /* always 0 args */ duk_set_magic(thr, -1, (duk_int_t) accessor_magic); defprop_flags |= DUK_DEFPROP_HAVE_GETTER; } c_func_setter = duk_bi_native_functions[natidx_setter]; if (c_func_setter != NULL) { - duk_push_c_function_builtin_noconstruct(thr, c_func_setter, 1); /* always 1 arg */ + duk_push_c_function_builtin_noconstruct(thr, c_func_setter, 1); /* always 1 arg */ duk_set_magic(thr, -1, (duk_int_t) accessor_magic); defprop_flags |= DUK_DEFPROP_HAVE_SETTER; } /* Writable flag doesn't make sense for an accessor. */ - DUK_ASSERT((defprop_flags & DUK_PROPDESC_FLAG_WRITABLE) == 0); /* genbuiltins.py ensures */ + DUK_ASSERT((defprop_flags & DUK_PROPDESC_FLAG_WRITABLE) == 0); /* genbuiltins.py ensures */ defprop_flags &= ~(DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_HAVE_WRITABLE); defprop_flags |= DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE; @@ -63869,7 +65087,7 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { for (j = 0; j < num; j++) { duk_hstring *h_key; duk_small_uint_t natidx; - duk_int_t c_nargs; /* must hold DUK_VARARGS */ + duk_int_t c_nargs; /* must hold DUK_VARARGS */ duk_small_uint_t c_length; duk_int16_t magic; duk_c_function c_func; @@ -63892,51 +65110,66 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { c_func = duk_bi_native_functions[natidx]; - DUK_DDD(DUK_DDDPRINT("built-in %ld, function-valued property %ld, key %!O, natidx %ld, length %ld, nargs %ld", - (long) i, (long) j, (duk_heaphdr *) h_key, (long) natidx, (long) c_length, - (c_nargs == DUK_VARARGS ? (long) -1 : (long) c_nargs))); + DUK_DDD( + DUK_DDDPRINT("built-in %ld, function-valued property %ld, key %!O, natidx %ld, length %ld, nargs %ld", + (long) i, + (long) j, + (duk_heaphdr *) h_key, + (long) natidx, + (long) c_length, + (c_nargs == DUK_VARARGS ? (long) -1 : (long) c_nargs))); /* Cast converts magic to 16-bit signed value */ magic = (duk_int16_t) duk_bd_decode_varuint(bd); #if defined(DUK_USE_LIGHTFUNC_BUILTINS) lightfunc_eligible = - ((c_nargs >= DUK_LFUNC_NARGS_MIN && c_nargs <= DUK_LFUNC_NARGS_MAX) || (c_nargs == DUK_VARARGS)) && - (c_length <= DUK_LFUNC_LENGTH_MAX) && - (magic >= DUK_LFUNC_MAGIC_MIN && magic <= DUK_LFUNC_MAGIC_MAX); + ((c_nargs >= DUK_LFUNC_NARGS_MIN && c_nargs <= DUK_LFUNC_NARGS_MAX) || (c_nargs == DUK_VARARGS)) && + (c_length <= DUK_LFUNC_LENGTH_MAX) && (magic >= DUK_LFUNC_MAGIC_MIN && magic <= DUK_LFUNC_MAGIC_MAX); /* These functions have trouble working as lightfuncs. * Some of them have specific asserts and some may have - * additional properties (e.g. 'require.id' may be written). + * additional properties (e.g. 'require.id' may be written). */ if (c_func == duk_bi_global_object_eval) { lightfunc_eligible = 0; } #if defined(DUK_USE_COROUTINE_SUPPORT) - if (c_func == duk_bi_thread_yield || - c_func == duk_bi_thread_resume) { + if (c_func == duk_bi_thread_yield || c_func == duk_bi_thread_resume) { lightfunc_eligible = 0; } #endif - if (c_func == duk_bi_function_prototype_call || - c_func == duk_bi_function_prototype_apply || - c_func == duk_bi_reflect_apply || - c_func == duk_bi_reflect_construct) { + if (c_func == duk_bi_function_prototype_call || c_func == duk_bi_function_prototype_apply || + c_func == duk_bi_reflect_apply || c_func == duk_bi_reflect_construct) { lightfunc_eligible = 0; } if (lightfunc_eligible) { duk_tval tv_lfunc; - duk_small_uint_t lf_nargs = (duk_small_uint_t) (c_nargs == DUK_VARARGS ? DUK_LFUNC_NARGS_VARARGS : c_nargs); + duk_small_uint_t lf_nargs = + (duk_small_uint_t) (c_nargs == DUK_VARARGS ? DUK_LFUNC_NARGS_VARARGS : c_nargs); duk_small_uint_t lf_flags = DUK_LFUNC_FLAGS_PACK(magic, c_length, lf_nargs); DUK_TVAL_SET_LIGHTFUNC(&tv_lfunc, c_func, lf_flags); duk_push_tval(thr, &tv_lfunc); - DUK_D(DUK_DPRINT("built-in function eligible as light function: i=%d, j=%d c_length=%ld, c_nargs=%ld, magic=%ld -> %!iT", (int) i, (int) j, (long) c_length, (long) c_nargs, (long) magic, duk_get_tval(thr, -1))); + DUK_D(DUK_DPRINT("built-in function eligible as light function: i=%d, j=%d c_length=%ld, " + "c_nargs=%ld, magic=%ld -> %!iT", + (int) i, + (int) j, + (long) c_length, + (long) c_nargs, + (long) magic, + duk_get_tval(thr, -1))); goto lightfunc_skip; } - DUK_D(DUK_DPRINT("built-in function NOT ELIGIBLE as light function: i=%d, j=%d c_length=%ld, c_nargs=%ld, magic=%ld", (int) i, (int) j, (long) c_length, (long) c_nargs, (long) magic)); -#endif /* DUK_USE_LIGHTFUNC_BUILTINS */ + DUK_D(DUK_DPRINT( + "built-in function NOT ELIGIBLE as light function: i=%d, j=%d c_length=%ld, c_nargs=%ld, magic=%ld", + (int) i, + (int) j, + (long) c_length, + (long) c_nargs, + (long) magic)); +#endif /* DUK_USE_LIGHTFUNC_BUILTINS */ /* [ (builtin objects) name ] */ @@ -63947,10 +65180,8 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { /* XXX: add into init data? */ /* Special call handling, not described in init data. */ - if (c_func == duk_bi_global_object_eval || - c_func == duk_bi_function_prototype_call || - c_func == duk_bi_function_prototype_apply || - c_func == duk_bi_reflect_apply || + if (c_func == duk_bi_global_object_eval || c_func == duk_bi_function_prototype_call || + c_func == duk_bi_function_prototype_apply || c_func == duk_bi_reflect_apply || c_func == duk_bi_reflect_construct) { DUK_HOBJECT_SET_SPECIAL_CALL((duk_hobject *) h_func); } @@ -63984,7 +65215,9 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { /* XXX: other properties of function instances; 'arguments', 'caller'. */ DUK_DD(DUK_DDPRINT("built-in object %ld, function property %ld -> %!T", - (long) i, (long) j, (duk_tval *) duk_get_tval(thr, -1))); + (long) i, + (long) j, + (duk_tval *) duk_get_tval(thr, -1))); /* [ (builtin objects) name func ] */ @@ -63994,17 +65227,14 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { */ #if defined(DUK_USE_LIGHTFUNC_BUILTINS) - lightfunc_skip: + lightfunc_skip: #endif defprop_flags = (duk_small_uint_t) duk_bd_decode_flagged(bd, DUK__PROP_FLAGS_BITS, (duk_uint32_t) DUK_PROPDESC_FLAGS_WC); - defprop_flags |= DUK_DEFPROP_FORCE | - DUK_DEFPROP_HAVE_VALUE | - DUK_DEFPROP_HAVE_WRITABLE | - DUK_DEFPROP_HAVE_ENUMERABLE | - DUK_DEFPROP_HAVE_CONFIGURABLE; + defprop_flags |= DUK_DEFPROP_FORCE | DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_HAVE_WRITABLE | + DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE; DUK_ASSERT(DUK_PROPDESC_FLAG_WRITABLE == DUK_DEFPROP_WRITABLE); DUK_ASSERT(DUK_PROPDESC_FLAG_ENUMERABLE == DUK_DEFPROP_ENUMERABLE); DUK_ASSERT(DUK_PROPDESC_FLAG_CONFIGURABLE == DUK_DEFPROP_CONFIGURABLE); @@ -64042,22 +65272,28 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { #if !defined(DUK_USE_ES6_OBJECT_PROTO_PROPERTY) DUK_DD(DUK_DDPRINT("delete Object.prototype.__proto__ built-in which is not enabled in features")); - (void) duk_hobject_delprop_raw(thr, thr->builtins[DUK_BIDX_OBJECT_PROTOTYPE], DUK_HTHREAD_STRING___PROTO__(thr), DUK_DELPROP_FLAG_THROW); + (void) duk_hobject_delprop_raw(thr, + thr->builtins[DUK_BIDX_OBJECT_PROTOTYPE], + DUK_HTHREAD_STRING___PROTO__(thr), + DUK_DELPROP_FLAG_THROW); #endif #if !defined(DUK_USE_ES6_OBJECT_SETPROTOTYPEOF) DUK_DD(DUK_DDPRINT("delete Object.setPrototypeOf built-in which is not enabled in features")); - (void) duk_hobject_delprop_raw(thr, thr->builtins[DUK_BIDX_OBJECT_CONSTRUCTOR], DUK_HTHREAD_STRING_SET_PROTOTYPE_OF(thr), DUK_DELPROP_FLAG_THROW); + (void) duk_hobject_delprop_raw(thr, + thr->builtins[DUK_BIDX_OBJECT_CONSTRUCTOR], + DUK_HTHREAD_STRING_SET_PROTOTYPE_OF(thr), + DUK_DELPROP_FLAG_THROW); #endif /* XXX: relocate */ duk_push_string(thr, - /* Endianness indicator */ + /* Endianness indicator */ #if defined(DUK_USE_INTEGER_LE) "l" #elif defined(DUK_USE_INTEGER_BE) "b" -#elif defined(DUK_USE_INTEGER_ME) /* integer mixed endian not really used now */ +#elif defined(DUK_USE_INTEGER_ME) /* integer mixed endian not really used now */ "m" #else "?" @@ -64072,89 +65308,85 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { "?" #endif " " - /* Packed or unpacked tval */ + /* Packed or unpacked tval */ #if defined(DUK_USE_PACKED_TVAL) "p" #else "u" #endif #if defined(DUK_USE_FASTINT) - "f" -#endif - " " - /* Low memory/performance options */ -#if defined(DUK_USE_STRTAB_PTRCOMP) - "s" -#endif -#if !defined(DUK_USE_HEAPPTR16) && !defined(DUK_DATAPTR16) && !defined(DUK_FUNCPTR16) - "n" -#endif -#if defined(DUK_USE_HEAPPTR16) - "h" -#endif -#if defined(DUK_USE_DATAPTR16) - "d" -#endif -#if defined(DUK_USE_FUNCPTR16) - "f" -#endif -#if defined(DUK_USE_REFCOUNT16) - "R" -#endif -#if defined(DUK_USE_STRHASH16) - "H" -#endif -#if defined(DUK_USE_STRLEN16) - "S" -#endif -#if defined(DUK_USE_BUFLEN16) - "B" -#endif -#if defined(DUK_USE_OBJSIZES16) - "O" -#endif -#if defined(DUK_USE_LIGHTFUNC_BUILTINS) - "L" -#endif -#if defined(DUK_USE_ROM_STRINGS) || defined(DUK_USE_ROM_OBJECTS) - /* XXX: This won't be shown in practice now - * because this code is not run when builtins - * are in ROM. - */ - "Z" -#endif -#if defined(DUK_USE_LITCACHE_SIZE) - "l" + "f" #endif " " - /* Object property allocation layout */ -#if defined(DUK_USE_HOBJECT_LAYOUT_1) - "p1" -#elif defined(DUK_USE_HOBJECT_LAYOUT_2) - "p2" -#elif defined(DUK_USE_HOBJECT_LAYOUT_3) - "p3" -#else - "p?" + /* Low memory/performance options */ +#if defined(DUK_USE_STRTAB_PTRCOMP) + "s" #endif - " " - /* Alignment guarantee */ +#if !defined(DUK_USE_HEAPPTR16) && !defined(DUK_DATAPTR16) && !defined(DUK_FUNCPTR16) + "n" +#endif +#if defined(DUK_USE_HEAPPTR16) + "h" +#endif +#if defined(DUK_USE_DATAPTR16) + "d" +#endif +#if defined(DUK_USE_FUNCPTR16) + "f" +#endif +#if defined(DUK_USE_REFCOUNT16) + "R" +#endif +#if defined(DUK_USE_STRHASH16) + "H" +#endif +#if defined(DUK_USE_STRLEN16) + "S" +#endif +#if defined(DUK_USE_BUFLEN16) + "B" +#endif +#if defined(DUK_USE_OBJSIZES16) + "O" +#endif +#if defined(DUK_USE_LIGHTFUNC_BUILTINS) + "L" +#endif +#if defined(DUK_USE_ROM_STRINGS) || defined(DUK_USE_ROM_OBJECTS) + /* XXX: This won't be shown in practice now + * because this code is not run when builtins + * are in ROM. + */ + "Z" +#endif +#if defined(DUK_USE_LITCACHE_SIZE) + "l" +#endif + " " + /* Object property allocation layout */ +#if defined(DUK_USE_HOBJECT_LAYOUT_1) + "p1" +#elif defined(DUK_USE_HOBJECT_LAYOUT_2) + "p2" +#elif defined(DUK_USE_HOBJECT_LAYOUT_3) + "p3" +#else + "p?" +#endif + " " + /* Alignment guarantee */ #if (DUK_USE_ALIGN_BY == 4) - "a4" + "a4" #elif (DUK_USE_ALIGN_BY == 8) - "a8" + "a8" #elif (DUK_USE_ALIGN_BY == 1) - "a1" + "a1" #else #error invalid DUK_USE_ALIGN_BY #endif - " " - /* Architecture, OS, and compiler strings */ - DUK_USE_ARCH_STRING - " " - DUK_USE_OS_STRING - " " - DUK_USE_COMPILER_STRING); + " " + /* Architecture, OS, and compiler strings */ + DUK_USE_ARCH_STRING " " DUK_USE_OS_STRING " " DUK_USE_COMPILER_STRING); duk_xdef_prop_stridx_short(thr, DUK_BIDX_DUKTAPE, DUK_STRIDX_ENV, DUK_PROPDESC_FLAGS_WC); /* @@ -64171,7 +65403,8 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 1) for (i = 0; i < DUK_NUM_ALL_BUILTINS; i++) { DUK_DD(DUK_DDPRINT("built-in object %ld after initialization and compacting: %!@iO", - (long) i, (duk_heaphdr *) duk_require_hobject(thr, (duk_idx_t) i))); + (long) i, + (duk_heaphdr *) duk_require_hobject(thr, (duk_idx_t) i))); } #endif @@ -64184,14 +65417,14 @@ DUK_INTERNAL void duk_hthread_create_builtin_objects(duk_hthread *thr) { duk_set_top(thr, 0); DUK_ASSERT_TOP(thr, 0); } -#endif /* DUK_USE_ROM_OBJECTS */ +#endif /* DUK_USE_ROM_OBJECTS */ DUK_INTERNAL void duk_hthread_copy_builtin_objects(duk_hthread *thr_from, duk_hthread *thr_to) { duk_small_uint_t i; for (i = 0; i < DUK_NUM_BUILTINS; i++) { thr_to->builtins[i] = thr_from->builtins[i]; - DUK_HOBJECT_INCREF_ALLOWNULL(thr_to, thr_to->builtins[i]); /* side effect free */ + DUK_HOBJECT_INCREF_ALLOWNULL(thr_to, thr_to->builtins[i]); /* side effect free */ } } @@ -64223,7 +65456,7 @@ DUK_INTERNAL void duk_hthread_terminate(duk_hthread *thr) { } thr->valstack_bottom = thr->valstack; - duk_set_top(thr, 0); /* unwinds valstack, updating refcounts */ + duk_set_top(thr, 0); /* unwinds valstack, updating refcounts */ thr->state = DUK_HTHREAD_STATE_TERMINATED; @@ -64254,7 +65487,7 @@ DUK_INTERNAL duk_uint_fast32_t duk_hthread_get_act_curr_pc(duk_hthread *thr, duk } return 0; } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ DUK_INTERNAL duk_uint_fast32_t duk_hthread_get_act_prev_pc(duk_hthread *thr, duk_activation *act) { duk_instr_t *bcode; @@ -64323,7 +65556,7 @@ DUK_INTERNAL void duk_hthread_catcher_unwind_norz(duk_hthread *thr, duk_activati DUK_ASSERT(thr != NULL); DUK_ASSERT(act != NULL); - DUK_ASSERT(act->cat != NULL); /* caller must check */ + DUK_ASSERT(act->cat != NULL); /* caller must check */ cat = act->cat; DUK_ASSERT(cat != NULL); @@ -64332,9 +65565,9 @@ DUK_INTERNAL void duk_hthread_catcher_unwind_norz(duk_hthread *thr, duk_activati if (DUK_CAT_HAS_LEXENV_ACTIVE(cat)) { duk_hobject *env; - env = act->lex_env; /* current lex_env of the activation (created for catcher) */ - DUK_ASSERT(env != NULL); /* must be, since env was created when catcher was created */ - act->lex_env = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, env); /* prototype is lex_env before catcher created */ + env = act->lex_env; /* current lex_env of the activation (created for catcher) */ + DUK_ASSERT(env != NULL); /* must be, since env was created when catcher was created */ + act->lex_env = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, env); /* prototype is lex_env before catcher created */ DUK_HOBJECT_INCREF(thr, act->lex_env); DUK_HOBJECT_DECREF_NORZ(thr, env); @@ -64353,7 +65586,7 @@ DUK_INTERNAL void duk_hthread_catcher_unwind_nolexenv_norz(duk_hthread *thr, duk DUK_ASSERT(thr != NULL); DUK_ASSERT(act != NULL); - DUK_ASSERT(act->cat != NULL); /* caller must check */ + DUK_ASSERT(act->cat != NULL); /* caller must check */ cat = act->cat; DUK_ASSERT(cat != NULL); @@ -64391,11 +65624,11 @@ DUK_INTERNAL DUK_INLINE duk_catcher *duk_hthread_catcher_alloc(duk_hthread *thr) return duk__hthread_catcher_alloc_slow(thr); } -#else /* DUK_USE_CACHE_CATCHER */ +#else /* DUK_USE_CACHE_CATCHER */ DUK_INTERNAL duk_catcher *duk_hthread_catcher_alloc(duk_hthread *thr) { return duk__hthread_catcher_alloc_slow(thr); } -#endif /* DUK_USE_CACHE_CATCHER */ +#endif /* DUK_USE_CACHE_CATCHER */ DUK_INTERNAL void duk_hthread_catcher_free(duk_hthread *thr, duk_catcher *cat) { DUK_ASSERT(thr != NULL); @@ -64436,12 +65669,11 @@ DUK_INTERNAL DUK_INLINE duk_activation *duk_hthread_activation_alloc(duk_hthread return duk__hthread_activation_alloc_slow(thr); } -#else /* DUK_USE_CACHE_ACTIVATION */ +#else /* DUK_USE_CACHE_ACTIVATION */ DUK_INTERNAL duk_activation *duk_hthread_activation_alloc(duk_hthread *thr) { return duk__hthread_activation_alloc_slow(thr); } -#endif /* DUK_USE_CACHE_ACTIVATION */ - +#endif /* DUK_USE_CACHE_ACTIVATION */ DUK_INTERNAL void duk_hthread_activation_free(duk_hthread *thr, duk_activation *act) { DUK_ASSERT(thr != NULL); @@ -64468,7 +65700,7 @@ DUK_LOCAL void duk__activation_unwind_nofree_norz(duk_hthread *thr) { duk_hobject *tmp; DUK_ASSERT(thr != NULL); - DUK_ASSERT(thr->callstack_curr != NULL); /* caller must check */ + DUK_ASSERT(thr->callstack_curr != NULL); /* caller must check */ DUK_ASSERT(thr->callstack_top > 0); act = thr->callstack_curr; DUK_ASSERT(act != NULL); @@ -64505,7 +65737,7 @@ DUK_LOCAL void duk__activation_unwind_nofree_norz(duk_hthread *thr) { DUK_TVAL_SET_OBJECT(tv_caller, act->prev_caller); act->prev_caller = NULL; } else { - DUK_TVAL_SET_NULL(tv_caller); /* no incref needed */ + DUK_TVAL_SET_NULL(tv_caller); /* no incref needed */ DUK_ASSERT(act->prev_caller == NULL); } DUK_TVAL_DECREF_NORZ(thr, &tv_tmp); @@ -64534,7 +65766,7 @@ DUK_LOCAL void duk__activation_unwind_nofree_norz(duk_hthread *thr) { duk_debug_set_paused(heap); } else { DUK_D(DUK_DPRINT("unwound past dbg_pause_act, set to NULL")); - heap->dbg_pause_act = NULL; /* avoid stale pointers */ + heap->dbg_pause_act = NULL; /* avoid stale pointers */ } DUK_ASSERT(heap->dbg_pause_act == NULL); } @@ -64583,12 +65815,11 @@ DUK_LOCAL void duk__activation_unwind_nofree_norz(duk_hthread *thr) { * fixed e.g. by preallocating the scope property slots. */ if (act->var_env != NULL) { - DUK_DDD(DUK_DDDPRINT("closing var_env record %p -> %!O", - (void *) act->var_env, (duk_heaphdr *) act->var_env)); + DUK_DDD(DUK_DDDPRINT("closing var_env record %p -> %!O", (void *) act->var_env, (duk_heaphdr *) act->var_env)); duk_js_close_environment_record(thr, act->var_env); } - skip_env_close: +skip_env_close: /* * Update preventcount @@ -64712,7 +65943,7 @@ DUK_INTERNAL void duk_hthread_valstack_torture_realloc(duk_hthread *thr) { DUK_D(DUK_DPRINT("failed to realloc valstack for torture, ignore")); } } -#endif /* DUK_USE_FINALIZER_TORTURE */ +#endif /* DUK_USE_FINALIZER_TORTURE */ /* * Shared helpers for arithmetic operations */ @@ -64756,10 +65987,14 @@ DUK_INTERNAL double duk_js_arith_mod(double d1, double d2) { DUK_ASSERT(DUK_ISNAN(DUK_FMOD(-DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY))); DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, 1.0), 0.0) && DUK_SIGNBIT(DUK_FMOD(0.0, 1.0)) == 0); DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, 1.0), 0.0) && DUK_SIGNBIT(DUK_FMOD(-0.0, 1.0)) != 0); - DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0); - DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY)) != 0); - DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, -DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0); - DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY)) != 0); + DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY), 0.0) && + DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0); + DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY), 0.0) && + DUK_SIGNBIT(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY)) != 0); + DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, -DUK_DOUBLE_INFINITY), 0.0) && + DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0); + DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY), 0.0) && + DUK_SIGNBIT(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY)) != 0); DUK_ASSERT(DUK_ISNAN(DUK_FMOD(0.0, 0.0))); DUK_ASSERT(DUK_ISNAN(DUK_FMOD(-0.0, 0.0))); DUK_ASSERT(DUK_ISNAN(DUK_FMOD(0.0, -0.0))); @@ -64847,7 +66082,7 @@ DUK_INTERNAL double duk_js_arith_pow(double x, double y) { return DUK_POW(x, y); - ret_nan: +ret_nan: return DUK_DOUBLE_NAN; } /* @@ -64903,10 +66138,10 @@ DUK_INTERNAL void duk_native_stack_check(duk_hthread *thr) { * for, e.g. a print() call at the deepest level, and an extra * +1 for protected call wrapping. */ -#define DUK__AUGMENT_CALL_RELAX_COUNT (10 + 2) +#define DUK__AUGMENT_CALL_RELAX_COUNT (10 + 2) /* Stack space required by call handling entry. */ -#define DUK__CALL_HANDLING_REQUIRE_STACK 8 +#define DUK__CALL_HANDLING_REQUIRE_STACK 8 DUK_LOCAL DUK_NOINLINE void duk__call_c_recursion_limit_check_slowpath(duk_hthread *thr) { /* When augmenting an error, the effective limit is a bit higher. @@ -65000,7 +66235,8 @@ DUK_LOCAL void duk__interrupt_fixup(duk_hthread *thr, duk_hthread *entry_curr_th thr->heap->inst_count_interrupt += thr->interrupt_init; DUK_DD(DUK_DDPRINT("debug test: updated interrupt count on exit to " "user code, instruction counts: executor=%ld, interrupt=%ld", - (long) thr->heap->inst_count_exec, (long) thr->heap->inst_count_interrupt)); + (long) thr->heap->inst_count_exec, + (long) thr->heap->inst_count_interrupt)); DUK_ASSERT(thr->heap->inst_count_exec == thr->heap->inst_count_interrupt); } #else @@ -65019,12 +66255,9 @@ DUK_LOCAL void duk__interrupt_fixup(duk_hthread *thr, duk_hthread *entry_curr_th * object flag DUK_HOBJECT_FLAG_EXOTIC_ARGUMENTS. */ -DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, - duk_hobject *func, - duk_hobject *varenv, - duk_idx_t idx_args) { - duk_hobject *arg; /* 'arguments' */ - duk_hobject *formals; /* formals for 'func' (may be NULL if func is a C function) */ +DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, duk_hobject *func, duk_hobject *varenv, duk_idx_t idx_args) { + duk_hobject *arg; /* 'arguments' */ + duk_hobject *formals; /* formals for 'func' (may be NULL if func is a C function) */ duk_idx_t i_arg; duk_idx_t i_map; duk_idx_t i_mappednames; @@ -65070,9 +66303,8 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, DUK_ASSERT(n_formals >= 0); DUK_ASSERT(formals != NULL || n_formals == 0); - DUK_DDD(DUK_DDDPRINT("func=%!O, formals=%!O, n_formals=%ld", - (duk_heaphdr *) func, (duk_heaphdr *) formals, - (long) n_formals)); + DUK_DDD( + DUK_DDDPRINT("func=%!O, formals=%!O, n_formals=%ld", (duk_heaphdr *) func, (duk_heaphdr *) formals, (long) n_formals)); /* [ ... formals ] */ @@ -65084,28 +66316,24 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, */ arg = duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_FLAG_ARRAY_PART | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARGUMENTS), + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | DUK_HOBJECT_FLAG_ARRAY_PART | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_ARGUMENTS), DUK_BIDX_OBJECT_PROTOTYPE); DUK_ASSERT(arg != NULL); (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), - -1); /* no prototype */ + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), + -1); /* no prototype */ (void) duk_push_object_helper(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_FLAG_FASTREFS | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), - -1); /* no prototype */ + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_FLAG_FASTREFS | + DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJECT), + -1); /* no prototype */ i_arg = duk_get_top(thr) - 3; i_map = i_arg + 1; i_mappednames = i_arg + 2; - DUK_ASSERT(!duk_is_bare_object(thr, -3)); /* arguments */ - DUK_ASSERT(duk_is_bare_object(thr, -2)); /* map */ - DUK_ASSERT(duk_is_bare_object(thr, -1)); /* mappedNames */ + DUK_ASSERT(!duk_is_bare_object(thr, -3)); /* arguments */ + DUK_ASSERT(duk_is_bare_object(thr, -2)); /* map */ + DUK_ASSERT(duk_is_bare_object(thr, -1)); /* mappedNames */ /* [ ... formals arguments map mappedNames ] */ @@ -65113,9 +66341,12 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, "arguments at index %ld -> %!O " "map at index %ld -> %!O " "mappednames at index %ld -> %!O", - (long) i_arg, (duk_heaphdr *) duk_get_hobject(thr, i_arg), - (long) i_map, (duk_heaphdr *) duk_get_hobject(thr, i_map), - (long) i_mappednames, (duk_heaphdr *) duk_get_hobject(thr, i_mappednames))); + (long) i_arg, + (duk_heaphdr *) duk_get_hobject(thr, i_arg), + (long) i_map, + (duk_heaphdr *) duk_get_hobject(thr, i_map), + (long) i_mappednames, + (duk_heaphdr *) duk_get_hobject(thr, i_mappednames))); /* * Init arguments properties, map, etc. @@ -65131,8 +66362,8 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, /* step 11 */ idx = num_stack_args - 1; while (idx >= 0) { - DUK_DDD(DUK_DDDPRINT("arg idx %ld, argbase=%ld, argidx=%ld", - (long) idx, (long) i_argbase, (long) (i_argbase + idx))); + DUK_DDD( + DUK_DDDPRINT("arg idx %ld, argbase=%ld, argidx=%ld", (long) idx, (long) i_argbase, (long) (i_argbase + idx))); DUK_DDD(DUK_DDDPRINT("define arguments[%ld]=arg", (long) idx)); duk_dup(thr, i_argbase + idx); @@ -65143,13 +66374,12 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, if (!DUK_HOBJECT_HAS_STRICT(func) && idx < n_formals) { DUK_ASSERT(formals != NULL); - DUK_DDD(DUK_DDDPRINT("strict function, index within formals (%ld < %ld)", - (long) idx, (long) n_formals)); + DUK_DDD(DUK_DDDPRINT("strict function, index within formals (%ld < %ld)", (long) idx, (long) n_formals)); duk_get_prop_index(thr, i_formals, (duk_uarridx_t) idx); DUK_ASSERT(duk_is_string(thr, -1)); - duk_dup_top(thr); /* [ ... name name ] */ + duk_dup_top(thr); /* [ ... name name ] */ if (!duk_has_prop(thr, i_mappednames)) { /* steps 11.c.ii.1 - 11.c.ii.4, but our internal book-keeping @@ -65160,24 +66390,21 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, need_map = 1; - DUK_DDD(DUK_DDDPRINT("set mappednames[%s]=%ld", - (const char *) duk_get_string(thr, -1), - (long) idx)); - duk_dup_top(thr); /* name */ - (void) duk_push_uint_to_hstring(thr, (duk_uint_t) idx); /* index */ - duk_xdef_prop_wec(thr, i_mappednames); /* out of spec, must be configurable */ + DUK_DDD( + DUK_DDDPRINT("set mappednames[%s]=%ld", (const char *) duk_get_string(thr, -1), (long) idx)); + duk_dup_top(thr); /* name */ + (void) duk_push_uint_to_hstring(thr, (duk_uint_t) idx); /* index */ + duk_xdef_prop_wec(thr, i_mappednames); /* out of spec, must be configurable */ - DUK_DDD(DUK_DDDPRINT("set map[%ld]=%s", - (long) idx, - duk_get_string(thr, -1))); - duk_dup_top(thr); /* name */ - duk_xdef_prop_index_wec(thr, i_map, (duk_uarridx_t) idx); /* out of spec, must be configurable */ + DUK_DDD(DUK_DDDPRINT("set map[%ld]=%s", (long) idx, duk_get_string(thr, -1))); + duk_dup_top(thr); /* name */ + duk_xdef_prop_index_wec(thr, i_map, (duk_uarridx_t) idx); /* out of spec, must be configurable */ } else { /* duk_has_prop() popped the second 'name' */ } /* [ ... name ] */ - duk_pop(thr); /* pop 'name' */ + duk_pop(thr); /* pop 'name' */ } idx--; @@ -65193,7 +66420,7 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, DUK_ASSERT(!DUK_HOBJECT_HAS_STRICT(func)); duk_dup(thr, i_map); - duk_xdef_prop_stridx(thr, i_arg, DUK_STRIDX_INT_MAP, DUK_PROPDESC_FLAGS_NONE); /* out of spec, don't care */ + duk_xdef_prop_stridx(thr, i_arg, DUK_STRIDX_INT_MAP, DUK_PROPDESC_FLAGS_NONE); /* out of spec, don't care */ /* The variable environment for magic variable bindings needs to be * given by the caller and recorded in the arguments object. @@ -65205,7 +66432,7 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, */ duk_push_hobject(thr, varenv); - duk_xdef_prop_stridx(thr, i_arg, DUK_STRIDX_INT_VARENV, DUK_PROPDESC_FLAGS_NONE); /* out of spec, don't care */ + duk_xdef_prop_stridx(thr, i_arg, DUK_STRIDX_INT_VARENV, DUK_PROPDESC_FLAGS_NONE); /* out of spec, don't care */ } /* steps 13-14 */ @@ -65258,9 +66485,12 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, "arguments at index %ld -> %!O " "map at index %ld -> %!O " "mappednames at index %ld -> %!O", - (long) i_arg, (duk_heaphdr *) duk_get_hobject(thr, i_arg), - (long) i_map, (duk_heaphdr *) duk_get_hobject(thr, i_map), - (long) i_mappednames, (duk_heaphdr *) duk_get_hobject(thr, i_mappednames))); + (long) i_arg, + (duk_heaphdr *) duk_get_hobject(thr, i_arg), + (long) i_map, + (duk_heaphdr *) duk_get_hobject(thr, i_map), + (long) i_mappednames, + (duk_heaphdr *) duk_get_hobject(thr, i_mappednames))); /* [ args(n) envobj formals arguments map mappednames ] */ @@ -65273,10 +66503,7 @@ DUK_LOCAL void duk__create_arguments_object(duk_hthread *thr, /* Helper for creating the arguments object and adding it to the env record * on top of the value stack. */ -DUK_LOCAL void duk__handle_createargs_for_call(duk_hthread *thr, - duk_hobject *func, - duk_hobject *env, - duk_idx_t idx_args) { +DUK_LOCAL void duk__handle_createargs_for_call(duk_hthread *thr, duk_hobject *func, duk_hobject *env, duk_idx_t idx_args) { DUK_DDD(DUK_DDDPRINT("creating arguments object for function call")); DUK_ASSERT(thr != NULL); @@ -65286,18 +66513,15 @@ DUK_LOCAL void duk__handle_createargs_for_call(duk_hthread *thr, /* [ ... arg1 ... argN envobj ] */ - duk__create_arguments_object(thr, - func, - env, - idx_args); + duk__create_arguments_object(thr, func, env, idx_args); /* [ ... arg1 ... argN envobj argobj ] */ duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LC_ARGUMENTS, - DUK_HOBJECT_HAS_STRICT(func) ? DUK_PROPDESC_FLAGS_E : /* strict: non-deletable, non-writable */ - DUK_PROPDESC_FLAGS_WE); /* non-strict: non-deletable, writable */ + DUK_HOBJECT_HAS_STRICT(func) ? DUK_PROPDESC_FLAGS_E : /* strict: non-deletable, non-writable */ + DUK_PROPDESC_FLAGS_WE); /* non-strict: non-deletable, writable */ /* [ ... arg1 ... argN envobj ] */ } @@ -65347,7 +66571,8 @@ DUK_LOCAL void duk__update_default_instance_proto(duk_hthread *thr, duk_idx_t id "-> leave standard Object prototype as fallback prototype")); } else { DUK_DDD(DUK_DDDPRINT("constructor has 'prototype' property with object value " - "-> set fallback prototype to that value: %!iO", (duk_heaphdr *) proto)); + "-> set fallback prototype to that value: %!iO", + (duk_heaphdr *) proto)); /* Original fallback (default instance) is untouched when * resolving bound functions etc. */ @@ -65369,9 +66594,7 @@ DUK_INTERNAL void duk_call_construct_postprocess(duk_hthread *thr, duk_small_uin * Object (we accept object-like values like buffers and * lightfuncs too). If not, TypeError. */ - if (duk_check_type_mask(thr, -1, DUK_TYPE_MASK_OBJECT | - DUK_TYPE_MASK_BUFFER | - DUK_TYPE_MASK_LIGHTFUNC)) { + if (duk_check_type_mask(thr, -1, DUK_TYPE_MASK_OBJECT | DUK_TYPE_MASK_BUFFER | DUK_TYPE_MASK_LIGHTFUNC)) { DUK_DDD(DUK_DDDPRINT("replacement value")); } else { if (DUK_UNLIKELY(proxy_invariant != 0U)) { @@ -65393,8 +66616,7 @@ DUK_INTERNAL void duk_call_construct_postprocess(duk_hthread *thr, duk_small_uin * out right; however it is always synced here so just assert for it. */ DUK_ASSERT(thr->ptr_curr_pc == NULL); - duk_err_augment_error_create(thr, thr, NULL, 0, DUK_AUGMENT_FLAG_NOBLAME_FILELINE | - DUK_AUGMENT_FLAG_SKIP_ONE); + duk_err_augment_error_create(thr, thr, NULL, 0, DUK_AUGMENT_FLAG_NOBLAME_FILELINE | DUK_AUGMENT_FLAG_SKIP_ONE); #endif } @@ -65411,9 +66633,7 @@ DUK_INTERNAL void duk_call_construct_postprocess(duk_hthread *thr, duk_small_uin * [[BoundThis]]. */ -DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, - duk_idx_t idx_func, - duk_bool_t is_constructor_call) { +DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, duk_idx_t idx_func, duk_bool_t is_constructor_call) { duk_tval *tv_func; duk_hobject *func; duk_idx_t len; @@ -65444,7 +66664,8 @@ DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, DUK_ASSERT(len == 0 || tv_args != NULL); DUK_DDD(DUK_DDDPRINT("bound function encountered, ptr=%p: %!T", - (void *) DUK_TVAL_GET_OBJECT(tv_func), tv_func)); + (void *) DUK_TVAL_GET_OBJECT(tv_func), + tv_func)); /* [ ... func this arg1 ... argN ] */ @@ -65454,7 +66675,7 @@ DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, } else { /* XXX: duk_replace_tval */ duk_push_tval(thr, &h_bound->this_binding); - duk_replace(thr, idx_func + 1); /* idx_this = idx_func + 1 */ + duk_replace(thr, idx_func + 1); /* idx_this = idx_func + 1 */ } /* [ ... func this arg1 ... argN ] */ @@ -65467,10 +66688,11 @@ DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, /* [ ... func this arg1 ... argN ] */ duk_push_tval(thr, &h_bound->target); - duk_replace(thr, idx_func); /* replace in stack */ + duk_replace(thr, idx_func); /* replace in stack */ DUK_DDD(DUK_DDDPRINT("bound function handled, idx_func=%ld, curr func=%!T", - (long) idx_func, duk_get_tval(thr, idx_func))); + (long) idx_func, + duk_get_tval(thr, idx_func))); } } else if (DUK_TVAL_IS_LIGHTFUNC(tv_func)) { /* Lightweight function: never bound, so terminate. */ @@ -65492,9 +66714,7 @@ DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, func = DUK_TVAL_GET_OBJECT(tv_func); DUK_ASSERT(func != NULL); DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(func)); - DUK_ASSERT(DUK_HOBJECT_HAS_COMPFUNC(func) || - DUK_HOBJECT_HAS_NATFUNC(func) || - DUK_HOBJECT_IS_PROXY(func)); + DUK_ASSERT(DUK_HOBJECT_HAS_COMPFUNC(func) || DUK_HOBJECT_HAS_NATFUNC(func) || DUK_HOBJECT_IS_PROXY(func)); } #endif } @@ -65503,14 +66723,18 @@ DUK_LOCAL void duk__handle_bound_chain_for_call(duk_hthread *thr, * Helper for inline handling of .call(), .apply(), and .construct(). */ -DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx_t idx_func, duk_hobject *func, duk_small_uint_t *call_flags, duk_bool_t first) { +DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, + duk_idx_t idx_func, + duk_hobject *func, + duk_small_uint_t *call_flags, + duk_bool_t first) { #if defined(DUK_USE_ASSERTIONS) duk_c_function natfunc; #endif duk_tval *tv_args; DUK_ASSERT(func != NULL); - DUK_ASSERT((*call_flags & DUK_CALL_FLAG_CONSTRUCT) == 0); /* Caller. */ + DUK_ASSERT((*call_flags & DUK_CALL_FLAG_CONSTRUCT) == 0); /* Caller. */ #if defined(DUK_USE_ASSERTIONS) natfunc = ((duk_hnatfunc *) func)->func; @@ -65538,7 +66762,7 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx *call_flags = (*call_flags & ~DUK_CALL_FLAG_CALLED_AS_EVAL) | DUK_CALL_FLAG_DIRECT_EVAL; } DUK_ASSERT(duk_get_top(thr) >= idx_func + 2); - return 1; /* stop resolving */ + return 1; /* stop resolving */ } /* Handle special functions based on the DUK_HOBJECT_FLAG_SPECIAL_CALL @@ -65548,7 +66772,7 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx * for the result values (unlike most other value stack calls). */ switch (((duk_hnatfunc *) func)->magic) { - case 0: { /* 0=Function.prototype.call() */ + case 0: { /* 0=Function.prototype.call() */ /* Value stack: * idx_func + 0: Function.prototype.call() [removed] * idx_func + 1: this binding for .call (target function) @@ -65567,11 +66791,11 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx tv_args = thr->valstack_bottom + idx_func + 2; if (thr->valstack_top < tv_args) { DUK_ASSERT(tv_args <= thr->valstack_end); - thr->valstack_top = tv_args; /* at least target function and 'this' binding present */ + thr->valstack_top = tv_args; /* at least target function and 'this' binding present */ } break; } - case 1: { /* 1=Function.prototype.apply() */ + case 1: { /* 1=Function.prototype.apply() */ /* Value stack: * idx_func + 0: Function.prototype.apply() [removed] * idx_func + 1: this binding for .apply (target function) @@ -65590,7 +66814,7 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx goto apply_shared; } #if defined(DUK_USE_REFLECT_BUILTIN) - case 2: { /* 2=Reflect.apply() */ + case 2: { /* 2=Reflect.apply() */ /* Value stack: * idx_func + 0: Reflect.apply() [removed] * idx_func + 1: this binding for .apply (ignored, usually Reflect) [removed] @@ -65609,7 +66833,7 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx duk_remove_n_unsafe(thr, idx_func, 2); goto apply_shared; } - case 3: { /* 3=Reflect.construct() */ + case 3: { /* 3=Reflect.construct() */ /* Value stack: * idx_func + 0: Reflect.construct() [removed] * idx_func + 1: this binding for .construct (ignored, usually Reflect) [removed] @@ -65643,11 +66867,11 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx * unpacking argArray (which may cause side effects). * Just return; caller will throw the error. */ - duk_set_top_unsafe(thr, idx_func + 2); /* satisfy asserts */ + duk_set_top_unsafe(thr, idx_func + 2); /* satisfy asserts */ break; } duk_push_object(thr); - duk_insert(thr, idx_func + 1); /* default instance */ + duk_insert(thr, idx_func + 1); /* default instance */ /* [ ... func default_instance argArray newTarget? ] */ @@ -65663,16 +66887,17 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx DUK_ERROR_UNSUPPORTED(thr); DUK_WO_NORETURN(return 0;); } - duk_set_top_unsafe(thr, idx_func + 3); /* remove any args beyond argArray */ + duk_set_top_unsafe(thr, idx_func + 3); /* remove any args beyond argArray */ } DUK_ASSERT(duk_get_top(thr) == idx_func + 3); DUK_ASSERT(duk_is_valid_index(thr, idx_func + 2)); - (void) duk_unpack_array_like(thr, idx_func + 2); /* XXX: should also remove target to be symmetric with duk_pack()? */ + (void) duk_unpack_array_like(thr, + idx_func + 2); /* XXX: should also remove target to be symmetric with duk_pack()? */ duk_remove(thr, idx_func + 2); DUK_ASSERT(duk_get_top(thr) >= idx_func + 2); break; } -#endif /* DUK_USE_REFLECT_BUILTIN */ +#endif /* DUK_USE_REFLECT_BUILTIN */ default: { DUK_ASSERT(0); DUK_UNREACHABLE(); @@ -65680,18 +66905,18 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx } DUK_ASSERT(duk_get_top(thr) >= idx_func + 2); - return 0; /* keep resolving */ + return 0; /* keep resolving */ - apply_shared: +apply_shared: tv_args = thr->valstack_bottom + idx_func + 2; if (thr->valstack_top <= tv_args) { DUK_ASSERT(tv_args <= thr->valstack_end); - thr->valstack_top = tv_args; /* at least target func and 'this' binding present */ + thr->valstack_top = tv_args; /* at least target func and 'this' binding present */ /* No need to check for argArray. */ } else { - DUK_ASSERT(duk_get_top(thr) >= idx_func + 3); /* idx_func + 2 covered above */ + DUK_ASSERT(duk_get_top(thr) >= idx_func + 3); /* idx_func + 2 covered above */ if (thr->valstack_top > tv_args + 1) { - duk_set_top_unsafe(thr, idx_func + 3); /* remove any args beyond argArray */ + duk_set_top_unsafe(thr, idx_func + 3); /* remove any args beyond argArray */ } DUK_ASSERT(duk_is_valid_index(thr, idx_func + 2)); if (!duk_is_callable(thr, idx_func)) { @@ -65704,7 +66929,7 @@ DUK_LOCAL duk_bool_t duk__handle_specialfuncs_for_call(duk_hthread *thr, duk_idx } } DUK_ASSERT(duk_get_top(thr) >= idx_func + 2); - return 0; /* keep resolving */ + return 0; /* keep resolving */ } /* @@ -65802,8 +67027,8 @@ DUK_LOCAL void duk__handle_proxy_for_call(duk_hthread *thr, duk_idx_t idx_func, DUK_ASSERT(duk_get_top(thr) == idx_func + 6); if (*call_flags & DUK_CALL_FLAG_CONSTRUCT) { - *call_flags |= DUK_CALL_FLAG_CONSTRUCT_PROXY; /* Enable 'construct' trap return invariant check. */ - *call_flags &= ~(DUK_CALL_FLAG_CONSTRUCT); /* Resume as non-constructor call to the trap. */ + *call_flags |= DUK_CALL_FLAG_CONSTRUCT_PROXY; /* Enable 'construct' trap return invariant check. */ + *call_flags &= ~(DUK_CALL_FLAG_CONSTRUCT); /* Resume as non-constructor call to the trap. */ /* 'apply' args: target, thisArg, argArray * 'construct' args: target, argArray, newTarget @@ -65814,19 +67039,17 @@ DUK_LOCAL void duk__handle_proxy_for_call(duk_hthread *thr, duk_idx_t idx_func, /* Finalize value stack layout by removing Proxy reference. */ duk_remove(thr, idx_func); - h_proxy = NULL; /* invalidated */ + h_proxy = NULL; /* invalidated */ DUK_ASSERT(duk_get_top(thr) == idx_func + 5); } -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ /* * Helper for setting up var_env and lex_env of an activation, * assuming it does NOT have the DUK_HOBJECT_FLAG_NEWENV flag. */ -DUK_LOCAL void duk__handle_oldenv_for_call(duk_hthread *thr, - duk_hobject *func, - duk_activation *act) { +DUK_LOCAL void duk__handle_oldenv_for_call(duk_hthread *thr, duk_hobject *func, duk_activation *act) { duk_hcompfunc *f; duk_hobject *h_lex; duk_hobject *h_var; @@ -65842,7 +67065,7 @@ DUK_LOCAL void duk__handle_oldenv_for_call(duk_hthread *thr, f = (duk_hcompfunc *) func; h_lex = DUK_HCOMPFUNC_GET_LEXENV(thr->heap, f); h_var = DUK_HCOMPFUNC_GET_VARENV(thr->heap, f); - DUK_ASSERT(h_lex != NULL); /* Always true for closures (not for templates) */ + DUK_ASSERT(h_lex != NULL); /* Always true for closures (not for templates) */ DUK_ASSERT(h_var != NULL); act->lex_env = h_lex; act->var_env = h_var; @@ -65863,7 +67086,7 @@ DUK_LOCAL void duk__update_func_caller_prop(duk_hthread *thr, duk_hobject *func) DUK_ASSERT(thr != NULL); DUK_ASSERT(func != NULL); - DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(func)); /* bound chain resolved */ + DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(func)); /* bound chain resolved */ DUK_ASSERT(thr->callstack_top >= 1); if (DUK_HOBJECT_HAS_STRICT(func)) { @@ -65917,7 +67140,7 @@ DUK_LOCAL void duk__update_func_caller_prop(duk_hthread *thr, duk_hobject *func) DUK_TVAL_SET_OBJECT(tv_caller, act_caller->func); DUK_TVAL_INCREF(thr, tv_caller); } else { - DUK_TVAL_SET_NULL(tv_caller); /* no incref */ + DUK_TVAL_SET_NULL(tv_caller); /* no incref */ } } else { /* 'caller' must only take on 'null' or function value */ @@ -65930,12 +67153,12 @@ DUK_LOCAL void duk__update_func_caller_prop(duk_hthread *thr, duk_hobject *func) DUK_TVAL_SET_OBJECT(tv_caller, act_caller->func); DUK_TVAL_INCREF(thr, tv_caller); } else { - DUK_TVAL_SET_NULL(tv_caller); /* no incref */ + DUK_TVAL_SET_NULL(tv_caller); /* no incref */ } } } } -#endif /* DUK_USE_NONSTD_FUNC_CALLER_PROPERTY */ +#endif /* DUK_USE_NONSTD_FUNC_CALLER_PROPERTY */ /* * Shared helpers for resolving the final, non-bound target function of the @@ -65981,7 +67204,7 @@ DUK_LOCAL DUK_INLINE void duk__coerce_nonstrict_this_binding(duk_hthread *thr, d obj_global = thr->builtins[DUK_BIDX_GLOBAL]; /* XXX: avoid this check somehow */ if (DUK_LIKELY(obj_global != NULL)) { - DUK_ASSERT(!DUK_TVAL_IS_HEAP_ALLOCATED(tv_this)); /* no need to decref previous value */ + DUK_ASSERT(!DUK_TVAL_IS_HEAP_ALLOCATED(tv_this)); /* no need to decref previous value */ DUK_TVAL_SET_OBJECT(tv_this, obj_global); DUK_HOBJECT_INCREF(thr, obj_global); } else { @@ -65989,8 +67212,8 @@ DUK_LOCAL DUK_INLINE void duk__coerce_nonstrict_this_binding(duk_hthread *thr, d * This behavior is out of specification scope. */ DUK_D(DUK_DPRINT("this binding: wanted to use global object, but it is NULL -> using undefined instead")); - DUK_ASSERT(!DUK_TVAL_IS_HEAP_ALLOCATED(tv_this)); /* no need to decref previous value */ - DUK_TVAL_SET_UNDEFINED(tv_this); /* nothing to incref */ + DUK_ASSERT(!DUK_TVAL_IS_HEAP_ALLOCATED(tv_this)); /* no need to decref previous value */ + DUK_TVAL_SET_UNDEFINED(tv_this); /* nothing to incref */ } break; default: @@ -66001,18 +67224,21 @@ DUK_LOCAL DUK_INLINE void duk__coerce_nonstrict_this_binding(duk_hthread *thr, d */ DUK_ASSERT(!DUK_TVAL_IS_UNUSED(tv_this)); DUK_DDD(DUK_DDDPRINT("this binding: non-strict, not object/undefined/null -> use ToObject(value)")); - duk_to_object(thr, idx_this); /* may have side effects */ + duk_to_object(thr, idx_this); /* may have side effects */ break; } } -DUK_LOCAL DUK_ALWAYS_INLINE duk_bool_t duk__resolve_target_fastpath_check(duk_hthread *thr, duk_idx_t idx_func, duk_hobject **out_func, duk_small_uint_t call_flags) { +DUK_LOCAL DUK_ALWAYS_INLINE duk_bool_t duk__resolve_target_fastpath_check(duk_hthread *thr, + duk_idx_t idx_func, + duk_hobject **out_func, + duk_small_uint_t call_flags) { #if defined(DUK_USE_PREFER_SIZE) DUK_UNREF(thr); DUK_UNREF(idx_func); DUK_UNREF(out_func); DUK_UNREF(call_flags); -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ duk_tval *tv_func; duk_hobject *func; @@ -66025,9 +67251,7 @@ DUK_LOCAL DUK_ALWAYS_INLINE duk_bool_t duk__resolve_target_fastpath_check(duk_ht if (DUK_LIKELY(DUK_TVAL_IS_OBJECT(tv_func))) { func = DUK_TVAL_GET_OBJECT(tv_func); - if (DUK_HOBJECT_IS_CALLABLE(func) && - !DUK_HOBJECT_HAS_BOUNDFUNC(func) && - !DUK_HOBJECT_HAS_SPECIAL_CALL(func)) { + if (DUK_HOBJECT_IS_CALLABLE(func) && !DUK_HOBJECT_HAS_BOUNDFUNC(func) && !DUK_HOBJECT_HAS_SPECIAL_CALL(func)) { *out_func = func; if (DUK_HOBJECT_HAS_STRICT(func)) { @@ -66047,8 +67271,8 @@ DUK_LOCAL DUK_ALWAYS_INLINE duk_bool_t duk__resolve_target_fastpath_check(duk_ht */ return 1; } -#endif /* DUK_USE_PREFER_SIZE */ - return 0; /* let slow path deal with it */ +#endif /* DUK_USE_PREFER_SIZE */ + return 0; /* let slow path deal with it */ } DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *thr, @@ -66081,8 +67305,7 @@ DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *th } } - if (DUK_LIKELY(!DUK_HOBJECT_HAS_BOUNDFUNC(func) && - !DUK_HOBJECT_HAS_SPECIAL_CALL(func) && + if (DUK_LIKELY(!DUK_HOBJECT_HAS_BOUNDFUNC(func) && !DUK_HOBJECT_HAS_SPECIAL_CALL(func) && !DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(func))) { /* Common case, so test for using a single bitfield test. * Break out to handle this coercion etc. @@ -66118,8 +67341,7 @@ DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *th * the trap may be bound. */ duk__handle_proxy_for_call(thr, idx_func, (duk_hproxy *) func, call_flags); - } - else + } else #endif { DUK_ASSERT(DUK_HOBJECT_IS_NATFUNC(func)); @@ -66166,28 +67388,25 @@ DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *th } } - finished: - +finished : #if defined(DUK_USE_ASSERTIONS) - { - duk_tval *tv_tmp; +{ + duk_tval *tv_tmp; - tv_tmp = duk_get_tval(thr, idx_func); - DUK_ASSERT(tv_tmp != NULL); + tv_tmp = duk_get_tval(thr, idx_func); + DUK_ASSERT(tv_tmp != NULL); - DUK_ASSERT((DUK_TVAL_IS_OBJECT(tv_tmp) && DUK_HOBJECT_IS_CALLABLE(DUK_TVAL_GET_OBJECT(tv_tmp))) || - DUK_TVAL_IS_LIGHTFUNC(tv_tmp)); - DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUNDFUNC(func)); - DUK_ASSERT(func == NULL || (DUK_HOBJECT_IS_COMPFUNC(func) || - DUK_HOBJECT_IS_NATFUNC(func))); - DUK_ASSERT(func == NULL || (DUK_HOBJECT_HAS_CONSTRUCTABLE(func) || - (*call_flags & DUK_CALL_FLAG_CONSTRUCT) == 0)); - } + DUK_ASSERT((DUK_TVAL_IS_OBJECT(tv_tmp) && DUK_HOBJECT_IS_CALLABLE(DUK_TVAL_GET_OBJECT(tv_tmp))) || + DUK_TVAL_IS_LIGHTFUNC(tv_tmp)); + DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUNDFUNC(func)); + DUK_ASSERT(func == NULL || (DUK_HOBJECT_IS_COMPFUNC(func) || DUK_HOBJECT_IS_NATFUNC(func))); + DUK_ASSERT(func == NULL || (DUK_HOBJECT_HAS_CONSTRUCTABLE(func) || (*call_flags & DUK_CALL_FLAG_CONSTRUCT) == 0)); +} #endif return func; - not_callable: +not_callable: DUK_ASSERT(tv_func != NULL); #if defined(DUK_USE_VERBOSE_ERRORS) @@ -66199,7 +67418,8 @@ DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *th * (which would be dangerous). */ if (DUK_TVAL_IS_OBJECT(tv_func)) { - duk_tval *tv_wrap = duk_hobject_find_entry_tval_ptr_stridx(thr->heap, DUK_TVAL_GET_OBJECT(tv_func), DUK_STRIDX_INT_TARGET); + duk_tval *tv_wrap = + duk_hobject_find_entry_tval_ptr_stridx(thr->heap, DUK_TVAL_GET_OBJECT(tv_func), DUK_STRIDX_INT_TARGET); if (tv_wrap != NULL) { DUK_DD(DUK_DDPRINT("delayed error from GETPROPC: %!T", tv_wrap)); duk_push_tval(thr, tv_wrap); @@ -66220,7 +67440,7 @@ DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *th #endif DUK_WO_NORETURN(return NULL;); - not_constructable: +not_constructable: /* For now GETPROPC delayed error not needed for constructor calls. */ #if defined(DUK_USE_VERBOSE_ERRORS) #if defined(DUK_USE_PARANOID_ERRORS) @@ -66244,7 +67464,10 @@ DUK_LOCAL duk_hobject *duk__resolve_target_func_and_this_binding(duk_hthread *th * empty (below idx_retbase). */ -DUK_LOCAL void duk__safe_call_adjust_valstack(duk_hthread *thr, duk_idx_t idx_retbase, duk_idx_t num_stack_rets, duk_idx_t num_actual_rets) { +DUK_LOCAL void duk__safe_call_adjust_valstack(duk_hthread *thr, + duk_idx_t idx_retbase, + duk_idx_t num_stack_rets, + duk_idx_t num_actual_rets) { duk_idx_t idx_rcbase; DUK_ASSERT(thr != NULL); @@ -66252,7 +67475,7 @@ DUK_LOCAL void duk__safe_call_adjust_valstack(duk_hthread *thr, duk_idx_t idx_re DUK_ASSERT(num_stack_rets >= 0); DUK_ASSERT(num_actual_rets >= 0); - idx_rcbase = duk_get_top(thr) - num_actual_rets; /* base of known return values */ + idx_rcbase = duk_get_top(thr) - num_actual_rets; /* base of known return values */ if (DUK_UNLIKELY(idx_rcbase < 0)) { DUK_ERROR_TYPE(thr, DUK_STR_INVALID_CFUNC_RC); DUK_WO_NORETURN(return;); @@ -66260,10 +67483,13 @@ DUK_LOCAL void duk__safe_call_adjust_valstack(duk_hthread *thr, duk_idx_t idx_re DUK_DDD(DUK_DDDPRINT("adjust valstack after func call: " "num_stack_rets=%ld, num_actual_rets=%ld, stack_top=%ld, idx_retbase=%ld, idx_rcbase=%ld", - (long) num_stack_rets, (long) num_actual_rets, (long) duk_get_top(thr), - (long) idx_retbase, (long) idx_rcbase)); + (long) num_stack_rets, + (long) num_actual_rets, + (long) duk_get_top(thr), + (long) idx_retbase, + (long) idx_rcbase)); - DUK_ASSERT(idx_rcbase >= 0); /* caller must check */ + DUK_ASSERT(idx_rcbase >= 0); /* caller must check */ /* Space for num_stack_rets was reserved before the safe call. * Because value stack reserve cannot shrink except in call returns, @@ -66278,24 +67504,28 @@ DUK_LOCAL void duk__safe_call_adjust_valstack(duk_hthread *thr, duk_idx_t idx_re duk_idx_t count = idx_rcbase - idx_retbase; DUK_DDD(DUK_DDDPRINT("elements at/after idx_retbase have enough to cover func retvals " - "(idx_retbase=%ld, idx_rcbase=%ld)", (long) idx_retbase, (long) idx_rcbase)); + "(idx_retbase=%ld, idx_rcbase=%ld)", + (long) idx_retbase, + (long) idx_rcbase)); /* Remove values between irc_rcbase (start of intended return * values) and idx_retbase to lower return values to idx_retbase. */ DUK_ASSERT(count > 0); - duk_remove_n(thr, idx_retbase, count); /* may be NORZ */ + duk_remove_n(thr, idx_retbase, count); /* may be NORZ */ } else { duk_idx_t count = idx_retbase - idx_rcbase; DUK_DDD(DUK_DDDPRINT("not enough elements at/after idx_retbase to cover func retvals " - "(idx_retbase=%ld, idx_rcbase=%ld)", (long) idx_retbase, (long) idx_rcbase)); + "(idx_retbase=%ld, idx_rcbase=%ld)", + (long) idx_retbase, + (long) idx_rcbase)); /* Insert 'undefined' at idx_rcbase (start of intended return * values) to lift return values to idx_retbase. */ DUK_ASSERT(count >= 0); - DUK_ASSERT(thr->valstack_end - thr->valstack_top >= count); /* reserve cannot shrink */ + DUK_ASSERT(thr->valstack_end - thr->valstack_top >= count); /* reserve cannot shrink */ duk_insert_undefined_n(thr, idx_rcbase, count); } @@ -66356,12 +67586,12 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr #if defined(DUK_USE_ES6_PROXY) | (duk_small_uint_t) ((act->flags & DUK_ACT_FLAG_CONSTRUCT_PROXY) ? 2 : 0) #endif - ; + ; flags2 = (duk_small_uint_t) ((call_flags & DUK_CALL_FLAG_CONSTRUCT) ? 1 : 0) #if defined(DUK_USE_ES6_PROXY) | (duk_small_uint_t) ((call_flags & DUK_CALL_FLAG_CONSTRUCT_PROXY) ? 2 : 0); #endif - ; + ; if (flags1 != flags2) { DUK_DDD(DUK_DDDPRINT("tail call prevented by incompatible return value handling")); return 0; @@ -66399,8 +67629,7 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr * https://github.com/svaarala/duktape/issues/1726. */ - DUK_DDD(DUK_DDDPRINT("is tail call, reusing activation at callstack top, at index %ld", - (long) (thr->callstack_top - 1))); + DUK_DDD(DUK_DDDPRINT("is tail call, reusing activation at callstack top, at index %ld", (long) (thr->callstack_top - 1))); DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(func)); DUK_ASSERT(!DUK_HOBJECT_HAS_NATFUNC(func)); @@ -66444,7 +67673,7 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr act->lex_env = NULL; DUK_ASSERT(func != NULL); DUK_ASSERT(DUK_HOBJECT_HAS_COMPFUNC(func)); - act->func = func; /* don't want an intermediate exposed state with func == NULL */ + act->func = func; /* don't want an intermediate exposed state with func == NULL */ #if defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) act->prev_caller = NULL; #endif @@ -66453,7 +67682,7 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr #if defined(DUK_USE_DEBUGGER_SUPPORT) act->prev_line = 0; #endif - DUK_TVAL_SET_OBJECT(&act->tv_func, func); /* borrowed, no refcount */ + DUK_TVAL_SET_OBJECT(&act->tv_func, func); /* borrowed, no refcount */ DUK_HOBJECT_INCREF(thr, func); act->flags = DUK_ACT_FLAG_TAILCALLED; @@ -66469,10 +67698,10 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr } #endif - DUK_ASSERT(DUK_ACT_GET_FUNC(act) == func); /* already updated */ + DUK_ASSERT(DUK_ACT_GET_FUNC(act) == func); /* already updated */ DUK_ASSERT(act->var_env == NULL); DUK_ASSERT(act->lex_env == NULL); - act->bottom_byteoff = entry_valstack_bottom_byteoff; /* tail call -> reuse current "frame" */ + act->bottom_byteoff = entry_valstack_bottom_byteoff; /* tail call -> reuse current "frame" */ #if 0 /* Topmost activation retval_byteoff is considered garbage, no need to init. */ act->retval_byteoff = 0; @@ -66497,22 +67726,23 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr tv1 = thr->valstack_bottom - 1; tv2 = thr->valstack_bottom + idx_func + 1; - DUK_ASSERT(tv1 >= thr->valstack && tv1 < thr->valstack_top); /* tv1 is -below- valstack_bottom */ + DUK_ASSERT(tv1 >= thr->valstack && tv1 < thr->valstack_top); /* tv1 is -below- valstack_bottom */ DUK_ASSERT(tv2 >= thr->valstack_bottom && tv2 < thr->valstack_top); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ idx_args = idx_func + 2; - duk_remove_n(thr, 0, idx_args); /* may be NORZ */ + duk_remove_n(thr, 0, idx_args); /* may be NORZ */ - idx_func = 0; DUK_UNREF(idx_func); /* really 'not applicable' anymore, should not be referenced after this */ + idx_func = 0; + DUK_UNREF(idx_func); /* really 'not applicable' anymore, should not be referenced after this */ idx_args = 0; *out_nargs = ((duk_hcompfunc *) func)->nargs; *out_nregs = ((duk_hcompfunc *) func)->nregs; DUK_ASSERT(*out_nregs >= 0); DUK_ASSERT(*out_nregs >= *out_nargs); - *out_vs_min_bytes = entry_valstack_bottom_byteoff + sizeof(duk_tval) * ((duk_size_t) *out_nregs + DUK_VALSTACK_INTERNAL_EXTRA); - + *out_vs_min_bytes = + entry_valstack_bottom_byteoff + sizeof(duk_tval) * ((duk_size_t) *out_nregs + DUK_VALSTACK_INTERNAL_EXTRA); #if defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) #if defined(DUK_USE_TAILCALL) @@ -66529,7 +67759,7 @@ DUK_LOCAL duk_small_uint_t duk__call_setup_act_attempt_tailcall(duk_hthread *thr return 1; } -#endif /* DUK_USE_TAILCALL */ +#endif /* DUK_USE_TAILCALL */ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, duk_small_uint_t call_flags, @@ -66546,8 +67776,7 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, DUK_UNREF(entry_valstack_end_byteoff); - DUK_DDD(DUK_DDDPRINT("not a tail call, pushing a new activation to callstack, to index %ld", - (long) (thr->callstack_top))); + DUK_DDD(DUK_DDDPRINT("not a tail call, pushing a new activation to callstack, to index %ld", (long) (thr->callstack_top))); duk__call_callstack_limit_check(thr); new_act = duk_hthread_activation_alloc(thr); @@ -66574,7 +67803,7 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, act = new_act; *out_act = act; - DUK_ASSERT(thr->valstack_top > thr->valstack_bottom); /* at least effective 'this' */ + DUK_ASSERT(thr->valstack_top > thr->valstack_bottom); /* at least effective 'this' */ DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUNDFUNC(func)); act->cat = NULL; @@ -66593,9 +67822,9 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, } /* start of arguments: idx_func + 2. */ - act->func = func; /* NULL for lightfunc */ + act->func = func; /* NULL for lightfunc */ if (DUK_LIKELY(func != NULL)) { - DUK_TVAL_SET_OBJECT(&act->tv_func, func); /* borrowed, no refcount */ + DUK_TVAL_SET_OBJECT(&act->tv_func, func); /* borrowed, no refcount */ if (DUK_HOBJECT_HAS_STRICT(func)) { act->flags |= DUK_ACT_FLAG_STRICT; } @@ -66604,8 +67833,9 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, *out_nregs = ((duk_hcompfunc *) func)->nregs; DUK_ASSERT(*out_nregs >= 0); DUK_ASSERT(*out_nregs >= *out_nargs); - *out_vs_min_bytes = entry_valstack_bottom_byteoff + - sizeof(duk_tval) * ((duk_size_t) idx_func + 2U + (duk_size_t) *out_nregs + DUK_VALSTACK_INTERNAL_EXTRA); + *out_vs_min_bytes = + entry_valstack_bottom_byteoff + + sizeof(duk_tval) * ((duk_size_t) idx_func + 2U + (duk_size_t) *out_nregs + DUK_VALSTACK_INTERNAL_EXTRA); } else { /* True because of call target lookup checks. */ DUK_ASSERT(DUK_HOBJECT_IS_NATFUNC(func)); @@ -66613,13 +67843,16 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, *out_nargs = ((duk_hnatfunc *) func)->nargs; *out_nregs = *out_nargs; if (*out_nargs >= 0) { - *out_vs_min_bytes = entry_valstack_bottom_byteoff + - sizeof(duk_tval) * ((duk_size_t) idx_func + 2U + (duk_size_t) *out_nregs + DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); + *out_vs_min_bytes = + entry_valstack_bottom_byteoff + + sizeof(duk_tval) * ((duk_size_t) idx_func + 2U + (duk_size_t) *out_nregs + + DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); } else { /* Vararg function. */ - duk_size_t valstack_top_byteoff = (duk_size_t) ((duk_uint8_t *) thr->valstack_top - ((duk_uint8_t *) thr->valstack)); - *out_vs_min_bytes = valstack_top_byteoff + - sizeof(duk_tval) * (DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); + duk_size_t valstack_top_byteoff = + (duk_size_t) ((duk_uint8_t *) thr->valstack_top - ((duk_uint8_t *) thr->valstack)); + *out_vs_min_bytes = valstack_top_byteoff + sizeof(duk_tval) * (DUK_VALSTACK_API_ENTRY_MINIMUM + + DUK_VALSTACK_INTERNAL_EXTRA); } } } else { @@ -66630,18 +67863,20 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, tv_func = DUK_GET_TVAL_POSIDX(thr, idx_func); DUK_ASSERT(DUK_TVAL_IS_LIGHTFUNC(tv_func)); - DUK_TVAL_SET_TVAL(&act->tv_func, tv_func); /* borrowed, no refcount */ + DUK_TVAL_SET_TVAL(&act->tv_func, tv_func); /* borrowed, no refcount */ lf_flags = DUK_TVAL_GET_LIGHTFUNC_FLAGS(tv_func); *out_nargs = DUK_LFUNC_FLAGS_GET_NARGS(lf_flags); if (*out_nargs != DUK_LFUNC_NARGS_VARARGS) { *out_vs_min_bytes = entry_valstack_bottom_byteoff + - sizeof(duk_tval) * ((duk_size_t) idx_func + 2U + (duk_size_t) *out_nargs + DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); + sizeof(duk_tval) * ((duk_size_t) idx_func + 2U + (duk_size_t) *out_nargs + + DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); } else { - duk_size_t valstack_top_byteoff = (duk_size_t) ((duk_uint8_t *) thr->valstack_top - ((duk_uint8_t *) thr->valstack)); + duk_size_t valstack_top_byteoff = + (duk_size_t) ((duk_uint8_t *) thr->valstack_top - ((duk_uint8_t *) thr->valstack)); *out_vs_min_bytes = valstack_top_byteoff + - sizeof(duk_tval) * (DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); - *out_nargs = -1; /* vararg */ + sizeof(duk_tval) * (DUK_VALSTACK_API_ENTRY_MINIMUM + DUK_VALSTACK_INTERNAL_EXTRA); + *out_nargs = -1; /* vararg */ } *out_nregs = *out_nargs; } @@ -66663,13 +67898,13 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, * even in error unwind because reserve_byteoff is only used when * returning to -this- activation. */ - act->reserve_byteoff = 0; /* filled in by caller */ + act->reserve_byteoff = 0; /* filled in by caller */ /* XXX: Is this INCREF necessary? 'func' is always a borrowed * reference reachable through the value stack? If changed, stack * unwind code also needs to be fixed to match. */ - DUK_HOBJECT_INCREF_ALLOWNULL(thr, func); /* act->func */ + DUK_HOBJECT_INCREF_ALLOWNULL(thr, func); /* act->func */ #if defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY) if (func) { @@ -66685,7 +67920,7 @@ DUK_LOCAL void duk__call_setup_act_not_tailcall(duk_hthread *thr, DUK_LOCAL void duk__call_env_setup(duk_hthread *thr, duk_hobject *func, duk_activation *act, duk_idx_t idx_args) { duk_hobject *env; - DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUNDFUNC(func)); /* bound function has already been resolved */ + DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUNDFUNC(func)); /* bound function has already been resolved */ if (DUK_LIKELY(func != NULL)) { if (DUK_LIKELY(DUK_HOBJECT_HAS_NEWENV(func))) { @@ -66716,7 +67951,7 @@ DUK_LOCAL void duk__call_env_setup(duk_hthread *thr, duk_hobject *func, duk_acti act->lex_env = env; act->var_env = env; DUK_HOBJECT_INCREF(thr, env); - DUK_HOBJECT_INCREF(thr, env); /* XXX: incref by count (2) directly */ + DUK_HOBJECT_INCREF(thr, env); /* XXX: incref by count (2) directly */ duk_pop(thr); } } else { @@ -66754,8 +67989,7 @@ DUK_LOCAL void duk__call_thread_state_update(duk_hthread *thr) { goto thread_state_error; } } else { - DUK_ASSERT(thr->heap->curr_thread == NULL || - thr->heap->curr_thread->state == DUK_HTHREAD_STATE_RUNNING); + DUK_ASSERT(thr->heap->curr_thread == NULL || thr->heap->curr_thread->state == DUK_HTHREAD_STATE_RUNNING); if (DUK_UNLIKELY(thr->state != DUK_HTHREAD_STATE_INACTIVE)) { goto thread_state_error; } @@ -66770,7 +68004,7 @@ DUK_LOCAL void duk__call_thread_state_update(duk_hthread *thr) { DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_RUNNING); return; - thread_state_error: +thread_state_error: DUK_ERROR_FMT1(thr, DUK_ERR_TYPE_ERROR, "invalid thread state (%ld)", (long) thr->state); DUK_WO_NORETURN(return;); } @@ -66796,9 +68030,7 @@ DUK_LOCAL void duk__call_thread_state_update(duk_hthread *thr) { * place; the only guarantee is that the state is consistent for unwinding. */ -DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, - duk_idx_t idx_func, - duk_small_uint_t call_flags) { +DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, duk_idx_t idx_func, duk_small_uint_t call_flags) { #if defined(DUK_USE_ASSERTIONS) duk_activation *entry_act; duk_size_t entry_callstack_top; @@ -66810,10 +68042,10 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, duk_uint_fast8_t entry_thread_state; duk_instr_t **entry_ptr_curr_pc; duk_idx_t idx_args; - duk_idx_t nargs; /* # argument registers target function wants (< 0 => "as is") */ - duk_idx_t nregs; /* # total registers target function wants on entry (< 0 => "as is") */ - duk_size_t vs_min_bytes; /* minimum value stack size (bytes) for handling call */ - duk_hobject *func; /* 'func' on stack (borrowed reference) */ + duk_idx_t nargs; /* # argument registers target function wants (< 0 => "as is") */ + duk_idx_t nregs; /* # total registers target function wants on entry (< 0 => "as is") */ + duk_size_t vs_min_bytes; /* minimum value stack size (bytes) for handling call */ + duk_hobject *func; /* 'func' on stack (borrowed reference) */ duk_activation *act; duk_ret_t rc; duk_small_uint_t use_tailcall; @@ -66854,7 +68086,7 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, DUK_ASSERT(DUK_CAT_GET_TYPE(tmp_cat) == DUK_CAT_TYPE_LABEL); /* a non-catching entry */ } } -#endif /* DUK_USE_ASSERTIONS */ +#endif /* DUK_USE_ASSERTIONS */ /* * Store entry state. @@ -66867,9 +68099,9 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, entry_valstack_bottom_byteoff = (duk_size_t) ((duk_uint8_t *) thr->valstack_bottom - (duk_uint8_t *) thr->valstack); entry_valstack_end_byteoff = (duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack); entry_call_recursion_depth = thr->heap->call_recursion_depth; - entry_curr_thread = thr->heap->curr_thread; /* may be NULL if first call */ + entry_curr_thread = thr->heap->curr_thread; /* may be NULL if first call */ entry_thread_state = thr->state; - entry_ptr_curr_pc = thr->ptr_curr_pc; /* may be NULL */ + entry_ptr_curr_pc = thr->ptr_curr_pc; /* may be NULL */ /* If thr->ptr_curr_pc is set, sync curr_pc to act->pc. Then NULL * thr->ptr_curr_pc so that it's not accidentally used with an incorrect @@ -66937,11 +68169,10 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("slow path target resolve")); func = duk__resolve_target_func_and_this_binding(thr, idx_func, &call_flags); } - DUK_ASSERT(duk_get_top(thr) - idx_func >= 2); /* at least func and this present */ + DUK_ASSERT(duk_get_top(thr) - idx_func >= 2); /* at least func and this present */ DUK_ASSERT(func == NULL || !DUK_HOBJECT_HAS_BOUNDFUNC(func)); - DUK_ASSERT(func == NULL || (DUK_HOBJECT_IS_COMPFUNC(func) || - DUK_HOBJECT_IS_NATFUNC(func))); + DUK_ASSERT(func == NULL || (DUK_HOBJECT_IS_COMPFUNC(func) || DUK_HOBJECT_IS_NATFUNC(func))); /* [ ... func this arg1 ... argN ] */ @@ -66976,7 +68207,7 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, &act); } #else - DUK_ASSERT((call_flags & DUK_CALL_FLAG_TAILCALL) == 0); /* compiler ensures this */ + DUK_ASSERT((call_flags & DUK_CALL_FLAG_TAILCALL) == 0); /* compiler ensures this */ use_tailcall = 0; #endif @@ -67002,6 +68233,15 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, /* [ ... func this arg1 ... argN ] */ + /* + * Grow value stack to required size before env setup. This + * must happen before env setup to handle some corner cases + * correctly, e.g. test-bug-scope-segv-gh2448.js. + */ + + duk_valstack_grow_check_throw(thr, vs_min_bytes); + act->reserve_byteoff = (duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack); + /* * Environment record creation and 'arguments' object creation. * Named function expression name binding is handled by the @@ -67023,13 +68263,8 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, * Setup value stack: clamp to 'nargs', fill up to 'nregs', * ensure value stack size matches target requirements, and * switch value stack bottom. Valstack top is kept. - * - * Value stack can only grow here. */ - duk_valstack_grow_check_throw(thr, vs_min_bytes); - act->reserve_byteoff = (duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack); - if (use_tailcall) { DUK_ASSERT(nregs >= 0); DUK_ASSERT(nregs >= nargs); @@ -67068,8 +68303,8 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, DUK_ASSERT((act->flags & DUK_ACT_FLAG_PREVENT_YIELD) == 0); DUK_REFZERO_CHECK_FAST(thr); DUK_ASSERT(thr->ptr_curr_pc == NULL); - thr->heap->call_recursion_depth--; /* No recursion increase for this case. */ - return 1; /* 1=reuse executor */ + thr->heap->call_recursion_depth--; /* No recursion increase for this case. */ + return 1; /* 1=reuse executor */ } DUK_ASSERT(use_tailcall == 0); @@ -67193,7 +68428,7 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, /* Explicit check for fastint downgrade. */ DUK_TVAL_CHKFAST_INPLACE_FAST(tv_funret); #endif - DUK_TVAL_SET_TVAL_UPDREF(thr, tv_ret, tv_funret); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv_ret, tv_funret); /* side effects */ } duk_set_top_unsafe(thr, idx_func + 1); @@ -67212,7 +68447,7 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, /* Restore entry thread executor curr_pc stack frame pointer. */ thr->ptr_curr_pc = entry_ptr_curr_pc; - DUK_HEAP_SWITCH_THREAD(thr->heap, entry_curr_thread); /* may be NULL */ + DUK_HEAP_SWITCH_THREAD(thr->heap, entry_curr_thread); /* may be NULL */ thr->state = (duk_uint8_t) entry_thread_state; /* Disabled assert: triggered with some torture tests. */ @@ -67253,12 +68488,10 @@ DUK_LOCAL duk_int_t duk__handle_call_raw(duk_hthread *thr, DUK_REFZERO_CHECK_FAST(thr); - return 0; /* 0=call handled inline */ + return 0; /* 0=call handled inline */ } -DUK_INTERNAL duk_int_t duk_handle_call_unprotected_nargs(duk_hthread *thr, - duk_idx_t nargs, - duk_small_uint_t call_flags) { +DUK_INTERNAL duk_int_t duk_handle_call_unprotected_nargs(duk_hthread *thr, duk_idx_t nargs, duk_small_uint_t call_flags) { duk_idx_t idx_func; DUK_ASSERT(duk_get_top(thr) >= nargs + 2); idx_func = duk_get_top(thr) - (nargs + 2); @@ -67266,9 +68499,7 @@ DUK_INTERNAL duk_int_t duk_handle_call_unprotected_nargs(duk_hthread *thr, return duk_handle_call_unprotected(thr, idx_func, call_flags); } -DUK_INTERNAL duk_int_t duk_handle_call_unprotected(duk_hthread *thr, - duk_idx_t idx_func, - duk_small_uint_t call_flags) { +DUK_INTERNAL duk_int_t duk_handle_call_unprotected(duk_hthread *thr, duk_idx_t idx_func, duk_small_uint_t call_flags) { DUK_ASSERT(duk_is_valid_index(thr, idx_func)); DUK_ASSERT(idx_func >= 0); return duk__handle_call_raw(thr, idx_func, call_flags); @@ -67335,7 +68566,8 @@ DUK_LOCAL void duk__handle_safe_call_inner(duk_hthread *thr, /* we're running inside the caller's activation, so no change in call/catch stack or valstack bottom */ DUK_ASSERT(thr->callstack_top == entry_callstack_top); DUK_ASSERT(thr->valstack_bottom >= thr->valstack); - DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_bottom - (duk_uint8_t *) thr->valstack) == entry_valstack_bottom_byteoff); + DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_bottom - (duk_uint8_t *) thr->valstack) == + entry_valstack_bottom_byteoff); DUK_ASSERT(thr->valstack_top >= thr->valstack_bottom); DUK_ASSERT(thr->valstack_end >= thr->valstack_top); @@ -67345,9 +68577,9 @@ DUK_LOCAL void duk__handle_safe_call_inner(duk_hthread *thr, } DUK_ASSERT(rc >= 0); - duk__safe_call_adjust_valstack(thr, idx_retbase, num_stack_rets, rc); /* throws for insane rc */ + duk__safe_call_adjust_valstack(thr, idx_retbase, num_stack_rets, rc); /* throws for insane rc */ - DUK_HEAP_SWITCH_THREAD(thr->heap, entry_curr_thread); /* may be NULL */ + DUK_HEAP_SWITCH_THREAD(thr->heap, entry_curr_thread); /* may be NULL */ thr->state = (duk_uint8_t) entry_thread_state; } @@ -67400,7 +68632,7 @@ DUK_LOCAL void duk__handle_safe_call_error(duk_hthread *thr, /* Switch active thread before any side effects to avoid a * dangling curr_thread pointer. */ - DUK_HEAP_SWITCH_THREAD(thr->heap, entry_curr_thread); /* may be NULL */ + DUK_HEAP_SWITCH_THREAD(thr->heap, entry_curr_thread); /* may be NULL */ thr->state = (duk_uint8_t) entry_thread_state; DUK_ASSERT(thr->heap->curr_thread == entry_curr_thread); @@ -67416,9 +68648,9 @@ DUK_LOCAL void duk__handle_safe_call_error(duk_hthread *thr, /* [ ... | (crud) errobj ] */ - DUK_ASSERT(duk_get_top(thr) >= 1); /* at least errobj must be on stack */ + DUK_ASSERT(duk_get_top(thr) >= 1); /* at least errobj must be on stack */ - duk__safe_call_adjust_valstack(thr, idx_retbase, num_stack_rets, 1); /* 1 = num actual 'return values' */ + duk__safe_call_adjust_valstack(thr, idx_retbase, num_stack_rets, 1); /* 1 = num actual 'return values' */ /* [ ... | ] or [ ... | errobj (M * undefined)] where M = num_stack_rets - 1 */ @@ -67504,7 +68736,7 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, duk_int_t retval; DUK_ASSERT(thr != NULL); - DUK_ASSERT(duk_get_top(thr) >= num_stack_args); /* Caller ensures. */ + DUK_ASSERT(duk_get_top(thr) >= num_stack_args); /* Caller ensures. */ DUK_STATS_INC(thr->heap, stats_safecall_all); @@ -67523,14 +68755,14 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, entry_callstack_preventcount = thr->callstack_preventcount; #endif entry_call_recursion_depth = thr->heap->call_recursion_depth; - entry_curr_thread = thr->heap->curr_thread; /* may be NULL if first call */ + entry_curr_thread = thr->heap->curr_thread; /* may be NULL if first call */ entry_thread_state = thr->state; - entry_ptr_curr_pc = thr->ptr_curr_pc; /* may be NULL */ - idx_retbase = duk_get_top(thr) - num_stack_args; /* not a valid stack index if num_stack_args == 0 */ + entry_ptr_curr_pc = thr->ptr_curr_pc; /* may be NULL */ + idx_retbase = duk_get_top(thr) - num_stack_args; /* not a valid stack index if num_stack_args == 0 */ DUK_ASSERT(idx_retbase >= 0); - DUK_ASSERT((duk_idx_t) (thr->valstack_top - thr->valstack_bottom) >= num_stack_args); /* Caller ensures. */ - DUK_ASSERT((duk_idx_t) (thr->valstack_end - (thr->valstack_bottom + idx_retbase)) >= num_stack_rets); /* Caller ensures. */ + DUK_ASSERT((duk_idx_t) (thr->valstack_top - thr->valstack_bottom) >= num_stack_args); /* Caller ensures. */ + DUK_ASSERT((duk_idx_t) (thr->valstack_end - (thr->valstack_bottom + idx_retbase)) >= num_stack_rets); /* Caller ensures. */ /* Cannot portably debug print a function pointer, hence 'func' not printed! */ DUK_DD(DUK_DDPRINT("duk_handle_safe_call: thr=%p, num_stack_args=%ld, num_stack_rets=%ld, " @@ -67590,7 +68822,8 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, * whatever calls are made. Reserve cannot decrease. */ DUK_ASSERT(thr->callstack_curr == entry_act); - DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= entry_valstack_end_byteoff); + DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= + entry_valstack_end_byteoff); retval = DUK_EXEC_SUCCESS; #if defined(DUK_USE_CPP_EXCEPTIONS) @@ -67600,7 +68833,8 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, } else { /* Error path. */ #endif - DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= entry_valstack_end_byteoff); + DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= + entry_valstack_end_byteoff); DUK_STATS_INC(thr->heap, stats_safecall_throw); @@ -67625,14 +68859,18 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, throw; } catch (std::exception &exc) { const char *what = exc.what(); - DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= entry_valstack_end_byteoff); + DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= + entry_valstack_end_byteoff); DUK_STATS_INC(thr->heap, stats_safecall_throw); if (!what) { what = "unknown"; } DUK_D(DUK_DPRINT("unexpected c++ std::exception (perhaps thrown by user code)")); try { - DUK_ERROR_FMT1(thr, DUK_ERR_TYPE_ERROR, "caught invalid c++ std::exception '%s' (perhaps thrown by user code)", what); + DUK_ERROR_FMT1(thr, + DUK_ERR_TYPE_ERROR, + "caught invalid c++ std::exception '%s' (perhaps thrown by user code)", + what); DUK_WO_NORETURN(return 0;); } catch (duk_internal_exception exc) { DUK_D(DUK_DPRINT("caught api error thrown from unexpected c++ std::exception")); @@ -67652,7 +68890,8 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, } } catch (...) { DUK_D(DUK_DPRINT("unexpected c++ exception (perhaps thrown by user code)")); - DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= entry_valstack_end_byteoff); + DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= + entry_valstack_end_byteoff); DUK_STATS_INC(thr->heap, stats_safecall_throw); try { DUK_ERROR_TYPE(thr, "caught invalid c++ exception (perhaps thrown by user code)"); @@ -67676,7 +68915,7 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, } #endif - DUK_ASSERT(thr->heap->lj.jmpbuf_ptr == old_jmpbuf_ptr); /* success/error path both do this */ + DUK_ASSERT(thr->heap->lj.jmpbuf_ptr == old_jmpbuf_ptr); /* success/error path both do this */ DUK_ASSERT_LJSTATE_UNSET(thr->heap); @@ -67697,7 +68936,8 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr, /* Final asserts. */ DUK_ASSERT(thr->callstack_curr == entry_act); - DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_bottom - (duk_uint8_t *) thr->valstack) == entry_valstack_bottom_byteoff); + DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_bottom - (duk_uint8_t *) thr->valstack) == + entry_valstack_bottom_byteoff); DUK_ASSERT((duk_size_t) ((duk_uint8_t *) thr->valstack_end - (duk_uint8_t *) thr->valstack) >= entry_valstack_end_byteoff); DUK_ASSERT(thr->callstack_top == entry_callstack_top); DUK_ASSERT(thr->heap->call_recursion_depth == entry_call_recursion_depth); @@ -67758,8 +68998,11 @@ DUK_INTERNAL DUK_NOINLINE DUK_COLD void duk_call_setup_propcall_error(duk_hthrea str_base = duk_get_type_name(thr, -3); duk_push_error_object(thr, DUK_ERR_TYPE_ERROR | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, - "%s not callable (property %s of %s)", str_targ, str_key, str_base); - duk_xdef_prop_stridx(thr, -2, DUK_STRIDX_INT_TARGET, DUK_PROPDESC_FLAGS_NONE); /* Marker property, reuse _Target. */ + "%s not callable (property %s of %s)", + str_targ, + str_key, + str_base); + duk_xdef_prop_stridx(thr, -2, DUK_STRIDX_INT_TARGET, DUK_PROPDESC_FLAGS_NONE); /* Marker property, reuse _Target. */ /* [ target base key { _Target: error } ] */ duk_replace(thr, entry_top - 1); #else @@ -67768,9 +69011,12 @@ DUK_INTERNAL DUK_NOINLINE DUK_COLD void duk_call_setup_propcall_error(duk_hthrea str_base = duk_push_string_readable(thr, -5); duk_push_error_object(thr, DUK_ERR_TYPE_ERROR | DUK_ERRCODE_FLAG_NOBLAME_FILELINE, - "%s not callable (property %s of %s)", str_targ, str_key, str_base); + "%s not callable (property %s of %s)", + str_targ, + str_key, + str_base); /* [ target base key {} str_targ str_key str_base error ] */ - duk_xdef_prop_stridx(thr, -5, DUK_STRIDX_INT_TARGET, DUK_PROPDESC_FLAGS_NONE); /* Marker property, reuse _Target. */ + duk_xdef_prop_stridx(thr, -5, DUK_STRIDX_INT_TARGET, DUK_PROPDESC_FLAGS_NONE); /* Marker property, reuse _Target. */ /* [ target base key { _Target: error } str_targ str_key str_base ] */ duk_swap(thr, -4, entry_top - 1); /* [ { _Target: error } base key target str_targ str_key str_base ] */ @@ -67780,9 +69026,9 @@ DUK_INTERNAL DUK_NOINLINE DUK_COLD void duk_call_setup_propcall_error(duk_hthrea duk_set_top(thr, entry_top); /* [ { _Target: error } */ - DUK_ASSERT(!duk_is_callable(thr, -1)); /* Critical so that call handling will throw the error. */ + DUK_ASSERT(!duk_is_callable(thr, -1)); /* Critical so that call handling will throw the error. */ } -#endif /* DUK_USE_VERBOSE_ERRORS */ +#endif /* DUK_USE_VERBOSE_ERRORS */ /* automatic undefs */ #undef DUK__AUGMENT_CALL_RELAX_COUNT @@ -67823,45 +69069,51 @@ DUK_INTERNAL DUK_NOINLINE DUK_COLD void duk_call_setup_propcall_error(duk_hthrea * uses this approach to avoid an explicit DUK__ISREG() check (the condition is * logically "'x' is a register AND 'x' >= temp_first"). */ -#define DUK__CONST_MARKER DUK_REGCONST_CONST_MARKER -#define DUK__REMOVECONST(x) ((x) & ~DUK__CONST_MARKER) -#define DUK__ISREG(x) ((x) >= 0) -#define DUK__ISCONST(x) ((x) < 0) -#define DUK__ISREG_TEMP(comp_ctx,x) ((duk_int32_t) (x) >= (duk_int32_t) ((comp_ctx)->curr_func.temp_first)) /* Check for x >= temp_first && x >= 0 by comparing as signed. */ -#define DUK__ISREG_NOTTEMP(comp_ctx,x) ((duk_uint32_t) (x) < (duk_uint32_t) ((comp_ctx)->curr_func.temp_first)) /* Check for x >= 0 && x < temp_first by interpreting as unsigned. */ -#define DUK__GETTEMP(comp_ctx) ((comp_ctx)->curr_func.temp_next) -#define DUK__SETTEMP(comp_ctx,x) ((comp_ctx)->curr_func.temp_next = (x)) /* dangerous: must only lower (temp_max not updated) */ -#define DUK__SETTEMP_CHECKMAX(comp_ctx,x) duk__settemp_checkmax((comp_ctx),(x)) -#define DUK__ALLOCTEMP(comp_ctx) duk__alloctemp((comp_ctx)) -#define DUK__ALLOCTEMPS(comp_ctx,count) duk__alloctemps((comp_ctx),(count)) +#define DUK__CONST_MARKER DUK_REGCONST_CONST_MARKER +#define DUK__REMOVECONST(x) ((x) & ~DUK__CONST_MARKER) +#define DUK__ISREG(x) ((x) >= 0) +#define DUK__ISCONST(x) ((x) < 0) +#define DUK__ISREG_TEMP(comp_ctx, x) \ + ((duk_int32_t) (x) >= \ + (duk_int32_t) ((comp_ctx)->curr_func.temp_first)) /* Check for x >= temp_first && x >= 0 by comparing as signed. */ +#define DUK__ISREG_NOTTEMP(comp_ctx, x) \ + ((duk_uint32_t) (x) < \ + (duk_uint32_t) ((comp_ctx)->curr_func.temp_first)) /* Check for x >= 0 && x < temp_first by interpreting as unsigned. */ +#define DUK__GETTEMP(comp_ctx) ((comp_ctx)->curr_func.temp_next) +#define DUK__SETTEMP(comp_ctx, x) ((comp_ctx)->curr_func.temp_next = (x)) /* dangerous: must only lower (temp_max not updated) */ +#define DUK__SETTEMP_CHECKMAX(comp_ctx, x) duk__settemp_checkmax((comp_ctx), (x)) +#define DUK__ALLOCTEMP(comp_ctx) duk__alloctemp((comp_ctx)) +#define DUK__ALLOCTEMPS(comp_ctx, count) duk__alloctemps((comp_ctx), (count)) /* Init value set size for array and object literals. */ -#define DUK__MAX_ARRAY_INIT_VALUES 20 -#define DUK__MAX_OBJECT_INIT_PAIRS 10 +#define DUK__MAX_ARRAY_INIT_VALUES 20 +#define DUK__MAX_OBJECT_INIT_PAIRS 10 /* XXX: hack, remove when const lookup is not O(n) */ -#define DUK__GETCONST_MAX_CONSTS_CHECK 256 +#define DUK__GETCONST_MAX_CONSTS_CHECK 256 /* These limits are based on bytecode limits. Max temps is limited * by duk_hcompfunc nargs/nregs fields being 16 bits. */ -#define DUK__MAX_CONSTS DUK_BC_BC_MAX -#define DUK__MAX_FUNCS DUK_BC_BC_MAX -#define DUK__MAX_TEMPS 0xffffL +#define DUK__MAX_CONSTS DUK_BC_BC_MAX +#define DUK__MAX_FUNCS DUK_BC_BC_MAX +#define DUK__MAX_TEMPS 0xffffL /* Initial bytecode size allocation. */ #if defined(DUK_USE_PREFER_SIZE) -#define DUK__BC_INITIAL_INSTS 16 +#define DUK__BC_INITIAL_INSTS 16 #else -#define DUK__BC_INITIAL_INSTS 256 +#define DUK__BC_INITIAL_INSTS 256 #endif -#define DUK__RECURSION_INCREASE(comp_ctx,thr) do { \ +#define DUK__RECURSION_INCREASE(comp_ctx, thr) \ + do { \ DUK_DDD(DUK_DDDPRINT("RECURSION INCREASE: %s:%ld", (const char *) DUK_FILE_MACRO, (long) DUK_LINE_MACRO)); \ duk__comp_recursion_increase((comp_ctx)); \ } while (0) -#define DUK__RECURSION_DECREASE(comp_ctx,thr) do { \ +#define DUK__RECURSION_DECREASE(comp_ctx, thr) \ + do { \ DUK_DDD(DUK_DDDPRINT("RECURSION DECREASE: %s:%ld", (const char *) DUK_FILE_MACRO, (long) DUK_LINE_MACRO)); \ duk__comp_recursion_decrease((comp_ctx)); \ } while (0) @@ -67869,11 +69121,11 @@ DUK_INTERNAL DUK_NOINLINE DUK_COLD void duk_call_setup_propcall_error(duk_hthrea /* Value stack slot limits: these are quite approximate right now, and * because they overlap in control flow, some could be eliminated. */ -#define DUK__COMPILE_ENTRY_SLOTS 8 -#define DUK__FUNCTION_INIT_REQUIRE_SLOTS 16 -#define DUK__FUNCTION_BODY_REQUIRE_SLOTS 16 -#define DUK__PARSE_STATEMENTS_SLOTS 16 -#define DUK__PARSE_EXPR_SLOTS 16 +#define DUK__COMPILE_ENTRY_SLOTS 8 +#define DUK__FUNCTION_INIT_REQUIRE_SLOTS 16 +#define DUK__FUNCTION_BODY_REQUIRE_SLOTS 16 +#define DUK__PARSE_STATEMENTS_SLOTS 16 +#define DUK__PARSE_EXPR_SLOTS 16 /* Temporary structure used to pass a stack allocated region through * duk_safe_call(). @@ -67905,10 +69157,14 @@ DUK_LOCAL_DECL duk_int_t duk__get_current_pc(duk_compiler_ctx *comp_ctx); DUK_LOCAL_DECL duk_compiler_instr *duk__get_instr_ptr(duk_compiler_ctx *comp_ctx, duk_int_t pc); DUK_LOCAL_DECL void duk__emit(duk_compiler_ctx *comp_ctx, duk_instr_t ins); DUK_LOCAL_DECL void duk__emit_op_only(duk_compiler_ctx *comp_ctx, duk_small_uint_t op); -DUK_LOCAL_DECL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a, duk_regconst_t b, duk_regconst_t c); +DUK_LOCAL_DECL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, + duk_small_uint_t op_flags, + duk_regconst_t a, + duk_regconst_t b, + duk_regconst_t c); DUK_LOCAL_DECL void duk__emit_a_b(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a, duk_regconst_t b); DUK_LOCAL_DECL void duk__emit_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t b, duk_regconst_t c); -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL void duk__emit_a(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a); DUK_LOCAL_DECL void duk__emit_b(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t b); #endif @@ -67922,7 +69178,12 @@ DUK_LOCAL_DECL duk_int_t duk__emit_jump_empty(duk_compiler_ctx *comp_ctx); DUK_LOCAL_DECL void duk__insert_jump_entry(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc); DUK_LOCAL_DECL void duk__patch_jump(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc, duk_int_t target_pc); DUK_LOCAL_DECL void duk__patch_jump_here(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc); -DUK_LOCAL_DECL void duk__patch_trycatch(duk_compiler_ctx *comp_ctx, duk_int_t ldconst_pc, duk_int_t trycatch_pc, duk_regconst_t reg_catch, duk_regconst_t const_varname, duk_small_uint_t flags); +DUK_LOCAL_DECL void duk__patch_trycatch(duk_compiler_ctx *comp_ctx, + duk_int_t ldconst_pc, + duk_int_t trycatch_pc, + duk_regconst_t reg_catch, + duk_regconst_t const_varname, + duk_small_uint_t flags); DUK_LOCAL_DECL void duk__emit_if_false_skip(duk_compiler_ctx *comp_ctx, duk_regconst_t regconst); DUK_LOCAL_DECL void duk__emit_if_true_skip(duk_compiler_ctx *comp_ctx, duk_regconst_t regconst); DUK_LOCAL_DECL void duk__emit_invalid(duk_compiler_ctx *comp_ctx); @@ -67953,7 +69214,7 @@ duk_regconst_t duk__ivalue_toregconst_raw(duk_compiler_ctx *comp_ctx, duk_regconst_t forced_reg, duk_small_uint_t flags); DUK_LOCAL_DECL duk_regconst_t duk__ivalue_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x); -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL duk_regconst_t duk__ivalue_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *x); #endif DUK_LOCAL_DECL void duk__ivalue_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *x, duk_int_t forced_reg); @@ -67967,7 +69228,13 @@ DUK_LOCAL_DECL duk_bool_t duk__lookup_lhs(duk_compiler_ctx *ctx, duk_regconst_t /* label handling */ DUK_LOCAL_DECL void duk__add_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, duk_int_t pc_label, duk_int_t label_id); DUK_LOCAL_DECL void duk__update_label_flags(duk_compiler_ctx *comp_ctx, duk_int_t label_id, duk_small_uint_t flags); -DUK_LOCAL_DECL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, duk_bool_t is_break, duk_int_t *out_label_id, duk_int_t *out_label_catch_depth, duk_int_t *out_label_pc, duk_bool_t *out_is_closest); +DUK_LOCAL_DECL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, + duk_hstring *h_label, + duk_bool_t is_break, + duk_int_t *out_label_id, + duk_int_t *out_label_catch_depth, + duk_int_t *out_label_pc, + duk_bool_t *out_is_closest); DUK_LOCAL_DECL void duk__reset_labels_to_length(duk_compiler_ctx *comp_ctx, duk_size_t len); /* top-down expression parser */ @@ -67981,26 +69248,32 @@ DUK_LOCAL_DECL void duk__expr(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_s DUK_LOCAL_DECL void duk__exprtop(duk_compiler_ctx *ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); /* convenience helpers */ -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL duk_regconst_t duk__expr_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); #endif -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL duk_regconst_t duk__expr_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); #endif -DUK_LOCAL_DECL void duk__expr_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags, duk_regconst_t forced_reg); +DUK_LOCAL_DECL void duk__expr_toforcedreg(duk_compiler_ctx *comp_ctx, + duk_ivalue *res, + duk_small_uint_t rbp_flags, + duk_regconst_t forced_reg); DUK_LOCAL_DECL duk_regconst_t duk__expr_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL duk_regconst_t duk__expr_totempconst(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); #endif DUK_LOCAL_DECL void duk__expr_toplain(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); DUK_LOCAL_DECL void duk__expr_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); DUK_LOCAL_DECL duk_regconst_t duk__exprtop_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL duk_regconst_t duk__exprtop_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); #endif -DUK_LOCAL_DECL void duk__exprtop_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags, duk_regconst_t forced_reg); +DUK_LOCAL_DECL void duk__exprtop_toforcedreg(duk_compiler_ctx *comp_ctx, + duk_ivalue *res, + duk_small_uint_t rbp_flags, + duk_regconst_t forced_reg); DUK_LOCAL_DECL duk_regconst_t duk__exprtop_toregconst(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL_DECL void duk__exprtop_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags); #endif @@ -68010,7 +69283,11 @@ DUK_LOCAL_DECL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalu DUK_LOCAL_DECL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *res); /* statement parsing */ -DUK_LOCAL_DECL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t expr_flags, duk_regconst_t *out_reg_varbind, duk_regconst_t *out_rc_varname); +DUK_LOCAL_DECL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, + duk_ivalue *res, + duk_small_uint_t expr_flags, + duk_regconst_t *out_reg_varbind, + duk_regconst_t *out_rc_varname); DUK_LOCAL_DECL void duk__parse_var_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t expr_flags); DUK_LOCAL_DECL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site); DUK_LOCAL_DECL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site); @@ -68024,18 +69301,25 @@ DUK_LOCAL_DECL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue * DUK_LOCAL_DECL void duk__parse_with_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res); DUK_LOCAL_DECL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_bool_t allow_source_elem); DUK_LOCAL_DECL duk_int_t duk__stmt_label_site(duk_compiler_ctx *comp_ctx, duk_int_t label_id); -DUK_LOCAL_DECL void duk__parse_stmts(duk_compiler_ctx *comp_ctx, duk_bool_t allow_source_elem, duk_bool_t expect_eof, duk_bool_t regexp_after); +DUK_LOCAL_DECL void duk__parse_stmts(duk_compiler_ctx *comp_ctx, + duk_bool_t allow_source_elem, + duk_bool_t expect_eof, + duk_bool_t regexp_after); -DUK_LOCAL_DECL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expect_eof, duk_bool_t implicit_return_value, duk_bool_t regexp_after, duk_small_int_t expect_token); +DUK_LOCAL_DECL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, + duk_bool_t expect_eof, + duk_bool_t implicit_return_value, + duk_bool_t regexp_after, + duk_small_int_t expect_token); DUK_LOCAL_DECL void duk__parse_func_formals(duk_compiler_ctx *comp_ctx); DUK_LOCAL_DECL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_small_uint_t flags); DUK_LOCAL_DECL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, duk_small_uint_t flags); -#define DUK__FUNC_FLAG_DECL (1 << 0) /* Parsing a function declaration. */ -#define DUK__FUNC_FLAG_GETSET (1 << 1) /* Parsing an object literal getter/setter. */ -#define DUK__FUNC_FLAG_METDEF (1 << 2) /* Parsing an object literal method definition shorthand. */ -#define DUK__FUNC_FLAG_PUSHNAME_PASS1 (1 << 3) /* Push function name when creating template (first pass only). */ -#define DUK__FUNC_FLAG_USE_PREVTOKEN (1 << 4) /* Use prev_token to start function parsing (workaround for object literal). */ +#define DUK__FUNC_FLAG_DECL (1 << 0) /* Parsing a function declaration. */ +#define DUK__FUNC_FLAG_GETSET (1 << 1) /* Parsing an object literal getter/setter. */ +#define DUK__FUNC_FLAG_METDEF (1 << 2) /* Parsing an object literal method definition shorthand. */ +#define DUK__FUNC_FLAG_PUSHNAME_PASS1 (1 << 3) /* Push function name when creating template (first pass only). */ +#define DUK__FUNC_FLAG_USE_PREVTOKEN (1 << 4) /* Use prev_token to start function parsing (workaround for object literal). */ /* * Parser control values for tokens. The token table is ordered by the @@ -68052,141 +69336,141 @@ DUK_LOCAL_DECL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, d /* XXX: actually single step levels would work just fine, clean up */ /* binding power "levels" (see doc/compiler.rst) */ -#define DUK__BP_INVALID 0 /* always terminates led() */ -#define DUK__BP_EOF 2 -#define DUK__BP_CLOSING 4 /* token closes expression, e.g. ')', ']' */ -#define DUK__BP_FOR_EXPR DUK__BP_CLOSING /* bp to use when parsing a top level Expression */ -#define DUK__BP_COMMA 6 -#define DUK__BP_ASSIGNMENT 8 -#define DUK__BP_CONDITIONAL 10 -#define DUK__BP_LOR 12 -#define DUK__BP_LAND 14 -#define DUK__BP_BOR 16 -#define DUK__BP_BXOR 18 -#define DUK__BP_BAND 20 -#define DUK__BP_EQUALITY 22 -#define DUK__BP_RELATIONAL 24 -#define DUK__BP_SHIFT 26 -#define DUK__BP_ADDITIVE 28 -#define DUK__BP_MULTIPLICATIVE 30 -#define DUK__BP_EXPONENTIATION 32 -#define DUK__BP_POSTFIX 34 -#define DUK__BP_CALL 36 -#define DUK__BP_MEMBER 38 +#define DUK__BP_INVALID 0 /* always terminates led() */ +#define DUK__BP_EOF 2 +#define DUK__BP_CLOSING 4 /* token closes expression, e.g. ')', ']' */ +#define DUK__BP_FOR_EXPR DUK__BP_CLOSING /* bp to use when parsing a top level Expression */ +#define DUK__BP_COMMA 6 +#define DUK__BP_ASSIGNMENT 8 +#define DUK__BP_CONDITIONAL 10 +#define DUK__BP_LOR 12 +#define DUK__BP_LAND 14 +#define DUK__BP_BOR 16 +#define DUK__BP_BXOR 18 +#define DUK__BP_BAND 20 +#define DUK__BP_EQUALITY 22 +#define DUK__BP_RELATIONAL 24 +#define DUK__BP_SHIFT 26 +#define DUK__BP_ADDITIVE 28 +#define DUK__BP_MULTIPLICATIVE 30 +#define DUK__BP_EXPONENTIATION 32 +#define DUK__BP_POSTFIX 34 +#define DUK__BP_CALL 36 +#define DUK__BP_MEMBER 38 #define DUK__TOKEN_LBP_BP_MASK 0x1f -#define DUK__TOKEN_LBP_FLAG_NO_REGEXP (1 << 5) /* regexp literal must not follow this token */ -#define DUK__TOKEN_LBP_FLAG_TERMINATES (1 << 6) /* terminates expression; e.g. post-increment/-decrement */ -#define DUK__TOKEN_LBP_FLAG_UNUSED (1 << 7) /* unused */ +#define DUK__TOKEN_LBP_FLAG_NO_REGEXP (1 << 5) /* regexp literal must not follow this token */ +#define DUK__TOKEN_LBP_FLAG_TERMINATES (1 << 6) /* terminates expression; e.g. post-increment/-decrement */ +#define DUK__TOKEN_LBP_FLAG_UNUSED (1 << 7) /* unused */ -#define DUK__TOKEN_LBP_GET_BP(x) ((duk_small_uint_t) (((x) & DUK__TOKEN_LBP_BP_MASK) * 2)) +#define DUK__TOKEN_LBP_GET_BP(x) ((duk_small_uint_t) (((x) &DUK__TOKEN_LBP_BP_MASK) * 2)) -#define DUK__MK_LBP(bp) ((bp) >> 1) /* bp is assumed to be even */ -#define DUK__MK_LBP_FLAGS(bp,flags) (((bp) >> 1) | (flags)) +#define DUK__MK_LBP(bp) ((bp) >> 1) /* bp is assumed to be even */ +#define DUK__MK_LBP_FLAGS(bp, flags) (((bp) >> 1) | (flags)) DUK_LOCAL const duk_uint8_t duk__token_lbp[] = { - DUK__MK_LBP(DUK__BP_EOF), /* DUK_TOK_EOF */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_IDENTIFIER */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_BREAK */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CASE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CATCH */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CONTINUE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DEBUGGER */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DEFAULT */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DELETE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DO */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_ELSE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_FINALLY */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_FOR */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_FUNCTION */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_IF */ - DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_IN */ - DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_INSTANCEOF */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_NEW */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_RETURN */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SWITCH */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_THIS */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_THROW */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_TRY */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_TYPEOF */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_VAR */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CONST */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_VOID */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_WHILE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_WITH */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CLASS */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_ENUM */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_EXPORT */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_EXTENDS */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_IMPORT */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SUPER */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_NULL */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_TRUE */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_FALSE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_GET */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SET */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_IMPLEMENTS */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_INTERFACE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_LET */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PACKAGE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PRIVATE */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PROTECTED */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PUBLIC */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_STATIC */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_YIELD */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_LCURLY */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_RCURLY */ - DUK__MK_LBP(DUK__BP_MEMBER), /* DUK_TOK_LBRACKET */ - DUK__MK_LBP_FLAGS(DUK__BP_CLOSING, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_RBRACKET */ - DUK__MK_LBP(DUK__BP_CALL), /* DUK_TOK_LPAREN */ - DUK__MK_LBP_FLAGS(DUK__BP_CLOSING, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_RPAREN */ - DUK__MK_LBP(DUK__BP_MEMBER), /* DUK_TOK_PERIOD */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SEMICOLON */ - DUK__MK_LBP(DUK__BP_COMMA), /* DUK_TOK_COMMA */ - DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_LT */ - DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_GT */ - DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_LE */ - DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_GE */ - DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_EQ */ - DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_NEQ */ - DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_SEQ */ - DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_SNEQ */ - DUK__MK_LBP(DUK__BP_ADDITIVE), /* DUK_TOK_ADD */ - DUK__MK_LBP(DUK__BP_ADDITIVE), /* DUK_TOK_SUB */ - DUK__MK_LBP(DUK__BP_MULTIPLICATIVE), /* DUK_TOK_MUL */ - DUK__MK_LBP(DUK__BP_MULTIPLICATIVE), /* DUK_TOK_DIV */ - DUK__MK_LBP(DUK__BP_MULTIPLICATIVE), /* DUK_TOK_MOD */ - DUK__MK_LBP(DUK__BP_EXPONENTIATION), /* DUK_TOK_EXP */ - DUK__MK_LBP_FLAGS(DUK__BP_POSTFIX, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_INCREMENT */ - DUK__MK_LBP_FLAGS(DUK__BP_POSTFIX, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_DECREMENT */ - DUK__MK_LBP(DUK__BP_SHIFT), /* DUK_TOK_ALSHIFT */ - DUK__MK_LBP(DUK__BP_SHIFT), /* DUK_TOK_ARSHIFT */ - DUK__MK_LBP(DUK__BP_SHIFT), /* DUK_TOK_RSHIFT */ - DUK__MK_LBP(DUK__BP_BAND), /* DUK_TOK_BAND */ - DUK__MK_LBP(DUK__BP_BOR), /* DUK_TOK_BOR */ - DUK__MK_LBP(DUK__BP_BXOR), /* DUK_TOK_BXOR */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_LNOT */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_BNOT */ - DUK__MK_LBP(DUK__BP_LAND), /* DUK_TOK_LAND */ - DUK__MK_LBP(DUK__BP_LOR), /* DUK_TOK_LOR */ - DUK__MK_LBP(DUK__BP_CONDITIONAL), /* DUK_TOK_QUESTION */ - DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_COLON */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_EQUALSIGN */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_ADD_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_SUB_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_MUL_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_DIV_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_MOD_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_EXP_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_ALSHIFT_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_ARSHIFT_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_RSHIFT_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_BAND_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_BOR_EQ */ - DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_BXOR_EQ */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_NUMBER */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_STRING */ - DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_REGEXP */ + DUK__MK_LBP(DUK__BP_EOF), /* DUK_TOK_EOF */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_IDENTIFIER */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_BREAK */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CASE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CATCH */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CONTINUE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DEBUGGER */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DEFAULT */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DELETE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_DO */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_ELSE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_FINALLY */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_FOR */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_FUNCTION */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_IF */ + DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_IN */ + DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_INSTANCEOF */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_NEW */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_RETURN */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SWITCH */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_THIS */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_THROW */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_TRY */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_TYPEOF */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_VAR */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CONST */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_VOID */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_WHILE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_WITH */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_CLASS */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_ENUM */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_EXPORT */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_EXTENDS */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_IMPORT */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SUPER */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_NULL */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_TRUE */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_FALSE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_GET */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SET */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_IMPLEMENTS */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_INTERFACE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_LET */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PACKAGE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PRIVATE */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PROTECTED */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_PUBLIC */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_STATIC */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_YIELD */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_LCURLY */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_RCURLY */ + DUK__MK_LBP(DUK__BP_MEMBER), /* DUK_TOK_LBRACKET */ + DUK__MK_LBP_FLAGS(DUK__BP_CLOSING, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_RBRACKET */ + DUK__MK_LBP(DUK__BP_CALL), /* DUK_TOK_LPAREN */ + DUK__MK_LBP_FLAGS(DUK__BP_CLOSING, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_RPAREN */ + DUK__MK_LBP(DUK__BP_MEMBER), /* DUK_TOK_PERIOD */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_SEMICOLON */ + DUK__MK_LBP(DUK__BP_COMMA), /* DUK_TOK_COMMA */ + DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_LT */ + DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_GT */ + DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_LE */ + DUK__MK_LBP(DUK__BP_RELATIONAL), /* DUK_TOK_GE */ + DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_EQ */ + DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_NEQ */ + DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_SEQ */ + DUK__MK_LBP(DUK__BP_EQUALITY), /* DUK_TOK_SNEQ */ + DUK__MK_LBP(DUK__BP_ADDITIVE), /* DUK_TOK_ADD */ + DUK__MK_LBP(DUK__BP_ADDITIVE), /* DUK_TOK_SUB */ + DUK__MK_LBP(DUK__BP_MULTIPLICATIVE), /* DUK_TOK_MUL */ + DUK__MK_LBP(DUK__BP_MULTIPLICATIVE), /* DUK_TOK_DIV */ + DUK__MK_LBP(DUK__BP_MULTIPLICATIVE), /* DUK_TOK_MOD */ + DUK__MK_LBP(DUK__BP_EXPONENTIATION), /* DUK_TOK_EXP */ + DUK__MK_LBP_FLAGS(DUK__BP_POSTFIX, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_INCREMENT */ + DUK__MK_LBP_FLAGS(DUK__BP_POSTFIX, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_DECREMENT */ + DUK__MK_LBP(DUK__BP_SHIFT), /* DUK_TOK_ALSHIFT */ + DUK__MK_LBP(DUK__BP_SHIFT), /* DUK_TOK_ARSHIFT */ + DUK__MK_LBP(DUK__BP_SHIFT), /* DUK_TOK_RSHIFT */ + DUK__MK_LBP(DUK__BP_BAND), /* DUK_TOK_BAND */ + DUK__MK_LBP(DUK__BP_BOR), /* DUK_TOK_BOR */ + DUK__MK_LBP(DUK__BP_BXOR), /* DUK_TOK_BXOR */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_LNOT */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_BNOT */ + DUK__MK_LBP(DUK__BP_LAND), /* DUK_TOK_LAND */ + DUK__MK_LBP(DUK__BP_LOR), /* DUK_TOK_LOR */ + DUK__MK_LBP(DUK__BP_CONDITIONAL), /* DUK_TOK_QUESTION */ + DUK__MK_LBP(DUK__BP_INVALID), /* DUK_TOK_COLON */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_EQUALSIGN */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_ADD_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_SUB_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_MUL_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_DIV_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_MOD_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_EXP_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_ALSHIFT_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_ARSHIFT_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_RSHIFT_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_BAND_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_BOR_EQ */ + DUK__MK_LBP(DUK__BP_ASSIGNMENT), /* DUK_TOK_BXOR_EQ */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_NUMBER */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_STRING */ + DUK__MK_LBP_FLAGS(DUK__BP_INVALID, DUK__TOKEN_LBP_FLAG_NO_REGEXP), /* DUK_TOK_REGEXP */ }; /* @@ -68217,8 +69501,7 @@ DUK_LOCAL duk_bool_t duk__hstring_is_eval_or_arguments(duk_compiler_ctx *comp_ct DUK_LOCAL duk_bool_t duk__hstring_is_eval_or_arguments_in_strict_mode(duk_compiler_ctx *comp_ctx, duk_hstring *h) { DUK_ASSERT(h != NULL); - return (comp_ctx->curr_func.is_strict && - DUK_HSTRING_HAS_EVAL_OR_ARGUMENTS(h)); + return (comp_ctx->curr_func.is_strict && DUK_HSTRING_HAS_EVAL_OR_ARGUMENTS(h)); } /* @@ -68233,8 +69516,8 @@ DUK_LOCAL void duk__advance_helper(duk_compiler_ctx *comp_ctx, duk_small_int_t e duk_hthread *thr = comp_ctx->thr; duk_bool_t regexp; - DUK_ASSERT_DISABLE(comp_ctx->curr_token.t >= 0); /* unsigned */ - DUK_ASSERT(comp_ctx->curr_token.t <= DUK_TOK_MAXVAL); /* MAXVAL is inclusive */ + DUK_ASSERT_DISABLE(comp_ctx->curr_token.t >= 0); /* unsigned */ + DUK_ASSERT(comp_ctx->curr_token.t <= DUK_TOK_MAXVAL); /* MAXVAL is inclusive */ /* * Use current token to decide whether a RegExp can follow. @@ -68259,8 +69542,7 @@ DUK_LOCAL void duk__advance_helper(duk_compiler_ctx *comp_ctx, duk_small_int_t e } if (expect >= 0 && comp_ctx->curr_token.t != (duk_small_uint_t) expect) { - DUK_D(DUK_DPRINT("parse error: expect=%ld, got=%ld", - (long) expect, (long) comp_ctx->curr_token.t)); + DUK_D(DUK_DPRINT("parse error: expect=%ld, got=%ld", (long) expect, (long) comp_ctx->curr_token.t)); DUK_ERROR_SYNTAX(thr, DUK_STR_PARSE_ERROR); DUK_WO_NORETURN(return;); } @@ -68271,10 +69553,7 @@ DUK_LOCAL void duk__advance_helper(duk_compiler_ctx *comp_ctx, duk_small_int_t e duk_copy(thr, comp_ctx->tok12_idx, comp_ctx->tok22_idx); /* parse new token */ - duk_lexer_parse_js_input_element(&comp_ctx->lex, - &comp_ctx->curr_token, - comp_ctx->curr_func.is_strict, - regexp); + duk_lexer_parse_js_input_element(&comp_ctx->lex, &comp_ctx->curr_token, comp_ctx->curr_func.is_strict, regexp); DUK_DDD(DUK_DDDPRINT("advance: curr: tok=%ld/%ld,%ld,term=%ld,%!T,%!T " "prev: tok=%ld/%ld,%ld,term=%ld,%!T,%!T", @@ -68314,7 +69593,7 @@ DUK_LOCAL void duk__init_func_valstack_slots(duk_compiler_ctx *comp_ctx) { entry_top = duk_get_top(thr); - duk_memzero(func, sizeof(*func)); /* intentional overlap with earlier memzero */ + duk_memzero(func, sizeof(*func)); /* intentional overlap with earlier memzero */ #if defined(DUK_USE_EXPLICIT_NULL_INIT) func->h_name = NULL; func->h_consts = NULL; @@ -68480,7 +69759,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { h_res = duk_push_hcompfunc(thr); DUK_ASSERT(h_res != NULL); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) h_res) == thr->builtins[DUK_BIDX_FUNCTION_PROTOTYPE]); - DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr, (duk_hobject *) h_res, NULL); /* Function templates are "bare objects". */ + DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr, (duk_hobject *) h_res, NULL); /* Function templates are "bare objects". */ if (func->is_function) { DUK_DDD(DUK_DDDPRINT("function -> set NEWENV")); @@ -68549,16 +69828,19 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { code_count = DUK_BW_GET_SIZE(thr, &func->bw_code) / sizeof(duk_compiler_instr); code_size = code_count * sizeof(duk_instr_t); - data_size = consts_count * sizeof(duk_tval) + - funcs_count * sizeof(duk_hobject *) + - code_size; + data_size = consts_count * sizeof(duk_tval) + funcs_count * sizeof(duk_hobject *) + code_size; DUK_DDD(DUK_DDDPRINT("consts_count=%ld, funcs_count=%ld, code_size=%ld -> " "data_size=%ld*%ld + %ld*%ld + %ld = %ld", - (long) consts_count, (long) funcs_count, (long) code_size, - (long) consts_count, (long) sizeof(duk_tval), - (long) funcs_count, (long) sizeof(duk_hobject *), - (long) code_size, (long) data_size)); + (long) consts_count, + (long) funcs_count, + (long) code_size, + (long) consts_count, + (long) sizeof(duk_tval), + (long) funcs_count, + (long) sizeof(duk_hobject *), + (long) code_size, + (long) data_size)); duk_push_fixed_buffer_nozero(thr, data_size); h_data = (duk_hbuffer_fixed *) (void *) duk_known_hbuffer(thr, -1); @@ -68568,12 +69850,12 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { p_const = (duk_tval *) (void *) DUK_HBUFFER_FIXED_GET_DATA_PTR(thr->heap, h_data); for (i = 0; i < consts_count; i++) { - DUK_ASSERT(i <= DUK_UARRIDX_MAX); /* const limits */ + DUK_ASSERT(i <= DUK_UARRIDX_MAX); /* const limits */ tv = duk_hobject_find_array_entry_tval_ptr(thr->heap, func->h_consts, (duk_uarridx_t) i); DUK_ASSERT(tv != NULL); DUK_TVAL_SET_TVAL(p_const, tv); p_const++; - DUK_TVAL_INCREF(thr, tv); /* may be a string constant */ + DUK_TVAL_INCREF(thr, tv); /* may be a string constant */ DUK_DDD(DUK_DDDPRINT("constant: %!T", (duk_tval *) tv)); } @@ -68582,7 +69864,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { DUK_HCOMPFUNC_SET_FUNCS(thr->heap, h_res, p_func); for (i = 0; i < funcs_count; i++) { duk_hobject *h; - DUK_ASSERT(i * 3 <= DUK_UARRIDX_MAX); /* func limits */ + DUK_ASSERT(i * 3 <= DUK_UARRIDX_MAX); /* func limits */ tv = duk_hobject_find_array_entry_tval_ptr(thr->heap, func->h_funcs, (duk_uarridx_t) (i * 3)); DUK_ASSERT(tv != NULL); DUK_ASSERT(DUK_TVAL_IS_OBJECT(tv)); @@ -68592,8 +69874,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { *p_func++ = h; DUK_HOBJECT_INCREF(thr, h); - DUK_DDD(DUK_DDDPRINT("inner function: %p -> %!iO", - (void *) h, (duk_heaphdr *) h)); + DUK_DDD(DUK_DDDPRINT("inner function: %p -> %!iO", (void *) h, (duk_heaphdr *) h)); } p_instr = (duk_instr_t *) p_func; @@ -68608,7 +69889,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { DUK_ASSERT((duk_uint8_t *) (p_instr + code_count) == DUK_HBUFFER_FIXED_GET_DATA_PTR(thr->heap, h_data) + data_size); - duk_pop(thr); /* 'data' (and everything in it) is reachable through h_res now */ + duk_pop(thr); /* 'data' (and everything in it) is reachable through h_res now */ /* * Init non-property result fields @@ -68623,7 +69904,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { DUK_ASSERT(func->temp_max >= 0); h_res->nregs = (duk_uint16_t) func->temp_max; h_res->nargs = (duk_uint16_t) duk_hobject_get_length(thr, func->h_argnames); - DUK_ASSERT(h_res->nregs >= h_res->nargs); /* pass2 allocation handles this */ + DUK_ASSERT(h_res->nregs >= h_res->nargs); /* pass2 allocation handles this */ #if defined(DUK_USE_DEBUGGER_SUPPORT) h_res->start_line = (duk_uint32_t) func->min_line; h_res->end_line = (duk_uint32_t) func->max_line; @@ -68651,11 +69932,13 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { DUK_DD(DUK_DDPRINT("keeping _Varmap because debugger support is enabled")); keep_varmap = 1; #else - if (func->id_access_slow_own || /* directly uses slow accesses that may match own variables */ - func->id_access_arguments || /* accesses 'arguments' directly */ - func->may_direct_eval || /* may indirectly slow access through a direct eval */ - funcs_count > 0) { /* has inner functions which may slow access (XXX: this can be optimized by looking at the inner functions) */ - DUK_DD(DUK_DDPRINT("keeping _Varmap because of direct eval, slow path access that may match local variables, or presence of inner functions")); + if (func->id_access_slow_own || /* directly uses slow accesses that may match own variables */ + func->id_access_arguments || /* accesses 'arguments' directly */ + func->may_direct_eval || /* may indirectly slow access through a direct eval */ + funcs_count > + 0) { /* has inner functions which may slow access (XXX: this can be optimized by looking at the inner functions) */ + DUK_DD(DUK_DDPRINT("keeping _Varmap because of direct eval, slow path access that may match local variables, or " + "presence of inner functions")); keep_varmap = 1; } else { DUK_DD(DUK_DDPRINT("dropping _Varmap")); @@ -68667,8 +69950,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { duk_int_t num_used; duk_dup(thr, func->varmap_idx); num_used = duk__cleanup_varmap(comp_ctx); - DUK_DDD(DUK_DDDPRINT("cleaned up varmap: %!T (num_used=%ld)", - (duk_tval *) duk_get_tval(thr, -1), (long) num_used)); + DUK_DDD(DUK_DDDPRINT("cleaned up varmap: %!T (num_used=%ld)", (duk_tval *) duk_get_tval(thr, -1), (long) num_used)); if (num_used > 0) { duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_VARMAP, DUK_PROPDESC_FLAGS_NONE); @@ -68697,12 +69979,12 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { */ DUK_DD(DUK_DDPRINT("keeping _Formals because _Formals.length != nargs")); keep_formals = 1; - } else if ((func->id_access_arguments || func->may_direct_eval) && - (formals_length > 0)) { + } else if ((func->id_access_arguments || func->may_direct_eval) && (formals_length > 0)) { /* Direct eval (may access 'arguments') or accesses 'arguments' * explicitly: keep _Formals unless it is zero length. */ - DUK_DD(DUK_DDPRINT("keeping _Formals because of direct eval or explicit access to 'arguments', and _Formals.length != 0")); + DUK_DD(DUK_DDPRINT( + "keeping _Formals because of direct eval or explicit access to 'arguments', and _Formals.length != 0")); keep_formals = 1; } else { DUK_DD(DUK_DDPRINT("omitting _Formals, nargs matches _Formals.length, so no properties added")); @@ -68722,7 +70004,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { DUK_DD(DUK_DDPRINT("setting function template .name to %!T", duk_get_tval(thr, -1))); duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_NAME, DUK_PROPDESC_FLAGS_NONE); } -#endif /* DUK_USE_FUNC_NAME_PROPERTY */ +#endif /* DUK_USE_FUNC_NAME_PROPERTY */ /* _Source */ #if defined(DUK_USE_NONSTD_FUNC_SOURCE_PROPERTY) @@ -68770,7 +70052,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_SOURCE, DUK_PROPDESC_FLAGS_NONE); #endif } -#endif /* DUK_USE_NONSTD_FUNC_SOURCE_PROPERTY */ +#endif /* DUK_USE_NONSTD_FUNC_SOURCE_PROPERTY */ /* _Pc2line */ #if defined(DUK_USE_PC2LINE) @@ -68780,14 +70062,14 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { */ DUK_ASSERT(code_count <= DUK_COMPILER_MAX_BYTECODE_LENGTH); - duk_hobject_pc2line_pack(thr, q_instr, (duk_uint_fast32_t) code_count); /* -> pushes fixed buffer */ + duk_hobject_pc2line_pack(thr, q_instr, (duk_uint_fast32_t) code_count); /* -> pushes fixed buffer */ duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_INT_PC2LINE, DUK_PROPDESC_FLAGS_NONE); /* XXX: if assertions enabled, walk through all valid PCs * and check line mapping. */ } -#endif /* DUK_USE_PC2LINE */ +#endif /* DUK_USE_PC2LINE */ /* fileName */ #if defined(DUK_USE_FUNC_FILENAME_PROPERTY) @@ -68801,8 +70083,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { } #endif - DUK_DD(DUK_DDPRINT("converted function: %!ixT", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DD(DUK_DDPRINT("converted function: %!ixT", (duk_tval *) duk_get_tval(thr, -1))); /* * Compact the function template. @@ -68874,14 +70155,14 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx) { /* Code emission flags, passed in the 'opcode' field. Opcode + flags * fit into 16 bits for now, so use duk_small_uint_t. */ -#define DUK__EMIT_FLAG_NO_SHUFFLE_A (1 << 8) -#define DUK__EMIT_FLAG_NO_SHUFFLE_B (1 << 9) -#define DUK__EMIT_FLAG_NO_SHUFFLE_C (1 << 10) -#define DUK__EMIT_FLAG_A_IS_SOURCE (1 << 11) /* slot A is a source (default: target) */ -#define DUK__EMIT_FLAG_B_IS_TARGET (1 << 12) /* slot B is a target (default: source) */ -#define DUK__EMIT_FLAG_C_IS_TARGET (1 << 13) /* slot C is a target (default: source) */ -#define DUK__EMIT_FLAG_BC_REGCONST (1 << 14) /* slots B and C are reg/const */ -#define DUK__EMIT_FLAG_RESERVE_JUMPSLOT (1 << 15) /* reserve a jumpslot after instr before target spilling, used for NEXTENUM */ +#define DUK__EMIT_FLAG_NO_SHUFFLE_A (1 << 8) +#define DUK__EMIT_FLAG_NO_SHUFFLE_B (1 << 9) +#define DUK__EMIT_FLAG_NO_SHUFFLE_C (1 << 10) +#define DUK__EMIT_FLAG_A_IS_SOURCE (1 << 11) /* slot A is a source (default: target) */ +#define DUK__EMIT_FLAG_B_IS_TARGET (1 << 12) /* slot B is a target (default: source) */ +#define DUK__EMIT_FLAG_C_IS_TARGET (1 << 13) /* slot C is a target (default: source) */ +#define DUK__EMIT_FLAG_BC_REGCONST (1 << 14) /* slots B and C are reg/const */ +#define DUK__EMIT_FLAG_RESERVE_JUMPSLOT (1 << 15) /* reserve a jumpslot after instr before target spilling, used for NEXTENUM */ /* XXX: macro smaller than call? */ DUK_LOCAL duk_int_t duk__get_current_pc(duk_compiler_ctx *comp_ctx) { @@ -68892,7 +70173,8 @@ DUK_LOCAL duk_int_t duk__get_current_pc(duk_compiler_ctx *comp_ctx) { DUK_LOCAL duk_compiler_instr *duk__get_instr_ptr(duk_compiler_ctx *comp_ctx, duk_int_t pc) { DUK_ASSERT(pc >= 0); - DUK_ASSERT((duk_size_t) pc < (duk_size_t) (DUK_BW_GET_SIZE(comp_ctx->thr, &comp_ctx->curr_func.bw_code) / sizeof(duk_compiler_instr))); + DUK_ASSERT((duk_size_t) pc < + (duk_size_t) (DUK_BW_GET_SIZE(comp_ctx->thr, &comp_ctx->curr_func.bw_code) / sizeof(duk_compiler_instr))); return ((duk_compiler_instr *) (void *) DUK_BW_GET_BASEPTR(comp_ctx->thr, &comp_ctx->curr_func.bw_code)) + pc; } @@ -68912,7 +70194,9 @@ DUK_LOCAL void duk__emit(duk_compiler_ctx *comp_ctx, duk_instr_t ins) { (long) duk__get_current_pc(comp_ctx), (duk_instr_t) ins)); - instr = (duk_compiler_instr *) (void *) DUK_BW_ENSURE_GETPTR(comp_ctx->thr, &comp_ctx->curr_func.bw_code, sizeof(duk_compiler_instr)); + instr = (duk_compiler_instr *) (void *) DUK_BW_ENSURE_GETPTR(comp_ctx->thr, + &comp_ctx->curr_func.bw_code, + sizeof(duk_compiler_instr)); DUK_BW_ADD_PTR(comp_ctx->thr, &comp_ctx->curr_func.bw_code, sizeof(duk_compiler_instr)); #if defined(DUK_USE_PC2LINE) @@ -68963,7 +70247,7 @@ DUK_LOCAL void duk__emit(duk_compiler_ctx *comp_ctx, duk_instr_t ins) { return; - fail_bc_limit: +fail_bc_limit: DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_BYTECODE_LIMIT); DUK_WO_NORETURN(return;); } @@ -68997,7 +70281,11 @@ DUK_LOCAL void duk__emit_op_only(duk_compiler_ctx *comp_ctx, duk_small_uint_t op } /* Important main primitive. */ -DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t a, duk_regconst_t b, duk_regconst_t c) { +DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, + duk_small_uint_t op_flags, + duk_regconst_t a, + duk_regconst_t b, + duk_regconst_t c) { duk_instr_t ins = 0; duk_int_t a_out = -1; duk_int_t b_out = -1; @@ -69005,8 +70293,7 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f duk_int_t tmp; duk_small_uint_t op = op_flags & 0xffU; - DUK_DDD(DUK_DDDPRINT("emit: op_flags=%04lx, a=%ld, b=%ld, c=%ld", - (unsigned long) op_flags, (long) a, (long) b, (long) c)); + DUK_DDD(DUK_DDDPRINT("emit: op_flags=%04lx, a=%ld, b=%ld, c=%ld", (unsigned long) op_flags, (long) a, (long) b, (long) c)); /* We could rely on max temp/const checks: if they don't exceed BC * limit, nothing here can either (just asserts would be enough). @@ -69015,11 +70302,11 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f * bugs. */ - DUK_ASSERT_DISABLE((op_flags & 0xff) >= DUK_BC_OP_MIN); /* unsigned */ + DUK_ASSERT_DISABLE((op_flags & 0xff) >= DUK_BC_OP_MIN); /* unsigned */ DUK_ASSERT((op_flags & 0xff) <= DUK_BC_OP_MAX); DUK_ASSERT(DUK__ISREG(a)); - DUK_ASSERT(b != -1); /* Not 'none'. */ - DUK_ASSERT(c != -1); /* Not 'none'. */ + DUK_ASSERT(b != -1); /* Not 'none'. */ + DUK_ASSERT(c != -1); /* Not 'none'. */ /* Input shuffling happens before the actual operation, while output * shuffling happens afterwards. Output shuffling decisions are still @@ -69081,7 +70368,7 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f if (op_flags & DUK__EMIT_FLAG_BC_REGCONST) { /* Opcode follows B/C reg/const convention. */ DUK_ASSERT((op & 0x01) == 0); - ins |= DUK_ENC_OP_A_B_C(0x01, 0, 0, 0); /* const flag for B */ + ins |= DUK_ENC_OP_A_B_C(0x01, 0, 0, 0); /* const flag for B */ } else { DUK_D(DUK_DPRINT("B is const, opcode is not B/C reg/const: %x", op_flags)); } @@ -69104,7 +70391,8 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f } else if (op_flags & DUK__EMIT_FLAG_NO_SHUFFLE_B) { if (b > DUK_BC_B_MAX) { /* Note: 0xff != DUK_BC_B_MAX */ - DUK_D(DUK_DPRINT("out of regs: 'b' (reg) needs shuffling but shuffle prohibited, b: %ld", (long) b)); + DUK_D( + DUK_DPRINT("out of regs: 'b' (reg) needs shuffling but shuffle prohibited, b: %ld", (long) b)); goto error_outofregs; } } else if (b <= DUK_BC_BC_MAX) { @@ -69125,7 +70413,7 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f duk__emit_load_int32_noshuffle(comp_ctx, tmp, b); DUK_ASSERT(DUK_OP_MPUTOBJI == DUK_OP_MPUTOBJ + 1); DUK_ASSERT(DUK_OP_MPUTARRI == DUK_OP_MPUTARR + 1); - op_flags++; /* indirect opcode follows direct */ + op_flags++; /* indirect opcode follows direct */ } else { duk__emit(comp_ctx, DUK_ENC_OP_A_BC(DUK_OP_LDREG, tmp, b)); } @@ -69151,7 +70439,7 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f if (op_flags & DUK__EMIT_FLAG_BC_REGCONST) { /* Opcode follows B/C reg/const convention. */ DUK_ASSERT((op & 0x02) == 0); - ins |= DUK_ENC_OP_A_B_C(0x02, 0, 0, 0); /* const flag for C */ + ins |= DUK_ENC_OP_A_B_C(0x02, 0, 0, 0); /* const flag for C */ } else { DUK_D(DUK_DPRINT("C is const, opcode is not B/C reg/const: %x", op_flags)); } @@ -69174,7 +70462,8 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f } else if (op_flags & DUK__EMIT_FLAG_NO_SHUFFLE_C) { if (c > DUK_BC_C_MAX) { /* Note: 0xff != DUK_BC_C_MAX */ - DUK_D(DUK_DPRINT("out of regs: 'c' (reg) needs shuffling but shuffle prohibited, c: %ld", (long) c)); + DUK_D( + DUK_DPRINT("out of regs: 'c' (reg) needs shuffling but shuffle prohibited, c: %ld", (long) c)); goto error_outofregs; } } else if (c <= DUK_BC_BC_MAX) { @@ -69248,7 +70537,7 @@ DUK_LOCAL void duk__emit_a_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_f return; - error_outofregs: +error_outofregs: DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_REG_LIMIT); DUK_WO_NORETURN(return;); } @@ -69276,7 +70565,7 @@ DUK_LOCAL void duk__emit_b_c(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_fla duk__emit_a_b_c(comp_ctx, op_flags, 0, b, c); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL void duk__emit_a(duk_compiler_ctx *comp_ctx, int op_flags, int a) { #if defined(DUK_USE_SHUFFLE_TORTURE) op_flags |= DUK__EMIT_FLAG_NO_SHUFFLE_B | DUK__EMIT_FLAG_NO_SHUFFLE_C; @@ -69285,7 +70574,7 @@ DUK_LOCAL void duk__emit_a(duk_compiler_ctx *comp_ctx, int op_flags, int a) { } #endif -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL void duk__emit_b(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_flags, duk_regconst_t b) { #if defined(DUK_USE_SHUFFLE_TORTURE) op_flags |= DUK__EMIT_FLAG_NO_SHUFFLE_A | DUK__EMIT_FLAG_NO_SHUFFLE_C; @@ -69299,10 +70588,10 @@ DUK_LOCAL void duk__emit_a_bc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_fl duk_int_t tmp; /* allow caller to give a const number with the DUK__CONST_MARKER */ - DUK_ASSERT(bc != -1); /* Not 'none'. */ + DUK_ASSERT(bc != -1); /* Not 'none'. */ bc = bc & (~DUK__CONST_MARKER); - DUK_ASSERT_DISABLE((op_flags & 0xff) >= DUK_BC_OP_MIN); /* unsigned */ + DUK_ASSERT_DISABLE((op_flags & 0xff) >= DUK_BC_OP_MIN); /* unsigned */ DUK_ASSERT((op_flags & 0xff) <= DUK_BC_OP_MAX); DUK_ASSERT(bc >= DUK_BC_BC_MIN); DUK_ASSERT(bc <= DUK_BC_BC_MAX); @@ -69347,7 +70636,7 @@ DUK_LOCAL void duk__emit_a_bc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op_fl } return; - error_outofregs: +error_outofregs: DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_REG_LIMIT); DUK_WO_NORETURN(return;); } @@ -69362,12 +70651,12 @@ DUK_LOCAL void duk__emit_bc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op, duk DUK_LOCAL void duk__emit_abc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op, duk_regconst_t abc) { duk_instr_t ins; - DUK_ASSERT_DISABLE(op >= DUK_BC_OP_MIN); /* unsigned */ + DUK_ASSERT_DISABLE(op >= DUK_BC_OP_MIN); /* unsigned */ DUK_ASSERT(op <= DUK_BC_OP_MAX); - DUK_ASSERT_DISABLE(abc >= DUK_BC_ABC_MIN); /* unsigned */ + DUK_ASSERT_DISABLE(abc >= DUK_BC_ABC_MIN); /* unsigned */ DUK_ASSERT(abc <= DUK_BC_ABC_MAX); DUK_ASSERT((abc & DUK__CONST_MARKER) == 0); - DUK_ASSERT(abc != -1); /* Not 'none'. */ + DUK_ASSERT(abc != -1); /* Not 'none'. */ if (abc <= DUK_BC_ABC_MAX) { ; @@ -69376,18 +70665,25 @@ DUK_LOCAL void duk__emit_abc(duk_compiler_ctx *comp_ctx, duk_small_uint_t op, du } ins = DUK_ENC_OP_ABC(op, abc); DUK_DDD(DUK_DDDPRINT("duk__emit_abc: 0x%08lx line=%ld pc=%ld op=%ld (%!X) abc=%ld (%!I)", - (unsigned long) ins, (long) comp_ctx->curr_token.start_line, - (long) duk__get_current_pc(comp_ctx), (long) op, (long) op, - (long) abc, (duk_instr_t) ins)); + (unsigned long) ins, + (long) comp_ctx->curr_token.start_line, + (long) duk__get_current_pc(comp_ctx), + (long) op, + (long) op, + (long) abc, + (duk_instr_t) ins)); duk__emit(comp_ctx, ins); return; - error_outofregs: +error_outofregs: DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_REG_LIMIT); DUK_WO_NORETURN(return;); } -DUK_LOCAL void duk__emit_load_int32_raw(duk_compiler_ctx *comp_ctx, duk_regconst_t reg, duk_int32_t val, duk_small_uint_t op_flags) { +DUK_LOCAL void duk__emit_load_int32_raw(duk_compiler_ctx *comp_ctx, + duk_regconst_t reg, + duk_int32_t val, + duk_small_uint_t op_flags) { /* XXX: Shuffling support could be implemented here so that LDINT+LDINTX * would only shuffle once (instead of twice). The current code works * though, and has a smaller compiler footprint. @@ -69402,7 +70698,10 @@ DUK_LOCAL void duk__emit_load_int32_raw(duk_compiler_ctx *comp_ctx, duk_regconst duk_int32_t lo = val & ((((duk_int32_t) 1) << DUK_BC_LDINTX_SHIFT) - 1); DUK_ASSERT(lo >= 0); DUK_DDD(DUK_DDDPRINT("emit LDINT+LDINTX to reg %ld for %ld -> hi %ld, lo %ld", - (long) reg, (long) val, (long) hi, (long) lo)); + (long) reg, + (long) val, + (long) hi, + (long) lo)); duk__emit_a_bc(comp_ctx, DUK_OP_LDINT | op_flags, reg, (duk_regconst_t) (hi + (duk_int32_t) DUK_BC_LDINT_BIAS)); duk__emit_a_bc(comp_ctx, DUK_OP_LDINTX | op_flags, reg, (duk_regconst_t) lo); } @@ -69443,7 +70742,7 @@ DUK_LOCAL void duk__emit_jump(duk_compiler_ctx *comp_ctx, duk_int_t target_pc) { DUK_LOCAL duk_int_t duk__emit_jump_empty(duk_compiler_ctx *comp_ctx) { duk_int_t ret; - ret = duk__get_current_pc(comp_ctx); /* useful for patching jumps later */ + ret = duk__get_current_pc(comp_ctx); /* useful for patching jumps later */ duk__emit_op_only(comp_ctx, DUK_OP_JUMP); return ret; } @@ -69461,13 +70760,10 @@ DUK_LOCAL void duk__insert_jump_entry(duk_compiler_ctx *comp_ctx, duk_int_t jump DUK_ASSERT(jump_pc >= 0); offset = (duk_size_t) jump_pc * sizeof(duk_compiler_instr); instr = (duk_compiler_instr *) (void *) - DUK_BW_INSERT_ENSURE_AREA(comp_ctx->thr, - &comp_ctx->curr_func.bw_code, - offset, - sizeof(duk_compiler_instr)); + DUK_BW_INSERT_ENSURE_AREA(comp_ctx->thr, &comp_ctx->curr_func.bw_code, offset, sizeof(duk_compiler_instr)); #if defined(DUK_USE_PC2LINE) - line = comp_ctx->curr_token.start_line; /* approximation, close enough */ + line = comp_ctx->curr_token.start_line; /* approximation, close enough */ #endif instr->ins = DUK_ENC_OP_ABC(DUK_OP_JUMP, 0); #if defined(DUK_USE_PC2LINE) @@ -69480,7 +70776,7 @@ DUK_LOCAL void duk__insert_jump_entry(duk_compiler_ctx *comp_ctx, duk_int_t jump } return; - fail_bc_limit: +fail_bc_limit: DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_BYTECODE_LIMIT); DUK_WO_NORETURN(return;); } @@ -69494,8 +70790,8 @@ DUK_LOCAL void duk__patch_jump(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc, du /* allow negative PCs, behave as a no-op */ if (jump_pc < 0) { - DUK_DDD(DUK_DDDPRINT("duk__patch_jump(): nop call, jump_pc=%ld (<0), target_pc=%ld", - (long) jump_pc, (long) target_pc)); + DUK_DDD( + DUK_DDDPRINT("duk__patch_jump(): nop call, jump_pc=%ld (<0), target_pc=%ld", (long) jump_pc, (long) target_pc)); return; } DUK_ASSERT(jump_pc >= 0); @@ -69509,14 +70805,21 @@ DUK_LOCAL void duk__patch_jump(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc, du instr->ins = DUK_ENC_OP_ABC(DUK_OP_JUMP, offset + DUK_BC_JUMP_BIAS); DUK_DDD(DUK_DDDPRINT("duk__patch_jump(): jump_pc=%ld, target_pc=%ld, offset=%ld", - (long) jump_pc, (long) target_pc, (long) offset)); + (long) jump_pc, + (long) target_pc, + (long) offset)); } DUK_LOCAL void duk__patch_jump_here(duk_compiler_ctx *comp_ctx, duk_int_t jump_pc) { duk__patch_jump(comp_ctx, jump_pc, duk__get_current_pc(comp_ctx)); } -DUK_LOCAL void duk__patch_trycatch(duk_compiler_ctx *comp_ctx, duk_int_t ldconst_pc, duk_int_t trycatch_pc, duk_regconst_t reg_catch, duk_regconst_t const_varname, duk_small_uint_t flags) { +DUK_LOCAL void duk__patch_trycatch(duk_compiler_ctx *comp_ctx, + duk_int_t ldconst_pc, + duk_int_t trycatch_pc, + duk_regconst_t reg_catch, + duk_regconst_t const_varname, + duk_small_uint_t flags) { duk_compiler_instr *instr; DUK_ASSERT(DUK__ISREG(reg_catch)); @@ -69536,7 +70839,10 @@ DUK_LOCAL void duk__patch_trycatch(duk_compiler_ctx *comp_ctx, duk_int_t ldconst * See: test-bug-trycatch-many-constants.js. */ DUK_D(DUK_DPRINT("failed to patch trycatch: flags=%ld, reg_catch=%ld, const_varname=%ld (0x%08lx)", - (long) flags, (long) reg_catch, (long) const_varname, (long) const_varname)); + (long) flags, + (long) reg_catch, + (long) const_varname, + (long) const_varname)); DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_REG_LIMIT); DUK_WO_NORETURN(return;); } @@ -69559,14 +70865,14 @@ DUK_LOCAL void duk__emit_if_false_skip(duk_compiler_ctx *comp_ctx, duk_regconst_ duk_small_uint_t op; op = DUK__ISREG(regconst) ? DUK_OP_IFFALSE_R : DUK_OP_IFFALSE_C; - duk__emit_bc(comp_ctx, op, regconst); /* helper will remove const flag */ + duk__emit_bc(comp_ctx, op, regconst); /* helper will remove const flag */ } DUK_LOCAL void duk__emit_if_true_skip(duk_compiler_ctx *comp_ctx, duk_regconst_t regconst) { duk_small_uint_t op; op = DUK__ISREG(regconst) ? DUK_OP_IFTRUE_R : DUK_OP_IFTRUE_C; - duk__emit_bc(comp_ctx, op, regconst); /* helper will remove const flag */ + duk__emit_bc(comp_ctx, op, regconst); /* helper will remove const flag */ } DUK_LOCAL void duk__emit_invalid(duk_compiler_ctx *comp_ctx) { @@ -69590,7 +70896,8 @@ DUK_LOCAL void duk__peephole_optimize_bytecode(duk_compiler_ctx *comp_ctx) { #if defined(DUK_USE_BUFLEN16) /* No need to assert, buffer size maximum is 0xffff. */ #else - DUK_ASSERT((duk_size_t) DUK_BW_GET_SIZE(comp_ctx->thr, &comp_ctx->curr_func.bw_code) / sizeof(duk_compiler_instr) <= (duk_size_t) DUK_INT_MAX); /* bytecode limits */ + DUK_ASSERT((duk_size_t) DUK_BW_GET_SIZE(comp_ctx->thr, &comp_ctx->curr_func.bw_code) / sizeof(duk_compiler_instr) <= + (duk_size_t) DUK_INT_MAX); /* bytecode limits */ #endif n = (duk_int_t) (DUK_BW_GET_SIZE(comp_ctx->thr, &comp_ctx->curr_func.bw_code) / sizeof(duk_compiler_instr)); @@ -69625,7 +70932,9 @@ DUK_LOCAL void duk__peephole_optimize_bytecode(duk_compiler_ctx *comp_ctx) { target_pc2 = target_pc1 + 1 + (duk_int_t) DUK_DEC_ABC(ins) - (duk_int_t) DUK_BC_JUMP_BIAS; DUK_DDD(DUK_DDDPRINT("optimizing jump at pc %ld; old target is %ld -> new target is %ld", - (long) i, (long) target_pc1, (long) target_pc2)); + (long) i, + (long) target_pc1, + (long) target_pc2)); bc[i].ins = DUK_ENC_OP_ABC(DUK_OP_JUMP, target_pc2 - (i + 1) + DUK_BC_JUMP_BIAS); @@ -69651,15 +70960,21 @@ DUK_LOCAL void duk__peephole_optimize_bytecode(duk_compiler_ctx *comp_ctx) { /* XXX: DUK__IVAL_FLAG_REQUIRE_SHORT is passed but not currently implemented * by ispec/ivalue operations. */ -#define DUK__IVAL_FLAG_ALLOW_CONST (1 << 0) /* allow a constant to be returned */ -#define DUK__IVAL_FLAG_REQUIRE_TEMP (1 << 1) /* require a (mutable) temporary as a result (or a const if allowed) */ -#define DUK__IVAL_FLAG_REQUIRE_SHORT (1 << 2) /* require a short (8-bit) reg/const which fits into bytecode B/C slot */ +#define DUK__IVAL_FLAG_ALLOW_CONST (1 << 0) /* allow a constant to be returned */ +#define DUK__IVAL_FLAG_REQUIRE_TEMP (1 << 1) /* require a (mutable) temporary as a result (or a const if allowed) */ +#define DUK__IVAL_FLAG_REQUIRE_SHORT (1 << 2) /* require a short (8-bit) reg/const which fits into bytecode B/C slot */ /* XXX: some code might benefit from DUK__SETTEMP_IFTEMP(thr,x) */ -#if 0 /* enable manually for dumping */ -#define DUK__DUMP_ISPEC(compctx,ispec) do { duk__dump_ispec((compctx), (ispec)); } while (0) -#define DUK__DUMP_IVALUE(compctx,ivalue) do { duk__dump_ivalue((compctx), (ivalue)); } while (0) +#if 0 /* enable manually for dumping */ +#define DUK__DUMP_ISPEC(compctx, ispec) \ + do { \ + duk__dump_ispec((compctx), (ispec)); \ + } while (0) +#define DUK__DUMP_IVALUE(compctx, ivalue) \ + do { \ + duk__dump_ivalue((compctx), (ivalue)); \ + } while (0) DUK_LOCAL void duk__dump_ispec(duk_compiler_ctx *comp_ctx, duk_ispec *x) { DUK_D(DUK_DPRINT("ispec dump: t=%ld regconst=0x%08lx, valstack_idx=%ld, value=%!T", @@ -69677,8 +70992,12 @@ DUK_LOCAL void duk__dump_ivalue(duk_compiler_ctx *comp_ctx, duk_ivalue *x) { duk_get_tval(comp_ctx->thr, x->x2.valstack_idx))); } #else -#define DUK__DUMP_ISPEC(comp_ctx,x) do {} while (0) -#define DUK__DUMP_IVALUE(comp_ctx,x) do {} while (0) +#define DUK__DUMP_ISPEC(comp_ctx, x) \ + do { \ + } while (0) +#define DUK__DUMP_IVALUE(comp_ctx, x) \ + do { \ + } while (0) #endif DUK_LOCAL void duk__ivalue_regconst(duk_ivalue *x, duk_regconst_t regconst) { @@ -69728,7 +71047,7 @@ DUK_LOCAL duk_regconst_t duk__alloctemps(duk_compiler_ctx *comp_ctx, duk_small_i res = comp_ctx->curr_func.temp_next; comp_ctx->curr_func.temp_next += num; - if (comp_ctx->curr_func.temp_next > DUK__MAX_TEMPS) { /* == DUK__MAX_TEMPS is OK */ + if (comp_ctx->curr_func.temp_next > DUK__MAX_TEMPS) { /* == DUK__MAX_TEMPS is OK */ DUK_ERROR_RANGE(comp_ctx->thr, DUK_STR_TEMP_LIMIT); DUK_WO_NORETURN(return 0;); } @@ -69781,8 +71100,7 @@ DUK_LOCAL duk_regconst_t duk__getconst(duk_compiler_ctx *comp_ctx) { * constant for e.g. +0 and -0. */ if (duk_js_samevalue(tv1, tv2)) { - DUK_DDD(DUK_DDDPRINT("reused existing constant for %!T -> const index %ld", - (duk_tval *) tv1, (long) i)); + DUK_DDD(DUK_DDDPRINT("reused existing constant for %!T -> const index %ld", (duk_tval *) tv1, (long) i)); duk_pop(thr); return (duk_regconst_t) i | (duk_regconst_t) DUK__CONST_MARKER; } @@ -69793,9 +71111,8 @@ DUK_LOCAL duk_regconst_t duk__getconst(duk_compiler_ctx *comp_ctx) { DUK_WO_NORETURN(return 0;); } - DUK_DDD(DUK_DDDPRINT("allocating new constant for %!T -> const index %ld", - (duk_tval *) tv1, (long) n)); - (void) duk_put_prop_index(thr, f->consts_idx, (duk_uarridx_t) n); /* invalidates tv1, tv2 */ + DUK_DDD(DUK_DDDPRINT("allocating new constant for %!T -> const index %ld", (duk_tval *) tv1, (long) n)); + (void) duk_put_prop_index(thr, f->consts_idx, (duk_uarridx_t) n); /* invalidates tv1, tv2 */ return (duk_regconst_t) n | (duk_regconst_t) DUK__CONST_MARKER; } @@ -69804,15 +71121,15 @@ DUK_LOCAL duk_bool_t duk__const_needs_refcount(duk_compiler_ctx *comp_ctx, duk_r duk_compiler_func *f = &comp_ctx->curr_func; duk_bool_t ret; - DUK_ASSERT((rc & DUK__CONST_MARKER) == 0); /* caller removes const marker */ + DUK_ASSERT((rc & DUK__CONST_MARKER) == 0); /* caller removes const marker */ (void) duk_get_prop_index(comp_ctx->thr, f->consts_idx, (duk_uarridx_t) rc); - ret = !duk_is_number(comp_ctx->thr, -1); /* now only number/string, so conservative check */ + ret = !duk_is_number(comp_ctx->thr, -1); /* now only number/string, so conservative check */ duk_pop(comp_ctx->thr); return ret; #else DUK_UNREF(comp_ctx); DUK_UNREF(rc); - DUK_ASSERT((rc & DUK__CONST_MARKER) == 0); /* caller removes const marker */ + DUK_ASSERT((rc & DUK__CONST_MARKER) == 0); /* caller removes const marker */ return 0; #endif } @@ -69875,9 +71192,7 @@ duk_regconst_t duk__ispec_toregconst_raw(duk_compiler_ctx *comp_ctx, } case DUK_TAG_BOOLEAN: { duk_regconst_t dest = (forced_reg >= 0 ? forced_reg : DUK__ALLOCTEMP(comp_ctx)); - duk__emit_bc(comp_ctx, - (DUK_TVAL_GET_BOOLEAN(tv) ? DUK_OP_LDTRUE : DUK_OP_LDFALSE), - dest); + duk__emit_bc(comp_ctx, (DUK_TVAL_GET_BOOLEAN(tv) ? DUK_OP_LDTRUE : DUK_OP_LDFALSE), dest); return dest; } case DUK_TAG_POINTER: { @@ -69893,7 +71208,7 @@ duk_regconst_t duk__ispec_toregconst_raw(duk_compiler_ctx *comp_ctx, DUK_UNREF(h); DUK_ASSERT(h != NULL); -#if 0 /* XXX: to be implemented? */ +#if 0 /* XXX: to be implemented? */ /* Use special opcodes to load short strings */ if (DUK_HSTRING_GET_BYTELEN(h) <= 2) { /* Encode into a single opcode (18 bits can encode 1-2 bytes + length indicator) */ @@ -69963,8 +71278,8 @@ duk_regconst_t duk__ispec_toregconst_raw(duk_compiler_ctx *comp_ctx, return dest; } } - } /* end switch */ - goto fail_internal; /* never here */ + } /* end switch */ + goto fail_internal; /* never here */ } case DUK_ISPEC_REGCONST: { if (forced_reg >= 0) { @@ -69997,11 +71312,11 @@ duk_regconst_t duk__ispec_toregconst_raw(duk_compiler_ctx *comp_ctx, return x->regconst; } default: { - break; /* never here */ + break; /* never here */ } } - fail_internal: +fail_internal: DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return 0;); } @@ -70021,10 +71336,13 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x DUK_DDD(DUK_DDDPRINT("duk__ivalue_toplain_raw(): x={t=%ld,op=%ld,x1={%ld:%ld:%!T},x2={%ld:%ld:%!T}}, " "forced_reg=%ld", - (long) x->t, (long) x->op, - (long) x->x1.t, (long) x->x1.regconst, + (long) x->t, + (long) x->op, + (long) x->x1.t, + (long) x->x1.regconst, (duk_tval *) duk_get_tval(thr, x->x1.valstack_idx), - (long) x->x2.t, (long) x->x2.regconst, + (long) x->x2.t, + (long) x->x2.regconst, (duk_tval *) duk_get_tval(thr, x->x2.valstack_idx), (long) forced_reg)); @@ -70050,9 +71368,7 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x DUK_ASSERT(tv1 != NULL); DUK_ASSERT(tv2 != NULL); - DUK_DDD(DUK_DDDPRINT("arith: tv1=%!T, tv2=%!T", - (duk_tval *) tv1, - (duk_tval *) tv2)); + DUK_DDD(DUK_DDDPRINT("arith: tv1=%!T, tv2=%!T", (duk_tval *) tv1, (duk_tval *) tv2)); if (DUK_TVAL_IS_NUMBER(tv1) && DUK_TVAL_IS_NUMBER(tv2)) { duk_double_t d1 = DUK_TVAL_GET_NUMBER(tv1); @@ -70061,7 +71377,9 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x duk_bool_t accept_fold = 1; DUK_DDD(DUK_DDDPRINT("arith inline check: d1=%lf, d2=%lf, op=%ld", - (double) d1, (double) d2, (long) x->op)); + (double) d1, + (double) d2, + (long) x->op)); switch (x->op) { case DUK_OP_ADD: { d3 = d1 + d2; @@ -70087,7 +71405,7 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x break; } default: { - d3 = 0.0; /* Won't be used, but silence MSVC /W4 warning. */ + d3 = 0.0; /* Won't be used, but silence MSVC /W4 warning. */ accept_fold = 0; break; } @@ -70101,7 +71419,7 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x x->t = DUK_IVAL_PLAIN; DUK_ASSERT(x->x1.t == DUK_ISPEC_VALUE); - DUK_TVAL_SET_NUMBER(tv1, d3); /* old value is number: no refcount */ + DUK_TVAL_SET_NUMBER(tv1, d3); /* old value is number: no refcount */ return; } } else if (x->op == DUK_OP_ADD && DUK_TVAL_IS_STRING(tv1) && DUK_TVAL_IS_STRING(tv2)) { @@ -70118,8 +71436,14 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x } } - arg1 = duk__ispec_toregconst_raw(comp_ctx, &x->x1, -1, DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); - arg2 = duk__ispec_toregconst_raw(comp_ctx, &x->x2, -1, DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); + arg1 = duk__ispec_toregconst_raw(comp_ctx, + &x->x1, + -1, + DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); + arg2 = duk__ispec_toregconst_raw(comp_ctx, + &x->x2, + -1, + DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); /* If forced reg, use it as destination. Otherwise try to * use either coerced ispec if it is a temporary. @@ -70147,8 +71471,14 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x duk_regconst_t dest; /* Need a short reg/const, does not have to be a mutable temp. */ - arg1 = duk__ispec_toregconst_raw(comp_ctx, &x->x1, -1, DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); - arg2 = duk__ispec_toregconst_raw(comp_ctx, &x->x2, -1, DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); + arg1 = duk__ispec_toregconst_raw(comp_ctx, + &x->x1, + -1, + DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); + arg2 = duk__ispec_toregconst_raw(comp_ctx, + &x->x2, + -1, + DUK__IVAL_FLAG_ALLOW_CONST | DUK__IVAL_FLAG_REQUIRE_SHORT /*flags*/); /* Pick a destination register. If either base value or key * happens to be a temp value, reuse it as the destination. @@ -70169,11 +71499,7 @@ DUK_LOCAL void duk__ivalue_toplain_raw(duk_compiler_ctx *comp_ctx, duk_ivalue *x dest = DUK__ALLOCTEMP(comp_ctx); } - duk__emit_a_b_c(comp_ctx, - DUK_OP_GETPROP | DUK__EMIT_FLAG_BC_REGCONST, - dest, - arg1, - arg2); + duk__emit_a_b_c(comp_ctx, DUK_OP_GETPROP | DUK__EMIT_FLAG_BC_REGCONST, dest, arg1, arg2); duk__ivalue_regconst(x, dest); return; @@ -70241,10 +71567,13 @@ duk_regconst_t duk__ivalue_toregconst_raw(duk_compiler_ctx *comp_ctx, DUK_DDD(DUK_DDDPRINT("duk__ivalue_toregconst_raw(): x={t=%ld,op=%ld,x1={%ld:%ld:%!T},x2={%ld:%ld:%!T}}, " "forced_reg=%ld, flags 0x%08lx: allow_const=%ld require_temp=%ld require_short=%ld", - (long) x->t, (long) x->op, - (long) x->x1.t, (long) x->x1.regconst, + (long) x->t, + (long) x->op, + (long) x->x1.t, + (long) x->x1.regconst, (duk_tval *) duk_get_tval(thr, x->x1.valstack_idx), - (long) x->x2.t, (long) x->x2.regconst, + (long) x->x2.t, + (long) x->x2.regconst, (duk_tval *) duk_get_tval(thr, x->x2.valstack_idx), (long) forced_reg, (unsigned long) flags, @@ -70267,7 +71596,7 @@ DUK_LOCAL duk_regconst_t duk__ivalue_toreg(duk_compiler_ctx *comp_ctx, duk_ivalu return duk__ivalue_toregconst_raw(comp_ctx, x, -1, 0 /*flags*/); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL duk_regconst_t duk__ivalue_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *x) { return duk__ivalue_toregconst_raw(comp_ctx, x, -1, DUK__IVAL_FLAG_REQUIRE_TEMP /*flags*/); } @@ -70303,8 +71632,7 @@ DUK_LOCAL duk_regconst_t duk__lookup_active_register_binding(duk_compiler_ctx *c duk_hstring *h_varname; duk_regconst_t ret; - DUK_DDD(DUK_DDDPRINT("resolving identifier reference to '%!T'", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("resolving identifier reference to '%!T'", (duk_tval *) duk_get_tval(thr, -1))); /* * Special name handling @@ -70357,13 +71685,13 @@ DUK_LOCAL duk_regconst_t duk__lookup_active_register_binding(duk_compiler_ctx *c DUK_DDD(DUK_DDDPRINT("identifier lookup -> reg %ld", (long) ret)); return ret; - slow_path_notown: +slow_path_notown: DUK_DDD(DUK_DDDPRINT("identifier lookup -> slow path, not own variable")); comp_ctx->curr_func.id_access_slow = 1; return (duk_regconst_t) -1; - slow_path_own: +slow_path_own: DUK_DDD(DUK_DDDPRINT("identifier lookup -> slow path, may be own variable")); comp_ctx->curr_func.id_access_slow = 1; @@ -70391,7 +71719,7 @@ DUK_LOCAL duk_bool_t duk__lookup_lhs(duk_compiler_ctx *comp_ctx, duk_regconst_t if (reg_varbind >= 0) { *out_reg_varbind = reg_varbind; - *out_rc_varname = 0; /* duk_regconst_t is unsigned, so use 0 as dummy value (ignored by caller) */ + *out_rc_varname = 0; /* duk_regconst_t is unsigned, so use 0 as dummy value (ignored by caller) */ duk_pop(thr); return 1; } else { @@ -70441,7 +71769,7 @@ DUK_LOCAL void duk__add_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, } duk_push_hstring(thr, h_label); - DUK_ASSERT(n <= DUK_UARRIDX_MAX); /* label limits */ + DUK_ASSERT(n <= DUK_UARRIDX_MAX); /* label limits */ (void) duk_put_prop_index(thr, comp_ctx->curr_func.labelnames_idx, (duk_uarridx_t) n); new_size = (n + 1) * sizeof(duk_labelinfo); @@ -70451,7 +71779,7 @@ DUK_LOCAL void duk__add_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, /* relookup after possible realloc */ p = (duk_uint8_t *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(thr->heap, comp_ctx->curr_func.h_labelinfos); li_start = (duk_labelinfo *) (void *) p; - DUK_UNREF(li_start); /* silence scan-build warning */ + DUK_UNREF(li_start); /* silence scan-build warning */ li = (duk_labelinfo *) (void *) (p + DUK_HBUFFER_GET_SIZE(comp_ctx->curr_func.h_labelinfos)); li--; @@ -70465,12 +71793,15 @@ DUK_LOCAL void duk__add_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, li->flags = DUK_LABEL_FLAG_ALLOW_BREAK; li->label_id = label_id; li->h_label = h_label; - li->catch_depth = comp_ctx->curr_func.catch_depth; /* catch depth from current func */ + li->catch_depth = comp_ctx->curr_func.catch_depth; /* catch depth from current func */ li->pc_label = pc_label; DUK_DDD(DUK_DDDPRINT("registered label: flags=0x%08lx, id=%ld, name=%!O, catch_depth=%ld, pc_label=%ld", - (unsigned long) li->flags, (long) li->label_id, (duk_heaphdr *) li->h_label, - (long) li->catch_depth, (long) li->pc_label)); + (unsigned long) li->flags, + (long) li->label_id, + (duk_heaphdr *) li->h_label, + (long) li->catch_depth, + (long) li->pc_label)); } /* Update all labels with matching label_id. */ @@ -70494,7 +71825,9 @@ DUK_LOCAL void duk__update_label_flags(duk_compiler_ctx *comp_ctx, duk_int_t lab } DUK_DDD(DUK_DDDPRINT("updating (overwriting) label flags for li=%p, label_id=%ld, flags=%ld", - (void *) li, (long) label_id, (long) flags)); + (void *) li, + (long) label_id, + (long) flags)); li->flags = flags; } @@ -70515,14 +71848,19 @@ DUK_LOCAL void duk__update_label_flags(duk_compiler_ctx *comp_ctx, duk_int_t lab */ /* XXX: awkward, especially the bunch of separate output values -> output struct? */ -DUK_LOCAL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, duk_hstring *h_label, duk_bool_t is_break, duk_int_t *out_label_id, duk_int_t *out_label_catch_depth, duk_int_t *out_label_pc, duk_bool_t *out_is_closest) { +DUK_LOCAL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, + duk_hstring *h_label, + duk_bool_t is_break, + duk_int_t *out_label_id, + duk_int_t *out_label_catch_depth, + duk_int_t *out_label_pc, + duk_bool_t *out_is_closest) { duk_hthread *thr = comp_ctx->thr; duk_uint8_t *p; duk_labelinfo *li_start, *li_end, *li; duk_bool_t match = 0; - DUK_DDD(DUK_DDDPRINT("looking up active label: label='%!O', is_break=%ld", - (duk_heaphdr *) h_label, (long) is_break)); + DUK_DDD(DUK_DDDPRINT("looking up active label: label='%!O', is_break=%ld", (duk_heaphdr *) h_label, (long) is_break)); DUK_UNREF(thr); @@ -70546,7 +71884,8 @@ DUK_LOCAL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, duk_hstring } DUK_DDD(DUK_DDDPRINT("labelinfo[%ld] -> '%!O' label name matches (still need to check type)", - (long) (li - li_start), (duk_heaphdr *) h_label)); + (long) (li - li_start), + (duk_heaphdr *) h_label)); /* currently all labels accept a break, so no explicit check for it now */ DUK_ASSERT(li->flags & DUK_LABEL_FLAG_ALLOW_BREAK); @@ -70580,8 +71919,10 @@ DUK_LOCAL void duk__lookup_active_label(duk_compiler_ctx *comp_ctx, duk_hstring } DUK_DDD(DUK_DDDPRINT("label match: %!O -> label_id %ld, catch_depth=%ld, pc_label=%ld", - (duk_heaphdr *) h_label, (long) li->label_id, - (long) li->catch_depth, (long) li->pc_label)); + (duk_heaphdr *) h_label, + (long) li->label_id, + (long) li->catch_depth, + (long) li->pc_label)); *out_label_id = li->label_id; *out_label_catch_depth = li->catch_depth; @@ -70605,21 +71946,21 @@ DUK_LOCAL void duk__reset_labels_to_length(duk_compiler_ctx *comp_ctx, duk_size_ */ /* object literal key tracking flags */ -#define DUK__OBJ_LIT_KEY_PLAIN (1 << 0) /* key encountered as a plain property */ -#define DUK__OBJ_LIT_KEY_GET (1 << 1) /* key encountered as a getter */ -#define DUK__OBJ_LIT_KEY_SET (1 << 2) /* key encountered as a setter */ +#define DUK__OBJ_LIT_KEY_PLAIN (1 << 0) /* key encountered as a plain property */ +#define DUK__OBJ_LIT_KEY_GET (1 << 1) /* key encountered as a getter */ +#define DUK__OBJ_LIT_KEY_SET (1 << 2) /* key encountered as a setter */ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk_hthread *thr = comp_ctx->thr; - duk_regconst_t reg_obj; /* result reg */ - duk_regconst_t reg_temp; /* temp reg */ - duk_regconst_t temp_start; /* temp reg value for start of loop */ - duk_small_uint_t max_init_values; /* max # of values initialized in one MPUTARR set */ - duk_small_uint_t num_values; /* number of values in current MPUTARR set */ - duk_uarridx_t curr_idx; /* current (next) array index */ - duk_uarridx_t start_idx; /* start array index of current MPUTARR set */ - duk_uarridx_t init_idx; /* last array index explicitly initialized, +1 */ - duk_bool_t require_comma; /* next loop requires a comma */ + duk_regconst_t reg_obj; /* result reg */ + duk_regconst_t reg_temp; /* temp reg */ + duk_regconst_t temp_start; /* temp reg value for start of loop */ + duk_small_uint_t max_init_values; /* max # of values initialized in one MPUTARR set */ + duk_small_uint_t num_values; /* number of values in current MPUTARR set */ + duk_uarridx_t curr_idx; /* current (next) array index */ + duk_uarridx_t start_idx; /* start array index of current MPUTARR set */ + duk_uarridx_t init_idx; /* last array index explicitly initialized, +1 */ + duk_bool_t require_comma; /* next loop requires a comma */ #if !defined(DUK_USE_PREFER_SIZE) duk_int_t pc_newarr; duk_compiler_instr *instr; @@ -70628,13 +71969,13 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re /* DUK_TOK_LBRACKET already eaten, current token is right after that */ DUK_ASSERT(comp_ctx->prev_token.t == DUK_TOK_LBRACKET); - max_init_values = DUK__MAX_ARRAY_INIT_VALUES; /* XXX: depend on available temps? */ + max_init_values = DUK__MAX_ARRAY_INIT_VALUES; /* XXX: depend on available temps? */ reg_obj = DUK__ALLOCTEMP(comp_ctx); #if !defined(DUK_USE_PREFER_SIZE) pc_newarr = duk__get_current_pc(comp_ctx); #endif - duk__emit_bc(comp_ctx, DUK_OP_NEWARR, reg_obj); /* XXX: patch initial size hint afterwards? */ + duk__emit_bc(comp_ctx, DUK_OP_NEWARR, reg_obj); /* XXX: patch initial size hint afterwards? */ temp_start = DUK__GETTEMP(comp_ctx); /* @@ -70650,7 +71991,7 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re */ curr_idx = 0; - init_idx = 0; /* tracks maximum initialized index + 1 */ + init_idx = 0; /* tracks maximum initialized index + 1 */ start_idx = 0; require_comma = 0; @@ -70696,7 +72037,7 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re duk__emit_load_int32(comp_ctx, reg_temp, (duk_int32_t) start_idx); } - reg_temp = DUK__ALLOCTEMP(comp_ctx); /* alloc temp just in case, to update max temp */ + reg_temp = DUK__ALLOCTEMP(comp_ctx); /* alloc temp just in case, to update max temp */ DUK__SETTEMP(comp_ctx, reg_temp); duk__expr_toforcedreg(comp_ctx, res, DUK__BP_COMMA /*rbp_flags*/, reg_temp /*forced_reg*/); DUK__SETTEMP(comp_ctx, reg_temp + 1); @@ -70721,9 +72062,7 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re * never needs to be. */ duk__emit_a_b_c(comp_ctx, - DUK_OP_MPUTARR | - DUK__EMIT_FLAG_NO_SHUFFLE_C | - DUK__EMIT_FLAG_A_IS_SOURCE, + DUK_OP_MPUTARR | DUK__EMIT_FLAG_NO_SHUFFLE_C | DUK__EMIT_FLAG_A_IS_SOURCE, reg_obj, temp_start, (duk_regconst_t) (num_values + 1)); @@ -70744,8 +72083,7 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re DUK_ASSERT(comp_ctx->curr_token.t == DUK_TOK_RBRACKET); duk__advance(comp_ctx); - DUK_DDD(DUK_DDDPRINT("array literal done, curridx=%ld, initidx=%ld", - (long) curr_idx, (long) init_idx)); + DUK_DDD(DUK_DDDPRINT("array literal done, curridx=%ld, initidx=%ld", (long) curr_idx, (long) init_idx)); /* trailing elisions? */ if (curr_idx > init_idx) { @@ -70753,10 +72091,7 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re DUK_DDD(DUK_DDDPRINT("array literal has trailing elisions which affect its length")); reg_temp = DUK__ALLOCTEMP(comp_ctx); duk__emit_load_int32(comp_ctx, reg_temp, (duk_int_t) curr_idx); - duk__emit_a_bc(comp_ctx, - DUK_OP_SETALEN | DUK__EMIT_FLAG_A_IS_SOURCE, - reg_obj, - reg_temp); + duk__emit_a_bc(comp_ctx, DUK_OP_SETALEN | DUK__EMIT_FLAG_A_IS_SOURCE, reg_obj, reg_temp); } DUK__SETTEMP(comp_ctx, temp_start); @@ -70764,7 +72099,7 @@ DUK_LOCAL void duk__nud_array_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *re duk__ivalue_regconst(res, reg_obj); return; - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_ARRAY_LITERAL); DUK_WO_NORETURN(return;); } @@ -70788,9 +72123,7 @@ DUK_LOCAL void duk__objlit_flush_keys(duk_compiler_ctx *comp_ctx, duk__objlit_st */ DUK_ASSERT(st->num_pairs > 0); duk__emit_a_b_c(comp_ctx, - DUK_OP_MPUTOBJ | - DUK__EMIT_FLAG_NO_SHUFFLE_C | - DUK__EMIT_FLAG_A_IS_SOURCE, + DUK_OP_MPUTOBJ | DUK__EMIT_FLAG_NO_SHUFFLE_C | DUK__EMIT_FLAG_A_IS_SOURCE, st->reg_obj, st->temp_start, (duk_regconst_t) (st->num_pairs * 2)); @@ -70809,7 +72142,7 @@ DUK_LOCAL duk_bool_t duk__objlit_load_key(duk_compiler_ctx *comp_ctx, duk_ivalue /* numbers can be loaded as numbers and coerced on the fly */ duk_push_number(comp_ctx->thr, tok->num); } else { - return 1; /* error */ + return 1; /* error */ } duk__ivalue_plain_fromstack(comp_ctx, res); @@ -70822,10 +72155,10 @@ DUK_LOCAL duk_bool_t duk__objlit_load_key(duk_compiler_ctx *comp_ctx, duk_ivalue DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk_hthread *thr = comp_ctx->thr; duk__objlit_state st; - duk_regconst_t reg_temp; /* temp reg */ - duk_small_uint_t max_init_pairs; /* max # of key-value pairs initialized in one MPUTOBJ set */ - duk_bool_t first; /* first value: comma must not precede the value */ - duk_bool_t is_set, is_get; /* temps */ + duk_regconst_t reg_temp; /* temp reg */ + duk_small_uint_t max_init_pairs; /* max # of key-value pairs initialized in one MPUTOBJ set */ + duk_bool_t first; /* first value: comma must not precede the value */ + duk_bool_t is_set, is_get; /* temps */ #if !defined(DUK_USE_PREFER_SIZE) duk_int_t pc_newobj; duk_compiler_instr *instr; @@ -70833,12 +72166,12 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r DUK_ASSERT(comp_ctx->prev_token.t == DUK_TOK_LCURLY); - max_init_pairs = DUK__MAX_OBJECT_INIT_PAIRS; /* XXX: depend on available temps? */ + max_init_pairs = DUK__MAX_OBJECT_INIT_PAIRS; /* XXX: depend on available temps? */ - st.reg_obj = DUK__ALLOCTEMP(comp_ctx); /* target object */ - st.temp_start = DUK__GETTEMP(comp_ctx); /* start of MPUTOBJ argument list */ - st.num_pairs = 0; /* number of key/value pairs emitted for current MPUTOBJ set */ - st.num_total_pairs = 0; /* number of key/value pairs emitted overall */ + st.reg_obj = DUK__ALLOCTEMP(comp_ctx); /* target object */ + st.temp_start = DUK__GETTEMP(comp_ctx); /* start of MPUTOBJ argument list */ + st.num_pairs = 0; /* number of key/value pairs emitted for current MPUTOBJ set */ + st.num_total_pairs = 0; /* number of key/value pairs emitted overall */ #if !defined(DUK_USE_PREFER_SIZE) pc_newobj = duk__get_current_pc(comp_ctx); @@ -70877,8 +72210,7 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r * worth the effort and would increase code size. */ - DUK_DDD(DUK_DDDPRINT("object literal loop, curr_token->t = %ld", - (long) comp_ctx->curr_token.t)); + DUK_DDD(DUK_DDDPRINT("object literal loop, curr_token->t = %ld", (long) comp_ctx->curr_token.t)); if (comp_ctx->curr_token.t == DUK_TOK_RCURLY) { break; @@ -70918,16 +72250,15 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r * identifier string content. */ - is_get = (comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && - comp_ctx->prev_token.str1 == DUK_HTHREAD_STRING_GET(thr)); - is_set = (comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && - comp_ctx->prev_token.str1 == DUK_HTHREAD_STRING_SET(thr)); + is_get = (comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && comp_ctx->prev_token.str1 == DUK_HTHREAD_STRING_GET(thr)); + is_set = (comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && comp_ctx->prev_token.str1 == DUK_HTHREAD_STRING_SET(thr)); if ((is_get || is_set) && comp_ctx->curr_token.t != DUK_TOK_COLON) { /* getter/setter */ duk_int_t fnum; duk__objlit_flush_keys(comp_ctx, &st); - DUK_ASSERT(DUK__GETTEMP(comp_ctx) == st.temp_start); /* 2 regs are guaranteed to be allocated w.r.t. temp_max */ + DUK_ASSERT(DUK__GETTEMP(comp_ctx) == + st.temp_start); /* 2 regs are guaranteed to be allocated w.r.t. temp_max */ reg_temp = DUK__ALLOCTEMPS(comp_ctx, 2); if (duk__objlit_load_key(comp_ctx, res, &comp_ctx->curr_token, reg_temp) != 0) { @@ -70937,21 +72268,18 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r /* curr_token = get/set name */ fnum = duk__parse_func_like_fnum(comp_ctx, DUK__FUNC_FLAG_GETSET); - duk__emit_a_bc(comp_ctx, - DUK_OP_CLOSURE, - st.temp_start + 1, - (duk_regconst_t) fnum); + duk__emit_a_bc(comp_ctx, DUK_OP_CLOSURE, st.temp_start + 1, (duk_regconst_t) fnum); /* Slot C is used in a non-standard fashion (range of regs), * emitter code has special handling for it (must not set the * "no shuffle" flag). */ duk__emit_a_bc(comp_ctx, - (is_get ? DUK_OP_INITGET : DUK_OP_INITSET) | DUK__EMIT_FLAG_A_IS_SOURCE, - st.reg_obj, - st.temp_start); /* temp_start+0 = key, temp_start+1 = closure */ + (is_get ? DUK_OP_INITGET : DUK_OP_INITSET) | DUK__EMIT_FLAG_A_IS_SOURCE, + st.reg_obj, + st.temp_start); /* temp_start+0 = key, temp_start+1 = closure */ - DUK_ASSERT(st.num_pairs == 0); /* temp state is reset on next loop */ + DUK_ASSERT(st.num_pairs == 0); /* temp state is reset on next loop */ #if defined(DUK_USE_ES6) } else if (comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && (comp_ctx->curr_token.t == DUK_TOK_COMMA || comp_ctx->curr_token.t == DUK_TOK_RCURLY)) { @@ -70959,15 +72287,14 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r load_rc = duk__objlit_load_key(comp_ctx, res, &comp_ctx->prev_token, reg_temp); DUK_UNREF(load_rc); - DUK_ASSERT(load_rc == 0); /* always succeeds because token is identifier */ + DUK_ASSERT(load_rc == 0); /* always succeeds because token is identifier */ duk__ivalue_var_hstring(comp_ctx, res, comp_ctx->prev_token.str1); DUK_ASSERT(DUK__GETTEMP(comp_ctx) == reg_temp + 1); duk__ivalue_toforcedreg(comp_ctx, res, reg_temp + 1); st.num_pairs++; - } else if ((comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER || - comp_ctx->prev_token.t == DUK_TOK_STRING || + } else if ((comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER || comp_ctx->prev_token.t == DUK_TOK_STRING || comp_ctx->prev_token.t == DUK_TOK_NUMBER) && comp_ctx->curr_token.t == DUK_TOK_LPAREN) { duk_int_t fnum; @@ -70985,13 +72312,10 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r fnum = duk__parse_func_like_fnum(comp_ctx, DUK__FUNC_FLAG_USE_PREVTOKEN | DUK__FUNC_FLAG_METDEF); - duk__emit_a_bc(comp_ctx, - DUK_OP_CLOSURE, - reg_temp + 1, - (duk_regconst_t) fnum); + duk__emit_a_bc(comp_ctx, DUK_OP_CLOSURE, reg_temp + 1, (duk_regconst_t) fnum); st.num_pairs++; -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ } else { #if defined(DUK_USE_ES6) if (comp_ctx->prev_token.t == DUK_TOK_LBRACKET) { @@ -71008,9 +72332,8 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r * form is not yet supported and causes a * SyntaxError on the DUK_TOK_COLON check below. */ - } - else -#endif /* DUK_USE_ES6 */ + } else +#endif /* DUK_USE_ES6 */ { if (duk__objlit_load_key(comp_ctx, res, &comp_ctx->prev_token, reg_temp) != 0) { goto syntax_error; @@ -71024,7 +72347,7 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r st.num_pairs++; } - } /* property loop */ + } /* property loop */ /* Flush remaining properties. */ duk__objlit_flush_keys(comp_ctx, &st); @@ -71043,12 +72366,12 @@ DUK_LOCAL void duk__nud_object_literal(duk_compiler_ctx *comp_ctx, duk_ivalue *r #endif DUK_ASSERT(comp_ctx->curr_token.t == DUK_TOK_RCURLY); - duk__advance(comp_ctx); /* No RegExp after object literal. */ + duk__advance(comp_ctx); /* No RegExp after object literal. */ duk__ivalue_regconst(res, st.reg_obj); return; - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_OBJECT_LITERAL); DUK_WO_NORETURN(return;); } @@ -71064,7 +72387,8 @@ DUK_LOCAL duk_int_t duk__parse_arguments(duk_compiler_ctx *comp_ctx, duk_ivalue /* Note: expect that caller has already eaten the left paren */ DUK_DDD(DUK_DDDPRINT("start parsing arguments, prev_token.t=%ld, curr_token.t=%ld", - (long) comp_ctx->prev_token.t, (long) comp_ctx->curr_token.t)); + (long) comp_ctx->prev_token.t, + (long) comp_ctx->curr_token.t)); for (;;) { if (comp_ctx->curr_token.t == DUK_TOK_RPAREN) { @@ -71081,11 +72405,14 @@ DUK_LOCAL duk_int_t duk__parse_arguments(duk_compiler_ctx *comp_ctx, duk_ivalue * This is not the cleanest possible approach. */ - reg_temp = DUK__ALLOCTEMP(comp_ctx); /* bump up "allocated" reg count, just in case */ + reg_temp = DUK__ALLOCTEMP(comp_ctx); /* bump up "allocated" reg count, just in case */ DUK__SETTEMP(comp_ctx, reg_temp); /* binding power must be high enough to NOT allow comma expressions directly */ - duk__expr_toforcedreg(comp_ctx, res, DUK__BP_COMMA /*rbp_flags*/, reg_temp); /* always allow 'in', coerce to 'tr' just in case */ + duk__expr_toforcedreg(comp_ctx, + res, + DUK__BP_COMMA /*rbp_flags*/, + reg_temp); /* always allow 'in', coerce to 'tr' just in case */ DUK__SETTEMP(comp_ctx, reg_temp + 1); nargs++; @@ -71094,7 +72421,7 @@ DUK_LOCAL duk_int_t duk__parse_arguments(duk_compiler_ctx *comp_ctx, duk_ivalue } /* eat the right paren */ - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* RegExp mode does not matter. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* RegExp mode does not matter. */ DUK_DDD(DUK_DDDPRINT("end parsing arguments")); @@ -71103,8 +72430,7 @@ DUK_LOCAL duk_int_t duk__parse_arguments(duk_compiler_ctx *comp_ctx, duk_ivalue DUK_LOCAL duk_bool_t duk__expr_is_empty(duk_compiler_ctx *comp_ctx) { /* empty expressions can be detected conveniently with nud/led counts */ - return (comp_ctx->curr_func.nud_count == 0) && - (comp_ctx->curr_func.led_count == 0); + return (comp_ctx->curr_func.nud_count == 0) && (comp_ctx->curr_func.led_count == 0); } DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { @@ -71112,7 +72438,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk_token *tk; duk_regconst_t temp_at_entry; duk_small_uint_t tok; - duk_uint32_t args; /* temp variable to pass constants and flags to shared code */ + duk_uint32_t args; /* temp variable to pass constants and flags to shared code */ /* * ctx->prev_token token to process with duk__expr_nud() @@ -71130,18 +72456,17 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { res->t = DUK_IVAL_NONE; DUK_DDD(DUK_DDDPRINT("duk__expr_nud(), prev_token.t=%ld, allow_in=%ld, paren_level=%ld", - (long) tk->t, (long) comp_ctx->curr_func.allow_in, (long) comp_ctx->curr_func.paren_level)); + (long) tk->t, + (long) comp_ctx->curr_func.allow_in, + (long) comp_ctx->curr_func.paren_level)); switch (tok) { - - /* PRIMARY EXPRESSIONS */ + /* PRIMARY EXPRESSIONS */ case DUK_TOK_THIS: { duk_regconst_t reg_temp; reg_temp = DUK__ALLOCTEMP(comp_ctx); - duk__emit_bc(comp_ctx, - DUK_OP_LDTHIS, - reg_temp); + duk__emit_bc(comp_ctx, DUK_OP_LDTHIS, reg_temp); duk__ivalue_regconst(res, reg_temp); return; } @@ -71173,15 +72498,13 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { case DUK_TOK_REGEXP: { #if defined(DUK_USE_REGEXP_SUPPORT) duk_regconst_t reg_temp; - duk_regconst_t rc_re_bytecode; /* const */ - duk_regconst_t rc_re_source; /* const */ + duk_regconst_t rc_re_bytecode; /* const */ + duk_regconst_t rc_re_source; /* const */ DUK_ASSERT(tk->str1 != NULL); DUK_ASSERT(tk->str2 != NULL); - DUK_DDD(DUK_DDDPRINT("emitting regexp op, str1=%!O, str2=%!O", - (duk_heaphdr *) tk->str1, - (duk_heaphdr *) tk->str2)); + DUK_DDD(DUK_DDDPRINT("emitting regexp op, str1=%!O, str2=%!O", (duk_heaphdr *) tk->str1, (duk_heaphdr *) tk->str2)); reg_temp = DUK__ALLOCTEMP(comp_ctx); duk_push_hstring(thr, tk->str1); @@ -71204,9 +72527,9 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk__ivalue_regconst(res, reg_temp); return; -#else /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ goto syntax_error; -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ } case DUK_TOK_LBRACKET: { DUK_DDD(DUK_DDDPRINT("parsing array literal")); @@ -71225,15 +72548,15 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { prev_allow_in = comp_ctx->curr_func.allow_in; comp_ctx->curr_func.allow_in = 1; /* reset 'allow_in' for parenthesized expression */ - duk__expr(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); /* Expression, terminates at a ')' */ + duk__expr(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); /* Expression, terminates at a ')' */ - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* No RegExp after parenthesized expression. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* No RegExp after parenthesized expression. */ comp_ctx->curr_func.allow_in = prev_allow_in; comp_ctx->curr_func.paren_level--; return; } - /* MEMBER/NEW/CALL EXPRESSIONS */ + /* MEMBER/NEW/CALL EXPRESSIONS */ case DUK_TOK_NEW: { /* @@ -71270,16 +72593,14 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { goto syntax_error_newtarget; } duk__advance(comp_ctx); - duk__emit_bc(comp_ctx, - DUK_OP_NEWTARGET, - reg_target); + duk__emit_bc(comp_ctx, DUK_OP_NEWTARGET, reg_target); duk__ivalue_regconst(res, reg_target); return; } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ duk__expr_toforcedreg(comp_ctx, res, DUK__BP_CALL /*rbp_flags*/, reg_target /*forced_reg*/); - duk__emit_bc(comp_ctx, DUK_OP_NEWOBJ, reg_target + 1); /* default instance */ + duk__emit_bc(comp_ctx, DUK_OP_NEWOBJ, reg_target + 1); /* default instance */ DUK__SETTEMP(comp_ctx, reg_target + 2); /* XXX: 'new obj.noSuch()' doesn't use GETPROPC now which @@ -71290,7 +72611,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { /* 'new' MemberExpression Arguments */ DUK_DDD(DUK_DDDPRINT("new expression has argument list")); duk__advance(comp_ctx); - nargs = duk__parse_arguments(comp_ctx, res); /* parse args starting from "next temp", reg_target + 1 */ + nargs = duk__parse_arguments(comp_ctx, res); /* parse args starting from "next temp", reg_target + 1 */ /* right paren eaten */ } else { /* 'new' MemberExpression */ @@ -71298,10 +72619,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { nargs = 0; } - duk__emit_a_bc(comp_ctx, - DUK_OP_CALL0 | DUK_BC_CALL_FLAG_CONSTRUCT, - nargs /*num_args*/, - reg_target /*target*/); + duk__emit_a_bc(comp_ctx, DUK_OP_CALL0 | DUK_BC_CALL_FLAG_CONSTRUCT, nargs /*num_args*/, reg_target /*target*/); DUK_DDD(DUK_DDDPRINT("end parsing new expression")); @@ -71309,7 +72627,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { return; } - /* FUNCTION EXPRESSIONS */ + /* FUNCTION EXPRESSIONS */ case DUK_TOK_FUNCTION: { /* Function expression. Note that any statement beginning with 'function' @@ -71332,16 +72650,13 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { fnum = duk__parse_func_like_fnum(comp_ctx, 0 /*flags*/); DUK_DDD(DUK_DDDPRINT("parsed inner function -> fnum %ld", (long) fnum)); - duk__emit_a_bc(comp_ctx, - DUK_OP_CLOSURE, - reg_temp /*a*/, - (duk_regconst_t) fnum /*bc*/); + duk__emit_a_bc(comp_ctx, DUK_OP_CLOSURE, reg_temp /*a*/, (duk_regconst_t) fnum /*bc*/); duk__ivalue_regconst(res, reg_temp); return; } - /* UNARY EXPRESSIONS */ + /* UNARY EXPRESSIONS */ case DUK_TOK_DELETE: { /* Delete semantics are a bit tricky. The description in E5 specification @@ -71349,7 +72664,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { * a reference (which is only known at runtime) seemingly at compile time * (= SyntaxError throwing). */ - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ if (res->t == DUK_IVAL_VAR) { /* not allowed in strict mode, regardless of whether resolves; * in non-strict mode DELVAR handles both non-resolving and @@ -71371,16 +72686,11 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk_dup(thr, res->x1.valstack_idx); if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { /* register bound variables are non-configurable -> always false */ - duk__emit_bc(comp_ctx, - DUK_OP_LDFALSE, - reg_temp); + duk__emit_bc(comp_ctx, DUK_OP_LDFALSE, reg_temp); } else { duk_dup(thr, res->x1.valstack_idx); rc_varname = duk__getconst(comp_ctx); - duk__emit_a_bc(comp_ctx, - DUK_OP_DELVAR, - reg_temp, - rc_varname); + duk__emit_a_bc(comp_ctx, DUK_OP_DELVAR, reg_temp, rc_varname); } duk__ivalue_regconst(res, reg_temp); } else if (res->t == DUK_IVAL_PROP) { @@ -71390,13 +72700,11 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { DUK__SETTEMP(comp_ctx, temp_at_entry); reg_temp = DUK__ALLOCTEMP(comp_ctx); - reg_obj = duk__ispec_toregconst_raw(comp_ctx, &res->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ - rc_key = duk__ispec_toregconst_raw(comp_ctx, &res->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); - duk__emit_a_b_c(comp_ctx, - DUK_OP_DELPROP | DUK__EMIT_FLAG_BC_REGCONST, - reg_temp, - reg_obj, - rc_key); + reg_obj = + duk__ispec_toregconst_raw(comp_ctx, &res->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ + rc_key = + duk__ispec_toregconst_raw(comp_ctx, &res->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); + duk__emit_a_b_c(comp_ctx, DUK_OP_DELPROP | DUK__EMIT_FLAG_BC_REGCONST, reg_temp, reg_obj, rc_key); duk__ivalue_regconst(res, reg_temp); } else { @@ -71407,7 +72715,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { return; } case DUK_TOK_VOID: { - duk__expr_toplain_ignore(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + duk__expr_toplain_ignore(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ duk_push_undefined(thr); goto plain_value; } @@ -71417,7 +72725,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { * will never be unresolvable so special handling is only required * when an identifier is a "slow path" one. */ - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ if (res->t == DUK_IVAL_VAR) { duk_regconst_t reg_varbind; @@ -71429,10 +72737,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { DUK_DDD(DUK_DDDPRINT("typeof for an identifier name which could not be resolved " "at compile time, need to use special run-time handling")); reg_temp = DUK__ALLOCTEMP(comp_ctx); - duk__emit_a_bc(comp_ctx, - DUK_OP_TYPEOFID, - reg_temp, - rc_varname); + duk__emit_a_bc(comp_ctx, DUK_OP_TYPEOFID, reg_temp, rc_varname); duk__ivalue_regconst(res, reg_temp); return; } @@ -71451,9 +72756,8 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { } case DUK_TOK_ADD: { /* unary plus */ - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ - if (res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_VALUE && - duk_is_number(thr, res->x1.valstack_idx)) { + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + if (res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_VALUE && duk_is_number(thr, res->x1.valstack_idx)) { /* unary plus of a number is identity */ return; } @@ -71462,9 +72766,8 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { } case DUK_TOK_SUB: { /* unary minus */ - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ - if (res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_VALUE && - duk_is_number(thr, res->x1.valstack_idx)) { + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + if (res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_VALUE && duk_is_number(thr, res->x1.valstack_idx)) { /* this optimization is important to handle negative literals * (which are not directly provided by the lexical grammar) */ @@ -71484,12 +72787,12 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { goto unary; } case DUK_TOK_BNOT: { - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ args = DUK_OP_BNOT; goto unary; } case DUK_TOK_LNOT: { - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ if (res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_VALUE) { /* Very minimal inlining to handle common idioms '!0' and '!1', * and also boolean arguments like '!false' and '!true'. @@ -71524,117 +72827,110 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { goto unary; } - } /* end switch */ + } /* end switch */ DUK_ERROR_SYNTAX(thr, DUK_STR_PARSE_ERROR); DUK_WO_NORETURN(return;); - unary: - { - /* Unary opcodes use just the 'BC' register source because it - * matches current shuffle limits, and maps cleanly to 16 high - * bits of the opcode. +unary : { + /* Unary opcodes use just the 'BC' register source because it + * matches current shuffle limits, and maps cleanly to 16 high + * bits of the opcode. + */ + + duk_regconst_t reg_src, reg_res; + + reg_src = duk__ivalue_toregconst_raw(comp_ctx, res, -1 /*forced_reg*/, 0 /*flags*/); + if (DUK__ISREG_TEMP(comp_ctx, reg_src)) { + reg_res = reg_src; + } else { + reg_res = DUK__ALLOCTEMP(comp_ctx); + } + duk__emit_a_bc(comp_ctx, args, reg_res, reg_src); + duk__ivalue_regconst(res, reg_res); + return; +} + +preincdec : { + /* preincrement and predecrement */ + duk_regconst_t reg_res; + duk_small_uint_t args_op1 = args & 0xff; /* DUK_OP_PREINCR/DUK_OP_PREDECR */ + duk_small_uint_t args_op2 = args >> 8; /* DUK_OP_PREINCP_RR/DUK_OP_PREDECP_RR */ + + /* Specific assumptions for opcode numbering. */ + DUK_ASSERT(DUK_OP_PREINCR + 4 == DUK_OP_PREINCV); + DUK_ASSERT(DUK_OP_PREDECR + 4 == DUK_OP_PREDECV); + + reg_res = DUK__ALLOCTEMP(comp_ctx); + + duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ + if (res->t == DUK_IVAL_VAR) { + duk_hstring *h_varname; + duk_regconst_t reg_varbind; + duk_regconst_t rc_varname; + + h_varname = duk_known_hstring(thr, res->x1.valstack_idx); + + if (duk__hstring_is_eval_or_arguments_in_strict_mode(comp_ctx, h_varname)) { + goto syntax_error; + } + + duk_dup(thr, res->x1.valstack_idx); + if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { + duk__emit_a_bc(comp_ctx, + args_op1, /* e.g. DUK_OP_PREINCR */ + reg_res, + reg_varbind); + } else { + duk__emit_a_bc(comp_ctx, + args_op1 + 4, /* e.g. DUK_OP_PREINCV */ + reg_res, + rc_varname); + } + + DUK_DDD(DUK_DDDPRINT("preincdec to '%!O' -> reg_varbind=%ld, rc_varname=%ld", + (duk_heaphdr *) h_varname, + (long) reg_varbind, + (long) rc_varname)); + } else if (res->t == DUK_IVAL_PROP) { + duk_regconst_t reg_obj; /* allocate to reg only (not const) */ + duk_regconst_t rc_key; + reg_obj = duk__ispec_toregconst_raw(comp_ctx, &res->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ + rc_key = duk__ispec_toregconst_raw(comp_ctx, &res->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); + duk__emit_a_b_c(comp_ctx, + args_op2 | DUK__EMIT_FLAG_BC_REGCONST, /* e.g. DUK_OP_PREINCP */ + reg_res, + reg_obj, + rc_key); + } else { + /* Technically return value is not needed because INVLHS will + * unconditially throw a ReferenceError. Coercion is necessary + * for proper semantics (consider ToNumber() called for an object). + * Use DUK_OP_UNP with a dummy register to get ToNumber(). */ - duk_regconst_t reg_src, reg_res; - - reg_src = duk__ivalue_toregconst_raw(comp_ctx, res, -1 /*forced_reg*/, 0 /*flags*/); - if (DUK__ISREG_TEMP(comp_ctx, reg_src)) { - reg_res = reg_src; - } else { - reg_res = DUK__ALLOCTEMP(comp_ctx); - } - duk__emit_a_bc(comp_ctx, - args, - reg_res, - reg_src); - duk__ivalue_regconst(res, reg_res); - return; + duk__ivalue_toforcedreg(comp_ctx, res, reg_res); + duk__emit_bc(comp_ctx, DUK_OP_UNP, reg_res); /* for side effects, result ignored */ + duk__emit_op_only(comp_ctx, DUK_OP_INVLHS); } + DUK__SETTEMP(comp_ctx, reg_res + 1); + duk__ivalue_regconst(res, reg_res); + return; +} - preincdec: - { - /* preincrement and predecrement */ - duk_regconst_t reg_res; - duk_small_uint_t args_op1 = args & 0xff; /* DUK_OP_PREINCR/DUK_OP_PREDECR */ - duk_small_uint_t args_op2 = args >> 8; /* DUK_OP_PREINCP_RR/DUK_OP_PREDECP_RR */ - - /* Specific assumptions for opcode numbering. */ - DUK_ASSERT(DUK_OP_PREINCR + 4 == DUK_OP_PREINCV); - DUK_ASSERT(DUK_OP_PREDECR + 4 == DUK_OP_PREDECV); - - reg_res = DUK__ALLOCTEMP(comp_ctx); - - duk__expr(comp_ctx, res, DUK__BP_MULTIPLICATIVE /*rbp_flags*/); /* UnaryExpression */ - if (res->t == DUK_IVAL_VAR) { - duk_hstring *h_varname; - duk_regconst_t reg_varbind; - duk_regconst_t rc_varname; - - h_varname = duk_known_hstring(thr, res->x1.valstack_idx); - - if (duk__hstring_is_eval_or_arguments_in_strict_mode(comp_ctx, h_varname)) { - goto syntax_error; - } - - duk_dup(thr, res->x1.valstack_idx); - if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { - duk__emit_a_bc(comp_ctx, - args_op1, /* e.g. DUK_OP_PREINCR */ - reg_res, - reg_varbind); - } else { - duk__emit_a_bc(comp_ctx, - args_op1 + 4, /* e.g. DUK_OP_PREINCV */ - reg_res, - rc_varname); - } - - DUK_DDD(DUK_DDDPRINT("preincdec to '%!O' -> reg_varbind=%ld, rc_varname=%ld", - (duk_heaphdr *) h_varname, (long) reg_varbind, (long) rc_varname)); - } else if (res->t == DUK_IVAL_PROP) { - duk_regconst_t reg_obj; /* allocate to reg only (not const) */ - duk_regconst_t rc_key; - reg_obj = duk__ispec_toregconst_raw(comp_ctx, &res->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ - rc_key = duk__ispec_toregconst_raw(comp_ctx, &res->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); - duk__emit_a_b_c(comp_ctx, - args_op2 | DUK__EMIT_FLAG_BC_REGCONST, /* e.g. DUK_OP_PREINCP */ - reg_res, - reg_obj, - rc_key); - } else { - /* Technically return value is not needed because INVLHS will - * unconditially throw a ReferenceError. Coercion is necessary - * for proper semantics (consider ToNumber() called for an object). - * Use DUK_OP_UNP with a dummy register to get ToNumber(). - */ - - duk__ivalue_toforcedreg(comp_ctx, res, reg_res); - duk__emit_bc(comp_ctx, - DUK_OP_UNP, - reg_res); /* for side effects, result ignored */ - duk__emit_op_only(comp_ctx, - DUK_OP_INVLHS); - } - DUK__SETTEMP(comp_ctx, reg_res + 1); - duk__ivalue_regconst(res, reg_res); - return; - } - - plain_value: - { - /* Stack top contains plain value */ - duk__ivalue_plain_fromstack(comp_ctx, res); - return; - } +plain_value : { + /* Stack top contains plain value */ + duk__ivalue_plain_fromstack(comp_ctx, res); + return; +} #if defined(DUK_USE_ES6) - syntax_error_newtarget: +syntax_error_newtarget: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_NEWTARGET); DUK_WO_NORETURN(return;); #endif - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_EXPRESSION); DUK_WO_NORETURN(return;); } @@ -71647,7 +72943,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i duk_hthread *thr = comp_ctx->thr; duk_token *tk; duk_small_uint_t tok; - duk_uint32_t args; /* temp variable to pass constants and flags to shared code */ + duk_uint32_t args; /* temp variable to pass constants and flags to shared code */ /* * ctx->prev_token token to process with duk__expr_led() @@ -71661,13 +72957,14 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i tok = tk->t; DUK_DDD(DUK_DDDPRINT("duk__expr_led(), prev_token.t=%ld, allow_in=%ld, paren_level=%ld", - (long) tk->t, (long) comp_ctx->curr_func.allow_in, (long) comp_ctx->curr_func.paren_level)); + (long) tk->t, + (long) comp_ctx->curr_func.allow_in, + (long) comp_ctx->curr_func.paren_level)); /* XXX: default priority for infix operators is duk__expr_lbp(tok) -> get it here? */ switch (tok) { - - /* PRIMARY EXPRESSIONS */ + /* PRIMARY EXPRESSIONS */ case DUK_TOK_PERIOD: { /* Property access expressions are critical for correct LHS ordering, @@ -71695,7 +72992,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i } res->t = DUK_IVAL_PROP; - duk__copy_ispec(comp_ctx, &left->x1, &res->x1); /* left.x1 -> res.x1 */ + duk__copy_ispec(comp_ctx, &left->x1, &res->x1); /* left.x1 -> res.x1 */ DUK_ASSERT(comp_ctx->curr_token.str1 != NULL); duk_push_hstring(thr, comp_ctx->curr_token.str1); duk_replace(thr, res->x2.valstack_idx); @@ -71730,12 +73027,12 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * See: test-bug-nested-prop-mutate.js. */ duk__ivalue_totempconst(comp_ctx, left); - duk__expr_toplain(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); /* Expression, ']' terminates */ + duk__expr_toplain(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); /* Expression, ']' terminates */ duk__advance_expect(comp_ctx, DUK_TOK_RBRACKET); res->t = DUK_IVAL_PROP; - duk__copy_ispec(comp_ctx, &res->x1, &res->x2); /* res.x1 -> res.x2 */ - duk__copy_ispec(comp_ctx, &left->x1, &res->x1); /* left.x1 -> res.x1 */ + duk__copy_ispec(comp_ctx, &res->x1, &res->x2); /* res.x1 -> res.x2 */ + duk__copy_ispec(comp_ctx, &left->x1, &res->x1); /* left.x1 -> res.x1 */ return; } case DUK_TOK_LPAREN: { @@ -71779,19 +73076,13 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i duk_dup(thr, left->x1.valstack_idx); if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { - duk__emit_a_bc(comp_ctx, - DUK_OP_CSREG | DUK__EMIT_FLAG_A_IS_SOURCE, - reg_varbind, - reg_cs + 0); + duk__emit_a_bc(comp_ctx, DUK_OP_CSREG | DUK__EMIT_FLAG_A_IS_SOURCE, reg_varbind, reg_cs + 0); } else { /* XXX: expand target register or constant field to * reduce shuffling. */ DUK_ASSERT(DUK__ISCONST(rc_varname)); - duk__emit_a_b(comp_ctx, - DUK_OP_CSVAR | DUK__EMIT_FLAG_BC_REGCONST, - reg_cs + 0, - rc_varname); + duk__emit_a_b(comp_ctx, DUK_OP_CSVAR | DUK__EMIT_FLAG_BC_REGCONST, reg_cs + 0, rc_varname); } } else if (left->t == DUK_IVAL_PROP) { /* Call through a property lookup, E5 Section 11.2.3, step 6.a.i, @@ -71813,16 +73104,12 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * and reuse, but it would still be in the wrong position * (reg_cs + 0 rather than reg_cs + 1). */ - duk__ispec_toforcedreg(comp_ctx, &left->x1, reg_cs + 1); /* base */ + duk__ispec_toforcedreg(comp_ctx, &left->x1, reg_cs + 1); /* base */ #if defined(DUK_USE_VERBOSE_ERRORS) reg_key = duk__ispec_toregconst_raw(comp_ctx, &left->x2, -1, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); - duk__emit_a_b_c(comp_ctx, - DUK_OP_GETPROPC | DUK__EMIT_FLAG_BC_REGCONST, - reg_cs + 0, - reg_cs + 1, - reg_key); + duk__emit_a_b_c(comp_ctx, DUK_OP_GETPROPC | DUK__EMIT_FLAG_BC_REGCONST, reg_cs + 0, reg_cs + 1, reg_key); #else - duk__ivalue_toforcedreg(comp_ctx, left, reg_cs + 0); /* base[key] */ + duk__ivalue_toforcedreg(comp_ctx, left, reg_cs + 0); /* base[key] */ #endif } else { DUK_DDD(DUK_DDDPRINT("function call with register base")); @@ -71841,23 +73128,20 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i } DUK__SETTEMP(comp_ctx, reg_cs + 2); - nargs = duk__parse_arguments(comp_ctx, res); /* parse args starting from "next temp" */ + nargs = duk__parse_arguments(comp_ctx, res); /* parse args starting from "next temp" */ /* Tailcalls are handled by back-patching the already emitted opcode * later in return statement parser. */ - duk__emit_a_bc(comp_ctx, - call_op, - (duk_regconst_t) nargs /*numargs*/, - reg_cs /*basereg*/); - DUK__SETTEMP(comp_ctx, reg_cs + 1); /* result in csreg */ + duk__emit_a_bc(comp_ctx, call_op, (duk_regconst_t) nargs /*numargs*/, reg_cs /*basereg*/); + DUK__SETTEMP(comp_ctx, reg_cs + 1); /* result in csreg */ duk__ivalue_regconst(res, reg_cs); return; } - /* POSTFIX EXPRESSION */ + /* POSTFIX EXPRESSION */ case DUK_TOK_INCREMENT: { args = (DUK_OP_POSTINCP_RR << 16) + (DUK_OP_POSTINCR << 8) + 0; @@ -71872,38 +73156,38 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i #if defined(DUK_USE_ES7_EXP_OPERATOR) case DUK_TOK_EXP: { - args = (DUK_OP_EXP << 8) + DUK__BP_EXPONENTIATION - 1; /* UnaryExpression */ + args = (DUK_OP_EXP << 8) + DUK__BP_EXPONENTIATION - 1; /* UnaryExpression */ goto binary; } #endif - /* MULTIPLICATIVE EXPRESSION */ + /* MULTIPLICATIVE EXPRESSION */ case DUK_TOK_MUL: { - args = (DUK_OP_MUL << 8) + DUK__BP_MULTIPLICATIVE; /* ExponentiationExpression */ + args = (DUK_OP_MUL << 8) + DUK__BP_MULTIPLICATIVE; /* ExponentiationExpression */ goto binary; } case DUK_TOK_DIV: { - args = (DUK_OP_DIV << 8) + DUK__BP_MULTIPLICATIVE; /* ExponentiationExpression */ + args = (DUK_OP_DIV << 8) + DUK__BP_MULTIPLICATIVE; /* ExponentiationExpression */ goto binary; } case DUK_TOK_MOD: { - args = (DUK_OP_MOD << 8) + DUK__BP_MULTIPLICATIVE; /* ExponentiationExpression */ + args = (DUK_OP_MOD << 8) + DUK__BP_MULTIPLICATIVE; /* ExponentiationExpression */ goto binary; } - /* ADDITIVE EXPRESSION */ + /* ADDITIVE EXPRESSION */ case DUK_TOK_ADD: { - args = (DUK_OP_ADD << 8) + DUK__BP_ADDITIVE; /* MultiplicativeExpression */ + args = (DUK_OP_ADD << 8) + DUK__BP_ADDITIVE; /* MultiplicativeExpression */ goto binary; } case DUK_TOK_SUB: { - args = (DUK_OP_SUB << 8) + DUK__BP_ADDITIVE; /* MultiplicativeExpression */ + args = (DUK_OP_SUB << 8) + DUK__BP_ADDITIVE; /* MultiplicativeExpression */ goto binary; } - /* SHIFT EXPRESSION */ + /* SHIFT EXPRESSION */ case DUK_TOK_ALSHIFT: { /* << */ @@ -71921,7 +73205,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i goto binary; } - /* RELATIONAL EXPRESSION */ + /* RELATIONAL EXPRESSION */ case DUK_TOK_LT: { /* < */ @@ -71949,7 +73233,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i goto binary; } - /* EQUALITY EXPRESSION */ + /* EQUALITY EXPRESSION */ case DUK_TOK_EQ: { args = (DUK_OP_EQ << 8) + DUK__BP_EQUALITY; @@ -71968,7 +73252,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i goto binary; } - /* BITWISE EXPRESSIONS */ + /* BITWISE EXPRESSIONS */ case DUK_TOK_BAND: { args = (DUK_OP_BAND << 8) + DUK__BP_BAND; @@ -71983,7 +73267,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i goto binary; } - /* LOGICAL EXPRESSIONS */ + /* LOGICAL EXPRESSIONS */ case DUK_TOK_LAND: { /* syntactically left-associative but parsed as right-associative */ @@ -71996,7 +73280,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i goto binary_logical; } - /* CONDITIONAL EXPRESSION */ + /* CONDITIONAL EXPRESSION */ case DUK_TOK_QUESTION: { /* XXX: common reg allocation need is to reuse a sub-expression's temp reg, @@ -72009,12 +73293,18 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i reg_temp = DUK__ALLOCTEMP(comp_ctx); duk__ivalue_toforcedreg(comp_ctx, left, reg_temp); duk__emit_if_true_skip(comp_ctx, reg_temp); - pc_jump1 = duk__emit_jump_empty(comp_ctx); /* jump to false */ - duk__expr_toforcedreg(comp_ctx, res, DUK__BP_COMMA /*rbp_flags*/, reg_temp /*forced_reg*/); /* AssignmentExpression */ + pc_jump1 = duk__emit_jump_empty(comp_ctx); /* jump to false */ + duk__expr_toforcedreg(comp_ctx, + res, + DUK__BP_COMMA /*rbp_flags*/, + reg_temp /*forced_reg*/); /* AssignmentExpression */ duk__advance_expect(comp_ctx, DUK_TOK_COLON); - pc_jump2 = duk__emit_jump_empty(comp_ctx); /* jump to end */ + pc_jump2 = duk__emit_jump_empty(comp_ctx); /* jump to end */ duk__patch_jump_here(comp_ctx, pc_jump1); - duk__expr_toforcedreg(comp_ctx, res, DUK__BP_COMMA /*rbp_flags*/, reg_temp /*forced_reg*/); /* AssignmentExpression */ + duk__expr_toforcedreg(comp_ctx, + res, + DUK__BP_COMMA /*rbp_flags*/, + reg_temp /*forced_reg*/); /* AssignmentExpression */ duk__patch_jump_here(comp_ctx, pc_jump2); DUK__SETTEMP(comp_ctx, reg_temp + 1); @@ -72022,7 +73312,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i return; } - /* ASSIGNMENT EXPRESSION */ + /* ASSIGNMENT EXPRESSION */ case DUK_TOK_EQUALSIGN: { /* @@ -72036,7 +73326,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * * XXX: just use DUK__BP_COMMA (i.e. no need for 2-step bp levels)? */ - args = (DUK_OP_NONE << 8) + DUK__BP_ASSIGNMENT - 1; /* DUK_OP_NONE marks a 'plain' assignment */ + args = (DUK_OP_NONE << 8) + DUK__BP_ASSIGNMENT - 1; /* DUK_OP_NONE marks a 'plain' assignment */ goto assign; } case DUK_TOK_ADD_EQ: { @@ -72102,12 +73392,12 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i goto assign; } - /* COMMA */ + /* COMMA */ case DUK_TOK_COMMA: { /* right associative */ - duk__ivalue_toplain_ignore(comp_ctx, left); /* need side effects, not value */ + duk__ivalue_toplain_ignore(comp_ctx, left); /* need side effects, not value */ duk__expr_toplain(comp_ctx, res, DUK__BP_COMMA - 1 /*rbp_flags*/); /* return 'res' (of right part) as our result */ @@ -72130,7 +73420,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i } #endif - binary: +binary: /* * Shared handling of binary operations * @@ -72156,11 +73446,15 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i duk_copy(thr, left->x1.valstack_idx, res->x1.valstack_idx); DUK_DDD(DUK_DDDPRINT("binary op, res: t=%ld, x1.t=%ld, x1.regconst=0x%08lx, x2.t=%ld, x2.regconst=0x%08lx", - (long) res->t, (long) res->x1.t, (unsigned long) res->x1.regconst, (long) res->x2.t, (unsigned long) res->x2.regconst)); + (long) res->t, + (long) res->x1.t, + (unsigned long) res->x1.regconst, + (long) res->x2.t, + (unsigned long) res->x2.regconst)); return; } - binary_logical: +binary_logical: /* * Shared handling for logical AND and logical OR. * @@ -72193,8 +73487,8 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i duk__ivalue_toforcedreg(comp_ctx, left, reg_temp); DUK_ASSERT(DUK__ISREG(reg_temp)); duk__emit_bc(comp_ctx, - (args_truthval ? DUK_OP_IFTRUE_R : DUK_OP_IFFALSE_R), - reg_temp); /* skip jump conditionally */ + (args_truthval ? DUK_OP_IFTRUE_R : DUK_OP_IFFALSE_R), + reg_temp); /* skip jump conditionally */ pc_jump = duk__emit_jump_empty(comp_ctx); duk__expr_toforcedreg(comp_ctx, res, args_rbp /*rbp_flags*/, reg_temp /*forced_reg*/); duk__patch_jump_here(comp_ctx, pc_jump); @@ -72203,7 +73497,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i return; } - assign: +assign: /* * Shared assignment expression handling * @@ -72256,7 +73550,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * is relevant for e.g. eval code. */ toplevel_assign = (comp_ctx->curr_func.nud_count == 1 && /* one token before */ - comp_ctx->curr_func.led_count == 1); /* one operator (= assign) */ + comp_ctx->curr_func.led_count == 1); /* one operator (= assign) */ DUK_DDD(DUK_DDDPRINT("assignment: nud_count=%ld, led_count=%ld, toplevel_assign=%ld", (long) comp_ctx->curr_func.nud_count, (long) comp_ctx->curr_func.led_count, @@ -72267,7 +73561,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i duk_regconst_t reg_varbind; duk_regconst_t rc_varname; - DUK_ASSERT(left->x1.t == DUK_ISPEC_VALUE); /* LHS is already side effect free */ + DUK_ASSERT(left->x1.t == DUK_ISPEC_VALUE); /* LHS is already side effect free */ h_varname = duk_known_hstring(thr, left->x1.valstack_idx); if (duk__hstring_is_eval_or_arguments_in_strict_mode(comp_ctx, h_varname)) { @@ -72284,9 +73578,10 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i DUK_DDD(DUK_DDDPRINT("plain assignment, toplevel assign, use as is")); } else { /* 'res' must be a plain ivalue, and not register-bound variable. */ - DUK_DDD(DUK_DDDPRINT("plain assignment, not toplevel assign, ensure not a reg-bound identifier")); - if (res->t != DUK_IVAL_PLAIN || (res->x1.t == DUK_ISPEC_REGCONST && - DUK__ISREG_NOTTEMP(comp_ctx, res->x1.regconst))) { + DUK_DDD(DUK_DDDPRINT( + "plain assignment, not toplevel assign, ensure not a reg-bound identifier")); + if (res->t != DUK_IVAL_PLAIN || + (res->x1.t == DUK_ISPEC_REGCONST && DUK__ISREG_NOTTEMP(comp_ctx, res->x1.regconst))) { duk__ivalue_totempconst(comp_ctx, res); } } @@ -72319,7 +73614,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * value, so go through a temp. */ DUK_DD(DUK_DDPRINT("= expression is not top level, write to reg_temp")); - reg_res = reg_temp; /* reg_res should be smallest possible */ + reg_res = reg_temp; /* reg_res should be smallest possible */ reg_temp = DUK__ALLOCTEMP(comp_ctx); } @@ -72331,10 +73626,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i */ pc_temp_load = duk__get_current_pc(comp_ctx); - duk__emit_a_bc(comp_ctx, - DUK_OP_LDREG, - reg_temp, - reg_varbind); + duk__emit_a_bc(comp_ctx, DUK_OP_LDREG, reg_temp, reg_varbind); pc_before_rhs = duk__get_current_pc(comp_ctx); duk__expr_toregconst(comp_ctx, res, args_rbp /*rbp_flags*/); @@ -72342,7 +73634,8 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i pc_after_rhs = duk__get_current_pc(comp_ctx); DUK_DD(DUK_DDPRINT("pc_temp_load=%ld, pc_before_rhs=%ld, pc_after_rhs=%ld", - (long) pc_temp_load, (long) pc_before_rhs, + (long) pc_temp_load, + (long) pc_before_rhs, (long) pc_after_rhs)); if (pc_after_rhs == pc_before_rhs) { @@ -72350,11 +73643,16 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * instructions, we may need to rewind more than * one instruction, so use explicit PC computation. */ - DUK_DD(DUK_DDPRINT("rhs is side effect free, rewind and avoid unnecessary temp for reg-based =")); - DUK_BW_ADD_PTR(comp_ctx->thr, &comp_ctx->curr_func.bw_code, (pc_temp_load - pc_before_rhs) * (duk_int_t) sizeof(duk_compiler_instr)); + DUK_DD(DUK_DDPRINT("rhs is side effect free, rewind and avoid unnecessary temp for " + "reg-based =")); + DUK_BW_ADD_PTR(comp_ctx->thr, + &comp_ctx->curr_func.bw_code, + (pc_temp_load - pc_before_rhs) * + (duk_int_t) sizeof(duk_compiler_instr)); reg_src = reg_varbind; } else { - DUK_DD(DUK_DDPRINT("rhs evaluation emitted code, not sure if rhs is side effect free; use temp reg for LHS")); + DUK_DD(DUK_DDPRINT("rhs evaluation emitted code, not sure if rhs is side effect " + "free; use temp reg for LHS")); reg_src = reg_temp; } @@ -72375,10 +73673,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * temporary. No optimization for top level assignment. */ - duk__emit_a_bc(comp_ctx, - DUK_OP_GETVAR, - reg_temp, - rc_varname); + duk__emit_a_bc(comp_ctx, DUK_OP_GETVAR, reg_temp, rc_varname); duk__expr_toregconst(comp_ctx, res, args_rbp /*rbp_flags*/); DUK_ASSERT(res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_REGCONST); @@ -72411,7 +73706,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i duk__ivalue_toforcedreg(comp_ctx, res, (duk_int_t) reg_varbind); } else { duk__ivalue_totempconst(comp_ctx, res); - duk__copy_ivalue(comp_ctx, res, left); /* use 'left' as a temp */ + duk__copy_ivalue(comp_ctx, res, left); /* use 'left' as a temp */ duk__ivalue_toforcedreg(comp_ctx, left, (duk_int_t) reg_varbind); } } else { @@ -72419,7 +73714,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i * free and may be a plain value, a register, or a * constant) and write it to the LHS binding too. */ - duk__copy_ivalue(comp_ctx, res, left); /* use 'left' as a temp */ + duk__copy_ivalue(comp_ctx, res, left); /* use 'left' as a temp */ duk__ivalue_toforcedreg(comp_ctx, left, (duk_int_t) reg_varbind); } } else { @@ -72432,10 +73727,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i */ duk__ivalue_toreg(comp_ctx, res); - duk__emit_a_bc(comp_ctx, - DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, - res->x1.regconst, - rc_varname); + duk__emit_a_bc(comp_ctx, DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, res->x1.regconst, rc_varname); } /* 'res' contains expression value */ @@ -72475,11 +73767,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i rc_res = res->x1.regconst; } else { reg_temp = DUK__ALLOCTEMP(comp_ctx); - duk__emit_a_b_c(comp_ctx, - DUK_OP_GETPROP | DUK__EMIT_FLAG_BC_REGCONST, - reg_temp, - reg_obj, - rc_key); + duk__emit_a_b_c(comp_ctx, DUK_OP_GETPROP | DUK__EMIT_FLAG_BC_REGCONST, reg_temp, reg_obj, rc_key); duk__expr_toregconst(comp_ctx, res, args_rbp /*rbp_flags*/); DUK_ASSERT(res->t == DUK_IVAL_PLAIN && res->x1.t == DUK_ISPEC_REGCONST); @@ -72530,90 +73818,88 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i return; } - postincdec: - { - /* - * Post-increment/decrement will return the original value as its - * result value. However, even that value will be coerced using - * ToNumber() which is quite awkward. Specific bytecode opcodes - * are used to handle these semantics. - * - * Note that post increment/decrement has a "no LineTerminator here" - * restriction. This is handled by duk__expr_lbp(), which forcibly terminates - * the previous expression if a LineTerminator occurs before '++'/'--'. - */ +postincdec : { + /* + * Post-increment/decrement will return the original value as its + * result value. However, even that value will be coerced using + * ToNumber() which is quite awkward. Specific bytecode opcodes + * are used to handle these semantics. + * + * Note that post increment/decrement has a "no LineTerminator here" + * restriction. This is handled by duk__expr_lbp(), which forcibly terminates + * the previous expression if a LineTerminator occurs before '++'/'--'. + */ - duk_regconst_t reg_res; - duk_small_uint_t args_op1 = (args >> 8) & 0xff; /* DUK_OP_POSTINCR/DUK_OP_POSTDECR */ - duk_small_uint_t args_op2 = args >> 16; /* DUK_OP_POSTINCP_RR/DUK_OP_POSTDECP_RR */ + duk_regconst_t reg_res; + duk_small_uint_t args_op1 = (args >> 8) & 0xff; /* DUK_OP_POSTINCR/DUK_OP_POSTDECR */ + duk_small_uint_t args_op2 = args >> 16; /* DUK_OP_POSTINCP_RR/DUK_OP_POSTDECP_RR */ - /* Specific assumptions for opcode numbering. */ - DUK_ASSERT(DUK_OP_POSTINCR + 4 == DUK_OP_POSTINCV); - DUK_ASSERT(DUK_OP_POSTDECR + 4 == DUK_OP_POSTDECV); + /* Specific assumptions for opcode numbering. */ + DUK_ASSERT(DUK_OP_POSTINCR + 4 == DUK_OP_POSTINCV); + DUK_ASSERT(DUK_OP_POSTDECR + 4 == DUK_OP_POSTDECV); - reg_res = DUK__ALLOCTEMP(comp_ctx); + reg_res = DUK__ALLOCTEMP(comp_ctx); - if (left->t == DUK_IVAL_VAR) { - duk_hstring *h_varname; - duk_regconst_t reg_varbind; - duk_regconst_t rc_varname; + if (left->t == DUK_IVAL_VAR) { + duk_hstring *h_varname; + duk_regconst_t reg_varbind; + duk_regconst_t rc_varname; - h_varname = duk_known_hstring(thr, left->x1.valstack_idx); + h_varname = duk_known_hstring(thr, left->x1.valstack_idx); - if (duk__hstring_is_eval_or_arguments_in_strict_mode(comp_ctx, h_varname)) { - goto syntax_error; - } - - duk_dup(thr, left->x1.valstack_idx); - if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { - duk__emit_a_bc(comp_ctx, - args_op1, /* e.g. DUK_OP_POSTINCR */ - reg_res, - reg_varbind); - } else { - duk__emit_a_bc(comp_ctx, - args_op1 + 4, /* e.g. DUK_OP_POSTINCV */ - reg_res, - rc_varname); - } - - DUK_DDD(DUK_DDDPRINT("postincdec to '%!O' -> reg_varbind=%ld, rc_varname=%ld", - (duk_heaphdr *) h_varname, (long) reg_varbind, (long) rc_varname)); - } else if (left->t == DUK_IVAL_PROP) { - duk_regconst_t reg_obj; /* allocate to reg only (not const) */ - duk_regconst_t rc_key; - - reg_obj = duk__ispec_toregconst_raw(comp_ctx, &left->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ - rc_key = duk__ispec_toregconst_raw(comp_ctx, &left->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); - duk__emit_a_b_c(comp_ctx, - args_op2 | DUK__EMIT_FLAG_BC_REGCONST, /* e.g. DUK_OP_POSTINCP */ - reg_res, - reg_obj, - rc_key); - } else { - /* Technically return value is not needed because INVLHS will - * unconditially throw a ReferenceError. Coercion is necessary - * for proper semantics (consider ToNumber() called for an object). - * Use DUK_OP_UNP with a dummy register to get ToNumber(). - */ - duk__ivalue_toforcedreg(comp_ctx, left, reg_res); - duk__emit_bc(comp_ctx, - DUK_OP_UNP, - reg_res); /* for side effects, result ignored */ - duk__emit_op_only(comp_ctx, - DUK_OP_INVLHS); + if (duk__hstring_is_eval_or_arguments_in_strict_mode(comp_ctx, h_varname)) { + goto syntax_error; } - DUK__SETTEMP(comp_ctx, reg_res + 1); - duk__ivalue_regconst(res, reg_res); - return; + duk_dup(thr, left->x1.valstack_idx); + if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { + duk__emit_a_bc(comp_ctx, + args_op1, /* e.g. DUK_OP_POSTINCR */ + reg_res, + reg_varbind); + } else { + duk__emit_a_bc(comp_ctx, + args_op1 + 4, /* e.g. DUK_OP_POSTINCV */ + reg_res, + rc_varname); + } + + DUK_DDD(DUK_DDDPRINT("postincdec to '%!O' -> reg_varbind=%ld, rc_varname=%ld", + (duk_heaphdr *) h_varname, + (long) reg_varbind, + (long) rc_varname)); + } else if (left->t == DUK_IVAL_PROP) { + duk_regconst_t reg_obj; /* allocate to reg only (not const) */ + duk_regconst_t rc_key; + + reg_obj = duk__ispec_toregconst_raw(comp_ctx, &left->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ + rc_key = duk__ispec_toregconst_raw(comp_ctx, &left->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); + duk__emit_a_b_c(comp_ctx, + args_op2 | DUK__EMIT_FLAG_BC_REGCONST, /* e.g. DUK_OP_POSTINCP */ + reg_res, + reg_obj, + rc_key); + } else { + /* Technically return value is not needed because INVLHS will + * unconditially throw a ReferenceError. Coercion is necessary + * for proper semantics (consider ToNumber() called for an object). + * Use DUK_OP_UNP with a dummy register to get ToNumber(). + */ + duk__ivalue_toforcedreg(comp_ctx, left, reg_res); + duk__emit_bc(comp_ctx, DUK_OP_UNP, reg_res); /* for side effects, result ignored */ + duk__emit_op_only(comp_ctx, DUK_OP_INVLHS); } - syntax_error: + DUK__SETTEMP(comp_ctx, reg_res + 1); + duk__ivalue_regconst(res, reg_res); + return; +} + +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_EXPRESSION); DUK_WO_NORETURN(return;); - syntax_error_lvalue: +syntax_error_lvalue: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_LVALUE); DUK_WO_NORETURN(return;); } @@ -72621,7 +73907,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i DUK_LOCAL duk_small_uint_t duk__expr_lbp(duk_compiler_ctx *comp_ctx) { duk_small_uint_t tok = comp_ctx->curr_token.t; - DUK_ASSERT_DISABLE(tok >= DUK_TOK_MINVAL); /* unsigned */ + DUK_ASSERT_DISABLE(tok >= DUK_TOK_MINVAL); /* unsigned */ DUK_ASSERT(tok <= DUK_TOK_MAXVAL); DUK_ASSERT(sizeof(duk__token_lbp) == DUK_TOK_MAXVAL + 1); @@ -72634,8 +73920,7 @@ DUK_LOCAL duk_small_uint_t duk__expr_lbp(duk_compiler_ctx *comp_ctx) { return 0; } - if ((tok == DUK_TOK_DECREMENT || tok == DUK_TOK_INCREMENT) && - (comp_ctx->curr_token.lineterm)) { + if ((tok == DUK_TOK_DECREMENT || tok == DUK_TOK_INCREMENT) && (comp_ctx->curr_token.lineterm)) { /* '++' or '--' in a post-increment/decrement position, * and a LineTerminator occurs between the operator and * the preceding expression. Force the previous expr @@ -72645,7 +73930,7 @@ DUK_LOCAL duk_small_uint_t duk__expr_lbp(duk_compiler_ctx *comp_ctx) { return 0; } - return DUK__TOKEN_LBP_GET_BP(duk__token_lbp[tok]); /* format is bit packed */ + return DUK__TOKEN_LBP_GET_BP(duk__token_lbp[tok]); /* format is bit packed */ } /* @@ -72657,15 +73942,15 @@ DUK_LOCAL duk_small_uint_t duk__expr_lbp(duk_compiler_ctx *comp_ctx) { * statement). */ -#define DUK__EXPR_RBP_MASK 0xff -#define DUK__EXPR_FLAG_REJECT_IN (1 << 8) /* reject 'in' token (used for for-in) */ -#define DUK__EXPR_FLAG_ALLOW_EMPTY (1 << 9) /* allow empty expression */ -#define DUK__EXPR_FLAG_REQUIRE_INIT (1 << 10) /* require initializer for var/const */ +#define DUK__EXPR_RBP_MASK 0xff +#define DUK__EXPR_FLAG_REJECT_IN (1 << 8) /* reject 'in' token (used for for-in) */ +#define DUK__EXPR_FLAG_ALLOW_EMPTY (1 << 9) /* allow empty expression */ +#define DUK__EXPR_FLAG_REQUIRE_INIT (1 << 10) /* require initializer for var/const */ /* main expression parser function */ DUK_LOCAL void duk__expr(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags) { duk_hthread *thr = comp_ctx->thr; - duk_ivalue tmp_alloc; /* 'res' is used for "left", and 'tmp' for "right" */ + duk_ivalue tmp_alloc; /* 'res' is used for "left", and 'tmp' for "right" */ duk_ivalue *tmp = &tmp_alloc; duk_small_uint_t rbp; @@ -72677,7 +73962,9 @@ DUK_LOCAL void duk__expr(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_ rbp = rbp_flags & DUK__EXPR_RBP_MASK; DUK_DDD(DUK_DDDPRINT("duk__expr(), rbp_flags=%ld, rbp=%ld, allow_in=%ld, paren_level=%ld", - (long) rbp_flags, (long) rbp, (long) comp_ctx->curr_func.allow_in, + (long) rbp_flags, + (long) rbp, + (long) comp_ctx->curr_func.allow_in, (long) comp_ctx->curr_func.paren_level)); duk_memzero(&tmp_alloc, sizeof(tmp_alloc)); @@ -72708,14 +73995,14 @@ DUK_LOCAL void duk__expr(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_ } duk__advance(comp_ctx); - duk__expr_nud(comp_ctx, res); /* reuse 'res' as 'left' */ + duk__expr_nud(comp_ctx, res); /* reuse 'res' as 'left' */ while (rbp < duk__expr_lbp(comp_ctx)) { duk__advance(comp_ctx); duk__expr_led(comp_ctx, res, tmp); - duk__copy_ivalue(comp_ctx, tmp, res); /* tmp -> res */ + duk__copy_ivalue(comp_ctx, tmp, res); /* tmp -> res */ } - cleanup: +cleanup: /* final result is already in 'res' */ duk_pop_2(thr); @@ -72749,21 +74036,24 @@ DUK_LOCAL void duk__exprtop(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_sma * Each helper needs at least 2-3 calls to make it worth while to wrap. */ -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL duk_regconst_t duk__expr_toreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags) { duk__expr(comp_ctx, res, rbp_flags); return duk__ivalue_toreg(comp_ctx, res); } #endif -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL duk_regconst_t duk__expr_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags) { duk__expr(comp_ctx, res, rbp_flags); return duk__ivalue_totemp(comp_ctx, res); } #endif -DUK_LOCAL void duk__expr_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags, duk_regconst_t forced_reg) { +DUK_LOCAL void duk__expr_toforcedreg(duk_compiler_ctx *comp_ctx, + duk_ivalue *res, + duk_small_uint_t rbp_flags, + duk_regconst_t forced_reg) { DUK_ASSERT(forced_reg >= 0); duk__expr(comp_ctx, res, rbp_flags); duk__ivalue_toforcedreg(comp_ctx, res, forced_reg); @@ -72774,7 +74064,7 @@ DUK_LOCAL duk_regconst_t duk__expr_toregconst(duk_compiler_ctx *comp_ctx, duk_iv return duk__ivalue_toregconst(comp_ctx, res); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL duk_regconst_t duk__expr_totempconst(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags) { duk__expr(comp_ctx, res, rbp_flags); return duk__ivalue_totempconst(comp_ctx, res); @@ -72796,14 +74086,17 @@ DUK_LOCAL duk_regconst_t duk__exprtop_toreg(duk_compiler_ctx *comp_ctx, duk_ival return duk__ivalue_toreg(comp_ctx, res); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL duk_regconst_t duk__exprtop_totemp(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags) { duk__exprtop(comp_ctx, res, rbp_flags); return duk__ivalue_totemp(comp_ctx, res); } #endif -DUK_LOCAL void duk__exprtop_toforcedreg(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t rbp_flags, duk_regconst_t forced_reg) { +DUK_LOCAL void duk__exprtop_toforcedreg(duk_compiler_ctx *comp_ctx, + duk_ivalue *res, + duk_small_uint_t rbp_flags, + duk_regconst_t forced_reg) { DUK_ASSERT(forced_reg >= 0); duk__exprtop(comp_ctx, res, rbp_flags); duk__ivalue_toforcedreg(comp_ctx, res, forced_reg); @@ -72814,7 +74107,7 @@ DUK_LOCAL duk_regconst_t duk__exprtop_toregconst(duk_compiler_ctx *comp_ctx, duk return duk__ivalue_toregconst(comp_ctx, res); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL void duk__exprtop_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalue *res, int rbp_flags) { duk__exprtop(comp_ctx, res, rbp_flags); duk__ivalue_toplain_ignore(comp_ctx, res); @@ -72833,11 +74126,11 @@ DUK_LOCAL void duk__exprtop_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalu * the token after the terminator). */ -#define DUK__HAS_VAL (1 << 0) /* stmt has non-empty value */ -#define DUK__HAS_TERM (1 << 1) /* stmt has explicit/implicit semicolon terminator */ -#define DUK__ALLOW_AUTO_SEMI_ALWAYS (1 << 2) /* allow automatic semicolon even without lineterm (compatibility) */ -#define DUK__STILL_PROLOGUE (1 << 3) /* statement does not terminate directive prologue */ -#define DUK__IS_TERMINAL (1 << 4) /* statement is guaranteed to be terminal (control doesn't flow to next statement) */ +#define DUK__HAS_VAL (1 << 0) /* stmt has non-empty value */ +#define DUK__HAS_TERM (1 << 1) /* stmt has explicit/implicit semicolon terminator */ +#define DUK__ALLOW_AUTO_SEMI_ALWAYS (1 << 2) /* allow automatic semicolon even without lineterm (compatibility) */ +#define DUK__STILL_PROLOGUE (1 << 3) /* statement does not terminate directive prologue */ +#define DUK__IS_TERMINAL (1 << 4) /* statement is guaranteed to be terminal (control doesn't flow to next statement) */ /* Parse a single variable declaration (e.g. "i" or "i=10"). A leading 'var' * has already been eaten. These is no return value in 'res', it is used only @@ -72857,7 +74150,11 @@ DUK_LOCAL void duk__exprtop_toplain_ignore(duk_compiler_ctx *comp_ctx, duk_ivalu * as is done in 'for-in' parsing. */ -DUK_LOCAL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_small_uint_t expr_flags, duk_regconst_t *out_reg_varbind, duk_regconst_t *out_rc_varname) { +DUK_LOCAL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, + duk_ivalue *res, + duk_small_uint_t expr_flags, + duk_regconst_t *out_reg_varbind, + duk_regconst_t *out_rc_varname) { duk_hthread *thr = comp_ctx->thr; duk_hstring *h_varname; duk_regconst_t reg_varbind; @@ -72881,8 +74178,7 @@ DUK_LOCAL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, duk_ivalue *res, /* register declarations in first pass */ if (comp_ctx->curr_func.in_scanning) { duk_uarridx_t n; - DUK_DDD(DUK_DDDPRINT("register variable declaration %!O in pass 1", - (duk_heaphdr *) h_varname)); + DUK_DDD(DUK_DDDPRINT("register variable declaration %!O in pass 1", (duk_heaphdr *) h_varname)); n = (duk_uarridx_t) duk_get_length(thr, comp_ctx->curr_func.decls_idx); duk_push_hstring(thr, h_varname); duk_put_prop_index(thr, comp_ctx->curr_func.decls_idx, n); @@ -72890,31 +74186,30 @@ DUK_LOCAL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_put_prop_index(thr, comp_ctx->curr_func.decls_idx, n + 1); } - duk_push_hstring(thr, h_varname); /* push before advancing to keep reachable */ + duk_push_hstring(thr, h_varname); /* push before advancing to keep reachable */ /* register binding lookup is based on varmap (even in first pass) */ duk_dup_top(thr); (void) duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname); - duk__advance(comp_ctx); /* eat identifier */ + duk__advance(comp_ctx); /* eat identifier */ if (comp_ctx->curr_token.t == DUK_TOK_EQUALSIGN) { duk__advance(comp_ctx); DUK_DDD(DUK_DDDPRINT("vardecl, assign to '%!O' -> reg_varbind=%ld, rc_varname=%ld", - (duk_heaphdr *) h_varname, (long) reg_varbind, (long) rc_varname)); + (duk_heaphdr *) h_varname, + (long) reg_varbind, + (long) rc_varname)); - duk__exprtop(comp_ctx, res, DUK__BP_COMMA | expr_flags /*rbp_flags*/); /* AssignmentExpression */ + duk__exprtop(comp_ctx, res, DUK__BP_COMMA | expr_flags /*rbp_flags*/); /* AssignmentExpression */ if (reg_varbind >= 0) { duk__ivalue_toforcedreg(comp_ctx, res, reg_varbind); } else { duk_regconst_t reg_val; reg_val = duk__ivalue_toreg(comp_ctx, res); - duk__emit_a_bc(comp_ctx, - DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, - reg_val, - rc_varname); + duk__emit_a_bc(comp_ctx, DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, reg_val, rc_varname); } } else { if (expr_flags & DUK__EXPR_FLAG_REQUIRE_INIT) { @@ -72923,14 +74218,14 @@ DUK_LOCAL void duk__parse_var_decl(duk_compiler_ctx *comp_ctx, duk_ivalue *res, } } - duk_pop(thr); /* pop varname */ + duk_pop(thr); /* pop varname */ *out_rc_varname = rc_varname; *out_reg_varbind = reg_varbind; return; - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_VAR_DECLARATION); DUK_WO_NORETURN(return;); } @@ -72939,7 +74234,7 @@ DUK_LOCAL void duk__parse_var_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_regconst_t reg_varbind; duk_regconst_t rc_varname; - duk__advance(comp_ctx); /* eat 'var' */ + duk__advance(comp_ctx); /* eat 'var' */ for (;;) { /* rc_varname and reg_varbind are ignored here */ @@ -72954,9 +74249,9 @@ DUK_LOCAL void duk__parse_var_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site) { duk_hthread *thr = comp_ctx->thr; - duk_int_t pc_v34_lhs; /* start variant 3/4 left-hand-side code (L1 in doc/compiler.rst example) */ - duk_regconst_t temp_reset; /* knock back "next temp" to this whenever possible */ - duk_regconst_t reg_temps; /* preallocated temporaries (2) for variants 3 and 4 */ + duk_int_t pc_v34_lhs; /* start variant 3/4 left-hand-side code (L1 in doc/compiler.rst example) */ + duk_regconst_t temp_reset; /* knock back "next temp" to this whenever possible */ + duk_regconst_t reg_temps; /* preallocated temporaries (2) for variants 3 and 4 */ DUK_DDD(DUK_DDDPRINT("start parsing a for/for-in statement")); @@ -72985,7 +74280,7 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, * issues, evaluation order issues, etc. */ - duk__advance(comp_ctx); /* eat 'for' */ + duk__advance(comp_ctx); /* eat 'for' */ duk__advance_expect(comp_ctx, DUK_TOK_LPAREN); DUK_DDD(DUK_DDDPRINT("detecting for/for-in loop variant, pc=%ld", (long) duk__get_current_pc(comp_ctx))); @@ -72999,10 +74294,10 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, * Variant 2 or 4 */ - duk_regconst_t reg_varbind; /* variable binding register if register-bound (otherwise < 0) */ - duk_regconst_t rc_varname; /* variable name reg/const, if variable not register-bound */ + duk_regconst_t reg_varbind; /* variable binding register if register-bound (otherwise < 0) */ + duk_regconst_t rc_varname; /* variable name reg/const, if variable not register-bound */ - duk__advance(comp_ctx); /* eat 'var' */ + duk__advance(comp_ctx); /* eat 'var' */ duk__parse_var_decl(comp_ctx, res, DUK__EXPR_FLAG_REJECT_IN, ®_varbind, &rc_varname); DUK__SETTEMP(comp_ctx, temp_reset); @@ -73012,17 +74307,11 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, */ DUK_DDD(DUK_DDDPRINT("detected for variant 4: for (var VariableDeclarationNoIn in Expression) Statement")); - pc_v34_lhs = duk__get_current_pc(comp_ctx); /* jump is inserted here */ + pc_v34_lhs = duk__get_current_pc(comp_ctx); /* jump is inserted here */ if (reg_varbind >= 0) { - duk__emit_a_bc(comp_ctx, - DUK_OP_LDREG, - reg_varbind, - reg_temps + 0); + duk__emit_a_bc(comp_ctx, DUK_OP_LDREG, reg_varbind, reg_temps + 0); } else { - duk__emit_a_bc(comp_ctx, - DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, - reg_temps + 0, - rc_varname); + duk__emit_a_bc(comp_ctx, DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, reg_temps + 0, rc_varname); } goto parse_3_or_4; } else { @@ -73030,7 +74319,8 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, * Variant 2 */ - DUK_DDD(DUK_DDDPRINT("detected for variant 2: for (var VariableDeclarationNoIn; Expression_opt; Expression_opt) Statement")); + DUK_DDD(DUK_DDDPRINT( + "detected for variant 2: for (var VariableDeclarationNoIn; Expression_opt; Expression_opt) Statement")); for (;;) { /* more initializers */ if (comp_ctx->curr_token.t != DUK_TOK_COMMA) { @@ -73038,7 +74328,7 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, } DUK_DDD(DUK_DDDPRINT("variant 2 has another variable initializer")); - duk__advance(comp_ctx); /* eat comma */ + duk__advance(comp_ctx); /* eat comma */ duk__parse_var_decl(comp_ctx, res, DUK__EXPR_FLAG_REJECT_IN, ®_varbind, &rc_varname); } goto parse_1_or_2; @@ -73048,14 +74338,17 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, * Variant 1 or 3 */ - pc_v34_lhs = duk__get_current_pc(comp_ctx); /* jump is inserted here (variant 3) */ + pc_v34_lhs = duk__get_current_pc(comp_ctx); /* jump is inserted here (variant 3) */ /* Note that duk__exprtop() here can clobber any reg above current temp_next, * so any loop variables (e.g. enumerator) must be "preallocated". */ /* don't coerce yet to a plain value (variant 3 needs special handling) */ - duk__exprtop(comp_ctx, res, DUK__BP_FOR_EXPR | DUK__EXPR_FLAG_REJECT_IN | DUK__EXPR_FLAG_ALLOW_EMPTY /*rbp_flags*/); /* Expression */ + duk__exprtop(comp_ctx, + res, + DUK__BP_FOR_EXPR | DUK__EXPR_FLAG_REJECT_IN | + DUK__EXPR_FLAG_ALLOW_EMPTY /*rbp_flags*/); /* Expression */ if (comp_ctx->curr_token.t == DUK_TOK_IN) { /* * Variant 3 @@ -73064,7 +74357,7 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, /* XXX: need to determine LHS type, and check that it is LHS compatible */ DUK_DDD(DUK_DDDPRINT("detected for variant 3: for (LeftHandSideExpression in Expression) Statement")); if (duk__expr_is_empty(comp_ctx)) { - goto syntax_error; /* LeftHandSideExpression does not allow empty expression */ + goto syntax_error; /* LeftHandSideExpression does not allow empty expression */ } if (res->t == DUK_IVAL_VAR) { @@ -73073,10 +74366,7 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_dup(thr, res->x1.valstack_idx); if (duk__lookup_lhs(comp_ctx, ®_varbind, &rc_varname)) { - duk__emit_a_bc(comp_ctx, - DUK_OP_LDREG, - reg_varbind, - reg_temps + 0); + duk__emit_a_bc(comp_ctx, DUK_OP_LDREG, reg_varbind, reg_temps + 0); } else { duk__emit_a_bc(comp_ctx, DUK_OP_PUTVAR | DUK__EMIT_FLAG_A_IS_SOURCE, @@ -73089,17 +74379,22 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, */ duk_regconst_t reg_obj; duk_regconst_t rc_key; - reg_obj = duk__ispec_toregconst_raw(comp_ctx, &res->x1, -1 /*forced_reg*/, 0 /*flags*/); /* don't allow const */ - rc_key = duk__ispec_toregconst_raw(comp_ctx, &res->x2, -1 /*forced_reg*/, DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); + reg_obj = duk__ispec_toregconst_raw(comp_ctx, + &res->x1, + -1 /*forced_reg*/, + 0 /*flags*/); /* don't allow const */ + rc_key = duk__ispec_toregconst_raw(comp_ctx, + &res->x2, + -1 /*forced_reg*/, + DUK__IVAL_FLAG_ALLOW_CONST /*flags*/); duk__emit_a_b_c(comp_ctx, DUK_OP_PUTPROP | DUK__EMIT_FLAG_A_IS_SOURCE | DUK__EMIT_FLAG_BC_REGCONST, reg_obj, rc_key, reg_temps + 0); } else { - duk__ivalue_toplain_ignore(comp_ctx, res); /* just in case */ - duk__emit_op_only(comp_ctx, - DUK_OP_INVLHS); + duk__ivalue_toplain_ignore(comp_ctx, res); /* just in case */ + duk__emit_op_only(comp_ctx, DUK_OP_INVLHS); } goto parse_3_or_4; } else { @@ -73107,13 +74402,14 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, * Variant 1 */ - DUK_DDD(DUK_DDDPRINT("detected for variant 1: for (ExpressionNoIn_opt; Expression_opt; Expression_opt) Statement")); + DUK_DDD(DUK_DDDPRINT( + "detected for variant 1: for (ExpressionNoIn_opt; Expression_opt; Expression_opt) Statement")); duk__ivalue_toplain_ignore(comp_ctx, res); goto parse_1_or_2; } } - parse_1_or_2: +parse_1_or_2: /* * Parse variant 1 or 2. The first part expression (which differs * in the variants) has already been parsed and its code emitted. @@ -73136,23 +74432,23 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk__advance_expect(comp_ctx, DUK_TOK_SEMICOLON); pc_l1 = duk__get_current_pc(comp_ctx); - duk__exprtop(comp_ctx, res, DUK__BP_FOR_EXPR | DUK__EXPR_FLAG_ALLOW_EMPTY /*rbp_flags*/); /* Expression_opt */ + duk__exprtop(comp_ctx, res, DUK__BP_FOR_EXPR | DUK__EXPR_FLAG_ALLOW_EMPTY /*rbp_flags*/); /* Expression_opt */ if (duk__expr_is_empty(comp_ctx)) { /* no need to coerce */ - pc_jumpto_l3 = duk__emit_jump_empty(comp_ctx); /* to body */ - pc_jumpto_l4 = -1; /* omitted */ + pc_jumpto_l3 = duk__emit_jump_empty(comp_ctx); /* to body */ + pc_jumpto_l4 = -1; /* omitted */ } else { rc_cond = duk__ivalue_toregconst(comp_ctx, res); duk__emit_if_false_skip(comp_ctx, rc_cond); - pc_jumpto_l3 = duk__emit_jump_empty(comp_ctx); /* to body */ - pc_jumpto_l4 = duk__emit_jump_empty(comp_ctx); /* to exit */ + pc_jumpto_l3 = duk__emit_jump_empty(comp_ctx); /* to body */ + pc_jumpto_l4 = duk__emit_jump_empty(comp_ctx); /* to exit */ } DUK__SETTEMP(comp_ctx, temp_reset); duk__advance_expect(comp_ctx, DUK_TOK_SEMICOLON); pc_l2 = duk__get_current_pc(comp_ctx); - duk__exprtop(comp_ctx, res, DUK__BP_FOR_EXPR | DUK__EXPR_FLAG_ALLOW_EMPTY /*rbp_flags*/); /* Expression_opt */ + duk__exprtop(comp_ctx, res, DUK__BP_FOR_EXPR | DUK__EXPR_FLAG_ALLOW_EMPTY /*rbp_flags*/); /* Expression_opt */ if (duk__expr_is_empty(comp_ctx)) { /* no need to coerce */ expr_c_empty = 1; @@ -73165,7 +74461,7 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, DUK__SETTEMP(comp_ctx, temp_reset); comp_ctx->curr_func.allow_regexp_in_adv = 1; - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ pc_l3 = duk__get_current_pc(comp_ctx); duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); @@ -73180,21 +74476,23 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, DUK_DDD(DUK_DDDPRINT("patching jumps: jumpto_l3: %ld->%ld, jumpto_l4: %ld->%ld, " "break: %ld->%ld, continue: %ld->%ld", - (long) pc_jumpto_l3, (long) pc_l3, (long) pc_jumpto_l4, (long) pc_l4, - (long) (pc_label_site + 1), (long) pc_l4, (long) (pc_label_site + 2), (long) pc_l2)); + (long) pc_jumpto_l3, + (long) pc_l3, + (long) pc_jumpto_l4, + (long) pc_l4, + (long) (pc_label_site + 1), + (long) pc_l4, + (long) (pc_label_site + 2), + (long) pc_l2)); duk__patch_jump(comp_ctx, pc_jumpto_l3, pc_l3); duk__patch_jump(comp_ctx, pc_jumpto_l4, pc_l4); - duk__patch_jump(comp_ctx, - pc_label_site + 1, - pc_l4); /* break jump */ - duk__patch_jump(comp_ctx, - pc_label_site + 2, - expr_c_empty ? pc_l1 : pc_l2); /* continue jump */ + duk__patch_jump(comp_ctx, pc_label_site + 1, pc_l4); /* break jump */ + duk__patch_jump(comp_ctx, pc_label_site + 2, expr_c_empty ? pc_l1 : pc_l2); /* continue jump */ } goto finished; - parse_3_or_4: +parse_3_or_4: /* * Parse variant 3 or 4. * @@ -73230,16 +74528,16 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, */ duk__insert_jump_entry(comp_ctx, pc_v34_lhs); - pc_jumpto_l2 = pc_v34_lhs; /* inserted jump */ - pc_l1 = pc_v34_lhs + 1; /* +1, right after inserted jump */ + pc_jumpto_l2 = pc_v34_lhs; /* inserted jump */ + pc_l1 = pc_v34_lhs + 1; /* +1, right after inserted jump */ /* The code for writing reg_temps + 0 to the left hand side has already * been emitted. */ - pc_jumpto_l3 = duk__emit_jump_empty(comp_ctx); /* -> loop body */ + pc_jumpto_l3 = duk__emit_jump_empty(comp_ctx); /* -> loop body */ - duk__advance(comp_ctx); /* eat 'in' */ + duk__advance(comp_ctx); /* eat 'in' */ /* Parse enumeration target and initialize enumerator. For 'null' and 'undefined', * INITENUM will creates a 'null' enumerator which works like an empty enumerator @@ -73248,16 +74546,13 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, */ pc_l2 = duk__get_current_pc(comp_ctx); - reg_target = duk__exprtop_toreg(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); /* Expression */ - duk__emit_b_c(comp_ctx, - DUK_OP_INITENUM | DUK__EMIT_FLAG_B_IS_TARGET, - reg_temps + 1, - reg_target); + reg_target = duk__exprtop_toreg(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); /* Expression */ + duk__emit_b_c(comp_ctx, DUK_OP_INITENUM | DUK__EMIT_FLAG_B_IS_TARGET, reg_temps + 1, reg_target); pc_jumpto_l4 = duk__emit_jump_empty(comp_ctx); DUK__SETTEMP(comp_ctx, temp_reset); comp_ctx->curr_func.allow_regexp_in_adv = 1; - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ pc_l3 = duk__get_current_pc(comp_ctx); duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); @@ -73274,8 +74569,8 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, DUK_OP_NEXTENUM | DUK__EMIT_FLAG_B_IS_TARGET | DUK__EMIT_FLAG_RESERVE_JUMPSLOT, reg_temps + 0, reg_temps + 1); - pc_jumpto_l5 = comp_ctx->emit_jumpslot_pc; /* NEXTENUM jump slot: executed when enum finished */ - duk__emit_jump(comp_ctx, pc_l1); /* jump to next loop, using reg_v34_iter as iterated value */ + pc_jumpto_l5 = comp_ctx->emit_jumpslot_pc; /* NEXTENUM jump slot: executed when enum finished */ + duk__emit_jump(comp_ctx, pc_l1); /* jump to next loop, using reg_v34_iter as iterated value */ pc_l5 = duk__get_current_pc(comp_ctx); @@ -73287,24 +74582,33 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, DUK_DDD(DUK_DDDPRINT("patching jumps: jumpto_l2: %ld->%ld, jumpto_l3: %ld->%ld, " "jumpto_l4: %ld->%ld, jumpto_l5: %ld->%ld, " "break: %ld->%ld, continue: %ld->%ld", - (long) pc_jumpto_l2, (long) pc_l2, (long) pc_jumpto_l3, (long) pc_l3, - (long) pc_jumpto_l4, (long) pc_l4, (long) pc_jumpto_l5, (long) pc_l5, - (long) (pc_label_site + 1), (long) pc_l5, (long) (pc_label_site + 2), (long) pc_l4)); + (long) pc_jumpto_l2, + (long) pc_l2, + (long) pc_jumpto_l3, + (long) pc_l3, + (long) pc_jumpto_l4, + (long) pc_l4, + (long) pc_jumpto_l5, + (long) pc_l5, + (long) (pc_label_site + 1), + (long) pc_l5, + (long) (pc_label_site + 2), + (long) pc_l4)); duk__patch_jump(comp_ctx, pc_jumpto_l2, pc_l2); duk__patch_jump(comp_ctx, pc_jumpto_l3, pc_l3); duk__patch_jump(comp_ctx, pc_jumpto_l4, pc_l4); duk__patch_jump(comp_ctx, pc_jumpto_l5, pc_l5); - duk__patch_jump(comp_ctx, pc_label_site + 1, pc_l5); /* break jump */ - duk__patch_jump(comp_ctx, pc_label_site + 2, pc_l4); /* continue jump */ + duk__patch_jump(comp_ctx, pc_label_site + 1, pc_l5); /* break jump */ + duk__patch_jump(comp_ctx, pc_label_site + 2, pc_l4); /* continue jump */ } goto finished; - finished: +finished: DUK_DDD(DUK_DDDPRINT("end parsing a for/for-in statement")); return; - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_FOR); DUK_WO_NORETURN(return;); } @@ -73312,12 +74616,12 @@ DUK_LOCAL void duk__parse_for_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_int_t pc_label_site) { duk_hthread *thr = comp_ctx->thr; duk_regconst_t temp_at_loop; - duk_regconst_t rc_switch; /* reg/const for switch value */ - duk_regconst_t rc_case; /* reg/const for case value */ - duk_regconst_t reg_temp; /* general temp register */ + duk_regconst_t rc_switch; /* reg/const for switch value */ + duk_regconst_t rc_case; /* reg/const for case value */ + duk_regconst_t reg_temp; /* general temp register */ duk_int_t pc_prevcase = -1; duk_int_t pc_prevstmt = -1; - duk_int_t pc_default = -1; /* -1 == not set, -2 == pending (next statement list) */ + duk_int_t pc_default = -1; /* -1 == not set, -2 == pending (next statement list) */ /* Note: negative pc values are ignored when patching jumps, so no explicit checks needed */ @@ -73348,7 +74652,7 @@ DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re duk__advance(comp_ctx); duk__advance_expect(comp_ctx, DUK_TOK_LPAREN); rc_switch = duk__exprtop_toregconst(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* RegExp mode does not matter. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* RegExp mode does not matter. */ duk__advance_expect(comp_ctx, DUK_TOK_LCURLY); DUK_DDD(DUK_DDDPRINT("switch value in register %ld", (long) rc_switch)); @@ -73378,24 +74682,20 @@ DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re * because it may be a constant. */ - duk__patch_jump_here(comp_ctx, pc_prevcase); /* chain jumps for case - * evaluation and checking - */ + duk__patch_jump_here(comp_ctx, pc_prevcase); /* chain jumps for case + * evaluation and checking + */ duk__advance(comp_ctx); rc_case = duk__exprtop_toregconst(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); duk__advance_expect(comp_ctx, DUK_TOK_COLON); reg_temp = DUK__ALLOCTEMP(comp_ctx); - duk__emit_a_b_c(comp_ctx, - DUK_OP_SEQ | DUK__EMIT_FLAG_BC_REGCONST, - reg_temp, - rc_switch, - rc_case); + duk__emit_a_b_c(comp_ctx, DUK_OP_SEQ | DUK__EMIT_FLAG_BC_REGCONST, reg_temp, rc_switch, rc_case); duk__emit_if_true_skip(comp_ctx, reg_temp); /* jump to next case clause */ - pc_prevcase = duk__emit_jump_empty(comp_ctx); /* no match, next case */ + pc_prevcase = duk__emit_jump_empty(comp_ctx); /* no match, next case */ /* statements go here (if any) on next loop */ } else if (comp_ctx->curr_token.t == DUK_TOK_DEFAULT) { @@ -73444,14 +74744,13 @@ DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re * they participate in 'fall-through' behavior even if the * default clause is in the middle. */ - duk__patch_jump_here(comp_ctx, pc_prevstmt); /* chain jumps for 'fall-through' - * after a case matches. - */ + duk__patch_jump_here(comp_ctx, pc_prevstmt); /* chain jumps for 'fall-through' + * after a case matches. + */ for (;;) { tok = comp_ctx->curr_token.t; - if (tok == DUK_TOK_CASE || tok == DUK_TOK_DEFAULT || - tok == DUK_TOK_RCURLY) { + if (tok == DUK_TOK_CASE || tok == DUK_TOK_DEFAULT || tok == DUK_TOK_RCURLY) { break; } num_stmts++; @@ -73474,7 +74773,7 @@ DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re DUK_ASSERT(comp_ctx->curr_token.t == DUK_TOK_RCURLY); comp_ctx->curr_func.allow_regexp_in_adv = 1; - duk__advance(comp_ctx); /* Allow RegExp as part of next stmt. */ + duk__advance(comp_ctx); /* Allow RegExp as part of next stmt. */ /* default case control flow patchup; note that if pc_prevcase < 0 * (i.e. no case clauses), control enters default case automatically. @@ -73495,7 +74794,7 @@ DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re duk__patch_jump_here(comp_ctx, pc_prevstmt); /* continue jump not patched, an INVALID opcode remains there */ - duk__patch_jump_here(comp_ctx, pc_label_site + 1); /* break jump */ + duk__patch_jump_here(comp_ctx, pc_label_site + 1); /* break jump */ /* Note: 'fast' breaks will jump to pc_label_site + 1, which will * then jump here. The double jump will be eliminated by a @@ -73505,7 +74804,7 @@ DUK_LOCAL void duk__parse_switch_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re return; - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_SWITCH); DUK_WO_NORETURN(return;); } @@ -73519,16 +74818,16 @@ DUK_LOCAL void duk__parse_if_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { temp_reset = DUK__GETTEMP(comp_ctx); - duk__advance(comp_ctx); /* eat 'if' */ + duk__advance(comp_ctx); /* eat 'if' */ duk__advance_expect(comp_ctx, DUK_TOK_LPAREN); rc_cond = duk__exprtop_toregconst(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); duk__emit_if_true_skip(comp_ctx, rc_cond); - pc_jump_false = duk__emit_jump_empty(comp_ctx); /* jump to end or else part */ + pc_jump_false = duk__emit_jump_empty(comp_ctx); /* jump to end or else part */ DUK__SETTEMP(comp_ctx, temp_reset); comp_ctx->curr_func.allow_regexp_in_adv = 1; - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); @@ -73543,7 +74842,7 @@ DUK_LOCAL void duk__parse_if_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk__advance(comp_ctx); - pc_jump_end = duk__emit_jump_empty(comp_ctx); /* jump from true part to end */ + pc_jump_end = duk__emit_jump_empty(comp_ctx); /* jump from true part to end */ duk__patch_jump_here(comp_ctx, pc_jump_false); duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); @@ -73564,11 +74863,11 @@ DUK_LOCAL void duk__parse_do_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, d DUK_DDD(DUK_DDDPRINT("begin parsing do statement")); - duk__advance(comp_ctx); /* Eat 'do'; allow RegExp as part of next stmt. */ + duk__advance(comp_ctx); /* Eat 'do'; allow RegExp as part of next stmt. */ pc_start = duk__get_current_pc(comp_ctx); duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); - duk__patch_jump_here(comp_ctx, pc_label_site + 2); /* continue jump */ + duk__patch_jump_here(comp_ctx, pc_label_site + 2); /* continue jump */ duk__advance_expect(comp_ctx, DUK_TOK_WHILE); duk__advance_expect(comp_ctx, DUK_TOK_LPAREN); @@ -73578,10 +74877,10 @@ DUK_LOCAL void duk__parse_do_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, d duk__emit_jump(comp_ctx, pc_start); /* no need to reset temps, as we're finished emitting code */ - comp_ctx->curr_func.allow_regexp_in_adv = 1; /* Allow RegExp as part of next stmt. */ + comp_ctx->curr_func.allow_regexp_in_adv = 1; /* Allow RegExp as part of next stmt. */ duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); - duk__patch_jump_here(comp_ctx, pc_label_site + 1); /* break jump */ + duk__patch_jump_here(comp_ctx, pc_label_site + 1); /* break jump */ DUK_DDD(DUK_DDDPRINT("end parsing do statement")); } @@ -73596,12 +74895,12 @@ DUK_LOCAL void duk__parse_while_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res temp_reset = DUK__GETTEMP(comp_ctx); - duk__advance(comp_ctx); /* eat 'while' */ + duk__advance(comp_ctx); /* eat 'while' */ duk__advance_expect(comp_ctx, DUK_TOK_LPAREN); pc_start = duk__get_current_pc(comp_ctx); - duk__patch_jump_here(comp_ctx, pc_label_site + 2); /* continue jump */ + duk__patch_jump_here(comp_ctx, pc_label_site + 2); /* continue jump */ rc_cond = duk__exprtop_toregconst(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); duk__emit_if_true_skip(comp_ctx, rc_cond); @@ -73609,13 +74908,13 @@ DUK_LOCAL void duk__parse_while_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res DUK__SETTEMP(comp_ctx, temp_reset); comp_ctx->curr_func.allow_regexp_in_adv = 1; - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); duk__emit_jump(comp_ctx, pc_start); duk__patch_jump_here(comp_ctx, pc_jump_false); - duk__patch_jump_here(comp_ctx, pc_label_site + 1); /* break jump */ + duk__patch_jump_here(comp_ctx, pc_label_site + 1); /* break jump */ DUK_DDD(DUK_DDDPRINT("end parsing while statement")); } @@ -73625,23 +74924,35 @@ DUK_LOCAL void duk__parse_break_or_continue_stmt(duk_compiler_ctx *comp_ctx, duk duk_bool_t is_break = (comp_ctx->curr_token.t == DUK_TOK_BREAK); duk_int_t label_id; duk_int_t label_catch_depth; - duk_int_t label_pc; /* points to LABEL; pc+1 = jump site for break; pc+2 = jump site for continue */ + duk_int_t label_pc; /* points to LABEL; pc+1 = jump site for break; pc+2 = jump site for continue */ duk_bool_t label_is_closest; DUK_UNREF(res); - duk__advance(comp_ctx); /* eat 'break' or 'continue' */ + duk__advance(comp_ctx); /* eat 'break' or 'continue' */ - if (comp_ctx->curr_token.t == DUK_TOK_SEMICOLON || /* explicit semi follows */ - comp_ctx->curr_token.lineterm || /* automatic semi will be inserted */ - comp_ctx->curr_token.allow_auto_semi) { /* automatic semi will be inserted */ + if (comp_ctx->curr_token.t == DUK_TOK_SEMICOLON || /* explicit semi follows */ + comp_ctx->curr_token.lineterm || /* automatic semi will be inserted */ + comp_ctx->curr_token.allow_auto_semi) { /* automatic semi will be inserted */ /* break/continue without label */ - duk__lookup_active_label(comp_ctx, DUK_HTHREAD_STRING_EMPTY_STRING(thr), is_break, &label_id, &label_catch_depth, &label_pc, &label_is_closest); + duk__lookup_active_label(comp_ctx, + DUK_HTHREAD_STRING_EMPTY_STRING(thr), + is_break, + &label_id, + &label_catch_depth, + &label_pc, + &label_is_closest); } else if (comp_ctx->curr_token.t == DUK_TOK_IDENTIFIER) { /* break/continue with label (label cannot be a reserved word, production is 'Identifier' */ DUK_ASSERT(comp_ctx->curr_token.str1 != NULL); - duk__lookup_active_label(comp_ctx, comp_ctx->curr_token.str1, is_break, &label_id, &label_catch_depth, &label_pc, &label_is_closest); + duk__lookup_active_label(comp_ctx, + comp_ctx->curr_token.str1, + is_break, + &label_id, + &label_catch_depth, + &label_pc, + &label_is_closest); duk__advance(comp_ctx); } else { DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_BREAK_CONT_LABEL); @@ -73654,25 +74965,28 @@ DUK_LOCAL void duk__parse_break_or_continue_stmt(duk_compiler_ctx *comp_ctx, duk * The peephole optimizer will optimize the jump to a direct one. */ - if (label_catch_depth == comp_ctx->curr_func.catch_depth && - label_is_closest) { + if (label_catch_depth == comp_ctx->curr_func.catch_depth && label_is_closest) { DUK_DDD(DUK_DDDPRINT("break/continue: is_break=%ld, label_id=%ld, label_is_closest=%ld, " "label_catch_depth=%ld, catch_depth=%ld " "-> use fast variant (direct jump)", - (long) is_break, (long) label_id, (long) label_is_closest, - (long) label_catch_depth, (long) comp_ctx->curr_func.catch_depth)); + (long) is_break, + (long) label_id, + (long) label_is_closest, + (long) label_catch_depth, + (long) comp_ctx->curr_func.catch_depth)); duk__emit_jump(comp_ctx, label_pc + (is_break ? 1 : 2)); } else { DUK_DDD(DUK_DDDPRINT("break/continue: is_break=%ld, label_id=%ld, label_is_closest=%ld, " "label_catch_depth=%ld, catch_depth=%ld " "-> use slow variant (longjmp)", - (long) is_break, (long) label_id, (long) label_is_closest, - (long) label_catch_depth, (long) comp_ctx->curr_func.catch_depth)); + (long) is_break, + (long) label_id, + (long) label_is_closest, + (long) label_catch_depth, + (long) comp_ctx->curr_func.catch_depth)); - duk__emit_bc(comp_ctx, - is_break ? DUK_OP_BREAK : DUK_OP_CONTINUE, - (duk_regconst_t) label_id); + duk__emit_bc(comp_ctx, is_break ? DUK_OP_BREAK : DUK_OP_CONTINUE, (duk_regconst_t) label_id); } } @@ -73680,7 +74994,7 @@ DUK_LOCAL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re duk_hthread *thr = comp_ctx->thr; duk_regconst_t rc_val; - duk__advance(comp_ctx); /* eat 'return' */ + duk__advance(comp_ctx); /* eat 'return' */ /* A 'return' statement is only allowed inside an actual function body, * not as part of eval or global code. @@ -73690,9 +75004,9 @@ DUK_LOCAL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re DUK_WO_NORETURN(return;); } - if (comp_ctx->curr_token.t == DUK_TOK_SEMICOLON || /* explicit semi follows */ - comp_ctx->curr_token.lineterm || /* automatic semi will be inserted */ - comp_ctx->curr_token.allow_auto_semi) { /* automatic semi will be inserted */ + if (comp_ctx->curr_token.t == DUK_TOK_SEMICOLON || /* explicit semi follows */ + comp_ctx->curr_token.lineterm || /* automatic semi will be inserted */ + comp_ctx->curr_token.allow_auto_semi) { /* automatic semi will be inserted */ DUK_DDD(DUK_DDDPRINT("empty return value -> undefined")); duk__emit_op_only(comp_ctx, DUK_OP_RETUNDEF); } else { @@ -73744,8 +75058,8 @@ DUK_LOCAL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re */ #if defined(DUK_USE_TAILCALL) - if (comp_ctx->curr_func.catch_depth == 0 && /* no catchers */ - pc_after_expr > pc_before_expr) { /* at least one opcode emitted */ + if (comp_ctx->curr_func.catch_depth == 0 && /* no catchers */ + pc_after_expr > pc_before_expr) { /* at least one opcode emitted */ duk_compiler_instr *instr; duk_instr_t ins; duk_small_uint_t op; @@ -73755,8 +75069,7 @@ DUK_LOCAL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re ins = instr->ins; op = (duk_small_uint_t) DUK_DEC_OP(ins); - if ((op & ~0x0fU) == DUK_OP_CALL0 && - DUK__ISREG_TEMP(comp_ctx, rc_val) /* see above */) { + if ((op & ~0x0fU) == DUK_OP_CALL0 && DUK__ISREG_TEMP(comp_ctx, rc_val) /* see above */) { DUK_DDD(DUK_DDDPRINT("return statement detected a tail call opportunity: " "catch depth is 0, duk__exprtop() emitted >= 1 instructions, " "and last instruction is a CALL " @@ -73765,7 +75078,7 @@ DUK_LOCAL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re instr->ins = ins; } } -#endif /* DUK_USE_TAILCALL */ +#endif /* DUK_USE_TAILCALL */ if (DUK__ISREG(rc_val)) { duk__emit_bc(comp_ctx, DUK_OP_RETREG, rc_val); @@ -73783,7 +75096,7 @@ DUK_LOCAL void duk__parse_return_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *re DUK_LOCAL void duk__parse_throw_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk_regconst_t reg_val; - duk__advance(comp_ctx); /* eat 'throw' */ + duk__advance(comp_ctx); /* eat 'throw' */ /* Unlike break/continue, throw statement does not allow an empty value. */ @@ -73793,14 +75106,12 @@ DUK_LOCAL void duk__parse_throw_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res } reg_val = duk__exprtop_toreg(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); - duk__emit_bc(comp_ctx, - DUK_OP_THROW, - reg_val); + duk__emit_bc(comp_ctx, DUK_OP_THROW, reg_val); } DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) { duk_hthread *thr = comp_ctx->thr; - duk_regconst_t reg_catch; /* reg_catch+0 and reg_catch+1 are reserved for TRYCATCH */ + duk_regconst_t reg_catch; /* reg_catch+0 and reg_catch+1 are reserved for TRYCATCH */ duk_regconst_t rc_varname = 0; duk_small_uint_t trycatch_flags = 0; duk_int_t pc_ldconst = -1; @@ -73827,7 +75138,7 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) comp_ctx->curr_func.catch_depth++; - duk__advance(comp_ctx); /* eat 'try' */ + duk__advance(comp_ctx); /* eat 'try' */ reg_catch = DUK__ALLOCTEMPS(comp_ctx, 2); @@ -73840,9 +75151,9 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) duk__emit_a_bc(comp_ctx, DUK_OP_LDCONST, reg_catch, 0 /*patched later*/); pc_trycatch = duk__get_current_pc(comp_ctx); - duk__emit_invalid(comp_ctx); /* TRYCATCH, cannot emit now (not enough info) */ - duk__emit_invalid(comp_ctx); /* jump for 'catch' case */ - duk__emit_invalid(comp_ctx); /* jump for 'finally' case or end (if no finally) */ + duk__emit_invalid(comp_ctx); /* TRYCATCH, cannot emit now (not enough info) */ + duk__emit_invalid(comp_ctx); /* jump for 'catch' case */ + duk__emit_invalid(comp_ctx); /* jump for 'finally' case or end (if no finally) */ /* try part */ duk__advance_expect(comp_ctx, DUK_TOK_LCURLY); @@ -73871,7 +75182,7 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) */ duk_hstring *h_var; - duk_int_t varmap_value; /* for storing/restoring the varmap binding for catch variable */ + duk_int_t varmap_value; /* for storing/restoring the varmap binding for catch variable */ DUK_DDD(DUK_DDDPRINT("stack top at start of catch clause: %ld", (long) duk_get_top(thr))); @@ -73889,19 +75200,17 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) h_var = comp_ctx->curr_token.str1; DUK_ASSERT(h_var != NULL); - duk_push_hstring(thr, h_var); /* keep in on valstack, use borrowed ref below */ + duk_push_hstring(thr, h_var); /* keep in on valstack, use borrowed ref below */ if (comp_ctx->curr_func.is_strict && - ((h_var == DUK_HTHREAD_STRING_EVAL(thr)) || - (h_var == DUK_HTHREAD_STRING_LC_ARGUMENTS(thr)))) { + ((h_var == DUK_HTHREAD_STRING_EVAL(thr)) || (h_var == DUK_HTHREAD_STRING_LC_ARGUMENTS(thr)))) { DUK_DDD(DUK_DDDPRINT("catch identifier 'eval' or 'arguments' in strict mode -> SyntaxError")); goto syntax_error; } duk_dup_top(thr); rc_varname = duk__getconst(comp_ctx); - DUK_DDD(DUK_DDDPRINT("catch clause, rc_varname=0x%08lx (%ld)", - (unsigned long) rc_varname, (long) rc_varname)); + DUK_DDD(DUK_DDDPRINT("catch clause, rc_varname=0x%08lx (%ld)", (unsigned long) rc_varname, (long) rc_varname)); duk__advance(comp_ctx); duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); @@ -73964,8 +75273,7 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) DUK_DDD(DUK_DDDPRINT("varmap after restore catch clause: %!iT", (duk_tval *) duk_get_tval(thr, comp_ctx->curr_func.varmap_idx))); - duk__emit_op_only(comp_ctx, - DUK_OP_ENDCATCH); + duk__emit_op_only(comp_ctx, DUK_OP_ENDCATCH); /* * XXX: for now, indicate that an expensive catch binding @@ -73988,13 +75296,10 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) duk__advance_expect(comp_ctx, DUK_TOK_LCURLY); duk__parse_stmts(comp_ctx, 0 /*allow_source_elem*/, 0 /*expect_eof*/, 1 /*regexp_after*/); /* the DUK_TOK_RCURLY is eaten by duk__parse_stmts() */ - duk__emit_abc(comp_ctx, - DUK_OP_ENDFIN, - reg_catch); /* rethrow */ + duk__emit_abc(comp_ctx, DUK_OP_ENDFIN, reg_catch); /* rethrow */ } - if (!(trycatch_flags & DUK_BC_TRYCATCH_FLAG_HAVE_CATCH) && - !(trycatch_flags & DUK_BC_TRYCATCH_FLAG_HAVE_FINALLY)) { + if (!(trycatch_flags & DUK_BC_TRYCATCH_FLAG_HAVE_CATCH) && !(trycatch_flags & DUK_BC_TRYCATCH_FLAG_HAVE_FINALLY)) { /* must have catch and/or finally */ goto syntax_error; } @@ -74004,12 +75309,7 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) * constant 0) the DUK__CONST_MARKER flag will be set in rc_varname. */ - duk__patch_trycatch(comp_ctx, - pc_ldconst, - pc_trycatch, - reg_catch, - rc_varname, - trycatch_flags); + duk__patch_trycatch(comp_ctx, pc_ldconst, pc_trycatch, reg_catch, rc_varname, trycatch_flags); if (trycatch_flags & DUK_BC_TRYCATCH_FLAG_HAVE_CATCH) { DUK_ASSERT(pc_catch >= 0); @@ -74027,7 +75327,7 @@ DUK_LOCAL void duk__parse_try_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) comp_ctx->curr_func.catch_depth--; return; - syntax_error: +syntax_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_TRY); DUK_WO_NORETURN(return;); } @@ -74045,23 +75345,23 @@ DUK_LOCAL void duk__parse_with_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res) comp_ctx->curr_func.catch_depth++; - duk__advance(comp_ctx); /* eat 'with' */ + duk__advance(comp_ctx); /* eat 'with' */ reg_catch = DUK__ALLOCTEMPS(comp_ctx, 2); duk__advance_expect(comp_ctx, DUK_TOK_LPAREN); duk__exprtop_toforcedreg(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/, reg_catch); comp_ctx->curr_func.allow_regexp_in_adv = 1; - duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ + duk__advance_expect(comp_ctx, DUK_TOK_RPAREN); /* Allow RegExp as part of next stmt. */ pc_trycatch = duk__get_current_pc(comp_ctx); trycatch_flags = DUK_BC_TRYCATCH_FLAG_WITH_BINDING; duk__emit_a_bc(comp_ctx, - DUK_OP_TRYCATCH | DUK__EMIT_FLAG_NO_SHUFFLE_A, - (duk_regconst_t) trycatch_flags /*a*/, - reg_catch /*bc*/); - duk__emit_invalid(comp_ctx); /* catch jump */ - duk__emit_invalid(comp_ctx); /* finished jump */ + DUK_OP_TRYCATCH | DUK__EMIT_FLAG_NO_SHUFFLE_A, + (duk_regconst_t) trycatch_flags /*a*/, + reg_catch /*bc*/); + duk__emit_invalid(comp_ctx); /* catch jump */ + duk__emit_invalid(comp_ctx); /* finished jump */ duk__parse_stmt(comp_ctx, res, 0 /*allow_source_elem*/); duk__emit_op_only(comp_ctx, DUK_OP_ENDTRY); @@ -74082,9 +75382,7 @@ DUK_LOCAL duk_int_t duk__stmt_label_site(duk_compiler_ctx *comp_ctx, duk_int_t l label_id = comp_ctx->curr_func.label_next++; DUK_DDD(DUK_DDDPRINT("allocated new label id for label site: %ld", (long) label_id)); - duk__emit_bc(comp_ctx, - DUK_OP_LABEL, - (duk_regconst_t) label_id); + duk__emit_bc(comp_ctx, DUK_OP_LABEL, (duk_regconst_t) label_id); duk__emit_invalid(comp_ctx); duk__emit_invalid(comp_ctx); @@ -74098,10 +75396,10 @@ DUK_LOCAL duk_int_t duk__stmt_label_site(duk_compiler_ctx *comp_ctx, duk_int_t l */ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_bool_t allow_source_elem) { duk_hthread *thr = comp_ctx->thr; - duk_bool_t dir_prol_at_entry; /* directive prologue status at entry */ + duk_bool_t dir_prol_at_entry; /* directive prologue status at entry */ duk_regconst_t temp_at_entry; duk_size_t labels_len_at_entry; - duk_int_t pc_at_entry; /* assumed to also be PC of "LABEL" */ + duk_int_t pc_at_entry; /* assumed to also be PC of "LABEL" */ duk_int_t stmt_id; duk_small_uint_t stmt_flags = 0; duk_int_t label_id = -1; @@ -74120,8 +75418,11 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ DUK_DDD(DUK_DDDPRINT("parsing a statement, stmt_id=%ld, temp_at_entry=%ld, labels_len_at_entry=%ld, " "is_strict=%ld, in_directive_prologue=%ld, catch_depth=%ld", - (long) stmt_id, (long) temp_at_entry, (long) labels_len_at_entry, - (long) comp_ctx->curr_func.is_strict, (long) comp_ctx->curr_func.in_directive_prologue, + (long) stmt_id, + (long) temp_at_entry, + (long) labels_len_at_entry, + (long) comp_ctx->curr_func.is_strict, + (long) comp_ctx->curr_func.in_directive_prologue, (long) comp_ctx->curr_func.catch_depth)); /* The directive prologue flag is cleared by default so that it is @@ -74131,10 +75432,12 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ */ comp_ctx->curr_func.in_directive_prologue = 0; - retry_parse: +retry_parse: DUK_DDD(DUK_DDDPRINT("try stmt parse, stmt_id=%ld, label_id=%ld, allow_source_elem=%ld, catch_depth=%ld", - (long) stmt_id, (long) label_id, (long) allow_source_elem, + (long) stmt_id, + (long) label_id, + (long) allow_source_elem, (long) comp_ctx->curr_func.catch_depth)); /* @@ -74143,15 +75446,11 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ */ tok = comp_ctx->curr_token.t; - if (tok == DUK_TOK_FOR || tok == DUK_TOK_DO || tok == DUK_TOK_WHILE || - tok == DUK_TOK_SWITCH) { + if (tok == DUK_TOK_FOR || tok == DUK_TOK_DO || tok == DUK_TOK_WHILE || tok == DUK_TOK_SWITCH) { DUK_DDD(DUK_DDDPRINT("iteration/switch statement -> add empty label")); label_id = duk__stmt_label_site(comp_ctx, label_id); - duk__add_label(comp_ctx, - DUK_HTHREAD_STRING_EMPTY_STRING(thr), - pc_at_entry /*pc_label*/, - label_id); + duk__add_label(comp_ctx, DUK_HTHREAD_STRING_EMPTY_STRING(thr), pc_at_entry /*pc_label*/, label_id); } /* @@ -74178,10 +75477,8 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ * strict and non-strict modes. However, don't allow labelled * function declarations in strict mode. */ - test_func_decl = test_func_decl || - !comp_ctx->curr_func.is_strict || - label_id < 0; -#endif /* DUK_USE_NONSTD_FUNC_STMT */ + test_func_decl = test_func_decl || !comp_ctx->curr_func.is_strict || label_id < 0; +#endif /* DUK_USE_NONSTD_FUNC_STMT */ /* Strict: never allow function declarations outside top level. */ if (test_func_decl) { /* FunctionDeclaration: not strictly a statement but handled as such. @@ -74203,7 +75500,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ top_before = duk_get_top(thr); #endif - duk__advance(comp_ctx); /* eat 'function' */ + duk__advance(comp_ctx); /* eat 'function' */ fnum = duk__parse_func_like_fnum(comp_ctx, DUK__FUNC_FLAG_DECL | DUK__FUNC_FLAG_PUSHNAME_PASS1); /* The value stack convention here is a bit odd: the function @@ -74217,7 +75514,8 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ DUK_ASSERT(duk_get_top(thr) == top_before + 1); #endif DUK_DDD(DUK_DDDPRINT("register function declaration %!T in pass 1, fnum %ld", - duk_get_tval(thr, -1), (long) fnum)); + duk_get_tval(thr, -1), + (long) fnum)); n = (duk_uarridx_t) duk_get_length(thr, comp_ctx->curr_func.decls_idx); /* funcname is at index -1 */ duk_put_prop_index(thr, comp_ctx->curr_func.decls_idx, n); @@ -74244,7 +75542,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ duk__parse_stmts(comp_ctx, 0 /*allow_source_elem*/, 0 /*expect_eof*/, 1 /*regexp_after*/); /* the DUK_TOK_RCURLY is eaten by duk__parse_stmts() */ if (label_id >= 0) { - duk__patch_jump_here(comp_ctx, pc_at_entry + 1); /* break jump */ + duk__patch_jump_here(comp_ctx, pc_at_entry + 1); /* break jump */ } stmt_flags = 0; break; @@ -74271,7 +75569,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ DUK_DDD(DUK_DDDPRINT("if statement")); duk__parse_if_stmt(comp_ctx, res); if (label_id >= 0) { - duk__patch_jump_here(comp_ctx, pc_at_entry + 1); /* break jump */ + duk__patch_jump_here(comp_ctx, pc_at_entry + 1); /* break jump */ } stmt_flags = 0; break; @@ -74288,19 +75586,15 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ */ DUK_DDD(DUK_DDDPRINT("do statement")); DUK_ASSERT(label_id >= 0); - duk__update_label_flags(comp_ctx, - label_id, - DUK_LABEL_FLAG_ALLOW_BREAK | DUK_LABEL_FLAG_ALLOW_CONTINUE); + duk__update_label_flags(comp_ctx, label_id, DUK_LABEL_FLAG_ALLOW_BREAK | DUK_LABEL_FLAG_ALLOW_CONTINUE); duk__parse_do_stmt(comp_ctx, res, pc_at_entry); - stmt_flags = DUK__HAS_TERM | DUK__ALLOW_AUTO_SEMI_ALWAYS; /* DUK__ALLOW_AUTO_SEMI_ALWAYS workaround */ + stmt_flags = DUK__HAS_TERM | DUK__ALLOW_AUTO_SEMI_ALWAYS; /* DUK__ALLOW_AUTO_SEMI_ALWAYS workaround */ break; } case DUK_TOK_WHILE: { DUK_DDD(DUK_DDDPRINT("while statement")); DUK_ASSERT(label_id >= 0); - duk__update_label_flags(comp_ctx, - label_id, - DUK_LABEL_FLAG_ALLOW_BREAK | DUK_LABEL_FLAG_ALLOW_CONTINUE); + duk__update_label_flags(comp_ctx, label_id, DUK_LABEL_FLAG_ALLOW_BREAK | DUK_LABEL_FLAG_ALLOW_CONTINUE); duk__parse_while_stmt(comp_ctx, res, pc_at_entry); stmt_flags = 0; break; @@ -74315,9 +75609,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ */ DUK_DDD(DUK_DDDPRINT("for/for-in statement")); DUK_ASSERT(label_id >= 0); - duk__update_label_flags(comp_ctx, - label_id, - DUK_LABEL_FLAG_ALLOW_BREAK | DUK_LABEL_FLAG_ALLOW_CONTINUE); + duk__update_label_flags(comp_ctx, label_id, DUK_LABEL_FLAG_ALLOW_BREAK | DUK_LABEL_FLAG_ALLOW_CONTINUE); duk__parse_for_stmt(comp_ctx, res, pc_at_entry); stmt_flags = 0; break; @@ -74340,7 +75632,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ comp_ctx->curr_func.with_depth++; duk__parse_with_stmt(comp_ctx, res); if (label_id >= 0) { - duk__patch_jump_here(comp_ctx, pc_at_entry + 1); /* break jump */ + duk__patch_jump_here(comp_ctx, pc_at_entry + 1); /* break jump */ } comp_ctx->curr_func.with_depth--; stmt_flags = 0; @@ -74353,9 +75645,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ */ DUK_DDD(DUK_DDDPRINT("switch statement")); DUK_ASSERT(label_id >= 0); - duk__update_label_flags(comp_ctx, - label_id, - DUK_LABEL_FLAG_ALLOW_BREAK); /* don't allow continue */ + duk__update_label_flags(comp_ctx, label_id, DUK_LABEL_FLAG_ALLOW_BREAK); /* don't allow continue */ duk__parse_switch_stmt(comp_ctx, res, pc_at_entry); stmt_flags = 0; break; @@ -74422,12 +75712,10 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ DUK_DDD(DUK_DDDPRINT("expression statement")); duk__exprtop(comp_ctx, res, DUK__BP_FOR_EXPR /*rbp_flags*/); - single_token = (comp_ctx->curr_func.nud_count == 1 && /* one token */ - comp_ctx->curr_func.led_count == 0); /* no operators */ + single_token = (comp_ctx->curr_func.nud_count == 1 && /* one token */ + comp_ctx->curr_func.led_count == 0); /* no operators */ - if (single_token && - comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && - comp_ctx->curr_token.t == DUK_TOK_COLON) { + if (single_token && comp_ctx->prev_token.t == DUK_TOK_IDENTIFIER && comp_ctx->curr_token.t == DUK_TOK_COLON) { /* * Detected label */ @@ -74441,17 +75729,13 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ h_lab = comp_ctx->prev_token.str1; DUK_ASSERT(h_lab != NULL); - DUK_DDD(DUK_DDDPRINT("explicit label site for label '%!O'", - (duk_heaphdr *) h_lab)); + DUK_DDD(DUK_DDDPRINT("explicit label site for label '%!O'", (duk_heaphdr *) h_lab)); - duk__advance(comp_ctx); /* eat colon */ + duk__advance(comp_ctx); /* eat colon */ label_id = duk__stmt_label_site(comp_ctx, label_id); - duk__add_label(comp_ctx, - h_lab, - pc_at_entry /*pc_label*/, - label_id); + duk__add_label(comp_ctx, h_lab, pc_at_entry /*pc_label*/, label_id); /* a statement following a label cannot be a source element * (a function declaration). @@ -74464,8 +75748,8 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ stmt_flags = 0; - if (dir_prol_at_entry && /* still in prologue */ - single_token && /* single string token */ + if (dir_prol_at_entry && /* still in prologue */ + single_token && /* single string token */ comp_ctx->prev_token.t == DUK_TOK_STRING) { /* * Detected a directive @@ -74498,7 +75782,8 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ DUK_STRCMP((const char *) DUK_HSTRING_GET_DATA(h_dir), "use strict") == 0) { #if defined(DUK_USE_STRICT_DECL) DUK_DDD(DUK_DDDPRINT("use strict directive detected: strict flag %ld -> %ld", - (long) comp_ctx->curr_func.is_strict, (long) 1)); + (long) comp_ctx->curr_func.is_strict, + (long) 1)); comp_ctx->curr_func.is_strict = 1; #else DUK_DDD(DUK_DDDPRINT("use strict detected but strict declarations disabled, ignoring")); @@ -74506,21 +75791,23 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ } else if (DUK_HSTRING_GET_BYTELEN(h_dir) == 14 && DUK_STRCMP((const char *) DUK_HSTRING_GET_DATA(h_dir), "use duk notail") == 0) { DUK_DDD(DUK_DDDPRINT("use duk notail directive detected: notail flag %ld -> %ld", - (long) comp_ctx->curr_func.is_notail, (long) 1)); + (long) comp_ctx->curr_func.is_notail, + (long) 1)); comp_ctx->curr_func.is_notail = 1; } else { DUK_DD(DUK_DDPRINT("unknown directive: '%!O', ignoring but not terminating " - "directive prologue", (duk_hobject *) h_dir)); + "directive prologue", + (duk_hobject *) h_dir)); } } } else { DUK_DDD(DUK_DDDPRINT("non-directive expression statement or no longer in prologue; " "prologue terminated if still active")); - } + } stmt_flags |= DUK__HAS_VAL | DUK__HAS_TERM; } - } /* end switch (tok) */ + } /* end switch (tok) */ /* * Statement value handling. @@ -74596,9 +75883,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ */ if (label_id >= 0) { - duk__emit_bc(comp_ctx, - DUK_OP_ENDLABEL, - (duk_regconst_t) label_id); + duk__emit_bc(comp_ctx, DUK_OP_ENDLABEL, (duk_regconst_t) label_id); } DUK__SETTEMP(comp_ctx, temp_at_entry); @@ -74621,7 +75906,10 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_ * (EOF or closing brace). */ -DUK_LOCAL void duk__parse_stmts(duk_compiler_ctx *comp_ctx, duk_bool_t allow_source_elem, duk_bool_t expect_eof, duk_bool_t regexp_after) { +DUK_LOCAL void duk__parse_stmts(duk_compiler_ctx *comp_ctx, + duk_bool_t allow_source_elem, + duk_bool_t expect_eof, + duk_bool_t regexp_after) { duk_hthread *thr = comp_ctx->thr; duk_ivalue res_alloc; duk_ivalue *res = &res_alloc; @@ -74787,7 +76075,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct /* only functions can have arguments */ DUK_ASSERT(comp_ctx->curr_func.is_function); - duk_push_uarridx(thr, i); /* -> [ ... name index ] */ + duk_push_uarridx(thr, i); /* -> [ ... name index ] */ duk_put_prop(thr, comp_ctx->curr_func.varmap_idx); /* -> [ ... ] */ /* no code needs to be emitted, the regs already have values */ @@ -74823,16 +76111,15 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct */ num_decls = (duk_uarridx_t) duk_get_length(thr, comp_ctx->curr_func.decls_idx); - DUK_DDD(DUK_DDDPRINT("num_decls=%ld -> %!T", - (long) num_decls, - (duk_tval *) duk_get_tval(thr, comp_ctx->curr_func.decls_idx))); + DUK_DDD( + DUK_DDDPRINT("num_decls=%ld -> %!T", (long) num_decls, (duk_tval *) duk_get_tval(thr, comp_ctx->curr_func.decls_idx))); for (i = 0; i < num_decls; i += 2) { duk_int_t decl_type; duk_int_t fnum; - duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i + 1); /* decl type */ + duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i + 1); /* decl type */ decl_type = duk_to_int(thr, -1); - fnum = decl_type >> 8; /* XXX: macros */ + fnum = decl_type >> 8; /* XXX: macros */ decl_type = decl_type & 0xff; duk_pop(thr); @@ -74840,7 +76127,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct continue; } - duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i); /* decl name */ + duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i); /* decl name */ /* XXX: spilling */ if (comp_ctx->curr_func.is_function) { @@ -74850,18 +76137,12 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct /* shadowed; update value */ duk_dup_top(thr); duk_get_prop(thr, comp_ctx->curr_func.varmap_idx); - reg_bind = duk_to_int(thr, -1); /* [ ... name reg_bind ] */ - duk__emit_a_bc(comp_ctx, - DUK_OP_CLOSURE, - reg_bind, - (duk_regconst_t) fnum); + reg_bind = duk_to_int(thr, -1); /* [ ... name reg_bind ] */ + duk__emit_a_bc(comp_ctx, DUK_OP_CLOSURE, reg_bind, (duk_regconst_t) fnum); } else { /* function: always register bound */ reg_bind = DUK__ALLOCTEMP(comp_ctx); - duk__emit_a_bc(comp_ctx, - DUK_OP_CLOSURE, - reg_bind, - (duk_regconst_t) fnum); + duk__emit_a_bc(comp_ctx, DUK_OP_CLOSURE, reg_bind, (duk_regconst_t) fnum); duk_push_int(thr, (duk_int_t) reg_bind); } } else { @@ -74878,14 +76159,9 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct rc_name = duk__getconst(comp_ctx); duk_push_null(thr); - duk__emit_a_bc(comp_ctx, - DUK_OP_CLOSURE, - reg_temp, - (duk_regconst_t) fnum); + duk__emit_a_bc(comp_ctx, DUK_OP_CLOSURE, reg_temp, (duk_regconst_t) fnum); - declvar_flags = DUK_PROPDESC_FLAG_WRITABLE | - DUK_PROPDESC_FLAG_ENUMERABLE | - DUK_BC_DECLVAR_FLAG_FUNC_DECL; + declvar_flags = DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE | DUK_BC_DECLVAR_FLAG_FUNC_DECL; if (configurable_bindings) { declvar_flags |= DUK_PROPDESC_FLAG_CONFIGURABLE; @@ -74897,7 +76173,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct rc_name /*name*/, reg_temp /*value*/); - DUK__SETTEMP(comp_ctx, reg_temp); /* forget temp */ + DUK__SETTEMP(comp_ctx, reg_temp); /* forget temp */ } DUK_DDD(DUK_DDDPRINT("function declaration to varmap: %!T -> %!T", @@ -74907,7 +76183,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct #if defined(DUK_USE_FASTINT) DUK_ASSERT(DUK_TVAL_IS_NULL(duk_get_tval(thr, -1)) || DUK_TVAL_IS_FASTINT(duk_get_tval(thr, -1))); #endif - duk_put_prop(thr, comp_ctx->curr_func.varmap_idx); /* [ ... name reg/null ] -> [ ... ] */ + duk_put_prop(thr, comp_ctx->curr_func.varmap_idx); /* [ ... name reg/null ] -> [ ... ] */ } /* @@ -74934,7 +76210,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct for (i = 0; i < num_decls; i += 2) { duk_int_t decl_type; - duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i + 1); /* decl type */ + duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i + 1); /* decl type */ decl_type = duk_to_int(thr, -1); decl_type = decl_type & 0xff; duk_pop(thr); @@ -74943,16 +76219,15 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct continue; } - duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i); /* decl name */ + duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i); /* decl name */ if (duk_has_prop(thr, comp_ctx->curr_func.varmap_idx)) { /* shadowed, ignore */ } else { - duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i); /* decl name */ + duk_get_prop_index(thr, comp_ctx->curr_func.decls_idx, i); /* decl name */ h_name = duk_known_hstring(thr, -1); - if (h_name == DUK_HTHREAD_STRING_LC_ARGUMENTS(thr) && - !comp_ctx->curr_func.is_arguments_shadowed) { + if (h_name == DUK_HTHREAD_STRING_LC_ARGUMENTS(thr) && !comp_ctx->curr_func.is_arguments_shadowed) { /* E5 Section steps 7-8 */ DUK_DDD(DUK_DDDPRINT("'arguments' not shadowed by a function declaration, " "but appears as a variable declaration -> treat as " @@ -74971,8 +76246,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct rc_name = duk__getconst(comp_ctx); duk_push_null(thr); - declvar_flags = DUK_PROPDESC_FLAG_WRITABLE | - DUK_PROPDESC_FLAG_ENUMERABLE; + declvar_flags = DUK_PROPDESC_FLAG_WRITABLE | DUK_PROPDESC_FLAG_ENUMERABLE; if (configurable_bindings) { declvar_flags |= DUK_PROPDESC_FLAG_CONFIGURABLE; } @@ -74984,7 +76258,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct 0 /*value*/); } - duk_put_prop(thr, comp_ctx->curr_func.varmap_idx); /* [ ... name reg/null ] -> [ ... ] */ + duk_put_prop(thr, comp_ctx->curr_func.varmap_idx); /* [ ... name reg/null ] -> [ ... ] */ } } @@ -74999,11 +76273,11 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct DUK_ASSERT_TOP(thr, entry_top); return; - error_outofregs: +error_outofregs: DUK_ERROR_RANGE(thr, DUK_STR_REG_LIMIT); DUK_WO_NORETURN(return;); - error_argname: +error_argname: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_ARG_NAME); DUK_WO_NORETURN(return;); } @@ -75042,7 +76316,11 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct * token (EOF or closing brace). */ -DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expect_eof, duk_bool_t implicit_return_value, duk_bool_t regexp_after, duk_small_int_t expect_token) { +DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, + duk_bool_t expect_eof, + duk_bool_t implicit_return_value, + duk_bool_t regexp_after, + duk_small_int_t expect_token) { duk_compiler_func *func; duk_hthread *thr; duk_regconst_t reg_stmt_value = -1; @@ -75134,8 +76412,8 @@ DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expec DUK_DDD(DUK_DDDPRINT("begin 1st pass")); duk__parse_stmts(comp_ctx, - 1, /* allow source elements */ - expect_eof, /* expect EOF instead of } */ + 1, /* allow source elements */ + expect_eof, /* expect EOF instead of } */ regexp_after); /* regexp after */ DUK_DDD(DUK_DDDPRINT("end 1st pass")); @@ -75164,8 +76442,8 @@ DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expec DUK_DDD(DUK_DDDPRINT("rewind lexer")); DUK_LEXER_SETPOINT(&comp_ctx->lex, &lex_pt); - comp_ctx->curr_token.t = 0; /* this is needed for regexp mode */ - comp_ctx->curr_token.start_line = 0; /* needed for line number tracking (becomes prev_token.start_line) */ + comp_ctx->curr_token.t = 0; /* this is needed for regexp mode */ + comp_ctx->curr_token.start_line = 0; /* needed for line number tracking (becomes prev_token.start_line) */ duk__advance(comp_ctx); /* @@ -75186,8 +76464,7 @@ DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expec /* must be able to emit code, alloc consts, etc. */ - duk__init_varmap_and_prologue_for_pass2(comp_ctx, - (implicit_return_value ? ®_stmt_value : NULL)); + duk__init_varmap_and_prologue_for_pass2(comp_ctx, (implicit_return_value ? ®_stmt_value : NULL)); func->reg_stmt_value = reg_stmt_value; temp_first = DUK__GETTEMP(comp_ctx); @@ -75235,15 +76512,13 @@ DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expec if (implicit_return_value) { /* Default implicit return value. */ - duk__emit_bc(comp_ctx, - DUK_OP_LDUNDEF, - 0); + duk__emit_bc(comp_ctx, DUK_OP_LDUNDEF, 0); } DUK_DDD(DUK_DDDPRINT("begin 2nd pass")); duk__parse_stmts(comp_ctx, - 1, /* allow source elements */ - expect_eof, /* expect EOF instead of } */ + 1, /* allow source elements */ + expect_eof, /* expect EOF instead of } */ regexp_after); /* regexp after */ DUK_DDD(DUK_DDDPRINT("end 2nd pass")); @@ -75299,7 +76574,7 @@ DUK_LOCAL void duk__parse_func_body(duk_compiler_ctx *comp_ctx, duk_bool_t expec DUK__RECURSION_DECREASE(comp_ctx, thr); return; - error_funcname: +error_funcname: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_FUNC_NAME); DUK_WO_NORETURN(return;); } @@ -75354,15 +76629,14 @@ DUK_LOCAL void duk__parse_func_formals(duk_compiler_ctx *comp_ctx) { } DUK_ASSERT(comp_ctx->curr_token.t == DUK_TOK_IDENTIFIER); DUK_ASSERT(comp_ctx->curr_token.str1 != NULL); - DUK_DDD(DUK_DDDPRINT("formal argument: %!O", - (duk_heaphdr *) comp_ctx->curr_token.str1)); + DUK_DDD(DUK_DDDPRINT("formal argument: %!O", (duk_heaphdr *) comp_ctx->curr_token.str1)); /* XXX: append primitive */ duk_push_hstring(thr, comp_ctx->curr_token.str1); n = (duk_uarridx_t) duk_get_length(thr, comp_ctx->curr_func.argnames_idx); duk_put_prop_index(thr, comp_ctx->curr_func.argnames_idx, n); - duk__advance(comp_ctx); /* eat identifier */ + duk__advance(comp_ctx); /* eat identifier */ } } @@ -75410,7 +76684,7 @@ DUK_LOCAL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_small_ui if (flags & DUK__FUNC_FLAG_GETSET) { /* PropertyName -> IdentifierName | StringLiteral | NumericLiteral */ if (tok->t_nores == DUK_TOK_IDENTIFIER || tok->t == DUK_TOK_STRING) { - duk_push_hstring(thr, tok->str1); /* keep in valstack */ + duk_push_hstring(thr, tok->str1); /* keep in valstack */ } else if (tok->t == DUK_TOK_NUMBER) { duk_push_number(thr, tok->num); duk_to_string(thr, -1); @@ -75418,15 +76692,15 @@ DUK_LOCAL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_small_ui DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_GETSET_NAME); DUK_WO_NORETURN(return;); } - comp_ctx->curr_func.h_name = duk_known_hstring(thr, -1); /* borrowed reference */ + comp_ctx->curr_func.h_name = duk_known_hstring(thr, -1); /* borrowed reference */ } else { /* Function name is an Identifier (not IdentifierName), but we get * the raw name (not recognizing keywords) here and perform the name * checks only after pass 1. */ if (tok->t_nores == DUK_TOK_IDENTIFIER) { - duk_push_hstring(thr, tok->str1); /* keep in valstack */ - comp_ctx->curr_func.h_name = duk_known_hstring(thr, -1); /* borrowed reference */ + duk_push_hstring(thr, tok->str1); /* keep in valstack */ + comp_ctx->curr_func.h_name = duk_known_hstring(thr, -1); /* borrowed reference */ } else { /* valstack will be unbalanced, which is OK */ DUK_ASSERT((flags & DUK__FUNC_FLAG_GETSET) == 0); @@ -75439,8 +76713,7 @@ DUK_LOCAL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_small_ui } } - DUK_DD(DUK_DDPRINT("function name: %!O", - (duk_heaphdr *) comp_ctx->curr_func.h_name)); + DUK_DD(DUK_DDPRINT("function name: %!O", (duk_heaphdr *) comp_ctx->curr_func.h_name)); if (!no_advance) { duk__advance(comp_ctx); @@ -75466,17 +76739,17 @@ DUK_LOCAL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_small_ui */ duk__parse_func_body(comp_ctx, - 0, /* expect_eof */ - 0, /* implicit_return_value */ + 0, /* expect_eof */ + 0, /* implicit_return_value */ flags & DUK__FUNC_FLAG_DECL, /* regexp_after */ - DUK_TOK_LCURLY); /* expect_token */ + DUK_TOK_LCURLY); /* expect_token */ /* * Convert duk_compiler_func to a function template and add it * to the parent function table. */ - duk__convert_to_func_template(comp_ctx); /* -> [ ... func ] */ + duk__convert_to_func_template(comp_ctx); /* -> [ ... func ] */ } /* Parse an inner function, adding the function template to the current function's @@ -75514,12 +76787,14 @@ DUK_LOCAL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, duk_sm lex_pt.line = duk_to_int(thr, -1); duk_pop(thr); - DUK_DDD(DUK_DDDPRINT("second pass of an inner func, skip the function, reparse closing brace; lex offset=%ld, line=%ld", - (long) lex_pt.offset, (long) lex_pt.line)); + DUK_DDD( + DUK_DDDPRINT("second pass of an inner func, skip the function, reparse closing brace; lex offset=%ld, line=%ld", + (long) lex_pt.offset, + (long) lex_pt.line)); DUK_LEXER_SETPOINT(&comp_ctx->lex, &lex_pt); - comp_ctx->curr_token.t = 0; /* this is needed for regexp mode */ - comp_ctx->curr_token.start_line = 0; /* needed for line number tracking (becomes prev_token.start_line) */ + comp_ctx->curr_token.t = 0; /* this is needed for regexp mode */ + comp_ctx->curr_token.start_line = 0; /* needed for line number tracking (becomes prev_token.start_line) */ duk__advance(comp_ctx); /* RegExp is not allowed after a function expression, e.g. in @@ -75541,7 +76816,8 @@ DUK_LOCAL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, duk_sm entry_top = duk_get_top(thr); DUK_DDD(DUK_DDDPRINT("before func: entry_top=%ld, curr_tok.start_offset=%ld", - (long) entry_top, (long) comp_ctx->curr_token.start_offset)); + (long) entry_top, + (long) comp_ctx->curr_token.start_offset)); duk_memcpy(&old_func, &comp_ctx->curr_func, sizeof(duk_compiler_func)); @@ -75561,24 +76837,25 @@ DUK_LOCAL duk_int_t duk__parse_func_like_fnum(duk_compiler_ctx *comp_ctx, duk_sm DUK_ASSERT(comp_ctx->curr_func.is_eval == 0); DUK_ASSERT(comp_ctx->curr_func.is_global == 0); comp_ctx->curr_func.is_setget = ((flags & DUK__FUNC_FLAG_GETSET) != 0); - comp_ctx->curr_func.is_namebinding = !(flags & (DUK__FUNC_FLAG_GETSET | - DUK__FUNC_FLAG_METDEF | - DUK__FUNC_FLAG_DECL)); /* no name binding for: declarations, objlit getset, objlit method def */ - comp_ctx->curr_func.is_constructable = !(flags & (DUK__FUNC_FLAG_GETSET | - DUK__FUNC_FLAG_METDEF)); /* not constructable: objlit getset, objlit method def */ + comp_ctx->curr_func.is_namebinding = + !(flags & (DUK__FUNC_FLAG_GETSET | DUK__FUNC_FLAG_METDEF | + DUK__FUNC_FLAG_DECL)); /* no name binding for: declarations, objlit getset, objlit method def */ + comp_ctx->curr_func.is_constructable = + !(flags & (DUK__FUNC_FLAG_GETSET | DUK__FUNC_FLAG_METDEF)); /* not constructable: objlit getset, objlit method def */ /* * Parse inner function */ - duk__parse_func_like_raw(comp_ctx, flags); /* pushes function template */ + duk__parse_func_like_raw(comp_ctx, flags); /* pushes function template */ /* prev_token.start_offset points to the closing brace here; when skipping * we're going to reparse the closing brace to ensure semicolon insertion * etc work as expected. */ DUK_DDD(DUK_DDDPRINT("after func: prev_tok.start_offset=%ld, curr_tok.start_offset=%ld", - (long) comp_ctx->prev_token.start_offset, (long) comp_ctx->curr_token.start_offset)); + (long) comp_ctx->prev_token.start_offset, + (long) comp_ctx->curr_token.start_offset)); DUK_ASSERT(comp_ctx->lex.input[comp_ctx->prev_token.start_offset] == (duk_uint8_t) DUK_ASC_RCURLY); /* XXX: append primitive */ @@ -75664,7 +76941,7 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_hthread *thr, void *udata) { is_strict = (flags & DUK_COMPILE_STRICT ? 1 : 0); is_funcexpr = (flags & DUK_COMPILE_FUNCEXPR ? 1 : 0); - h_filename = duk_get_hstring(thr, -1); /* may be undefined */ + h_filename = duk_get_hstring(thr, -1); /* may be undefined */ /* * Init compiler and lexer contexts @@ -75682,11 +76959,11 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_hthread *thr, void *udata) { duk_require_stack(thr, DUK__COMPILE_ENTRY_SLOTS); - duk_push_dynamic_buffer(thr, 0); /* entry_top + 0 */ - duk_push_undefined(thr); /* entry_top + 1 */ - duk_push_undefined(thr); /* entry_top + 2 */ - duk_push_undefined(thr); /* entry_top + 3 */ - duk_push_undefined(thr); /* entry_top + 4 */ + duk_push_dynamic_buffer(thr, 0); /* entry_top + 0 */ + duk_push_undefined(thr); /* entry_top + 1 */ + duk_push_undefined(thr); /* entry_top + 2 */ + duk_push_undefined(thr); /* entry_top + 3 */ + duk_push_undefined(thr); /* entry_top + 4 */ comp_ctx->thr = thr; comp_ctx->h_filename = h_filename; @@ -75710,8 +76987,8 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_hthread *thr, void *udata) { lex_pt->offset = 0; lex_pt->line = 1; - DUK_LEXER_SETPOINT(&comp_ctx->lex, lex_pt); /* fills window */ - comp_ctx->curr_token.start_line = 0; /* needed for line number tracking (becomes prev_token.start_line) */ + DUK_LEXER_SETPOINT(&comp_ctx->lex, lex_pt); /* fills window */ + comp_ctx->curr_token.start_line = 0; /* needed for line number tracking (becomes prev_token.start_line) */ /* * Initialize function state for a zero-argument function @@ -75727,8 +77004,7 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_hthread *thr, void *udata) { */ DUK_ASSERT(func->h_name == NULL); } else { - duk_push_hstring_stridx(thr, (is_eval ? DUK_STRIDX_EVAL : - DUK_STRIDX_GLOBAL)); + duk_push_hstring_stridx(thr, (is_eval ? DUK_STRIDX_EVAL : DUK_STRIDX_GLOBAL)); func->h_name = duk_get_hstring(thr, -1); } @@ -75748,7 +77024,7 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_hthread *thr, void *udata) { func->is_namebinding = 1; func->is_constructable = 1; - duk__advance(comp_ctx); /* init 'curr_token' */ + duk__advance(comp_ctx); /* init 'curr_token' */ duk__advance_expect(comp_ctx, DUK_TOK_FUNCTION); (void) duk__parse_func_like_raw(comp_ctx, 0 /*flags*/); } else { @@ -75760,10 +77036,10 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_hthread *thr, void *udata) { DUK_ASSERT(func->is_constructable == 0); duk__parse_func_body(comp_ctx, - 1, /* expect_eof */ - 1, /* implicit_return_value */ - 1, /* regexp_after (does not matter) */ - -1); /* expect_token */ + 1, /* expect_eof */ + 1, /* implicit_return_value */ + 1, /* regexp_after (does not matter) */ + -1); /* expect_token */ } /* @@ -75795,14 +77071,14 @@ DUK_INTERNAL void duk_js_compile(duk_hthread *thr, const duk_uint8_t *src_buffer DUK_LEXER_INITCTX(&comp_stk.comp_ctx_alloc.lex); comp_stk.comp_ctx_alloc.lex.input = src_buffer; comp_stk.comp_ctx_alloc.lex.input_length = src_length; - comp_stk.comp_ctx_alloc.lex.flags = flags; /* Forward flags directly for now. */ + comp_stk.comp_ctx_alloc.lex.flags = flags; /* Forward flags directly for now. */ /* [ ... filename ] */ prev_ctx = thr->compile_ctx; - thr->compile_ctx = &comp_stk.comp_ctx_alloc; /* for duk_error_augment.c */ + thr->compile_ctx = &comp_stk.comp_ctx_alloc; /* for duk_error_augment.c */ safe_rc = duk_safe_call(thr, duk__js_compile_raw, (void *) &comp_stk /*udata*/, 1 /*nargs*/, 1 /*nrets*/); - thr->compile_ctx = prev_ctx; /* must restore reliably before returning */ + thr->compile_ctx = prev_ctx; /* must restore reliably before returning */ if (safe_rc != DUK_EXEC_SUCCESS) { DUK_D(DUK_DPRINT("compilation failed: %!T", duk_get_tval(thr, -1))); @@ -75916,7 +77192,8 @@ DUK_LOCAL_DECL void duk__js_execute_bytecode_inner(duk_hthread *entry_thread, du /* Replace value stack top to value at 'tv_ptr'. Optimize for * performance by only applying the net refcount change. */ -#define DUK__REPLACE_TO_TVPTR(thr,tv_ptr) do { \ +#define DUK__REPLACE_TO_TVPTR(thr, tv_ptr) \ + do { \ duk_hthread *duk__thr; \ duk_tval *duk__tvsrc; \ duk_tval *duk__tvdst; \ @@ -75926,13 +77203,13 @@ DUK_LOCAL_DECL void duk__js_execute_bytecode_inner(duk_hthread *entry_thread, du duk__tvdst = (tv_ptr); \ DUK_TVAL_SET_TVAL(&duk__tvtmp, duk__tvdst); \ DUK_TVAL_SET_TVAL(duk__tvdst, duk__tvsrc); \ - DUK_TVAL_SET_UNDEFINED(duk__tvsrc); /* value stack init policy */ \ + DUK_TVAL_SET_UNDEFINED(duk__tvsrc); /* value stack init policy */ \ duk__thr->valstack_top = duk__tvsrc; \ DUK_TVAL_DECREF(duk__thr, &duk__tvtmp); \ } while (0) /* XXX: candidate of being an internal shared API call */ -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL void duk__push_tvals_incref_only(duk_hthread *thr, duk_tval *tv_src, duk_small_uint_fast_t count) { duk_tval *tv_dst; duk_size_t copy_size; @@ -75974,7 +77251,10 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF duk_double_t duk__compute_exp(duk_double_t } #endif -DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_fast_t idx_z) { +DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, + duk_tval *tv_x, + duk_tval *tv_y, + duk_small_uint_fast_t idx_z) { /* * Addition operator is different from other arithmetic * operations in that it also provides string concatenation. @@ -75994,9 +77274,9 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, d duk_double_union du; DUK_ASSERT(thr != NULL); - DUK_ASSERT(tv_x != NULL); /* may be reg or const */ - DUK_ASSERT(tv_y != NULL); /* may be reg or const */ - DUK_ASSERT_DISABLE(idx_z >= 0); /* unsigned */ + DUK_ASSERT(tv_x != NULL); /* may be reg or const */ + DUK_ASSERT(tv_y != NULL); /* may be reg or const */ + DUK_ASSERT_DISABLE(idx_z >= 0); /* unsigned */ DUK_ASSERT((duk_uint_t) idx_z < (duk_uint_t) duk_get_top(thr)); /* @@ -76019,14 +77299,14 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, d v3_hi = (duk_int32_t) (v3 >> 32); if (DUK_LIKELY(v3_hi >= DUK_I64_CONSTANT(-0x8000) && v3_hi <= DUK_I64_CONSTANT(0x7fff))) { tv_z = thr->valstack_bottom + idx_z; - DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_z, v3); /* side effects */ + DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_z, v3); /* side effects */ return; } else { /* overflow, fall through */ ; } } -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ if (DUK_TVAL_IS_NUMBER(tv_x) && DUK_TVAL_IS_NUMBER(tv_y)) { #if !defined(DUK_USE_EXEC_PREFER_SIZE) @@ -76035,14 +77315,14 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, d du.d = DUK_TVAL_GET_NUMBER(tv_x) + DUK_TVAL_GET_NUMBER(tv_y); #if defined(DUK_USE_EXEC_PREFER_SIZE) - duk_push_number(thr, du.d); /* will NaN normalize result */ + duk_push_number(thr, du.d); /* will NaN normalize result */ duk_replace(thr, (duk_idx_t) idx_z); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ DUK_DBLUNION_NORMALIZE_NAN_CHECK(&du); DUK_ASSERT(DUK_DBLUNION_IS_NORMALIZED(&du)); tv_z = thr->valstack_bottom + idx_z; - DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_z, du.d); /* side effects */ -#endif /* DUK_USE_EXEC_PREFER_SIZE */ + DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_z, du.d); /* side effects */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ return; } @@ -76052,7 +77332,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, d duk_push_tval(thr, tv_x); duk_push_tval(thr, tv_y); - duk_to_primitive(thr, -2, DUK_HINT_NONE); /* side effects -> don't use tv_x, tv_y after */ + duk_to_primitive(thr, -2, DUK_HINT_NONE); /* side effects -> don't use tv_x, tv_y after */ duk_to_primitive(thr, -1, DUK_HINT_NONE); /* Since Duktape 2.x plain buffers are treated like ArrayBuffer. */ @@ -76063,7 +77343,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, d * in duk_concat_2() which also fails with TypeError so no * explicit check is needed. */ - duk_concat_2(thr); /* [... s1 s2] -> [... s1+s2] */ + duk_concat_2(thr); /* [... s1 s2] -> [... s1+s2] */ } else { duk_double_t d1, d2; @@ -76076,12 +77356,16 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, d du.d = d1 + d2; duk_pop_2_unsafe(thr); - duk_push_number(thr, du.d); /* will NaN normalize result */ + duk_push_number(thr, du.d); /* will NaN normalize result */ } - duk_replace(thr, (duk_idx_t) idx_z); /* side effects */ + duk_replace(thr, (duk_idx_t) idx_z); /* side effects */ } -DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_uint_fast_t idx_z, duk_small_uint_fast_t opcode) { +DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread *thr, + duk_tval *tv_x, + duk_tval *tv_y, + duk_uint_fast_t idx_z, + duk_small_uint_fast_t opcode) { /* * Arithmetic operations other than '+' have number-only semantics * and are implemented here. The separate switch-case here means a @@ -76098,12 +77382,12 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread * #endif DUK_ASSERT(thr != NULL); - DUK_ASSERT(tv_x != NULL); /* may be reg or const */ - DUK_ASSERT(tv_y != NULL); /* may be reg or const */ - DUK_ASSERT_DISABLE(idx_z >= 0); /* unsigned */ + DUK_ASSERT(tv_x != NULL); /* may be reg or const */ + DUK_ASSERT(tv_y != NULL); /* may be reg or const */ + DUK_ASSERT_DISABLE(idx_z >= 0); /* unsigned */ DUK_ASSERT((duk_uint_t) idx_z < (duk_uint_t) duk_get_top(thr)); - opcode_shifted = opcode >> 2; /* Get base opcode without reg/const modifiers. */ + opcode_shifted = opcode >> 2; /* Get base opcode without reg/const modifiers. */ #if defined(DUK_USE_FASTINT) if (DUK_TVAL_IS_FASTINT(tv_x) && DUK_TVAL_IS_FASTINT(tv_y)) { @@ -76170,13 +77454,13 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread * v3_hi = (duk_int32_t) (v3 >> 32); if (DUK_LIKELY(v3_hi >= DUK_I64_CONSTANT(-0x8000) && v3_hi <= DUK_I64_CONSTANT(0x7fff))) { tv_z = thr->valstack_bottom + idx_z; - DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_z, v3); /* side effects */ + DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_z, v3); /* side effects */ return; } /* fall through if overflow etc */ } - skip_fastint: -#endif /* DUK_USE_FASTINT */ +skip_fastint: +#endif /* DUK_USE_FASTINT */ if (DUK_TVAL_IS_NUMBER(tv_x) && DUK_TVAL_IS_NUMBER(tv_y)) { /* fast path */ @@ -76185,7 +77469,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread * } else { duk_push_tval(thr, tv_x); duk_push_tval(thr, tv_y); - d1 = duk_to_number_m2(thr); /* side effects */ + d1 = duk_to_number_m2(thr); /* side effects */ d2 = duk_to_number_m1(thr); DUK_ASSERT(duk_is_number(thr, -2)); DUK_ASSERT(duk_is_number(thr, -1)); @@ -76222,24 +77506,28 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread * #endif default: { DUK_UNREACHABLE(); - du.d = DUK_DOUBLE_NAN; /* should not happen */ + du.d = DUK_DOUBLE_NAN; /* should not happen */ break; } } #if defined(DUK_USE_EXEC_PREFER_SIZE) - duk_push_number(thr, du.d); /* will NaN normalize result */ + duk_push_number(thr, du.d); /* will NaN normalize result */ duk_replace(thr, (duk_idx_t) idx_z); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ /* important to use normalized NaN with 8-byte tagged types */ DUK_DBLUNION_NORMALIZE_NAN_CHECK(&du); DUK_ASSERT(DUK_DBLUNION_IS_NORMALIZED(&du)); tv_z = thr->valstack_bottom + idx_z; - DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_z, du.d); /* side effects */ -#endif /* DUK_USE_EXEC_PREFER_SIZE */ + DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_z, du.d); /* side effects */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ } -DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_fast_t idx_z, duk_small_uint_fast_t opcode) { +DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread *thr, + duk_tval *tv_x, + duk_tval *tv_y, + duk_small_uint_fast_t idx_z, + duk_small_uint_fast_t opcode) { /* * Binary bitwise operations use different coercions (ToInt32, ToUint32) * depending on the operation. We coerce the arguments first using @@ -76263,20 +77551,19 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread #endif DUK_ASSERT(thr != NULL); - DUK_ASSERT(tv_x != NULL); /* may be reg or const */ - DUK_ASSERT(tv_y != NULL); /* may be reg or const */ - DUK_ASSERT_DISABLE(idx_z >= 0); /* unsigned */ + DUK_ASSERT(tv_x != NULL); /* may be reg or const */ + DUK_ASSERT(tv_y != NULL); /* may be reg or const */ + DUK_ASSERT_DISABLE(idx_z >= 0); /* unsigned */ DUK_ASSERT((duk_uint_t) idx_z < (duk_uint_t) duk_get_top(thr)); - opcode_shifted = opcode >> 2; /* Get base opcode without reg/const modifiers. */ + opcode_shifted = opcode >> 2; /* Get base opcode without reg/const modifiers. */ #if defined(DUK_USE_FASTINT) if (DUK_TVAL_IS_FASTINT(tv_x) && DUK_TVAL_IS_FASTINT(tv_y)) { i1 = (duk_int32_t) DUK_TVAL_GET_FASTINT_I32(tv_x); i2 = (duk_int32_t) DUK_TVAL_GET_FASTINT_I32(tv_y); - } - else -#endif /* DUK_USE_FASTINT */ + } else +#endif /* DUK_USE_FASTINT */ { duk_push_tval(thr, tv_x); duk_push_tval(thr, tv_y); @@ -76305,15 +77592,15 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread */ u2 = ((duk_uint32_t) i2) & 0xffffffffUL; - i3 = (duk_int32_t) (((duk_uint32_t) i1) << (u2 & 0x1fUL)); /* E5 Section 11.7.1, steps 7 and 8 */ - i3 = i3 & ((duk_int32_t) 0xffffffffUL); /* Note: left shift, should mask */ + i3 = (duk_int32_t) (((duk_uint32_t) i1) << (u2 & 0x1fUL)); /* E5 Section 11.7.1, steps 7 and 8 */ + i3 = i3 & ((duk_int32_t) 0xffffffffUL); /* Note: left shift, should mask */ break; } case DUK_OP_BASR >> 2: { /* signed shift */ u2 = ((duk_uint32_t) i2) & 0xffffffffUL; - i3 = i1 >> (u2 & 0x1fUL); /* E5 Section 11.7.2, steps 7 and 8 */ + i3 = i1 >> (u2 & 0x1fUL); /* E5 Section 11.7.2, steps 7 and 8 */ break; } case DUK_OP_BLSR >> 2: { @@ -76323,7 +77610,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread u2 = ((duk_uint32_t) i2) & 0xffffffffUL; /* special result value handling */ - u3 = u1 >> (u2 & 0x1fUL); /* E5 Section 11.7.2, steps 7 and 8 */ + u3 = u1 >> (u2 & 0x1fUL); /* E5 Section 11.7.2, steps 7 and 8 */ #if defined(DUK_USE_FASTINT) fi3 = (duk_int64_t) u3; goto fastint_result_set; @@ -76334,7 +77621,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread } default: { DUK_UNREACHABLE(); - i3 = 0; /* should not happen */ + i3 = 0; /* should not happen */ break; } } @@ -76346,28 +77633,31 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread */ fi3 = (duk_int64_t) i3; - fastint_result_set: +fastint_result_set: tv_z = thr->valstack_bottom + idx_z; - DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_z, fi3); /* side effects */ -#else /* DUK_USE_FASTINT */ + DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_z, fi3); /* side effects */ +#else /* DUK_USE_FASTINT */ d3 = (duk_double_t) i3; - result_set: - DUK_ASSERT(!DUK_ISNAN(d3)); /* 'd3' is never NaN, so no need to normalize */ - DUK_ASSERT_DOUBLE_IS_NORMALIZED(d3); /* always normalized */ +result_set: + DUK_ASSERT(!DUK_ISNAN(d3)); /* 'd3' is never NaN, so no need to normalize */ + DUK_ASSERT_DOUBLE_IS_NORMALIZED(d3); /* always normalized */ #if defined(DUK_USE_EXEC_PREFER_SIZE) - duk_push_number(thr, d3); /* would NaN normalize result, but unnecessary */ + duk_push_number(thr, d3); /* would NaN normalize result, but unnecessary */ duk_replace(thr, (duk_idx_t) idx_z); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ tv_z = thr->valstack_bottom + idx_z; - DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_z, d3); /* side effects */ -#endif /* DUK_USE_EXEC_PREFER_SIZE */ -#endif /* DUK_USE_FASTINT */ + DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_z, d3); /* side effects */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_FASTINT */ } /* In-place unary operation. */ -DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst, duk_small_uint_fast_t opcode) { +DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *thr, + duk_uint_fast_t idx_src, + duk_uint_fast_t idx_dst, + duk_small_uint_fast_t opcode) { /* * Arithmetic operations other than '+' have number-only semantics * and are implemented here. The separate switch-case here means a @@ -76413,12 +77703,12 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *t } /* fall through if overflow etc */ } -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ if (DUK_TVAL_IS_NUMBER(tv)) { d1 = DUK_TVAL_GET_NUMBER(tv); } else { - d1 = duk_to_number_tval(thr, tv); /* side effects */ + d1 = duk_to_number_tval(thr, tv); /* side effects */ } if (opcode == DUK_OP_UNP) { @@ -76429,13 +77719,13 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *t DUK_ASSERT(DUK_DBLUNION_IS_NORMALIZED(&du)); #if defined(DUK_USE_FASTINT) tv = DUK_GET_TVAL_POSIDX(thr, (duk_idx_t) idx_dst); - DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF(thr, tv, du.d); /* always 'fast', i.e. inlined */ + DUK_TVAL_SET_NUMBER_CHKFAST_UPDREF(thr, tv, du.d); /* always 'fast', i.e. inlined */ return; #endif } else { DUK_ASSERT(opcode == DUK_OP_UNM); du.d = -d1; - DUK_DBLUNION_NORMALIZE_NAN_CHECK(&du); /* mandatory if du.d is a NaN */ + DUK_DBLUNION_NORMALIZE_NAN_CHECK(&du); /* mandatory if du.d is a NaN */ DUK_ASSERT(DUK_DBLUNION_IS_NORMALIZED(&du)); } @@ -76463,19 +77753,18 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_not(duk_hthread *thr, #if defined(DUK_USE_FASTINT) if (DUK_TVAL_IS_FASTINT(tv)) { i1 = (duk_int32_t) DUK_TVAL_GET_FASTINT_I32(tv); - } - else -#endif /* DUK_USE_FASTINT */ + } else +#endif /* DUK_USE_FASTINT */ { duk_push_tval(thr, tv); - i1 = duk_to_int32(thr, -1); /* side effects */ + i1 = duk_to_int32(thr, -1); /* side effects */ duk_pop_unsafe(thr); } /* Result is always fastint compatible. */ i2 = ~i1; tv = DUK_GET_TVAL_POSIDX(thr, (duk_idx_t) idx_dst); - DUK_TVAL_SET_I32_UPDREF(thr, tv, i2); /* side effects */ + DUK_TVAL_SET_I32_UPDREF(thr, tv, i2); /* side effects */ } DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_logical_not(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst) { @@ -76497,16 +77786,19 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_logical_not(duk_hthread *thr, * duk_js_toboolean() and then push+replace to the result slot. */ tv = DUK_GET_TVAL_POSIDX(thr, (duk_idx_t) idx_src); - res = duk_js_toboolean(tv); /* does not modify 'tv' */ + res = duk_js_toboolean(tv); /* does not modify 'tv' */ DUK_ASSERT(res == 0 || res == 1); res ^= 1; tv = DUK_GET_TVAL_POSIDX(thr, (duk_idx_t) idx_dst); /* XXX: size optimize: push+replace? */ - DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv, res); /* side effects */ + DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv, res); /* side effects */ } /* XXX: size optimized variant */ -DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_hthread *thr, duk_tval *tv_dst, duk_tval *tv_src, duk_small_uint_t op) { +DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_hthread *thr, + duk_tval *tv_dst, + duk_tval *tv_src, + duk_small_uint_t op) { duk_double_t x, y, z; /* Two lowest bits of opcode are used to distinguish @@ -76533,13 +77825,13 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_ht y_fi = x_fi + 1; } - DUK_TVAL_SET_FASTINT(tv_src, y_fi); /* no need for refcount update */ + DUK_TVAL_SET_FASTINT(tv_src, y_fi); /* no need for refcount update */ z_fi = (op & 0x02) ? x_fi : y_fi; - DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_dst, z_fi); /* side effects */ + DUK_TVAL_SET_FASTINT_UPDREF(thr, tv_dst, z_fi); /* side effects */ return; } - skip_fastint: +skip_fastint: #endif if (DUK_TVAL_IS_NUMBER(tv_src)) { /* Fast path for the case where the register @@ -76553,7 +77845,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_ht y = x + 1.0; } - DUK_TVAL_SET_NUMBER(tv_src, y); /* no need for refcount update */ + DUK_TVAL_SET_NUMBER(tv_src, y); /* no need for refcount update */ } else { /* Preserve duk_tval pointer(s) across a potential valstack * resize by converting them into offsets temporarily. @@ -76562,8 +77854,8 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_ht duk_size_t off_dst; off_dst = (duk_size_t) ((duk_uint8_t *) tv_dst - (duk_uint8_t *) thr->valstack_bottom); - bc = (duk_idx_t) (tv_src - thr->valstack_bottom); /* XXX: pass index explicitly? */ - tv_src = NULL; /* no longer referenced */ + bc = (duk_idx_t) (tv_src - thr->valstack_bottom); /* XXX: pass index explicitly? */ + tv_src = NULL; /* no longer referenced */ x = duk_to_number(thr, bc); if (op & 0x01) { @@ -76579,10 +77871,14 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_ht } z = (op & 0x02) ? x : y; - DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_dst, z); /* side effects */ + DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_dst, z); /* side effects */ } -DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_var_helper(duk_hthread *thr, duk_small_uint_t idx_dst, duk_tval *tv_id, duk_small_uint_t op, duk_small_uint_t is_strict) { +DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_var_helper(duk_hthread *thr, + duk_small_uint_t idx_dst, + duk_tval *tv_id, + duk_small_uint_t op, + duk_small_uint_t is_strict) { duk_activation *act; duk_double_t x, y; duk_hstring *name; @@ -76608,7 +77904,7 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_var_helper(duk_ht name = DUK_TVAL_GET_STRING(tv_id); DUK_ASSERT(name != NULL); act = thr->callstack_curr; - (void) duk_js_getvar_activation(thr, act, name, 1 /*throw*/); /* -> [ ... val this ] */ + (void) duk_js_getvar_activation(thr, act, name, 1 /*throw*/); /* -> [ ... val this ] */ /* XXX: Fastint fast path would be useful here. Also fastints * now lose their fastint status in current handling which is @@ -76625,22 +77921,22 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_var_helper(duk_ht /* [... x this] */ if (op & 0x02) { - duk_push_number(thr, y); /* -> [ ... x this y ] */ + duk_push_number(thr, y); /* -> [ ... x this y ] */ DUK_ASSERT(act == thr->callstack_curr); duk_js_putvar_activation(thr, act, name, DUK_GET_TVAL_NEGIDX(thr, -1), is_strict); - duk_pop_2_unsafe(thr); /* -> [ ... x ] */ + duk_pop_2_unsafe(thr); /* -> [ ... x ] */ } else { - duk_pop_2_unsafe(thr); /* -> [ ... ] */ - duk_push_number(thr, y); /* -> [ ... y ] */ + duk_pop_2_unsafe(thr); /* -> [ ... ] */ + duk_push_number(thr, y); /* -> [ ... y ] */ DUK_ASSERT(act == thr->callstack_curr); duk_js_putvar_activation(thr, act, name, DUK_GET_TVAL_NEGIDX(thr, -1), is_strict); } #if defined(DUK_USE_EXEC_PREFER_SIZE) duk_replace(thr, (duk_idx_t) idx_dst); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ DUK__REPLACE_TO_TVPTR(thr, DUK_GET_TVAL_POSIDX(thr, (duk_idx_t) idx_dst)); -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ } /* @@ -76654,11 +77950,11 @@ DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_var_helper(duk_ht * handled recursively. */ -#define DUK__LONGJMP_RESTART 0 /* state updated, restart bytecode execution */ -#define DUK__LONGJMP_RETHROW 1 /* exit bytecode executor by rethrowing an error to caller */ +#define DUK__LONGJMP_RESTART 0 /* state updated, restart bytecode execution */ +#define DUK__LONGJMP_RETHROW 1 /* exit bytecode executor by rethrowing an error to caller */ -#define DUK__RETHAND_RESTART 0 /* state updated, restart bytecode execution */ -#define DUK__RETHAND_FINISHED 1 /* exit bytecode execution with return value */ +#define DUK__RETHAND_RESTART 0 /* state updated, restart bytecode execution */ +#define DUK__RETHAND_FINISHED 1 /* exit bytecode execution with return value */ /* XXX: optimize reconfig valstack operations so that resize, clamp, and setting * top are combined into one pass. @@ -76687,7 +77983,8 @@ DUK_LOCAL void duk__reconfig_valstack_ecma_return(duk_hthread *thr) { thr->valstack_bottom = (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + act->bottom_byteoff); DUK_ASSERT(act->retval_byteoff >= act->bottom_byteoff); - clamp_top = (duk_idx_t) ((act->retval_byteoff - act->bottom_byteoff + sizeof(duk_tval)) / sizeof(duk_tval)); /* +1 = one retval */ + clamp_top = + (duk_idx_t) ((act->retval_byteoff - act->bottom_byteoff + sizeof(duk_tval)) / sizeof(duk_tval)); /* +1 = one retval */ duk_set_top_and_wipe(thr, h_func->nregs, clamp_top); DUK_ASSERT((duk_uint8_t *) thr->valstack_end >= (duk_uint8_t *) thr->valstack + act->reserve_byteoff); @@ -76717,7 +78014,7 @@ DUK_LOCAL void duk__reconfig_valstack_ecma_catcher(duk_hthread *thr, duk_activat thr->valstack_bottom = (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + act->bottom_byteoff); idx_bottom = (duk_size_t) (thr->valstack_bottom - thr->valstack); DUK_ASSERT(cat->idx_base >= idx_bottom); - clamp_top = (duk_idx_t) (cat->idx_base - idx_bottom + 2); /* +2 = catcher value, catcher lj_type */ + clamp_top = (duk_idx_t) (cat->idx_base - idx_bottom + 2); /* +2 = catcher value, catcher lj_type */ duk_set_top_and_wipe(thr, h_func->nregs, clamp_top); DUK_ASSERT((duk_uint8_t *) thr->valstack_end >= (duk_uint8_t *) thr->valstack + act->reserve_byteoff); @@ -76745,7 +78042,10 @@ DUK_LOCAL void duk__set_catcher_regs_norz(duk_hthread *thr, duk_catcher *cat, du DUK_TVAL_SET_U32_UPDREF_NORZ(thr, tv1, (duk_uint32_t) lj_type); } -DUK_LOCAL void duk__handle_catch_part1(duk_hthread *thr, duk_tval *tv_val_unstable, duk_small_uint_t lj_type, volatile duk_bool_t *out_delayed_catch_setup) { +DUK_LOCAL void duk__handle_catch_part1(duk_hthread *thr, + duk_tval *tv_val_unstable, + duk_small_uint_t lj_type, + volatile duk_bool_t *out_delayed_catch_setup) { duk_activation *act; duk_catcher *cat; @@ -76783,7 +78083,7 @@ DUK_LOCAL void duk__handle_catch_part1(duk_hthread *thr, duk_tval *tv_val_unstab cat = act->cat; DUK_ASSERT(cat != NULL); - act->curr_pc = cat->pc_base + 0; /* +0 = catch */ + act->curr_pc = cat->pc_base + 0; /* +0 = catch */ /* * If the catch block has an automatic catch variable binding, @@ -76843,9 +78143,7 @@ DUK_LOCAL void duk__handle_catch_part2(duk_hthread *thr) { DUK_ASSERT(act->var_env != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(act) != NULL); - new_env = duk_hdecenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); + new_env = duk_hdecenv_alloc(thr, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); DUK_ASSERT(new_env != NULL); duk_push_hobject(thr, (duk_hobject *) new_env); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) new_env) == NULL); @@ -76863,7 +78161,7 @@ DUK_LOCAL void duk__handle_catch_part2(duk_hthread *thr) { duk_push_hstring(thr, cat->h_varname); DUK_ASSERT(thr->valstack + cat->idx_base < thr->valstack_top); duk_push_tval(thr, thr->valstack + cat->idx_base); - duk_xdef_prop(thr, -3, DUK_PROPDESC_FLAGS_W); /* writable, not configurable */ + duk_xdef_prop(thr, -3, DUK_PROPDESC_FLAGS_W); /* writable, not configurable */ /* [ ... env ] */ @@ -76871,7 +78169,7 @@ DUK_LOCAL void duk__handle_catch_part2(duk_hthread *thr) { DUK_ASSERT(act != NULL); DUK_HOBJECT_SET_PROTOTYPE(thr->heap, (duk_hobject *) new_env, act->lex_env); act->lex_env = (duk_hobject *) new_env; - DUK_HOBJECT_INCREF(thr, (duk_hobject *) new_env); /* reachable through activation */ + DUK_HOBJECT_INCREF(thr, (duk_hobject *) new_env); /* reachable through activation */ /* Net refcount change to act->lex_env is 0: incref for new_env's * prototype, decref for act->lex_env overwrite. */ @@ -76913,7 +78211,7 @@ DUK_LOCAL void duk__handle_finally(duk_hthread *thr, duk_tval *tv_val_unstable, cat = act->cat; DUK_ASSERT(cat != NULL); - act->curr_pc = cat->pc_base + 1; /* +1 = finally */ + act->curr_pc = cat->pc_base + 1; /* +1 = finally */ DUK_CAT_CLEAR_FINALLY_ENABLED(cat); } @@ -76962,18 +78260,21 @@ DUK_LOCAL void duk__handle_yield(duk_hthread *thr, duk_hthread *resumer, duk_tva act_resumer = resumer->callstack_curr; DUK_ASSERT(act_resumer != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(act_resumer) != NULL); - DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(act_resumer))); /* resume caller must be an ECMAScript func */ + DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(act_resumer))); /* resume caller must be an ECMAScript func */ - tv1 = (duk_tval *) (void *) ((duk_uint8_t *) resumer->valstack + act_resumer->retval_byteoff); /* return value from Duktape.Thread.resume() */ - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv_val_unstable); /* side effects */ /* XXX: avoid side effects */ + tv1 = (duk_tval *) (void *) ((duk_uint8_t *) resumer->valstack + + act_resumer->retval_byteoff); /* return value from Duktape.Thread.resume() */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv_val_unstable); /* side effects */ /* XXX: avoid side effects */ duk__reconfig_valstack_ecma_return(resumer); /* caller must change active thread, and set thr->resumer to NULL */ } -#endif /* DUK_USE_COROUTINE_SUPPORT */ +#endif /* DUK_USE_COROUTINE_SUPPORT */ -DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation *entry_act, volatile duk_bool_t *out_delayed_catch_setup) { +DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, + duk_activation *entry_act, + volatile duk_bool_t *out_delayed_catch_setup) { duk_small_uint_t retval = DUK__LONGJMP_RESTART; DUK_ASSERT(thr != NULL); @@ -76994,17 +78295,16 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation * - 'thr' must reflect the "throwing" thread */ - check_longjmp: +check_longjmp: DUK_DD(DUK_DDPRINT("handling longjmp: type=%ld, value1=%!T, value2=%!T, iserror=%ld, top=%ld", (long) thr->heap->lj.type, (duk_tval *) &thr->heap->lj.value1, (duk_tval *) &thr->heap->lj.value2, (long) thr->heap->lj.iserror, - (long) duk_get_top(thr))); + (long) duk_get_top(thr))); switch (thr->heap->lj.type) { - #if defined(DUK_USE_COROUTINE_SUPPORT) case DUK_LJ_TYPE_RESUME: { /* @@ -77018,15 +78318,15 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation /* duk_bi_duk_object_yield() and duk_bi_duk_object_resume() ensure all of these are met */ - DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_RUNNING); /* unchanged by Duktape.Thread.resume() */ - DUK_ASSERT(thr->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ + DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_RUNNING); /* unchanged by Duktape.Thread.resume() */ + DUK_ASSERT(thr->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ DUK_ASSERT(thr->callstack_curr != NULL); DUK_ASSERT(thr->callstack_curr->parent != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr) != NULL && DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr)) && ((duk_hnatfunc *) DUK_ACT_GET_FUNC(thr->callstack_curr))->func == duk_bi_thread_resume); - tv = &thr->heap->lj.value2; /* resumee */ + tv = &thr->heap->lj.value2; /* resumee */ DUK_ASSERT(DUK_TVAL_IS_OBJECT(tv)); DUK_ASSERT(DUK_TVAL_GET_OBJECT(tv) != NULL); DUK_ASSERT(DUK_HOBJECT_IS_THREAD(DUK_TVAL_GET_OBJECT(tv))); @@ -77035,15 +78335,15 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation DUK_ASSERT(resumee != NULL); DUK_ASSERT(resumee->resumer == NULL); DUK_ASSERT(resumee->state == DUK_HTHREAD_STATE_INACTIVE || - resumee->state == DUK_HTHREAD_STATE_YIELDED); /* checked by Duktape.Thread.resume() */ + resumee->state == DUK_HTHREAD_STATE_YIELDED); /* checked by Duktape.Thread.resume() */ DUK_ASSERT(resumee->state != DUK_HTHREAD_STATE_YIELDED || - resumee->callstack_top >= 2); /* YIELDED: ECMAScript activation + Duktape.Thread.yield() activation */ + resumee->callstack_top >= 2); /* YIELDED: ECMAScript activation + Duktape.Thread.yield() activation */ DUK_ASSERT(resumee->state != DUK_HTHREAD_STATE_YIELDED || (DUK_ACT_GET_FUNC(resumee->callstack_curr) != NULL && DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(resumee->callstack_curr)) && ((duk_hnatfunc *) DUK_ACT_GET_FUNC(resumee->callstack_curr))->func == duk_bi_thread_yield)); DUK_ASSERT(resumee->state != DUK_HTHREAD_STATE_INACTIVE || - resumee->callstack_top == 0); /* INACTIVE: no activation, single function value on valstack */ + resumee->callstack_top == 0); /* INACTIVE: no activation, single function value on valstack */ if (thr->heap->lj.iserror) { /* @@ -77069,7 +78369,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation /* thr->heap->lj.value1 is already the value to throw */ /* thr->heap->lj.value2 is 'thread', will be wiped out at the end */ - DUK_ASSERT(thr->heap->lj.iserror); /* already set */ + DUK_ASSERT(thr->heap->lj.iserror); /* already set */ DUK_DD(DUK_DDPRINT("-> resume with an error, converted to a throw in the resumee, propagate")); goto check_longjmp; @@ -77082,17 +78382,18 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation duk_activation *act_resumee; DUK_ASSERT(resumee->callstack_top >= 2); - act_resumee = resumee->callstack_curr; /* Duktape.Thread.yield() */ + act_resumee = resumee->callstack_curr; /* Duktape.Thread.yield() */ DUK_ASSERT(act_resumee != NULL); - act_resumee = act_resumee->parent; /* ECMAScript call site for yield() */ + act_resumee = act_resumee->parent; /* ECMAScript call site for yield() */ DUK_ASSERT(act_resumee != NULL); - tv = (duk_tval *) (void *) ((duk_uint8_t *) resumee->valstack + act_resumee->retval_byteoff); /* return value from Duktape.Thread.yield() */ + tv = (duk_tval *) (void *) ((duk_uint8_t *) resumee->valstack + + act_resumee->retval_byteoff); /* return value from Duktape.Thread.yield() */ DUK_ASSERT(tv >= resumee->valstack && tv < resumee->valstack_top); tv2 = &thr->heap->lj.value1; - DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv2); /* side effects */ /* XXX: avoid side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv, tv2); /* side effects */ /* XXX: avoid side effects */ - duk_hthread_activation_unwind_norz(resumee); /* unwind to 'yield' caller */ + duk_hthread_activation_unwind_norz(resumee); /* unwind to 'yield' caller */ /* no need to unwind catch stack */ duk__reconfig_valstack_ecma_return(resumee); @@ -77122,7 +78423,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation /* resumee: [... initial_func undefined(= this) resume_value ] */ - call_flags = DUK_CALL_FLAG_ALLOW_ECMATOECMA; /* not tailcall, ecma-to-ecma (assumed to succeed) */ + call_flags = DUK_CALL_FLAG_ALLOW_ECMATOECMA; /* not tailcall, ecma-to-ecma (assumed to succeed) */ setup_rc = duk_handle_call_unprotected_nargs(resumee, 1 /*nargs*/, call_flags); if (setup_rc == 0) { @@ -77149,7 +78450,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation goto wipe_and_return; } DUK_UNREACHABLE(); - break; /* never here */ + break; /* never here */ } case DUK_LJ_TYPE_YIELD: { @@ -77167,31 +78468,31 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation /* duk_bi_duk_object_yield() and duk_bi_duk_object_resume() ensure all of these are met */ -#if 0 /* entry_thread not available for assert */ +#if 0 /* entry_thread not available for assert */ DUK_ASSERT(thr != entry_thread); /* Duktape.Thread.yield() should prevent */ #endif - DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_RUNNING); /* unchanged from Duktape.Thread.yield() */ - DUK_ASSERT(thr->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.yield() activation */ + DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_RUNNING); /* unchanged from Duktape.Thread.yield() */ + DUK_ASSERT(thr->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.yield() activation */ DUK_ASSERT(thr->callstack_curr != NULL); DUK_ASSERT(thr->callstack_curr->parent != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr) != NULL && DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr)) && ((duk_hnatfunc *) DUK_ACT_GET_FUNC(thr->callstack_curr))->func == duk_bi_thread_yield); DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack_curr->parent) != NULL && - DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr->parent))); /* an ECMAScript function */ + DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr->parent))); /* an ECMAScript function */ resumer = thr->resumer; DUK_ASSERT(resumer != NULL); - DUK_ASSERT(resumer->state == DUK_HTHREAD_STATE_RESUMED); /* written by a previous RESUME handling */ - DUK_ASSERT(resumer->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ + DUK_ASSERT(resumer->state == DUK_HTHREAD_STATE_RESUMED); /* written by a previous RESUME handling */ + DUK_ASSERT(resumer->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ DUK_ASSERT(resumer->callstack_curr != NULL); DUK_ASSERT(resumer->callstack_curr->parent != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(resumer->callstack_curr) != NULL && DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(resumer->callstack_curr)) && ((duk_hnatfunc *) DUK_ACT_GET_FUNC(resumer->callstack_curr))->func == duk_bi_thread_resume); DUK_ASSERT(DUK_ACT_GET_FUNC(resumer->callstack_curr->parent) != NULL && - DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(resumer->callstack_curr->parent))); /* an ECMAScript function */ + DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(resumer->callstack_curr->parent))); /* an ECMAScript function */ if (thr->heap->lj.iserror) { thr->state = DUK_HTHREAD_STATE_YIELDED; @@ -77203,7 +78504,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation thr->heap->lj.type = DUK_LJ_TYPE_THROW; /* lj.value1 is already set */ - DUK_ASSERT(thr->heap->lj.iserror); /* already set */ + DUK_ASSERT(thr->heap->lj.iserror); /* already set */ DUK_DD(DUK_DDPRINT("-> yield an error, converted to a throw in the resumer, propagate")); goto check_longjmp; @@ -77229,9 +78530,9 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation goto wipe_and_return; } DUK_UNREACHABLE(); - break; /* never here */ + break; /* never here */ } -#endif /* DUK_USE_COROUTINE_SUPPORT */ +#endif /* DUK_USE_COROUTINE_SUPPORT */ case DUK_LJ_TYPE_THROW: { /* @@ -77272,11 +78573,13 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation DUK_ASSERT(DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_TCF); DUK_DDD(DUK_DDDPRINT("before catch part 1: thr=%p, act=%p, cat=%p", - (void *) thr, (void *) act, (void *) act->cat)); + (void *) thr, + (void *) act, + (void *) act->cat)); duk__handle_catch_part1(thr, &thr->heap->lj.value1, DUK_LJ_TYPE_THROW, - out_delayed_catch_setup); + out_delayed_catch_setup); DUK_DD(DUK_DDPRINT("-> throw caught by a 'catch' clause, restart execution")); retval = DUK__LONGJMP_RESTART; @@ -77287,9 +78590,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation DUK_ASSERT(DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_TCF); DUK_ASSERT(!DUK_CAT_HAS_CATCH_ENABLED(cat)); - duk__handle_finally(thr, - &thr->heap->lj.value1, - DUK_LJ_TYPE_THROW); + duk__handle_finally(thr, &thr->heap->lj.value1, DUK_LJ_TYPE_THROW); DUK_DD(DUK_DDPRINT("-> throw caught by a 'finally' clause, restart execution")); retval = DUK__LONGJMP_RESTART; @@ -77319,20 +78620,21 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation */ DUK_ASSERT(thr->resumer != NULL); - DUK_ASSERT(thr->resumer->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ + DUK_ASSERT(thr->resumer->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ DUK_ASSERT(thr->resumer->callstack_curr != NULL); DUK_ASSERT(thr->resumer->callstack_curr->parent != NULL); - DUK_ASSERT(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent) != NULL && - DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent))); /* an ECMAScript function */ + DUK_ASSERT( + DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent) != NULL && + DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent))); /* an ECMAScript function */ resumer = thr->resumer; /* reset longjmp */ - DUK_ASSERT(thr->heap->lj.type == DUK_LJ_TYPE_THROW); /* already set */ + DUK_ASSERT(thr->heap->lj.type == DUK_LJ_TYPE_THROW); /* already set */ /* lj.value1 already set */ - duk_hthread_terminate(thr); /* updates thread state, minimizes its allocations */ + duk_hthread_terminate(thr); /* updates thread state, minimizes its allocations */ DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_TERMINATED); thr->resumer = NULL; @@ -77343,7 +78645,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation goto check_longjmp; } - case DUK_LJ_TYPE_BREAK: /* pseudotypes, not used in actual longjmps */ + case DUK_LJ_TYPE_BREAK: /* pseudotypes, not used in actual longjmps */ case DUK_LJ_TYPE_CONTINUE: case DUK_LJ_TYPE_RETURN: case DUK_LJ_TYPE_NORMAL: @@ -77353,25 +78655,24 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation goto convert_to_internal_error; } - } /* end switch */ + } /* end switch */ DUK_UNREACHABLE(); - wipe_and_return: - DUK_DD(DUK_DDPRINT("handling longjmp done, wipe-and-return, top=%ld", - (long) duk_get_top(thr))); +wipe_and_return: + DUK_DD(DUK_DDPRINT("handling longjmp done, wipe-and-return, top=%ld", (long) duk_get_top(thr))); thr->heap->lj.type = DUK_LJ_TYPE_UNKNOWN; thr->heap->lj.iserror = 0; - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, &thr->heap->lj.value1); /* side effects */ - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, &thr->heap->lj.value2); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, &thr->heap->lj.value1); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, &thr->heap->lj.value2); /* side effects */ DUK_GC_TORTURE(thr->heap); - just_return: +just_return: return retval; - convert_to_internal_error: +convert_to_internal_error: /* This could also be thrown internally (set the error, goto check_longjmp), * but it's better for internal errors to bubble outwards so that we won't * infinite loop in this catchpoint. @@ -77417,8 +78718,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_break_or_continue(duk_hthread /* XXX: bit mask test; FINALLY <-> TCF, single bit mask would suffice? */ - if (DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_TCF && - DUK_CAT_HAS_FINALLY_ENABLED(cat)) { + if (DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_TCF && DUK_CAT_HAS_FINALLY_ENABLED(cat)) { duk_tval tv_tmp; DUK_TVAL_SET_U32(&tv_tmp, (duk_uint32_t) label_id); @@ -77427,11 +78727,11 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_break_or_continue(duk_hthread DUK_DD(DUK_DDPRINT("-> break/continue caught by 'finally', restart execution")); return; } - if (DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_LABEL && - (duk_uint_t) DUK_CAT_GET_LABEL(cat) == label_id) { + if (DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_LABEL && (duk_uint_t) DUK_CAT_GET_LABEL(cat) == label_id) { duk__handle_label(thr, lj_type); - DUK_DD(DUK_DDPRINT("-> break/continue caught by a label catcher (in the same function), restart execution")); + DUK_DD( + DUK_DDPRINT("-> break/continue caught by a label catcher (in the same function), restart execution")); return; } @@ -77439,7 +78739,8 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_break_or_continue(duk_hthread } /* Should never happen, but be robust. */ - DUK_D(DUK_DPRINT("-> break/continue not caught by anything in the current function (should never happen), throw internal error")); + DUK_D(DUK_DPRINT( + "-> break/continue not caught by anything in the current function (should never happen), throw internal error")); DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return;); } @@ -77463,7 +78764,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * DUK_ASSERT(entry_act != NULL); DUK_ASSERT(thr->valstack_top - 1 >= thr->valstack_bottom); tv1 = thr->valstack_top - 1; - DUK_TVAL_CHKFAST_INPLACE_FAST(tv1); /* fastint downgrade check for return values */ + DUK_TVAL_CHKFAST_INPLACE_FAST(tv1); /* fastint downgrade check for return values */ /* * Four possible outcomes: @@ -77498,8 +78799,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * break; } - if (DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_TCF && - DUK_CAT_HAS_FINALLY_ENABLED(cat)) { + if (DUK_CAT_GET_TYPE(cat) == DUK_CAT_TYPE_TCF && DUK_CAT_HAS_FINALLY_ENABLED(cat)) { DUK_ASSERT(thr->valstack_top - 1 >= thr->valstack_bottom); duk__handle_finally(thr, thr->valstack_top - 1, DUK_LJ_TYPE_RETURN); @@ -77530,22 +78830,24 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * DUK_ASSERT(thr->callstack_curr != NULL); DUK_ASSERT(thr->callstack_curr->parent != NULL); - DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr->parent))); /* must be ECMAScript */ + DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->callstack_curr->parent))); /* must be ECMAScript */ #if defined(DUK_USE_ES6_PROXY) if (thr->callstack_curr->flags & (DUK_ACT_FLAG_CONSTRUCT | DUK_ACT_FLAG_CONSTRUCT_PROXY)) { - duk_call_construct_postprocess(thr, thr->callstack_curr->flags & DUK_ACT_FLAG_CONSTRUCT_PROXY); /* side effects */ + duk_call_construct_postprocess(thr, + thr->callstack_curr->flags & + DUK_ACT_FLAG_CONSTRUCT_PROXY); /* side effects */ } #else if (thr->callstack_curr->flags & DUK_ACT_FLAG_CONSTRUCT) { - duk_call_construct_postprocess(thr, 0); /* side effects */ + duk_call_construct_postprocess(thr, 0); /* side effects */ } #endif tv1 = (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + thr->callstack_curr->parent->retval_byteoff); DUK_ASSERT(thr->valstack_top - 1 >= thr->valstack_bottom); tv2 = thr->valstack_top - 1; - DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv1, tv2); /* side effects */ /* Catch stack unwind happens inline in callstack unwind. */ duk_hthread_activation_unwind_norz(thr); @@ -77560,14 +78862,15 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * DUK_DD(DUK_DDPRINT("no calling activation, thread finishes (similar to yield)")); DUK_ASSERT(thr->resumer != NULL); - DUK_ASSERT(thr->resumer->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ + DUK_ASSERT(thr->resumer->callstack_top >= 2); /* ECMAScript activation + Duktape.Thread.resume() activation */ DUK_ASSERT(thr->resumer->callstack_curr != NULL); DUK_ASSERT(thr->resumer->callstack_curr->parent != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr) != NULL && - DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr)) && - ((duk_hnatfunc *) DUK_ACT_GET_FUNC(thr->resumer->callstack_curr))->func == duk_bi_thread_resume); /* Duktape.Thread.resume() */ + DUK_HOBJECT_IS_NATFUNC(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr)) && + ((duk_hnatfunc *) DUK_ACT_GET_FUNC(thr->resumer->callstack_curr))->func == + duk_bi_thread_resume); /* Duktape.Thread.resume() */ DUK_ASSERT(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent) != NULL && - DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent))); /* an ECMAScript function */ + DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(thr->resumer->callstack_curr->parent))); /* an ECMAScript function */ DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_RUNNING); DUK_ASSERT(thr->resumer->state == DUK_HTHREAD_STATE_RESUMED); @@ -77589,11 +78892,11 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * */ DUK_ASSERT(thr->valstack_top - 1 >= thr->valstack_bottom); - duk_hthread_activation_unwind_norz(resumer); /* May remove last reference to 'thr', but is NORZ. */ - duk_push_tval(resumer, thr->valstack_top - 1); /* Capture return value, side effect free. */ - duk_push_hthread(resumer, thr); /* Make 'thr' reachable again, before side effects. */ + duk_hthread_activation_unwind_norz(resumer); /* May remove last reference to 'thr', but is NORZ. */ + duk_push_tval(resumer, thr->valstack_top - 1); /* Capture return value, side effect free. */ + duk_push_hthread(resumer, thr); /* Make 'thr' reachable again, before side effects. */ - duk_hthread_terminate(thr); /* Updates thread state, minimizes its allocations. */ + duk_hthread_terminate(thr); /* Updates thread state, minimizes its allocations. */ thr->resumer = NULL; DUK_HTHREAD_DECREF(thr, resumer); DUK_ASSERT(thr->state == DUK_HTHREAD_STATE_TERMINATED); @@ -77603,7 +78906,7 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * DUK_ASSERT(resumer->valstack_top - 2 >= resumer->valstack_bottom); duk__handle_yield(thr, resumer, resumer->valstack_top - 2); - thr = NULL; /* 'thr' invalidated by call */ + thr = NULL; /* 'thr' invalidated by call */ #if 0 thr = resumer; /* not needed */ @@ -77645,8 +78948,8 @@ DUK_LOCAL duk_small_uint_t duk__handle_return(duk_hthread *thr, duk_activation * #if defined(DUK_USE_INTERRUPT_COUNTER) -#define DUK__INT_NOACTION 0 /* no specific action, resume normal execution */ -#define DUK__INT_RESTART 1 /* must "goto restart_execution", e.g. breakpoints changed */ +#define DUK__INT_NOACTION 0 /* no specific action, resume normal execution */ +#define DUK__INT_RESTART 1 /* must "goto restart_execution", e.g. breakpoints changed */ #if defined(DUK_USE_DEBUGGER_SUPPORT) DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_immediate, duk_small_uint_t *out_interrupt_retval) { @@ -77657,7 +78960,7 @@ DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_ duk_bool_t process_messages; duk_bool_t processed_messages = 0; - DUK_ASSERT(thr->heap->dbg_processing == 0); /* don't re-enter e.g. during Eval */ + DUK_ASSERT(thr->heap->dbg_processing == 0); /* don't re-enter e.g. during Eval */ act = thr->callstack_curr; DUK_ASSERT(act != NULL); @@ -77680,17 +78983,14 @@ DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_ * Breakpoint and step state checks */ - if (act->flags & DUK_ACT_FLAG_BREAKPOINT_ACTIVE || - (thr->heap->dbg_pause_act == thr->callstack_curr)) { + if (act->flags & DUK_ACT_FLAG_BREAKPOINT_ACTIVE || (thr->heap->dbg_pause_act == thr->callstack_curr)) { line = duk_debug_curr_line(thr); if (act->prev_line != line) { /* Stepped? Step out is handled by callstack unwind. */ if ((thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_LINE_CHANGE) && - (thr->heap->dbg_pause_act == thr->callstack_curr) && - (line != thr->heap->dbg_pause_startline)) { - DUK_D(DUK_DPRINT("PAUSE TRIGGERED by line change, at line %ld", - (long) line)); + (thr->heap->dbg_pause_act == thr->callstack_curr) && (line != thr->heap->dbg_pause_startline)) { + DUK_D(DUK_DPRINT("PAUSE TRIGGERED by line change, at line %ld", (long) line)); duk_debug_set_paused(thr->heap); } @@ -77716,7 +79016,8 @@ DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_ DUK_ASSERT(bp->filename != NULL); if (act->prev_line != bp->line && line == bp->line) { DUK_D(DUK_DPRINT("PAUSE TRIGGERED by breakpoint at %!O:%ld", - (duk_heaphdr *) bp->filename, (long) bp->line)); + (duk_heaphdr *) bp->filename, + (long) bp->line)); duk_debug_set_paused(thr->heap); } } @@ -77809,11 +79110,10 @@ DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_ if (duk_debug_is_attached(thr->heap)) { DUK_ASSERT(act == thr->callstack_curr); DUK_ASSERT(act != NULL); - if (act->flags & DUK_ACT_FLAG_BREAKPOINT_ACTIVE || - (thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_ONE_OPCODE) || + if (act->flags & DUK_ACT_FLAG_BREAKPOINT_ACTIVE || (thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_ONE_OPCODE) || ((thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_LINE_CHANGE) && thr->heap->dbg_pause_act == thr->callstack_curr) || - DUK_HEAP_HAS_DEBUGGER_PAUSED(thr->heap)) { + DUK_HEAP_HAS_DEBUGGER_PAUSED(thr->heap)) { *out_immediate = 1; } @@ -77835,7 +79135,7 @@ DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_ DUK_D(DUK_DPRINT("debugger became detached, resume normal execution")); } } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ DUK_LOCAL DUK_EXEC_NOINLINE_PERF DUK_COLD duk_small_uint_t duk__executor_interrupt(duk_hthread *thr) { duk_int_t ctr; @@ -77852,8 +79152,10 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF DUK_COLD duk_small_uint_t duk__executor_interru thr->heap->inst_count_interrupt += thr->interrupt_init; DUK_DD(DUK_DDPRINT("execution interrupt, counter=%ld, init=%ld, " "instruction counts: executor=%ld, interrupt=%ld", - (long) thr->interrupt_counter, (long) thr->interrupt_init, - (long) thr->heap->inst_count_exec, (long) thr->heap->inst_count_interrupt)); + (long) thr->interrupt_counter, + (long) thr->interrupt_init, + (long) thr->heap->inst_count_exec, + (long) thr->heap->inst_count_interrupt)); #endif retval = DUK__INT_NOACTION; @@ -77915,18 +79217,17 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF DUK_COLD duk_small_uint_t duk__executor_interru DUK_ERROR_RANGE(thr, "execution timeout"); DUK_WO_NORETURN(return 0;); } -#endif /* DUK_USE_EXEC_TIMEOUT_CHECK */ +#endif /* DUK_USE_EXEC_TIMEOUT_CHECK */ #if defined(DUK_USE_DEBUGGER_SUPPORT) - if (!thr->heap->dbg_processing && - (thr->heap->dbg_read_cb != NULL || thr->heap->dbg_detaching)) { + if (!thr->heap->dbg_processing && (thr->heap->dbg_read_cb != NULL || thr->heap->dbg_detaching)) { /* Avoid recursive re-entry; enter when we're attached or * detaching (to finish off the pending detach). */ duk__interrupt_handle_debugger(thr, &immediate, &retval); DUK_ASSERT(act == thr->callstack_curr); } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ /* * Update the interrupt counter @@ -77949,7 +79250,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF DUK_COLD duk_small_uint_t duk__executor_interru return retval; } -#endif /* DUK_USE_INTERRUPT_COUNTER */ +#endif /* DUK_USE_INTERRUPT_COUNTER */ /* * Debugger handling for executor restart @@ -78017,8 +79318,7 @@ DUK_LOCAL void duk__executor_recheck_debugger(duk_hthread *thr, duk_activation * duk_hcompfunc *inner_fun; duk_bool_t bp_match; - if (bp->filename == filename && - bp->line >= fun->start_line && bp->line <= fun->end_line) { + if (bp->filename == filename && bp->line >= fun->start_line && bp->line <= fun->end_line) { bp_match = 1; DUK_DD(DUK_DDPRINT("breakpoint filename and line match: " "%s:%ld vs. %s (line %ld vs. %ld-%ld)", @@ -78055,13 +79355,12 @@ DUK_LOCAL void duk__executor_recheck_debugger(duk_hthread *thr, duk_activation * } } - *bp_active = NULL; /* terminate */ + *bp_active = NULL; /* terminate */ DUK_DD(DUK_DDPRINT("ACTIVE BREAKPOINTS: %ld", (long) (bp_active - thr->heap->dbg_breakpoints_active))); /* Force pause if we were doing "step into" in another activation. */ - if ((thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_FUNC_ENTRY) && - thr->heap->dbg_pause_act != thr->callstack_curr) { + if ((thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_FUNC_ENTRY) && thr->heap->dbg_pause_act != thr->callstack_curr) { DUK_D(DUK_DPRINT("PAUSE TRIGGERED by function entry")); duk_debug_set_paused(thr->heap); } @@ -78069,10 +79368,8 @@ DUK_LOCAL void duk__executor_recheck_debugger(duk_hthread *thr, duk_activation * /* Force interrupt right away if we're paused or in "checked mode". * Step out is handled by callstack unwind. */ - if ((act->flags & DUK_ACT_FLAG_BREAKPOINT_ACTIVE) || - DUK_HEAP_HAS_DEBUGGER_PAUSED(thr->heap) || - ((thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_LINE_CHANGE) && - thr->heap->dbg_pause_act == thr->callstack_curr)) { + if ((act->flags & DUK_ACT_FLAG_BREAKPOINT_ACTIVE) || DUK_HEAP_HAS_DEBUGGER_PAUSED(thr->heap) || + ((thr->heap->dbg_pause_flags & DUK_PAUSE_FLAG_LINE_CHANGE) && thr->heap->dbg_pause_act == thr->callstack_curr)) { /* We'll need to interrupt early so recompute the init * counter to reflect the number of bytecode instructions * executed so that step counts for e.g. debugger rate @@ -78083,7 +79380,7 @@ DUK_LOCAL void duk__executor_recheck_debugger(duk_hthread *thr, duk_activation * thr->interrupt_counter = 0; } } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ /* * Opcode handlers for opcodes with a lot of code and which are relatively @@ -78107,18 +79404,14 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_initset_initget(duk_hthread /* This could be made more optimal by accessing internals directly. */ idx = (duk_uint_fast_t) DUK_DEC_BC(ins); - duk_dup(thr, (duk_idx_t) (idx + 0)); /* key */ - duk_dup(thr, (duk_idx_t) (idx + 1)); /* getter/setter */ + duk_dup(thr, (duk_idx_t) (idx + 0)); /* key */ + duk_dup(thr, (duk_idx_t) (idx + 1)); /* getter/setter */ if (is_set) { - defprop_flags = DUK_DEFPROP_HAVE_SETTER | - DUK_DEFPROP_FORCE | - DUK_DEFPROP_SET_ENUMERABLE | - DUK_DEFPROP_SET_CONFIGURABLE; + defprop_flags = + DUK_DEFPROP_HAVE_SETTER | DUK_DEFPROP_FORCE | DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE; } else { - defprop_flags = DUK_DEFPROP_HAVE_GETTER | - DUK_DEFPROP_FORCE | - DUK_DEFPROP_SET_ENUMERABLE | - DUK_DEFPROP_SET_CONFIGURABLE; + defprop_flags = + DUK_DEFPROP_HAVE_GETTER | DUK_DEFPROP_FORCE | DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE; } duk_def_prop(thr, (duk_idx_t) DUK_DEC_A(ins), defprop_flags); } @@ -78183,7 +79476,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, * error handling, so there's no side effect problem even if the * error value has a finalizer. */ - duk_dup(thr, (duk_idx_t) bc); /* Stabilize value. */ + duk_dup(thr, (duk_idx_t) bc); /* Stabilize value. */ duk_to_undefined(thr, (duk_idx_t) bc); duk_to_undefined(thr, (duk_idx_t) (bc + 1)); @@ -78198,7 +79491,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, cat->flags = DUK_CAT_TYPE_TCF; cat->h_varname = NULL; - cat->pc_base = (duk_instr_t *) curr_pc; /* pre-incremented, points to first jump slot */ + cat->pc_base = (duk_instr_t *) curr_pc; /* pre-incremented, points to first jump slot */ cat->idx_base = (duk_size_t) (thr->valstack_bottom - thr->valstack) + bc; act = thr->callstack_curr; @@ -78237,7 +79530,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, duk_js_init_activation_environment_records_delayed(thr, act); DUK_ASSERT(act == thr->callstack_curr); - DUK_UNREF(act); /* 'act' is no longer accessed, scanbuild fix */ + DUK_UNREF(act); /* 'act' is no longer accessed, scanbuild fix */ } DUK_ASSERT(act->lex_env != NULL); DUK_ASSERT(act->var_env != NULL); @@ -78250,12 +79543,10 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, * so avoid side effects very carefully until it is * referenced. */ - env = duk_hobjenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); + env = duk_hobjenv_alloc(thr, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_OBJENV)); DUK_ASSERT(env != NULL); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) env) == NULL); - env->target = target; /* always provideThis=true */ + env->target = target; /* always provideThis=true */ DUK_HOBJECT_INCREF(thr, target); env->has_this = 1; DUK_HOBJENV_ASSERT_VALID(env); @@ -78265,7 +79556,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) env) == NULL); DUK_ASSERT(act->lex_env != NULL); DUK_HOBJECT_SET_PROTOTYPE(thr->heap, (duk_hobject *) env, act->lex_env); - act->lex_env = (duk_hobject *) env; /* Now reachable. */ + act->lex_env = (duk_hobject *) env; /* Now reachable. */ DUK_HOBJECT_INCREF(thr, (duk_hobject *) env); /* Net refcount change to act->lex_env is 0: incref for env's * prototype, decref for act->lex_env overwrite. @@ -78274,7 +79565,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, /* Set catcher lex_env active (affects unwind) * only when the whole setup is complete. */ - cat = act->cat; /* XXX: better to relookup? not mandatory because 'cat' is stable */ + cat = act->cat; /* XXX: better to relookup? not mandatory because 'cat' is stable */ cat->flags |= DUK_CAT_FLAG_LEXENV_ACTIVE; } else { ; @@ -78283,7 +79574,9 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("TRYCATCH catcher: flags=0x%08lx, pc_base=%ld, " "idx_base=%ld, h_varname=%!O", (unsigned long) cat->flags, - (long) cat->pc_base, (long) cat->idx_base, (duk_heaphdr *) cat->h_varname)); + (long) cat->pc_base, + (long) cat->idx_base, + (duk_heaphdr *) cat->h_varname)); duk_pop_unsafe(thr); } @@ -78313,23 +79606,24 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endtry(duk_hthread tv1 = thr->valstack + cat->idx_base; DUK_ASSERT(tv1 >= thr->valstack && tv1 < thr->valstack_top); - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv1); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv1); /* side effects */ tv1 = NULL; tv1 = thr->valstack + cat->idx_base + 1; DUK_ASSERT(tv1 >= thr->valstack && tv1 < thr->valstack_top); - DUK_TVAL_SET_U32_UPDREF(thr, tv1, (duk_uint32_t) DUK_LJ_TYPE_NORMAL); /* side effects */ + DUK_TVAL_SET_U32_UPDREF(thr, tv1, (duk_uint32_t) DUK_LJ_TYPE_NORMAL); /* side effects */ tv1 = NULL; DUK_CAT_CLEAR_FINALLY_ENABLED(cat); } else { - DUK_DDD(DUK_DDDPRINT("ENDTRY: no finally part, dismantle catcher, jump through 2nd jump slot (to end of statement)")); + DUK_DDD( + DUK_DDDPRINT("ENDTRY: no finally part, dismantle catcher, jump through 2nd jump slot (to end of statement)")); - duk_hthread_catcher_unwind_norz(thr, act); /* lexenv may be set for 'with' binding */ + duk_hthread_catcher_unwind_norz(thr, act); /* lexenv may be set for 'with' binding */ /* no need to unwind callstack */ } - return pc_base + 1; /* new curr_pc value */ + return pc_base + 1; /* new curr_pc value */ } DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthread *thr, duk_uint_fast32_t ins) { @@ -78345,7 +79639,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthrea DUK_ASSERT(act != NULL); cat = act->cat; DUK_ASSERT(cat != NULL); - DUK_ASSERT(!DUK_CAT_HAS_CATCH_ENABLED(cat)); /* cleared before entering catch part */ + DUK_ASSERT(!DUK_CAT_HAS_CATCH_ENABLED(cat)); /* cleared before entering catch part */ if (DUK_CAT_HAS_LEXENV_ACTIVE(cat)) { duk_hobject *prev_env; @@ -78361,7 +79655,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthrea act->lex_env = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, prev_env); DUK_CAT_CLEAR_LEXENV_ACTIVE(cat); DUK_HOBJECT_INCREF(thr, act->lex_env); - DUK_HOBJECT_DECREF(thr, prev_env); /* side effects */ + DUK_HOBJECT_DECREF(thr, prev_env); /* side effects */ DUK_ASSERT(act == thr->callstack_curr); DUK_ASSERT(act != NULL); @@ -78374,26 +79668,29 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthrea tv1 = thr->valstack + cat->idx_base; DUK_ASSERT(tv1 >= thr->valstack && tv1 < thr->valstack_top); - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv1); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv1); /* side effects */ tv1 = NULL; tv1 = thr->valstack + cat->idx_base + 1; DUK_ASSERT(tv1 >= thr->valstack && tv1 < thr->valstack_top); - DUK_TVAL_SET_U32_UPDREF(thr, tv1, (duk_uint32_t) DUK_LJ_TYPE_NORMAL); /* side effects */ + DUK_TVAL_SET_U32_UPDREF(thr, tv1, (duk_uint32_t) DUK_LJ_TYPE_NORMAL); /* side effects */ tv1 = NULL; DUK_CAT_CLEAR_FINALLY_ENABLED(cat); } else { - DUK_DDD(DUK_DDDPRINT("ENDCATCH: no finally part, dismantle catcher, jump through 2nd jump slot (to end of statement)")); + DUK_DDD( + DUK_DDDPRINT("ENDCATCH: no finally part, dismantle catcher, jump through 2nd jump slot (to end of statement)")); duk_hthread_catcher_unwind_norz(thr, act); /* no need to unwind callstack */ } - return pc_base + 1; /* new curr_pc value */ + return pc_base + 1; /* new curr_pc value */ } -DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthread *thr, duk_uint_fast32_t ins, duk_activation *entry_act) { +DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthread *thr, + duk_uint_fast32_t ins, + duk_activation *entry_act) { duk_activation *act; duk_tval *tv1; duk_uint_t reg_catch; @@ -78415,7 +79712,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthr (duk_tval *) (thr->valstack_bottom + reg_catch + 0), (duk_tval *) (thr->valstack_bottom + reg_catch + 1))); - tv1 = thr->valstack_bottom + reg_catch + 1; /* type */ + tv1 = thr->valstack_bottom + reg_catch + 1; /* type */ DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv1)); #if defined(DUK_USE_FASTINT) DUK_ASSERT(DUK_TVAL_IS_FASTINT(tv1)); @@ -78424,7 +79721,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthr cont_type = (duk_small_uint_t) DUK_TVAL_GET_NUMBER(tv1); #endif - tv1--; /* value */ + tv1--; /* value */ switch (cont_type) { case DUK_LJ_TYPE_NORMAL: { @@ -78433,11 +79730,12 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthr duk_hthread_catcher_unwind_norz(thr, act); /* no need to unwind callstack */ - return 0; /* restart execution */ + return 0; /* restart execution */ } case DUK_LJ_TYPE_RETURN: { DUK_DDD(DUK_DDDPRINT("ENDFIN: finally part finishing with 'return' complation -> dismantle " - "catcher, handle return, lj.value1=%!T", tv1)); + "catcher, handle return, lj.value1=%!T", + tv1)); /* Not necessary to unwind catch stack: return handling will * do it. The finally flag of 'cat' is no longer set. The @@ -78447,12 +79745,12 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthr duk_push_tval(thr, tv1); ret_result = duk__handle_return(thr, entry_act); if (ret_result == DUK__RETHAND_RESTART) { - return 0; /* restart execution */ + return 0; /* restart execution */ } DUK_ASSERT(ret_result == DUK__RETHAND_FINISHED); DUK_DDD(DUK_DDDPRINT("exiting executor after ENDFIN and RETURN (pseudo) longjmp type")); - return 1; /* exit executor */ + return 1; /* exit executor */ } case DUK_LJ_TYPE_BREAK: case DUK_LJ_TYPE_CONTINUE: { @@ -78474,7 +79772,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthr #endif lj_type = cont_type; duk__handle_break_or_continue(thr, label_id, lj_type); - return 0; /* restart execution */ + return 0; /* restart execution */ } default: { DUK_DDD(DUK_DDDPRINT("ENDFIN: finally part finishing with abrupt completion, lj_type=%ld -> " @@ -78484,7 +79782,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthr duk_err_setup_ljstate1(thr, (duk_small_uint_t) cont_type, tv1); /* No debugger Throw notify check on purpose (rethrow). */ - DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* always in executor */ + DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* always in executor */ duk_err_longjmp(thr); DUK_UNREACHABLE(); } @@ -78517,7 +79815,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_initenum(duk_hthread *thr, } else { duk_dup(thr, (duk_idx_t) c); duk_to_object(thr, -1); - duk_hobject_enumerator_create(thr, 0 /*enum_flags*/); /* [ ... val ] --> [ ... enum ] */ + duk_hobject_enumerator_create(thr, 0 /*enum_flags*/); /* [ ... val ] --> [ ... enum ] */ duk_replace(thr, (duk_idx_t) b); } } @@ -78549,13 +79847,12 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_nextenum(duk_ht duk_dup(thr, (duk_idx_t) c); if (duk_hobject_enumerator_next(thr, 0 /*get_value*/)) { /* [ ... enum ] -> [ ... next_key ] */ - DUK_DDD(DUK_DDDPRINT("enum active, next key is %!T, skip jump slot ", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD(DUK_DDDPRINT("enum active, next key is %!T, skip jump slot ", (duk_tval *) duk_get_tval(thr, -1))); pc_skip = 1; } else { /* [ ... enum ] -> [ ... ] */ DUK_DDD(DUK_DDDPRINT("enum finished, execute jump slot")); - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* valstack policy */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* valstack policy */ thr->valstack_top++; } duk_replace(thr, (duk_idx_t) b); @@ -78575,7 +79872,7 @@ DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_nextenum(duk_ht DUK_LOCAL duk_bool_t duk__executor_handle_call(duk_hthread *thr, duk_idx_t idx, duk_idx_t nargs, duk_small_uint_t call_flags) { duk_bool_t rc; - duk_set_top_unsafe(thr, (duk_idx_t) (idx + nargs + 2)); /* [ ... func this arg1 ... argN ] */ + duk_set_top_unsafe(thr, (duk_idx_t) (idx + nargs + 2)); /* [ ... func this arg1 ... argN ] */ /* Attempt an Ecma-to-Ecma call setup. If the call * target is (directly or indirectly) Reflect.construct(), @@ -78629,22 +79926,22 @@ DUK_LOCAL duk_bool_t duk__executor_handle_call(duk_hthread *thr, duk_idx_t idx, * difference and the best option is architecture dependent. */ #if defined(DUK_USE_EXEC_FUN_LOCAL) -#define DUK__FUN() fun +#define DUK__FUN() fun #else -#define DUK__FUN() ((duk_hcompfunc *) DUK_ACT_GET_FUNC((thr)->callstack_curr)) +#define DUK__FUN() ((duk_hcompfunc *) DUK_ACT_GET_FUNC((thr)->callstack_curr)) #endif /* Strict flag. */ -#define DUK__STRICT() ((duk_small_uint_t) DUK_HOBJECT_HAS_STRICT((duk_hobject *) DUK__FUN())) +#define DUK__STRICT() ((duk_small_uint_t) DUK_HOBJECT_HAS_STRICT((duk_hobject *) DUK__FUN())) /* Reg/const access macros: these are very footprint and performance sensitive * so modify with care. Arguments are sometimes evaluated multiple times which * is not ideal. */ -#define DUK__REG(x) (*(thr->valstack_bottom + (x))) -#define DUK__REGP(x) (thr->valstack_bottom + (x)) -#define DUK__CONST(x) (*(consts + (x))) -#define DUK__CONSTP(x) (consts + (x)) +#define DUK__REG(x) (*(thr->valstack_bottom + (x))) +#define DUK__REGP(x) (thr->valstack_bottom + (x)) +#define DUK__CONST(x) (*(consts + (x))) +#define DUK__CONSTP(x) (consts + (x)) /* Reg/const access macros which take the 32-bit instruction and avoid an * explicit field decoding step by using shifts and masks. These must be @@ -78653,68 +79950,74 @@ DUK_LOCAL duk_bool_t duk__executor_handle_call(duk_hthread *thr, duk_idx_t idx, * instead of a duk_tval offset which needs further shifting (which is an * issue on some, but not all, CPUs). */ -#define DUK__RCBIT_B DUK_BC_REGCONST_B -#define DUK__RCBIT_C DUK_BC_REGCONST_C +#define DUK__RCBIT_B DUK_BC_REGCONST_B +#define DUK__RCBIT_C DUK_BC_REGCONST_C #if defined(DUK_USE_EXEC_REGCONST_OPTIMIZE) #if defined(DUK_USE_PACKED_TVAL) -#define DUK__TVAL_SHIFT 3 /* sizeof(duk_tval) == 8 */ +#define DUK__TVAL_SHIFT 3 /* sizeof(duk_tval) == 8 */ #else -#define DUK__TVAL_SHIFT 4 /* sizeof(duk_tval) == 16; not always the case so also asserted for */ +#define DUK__TVAL_SHIFT 4 /* sizeof(duk_tval) == 16; not always the case so also asserted for */ #endif -#define DUK__SHIFT_A (DUK_BC_SHIFT_A - DUK__TVAL_SHIFT) -#define DUK__SHIFT_B (DUK_BC_SHIFT_B - DUK__TVAL_SHIFT) -#define DUK__SHIFT_C (DUK_BC_SHIFT_C - DUK__TVAL_SHIFT) -#define DUK__SHIFT_BC (DUK_BC_SHIFT_BC - DUK__TVAL_SHIFT) -#define DUK__MASK_A (DUK_BC_UNSHIFTED_MASK_A << DUK__TVAL_SHIFT) -#define DUK__MASK_B (DUK_BC_UNSHIFTED_MASK_B << DUK__TVAL_SHIFT) -#define DUK__MASK_C (DUK_BC_UNSHIFTED_MASK_C << DUK__TVAL_SHIFT) -#define DUK__MASK_BC (DUK_BC_UNSHIFTED_MASK_BC << DUK__TVAL_SHIFT) -#define DUK__BYTEOFF_A(ins) (((ins) >> DUK__SHIFT_A) & DUK__MASK_A) -#define DUK__BYTEOFF_B(ins) (((ins) >> DUK__SHIFT_B) & DUK__MASK_B) -#define DUK__BYTEOFF_C(ins) (((ins) >> DUK__SHIFT_C) & DUK__MASK_C) -#define DUK__BYTEOFF_BC(ins) (((ins) >> DUK__SHIFT_BC) & DUK__MASK_BC) +#define DUK__SHIFT_A (DUK_BC_SHIFT_A - DUK__TVAL_SHIFT) +#define DUK__SHIFT_B (DUK_BC_SHIFT_B - DUK__TVAL_SHIFT) +#define DUK__SHIFT_C (DUK_BC_SHIFT_C - DUK__TVAL_SHIFT) +#define DUK__SHIFT_BC (DUK_BC_SHIFT_BC - DUK__TVAL_SHIFT) +#define DUK__MASK_A (DUK_BC_UNSHIFTED_MASK_A << DUK__TVAL_SHIFT) +#define DUK__MASK_B (DUK_BC_UNSHIFTED_MASK_B << DUK__TVAL_SHIFT) +#define DUK__MASK_C (DUK_BC_UNSHIFTED_MASK_C << DUK__TVAL_SHIFT) +#define DUK__MASK_BC (DUK_BC_UNSHIFTED_MASK_BC << DUK__TVAL_SHIFT) +#define DUK__BYTEOFF_A(ins) (((ins) >> DUK__SHIFT_A) & DUK__MASK_A) +#define DUK__BYTEOFF_B(ins) (((ins) >> DUK__SHIFT_B) & DUK__MASK_B) +#define DUK__BYTEOFF_C(ins) (((ins) >> DUK__SHIFT_C) & DUK__MASK_C) +#define DUK__BYTEOFF_BC(ins) (((ins) >> DUK__SHIFT_BC) & DUK__MASK_BC) -#define DUK__REGP_A(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_A((ins)))) -#define DUK__REGP_B(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_B((ins)))) -#define DUK__REGP_C(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_C((ins)))) -#define DUK__REGP_BC(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_BC((ins)))) -#define DUK__CONSTP_A(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_A((ins)))) -#define DUK__CONSTP_B(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_B((ins)))) -#define DUK__CONSTP_C(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_C((ins)))) -#define DUK__CONSTP_BC(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_BC((ins)))) -#define DUK__REGCONSTP_B(ins) ((duk_tval *) (void *) ((duk_uint8_t *) (((ins) & DUK__RCBIT_B) ? consts : thr->valstack_bottom) + DUK__BYTEOFF_B((ins)))) -#define DUK__REGCONSTP_C(ins) ((duk_tval *) (void *) ((duk_uint8_t *) (((ins) & DUK__RCBIT_C) ? consts : thr->valstack_bottom) + DUK__BYTEOFF_C((ins)))) -#else /* DUK_USE_EXEC_REGCONST_OPTIMIZE */ +#define DUK__REGP_A(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_A((ins)))) +#define DUK__REGP_B(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_B((ins)))) +#define DUK__REGP_C(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_C((ins)))) +#define DUK__REGP_BC(ins) ((duk_tval *) (void *) ((duk_uint8_t *) thr->valstack_bottom + DUK__BYTEOFF_BC((ins)))) +#define DUK__CONSTP_A(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_A((ins)))) +#define DUK__CONSTP_B(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_B((ins)))) +#define DUK__CONSTP_C(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_C((ins)))) +#define DUK__CONSTP_BC(ins) ((duk_tval *) (void *) ((duk_uint8_t *) consts + DUK__BYTEOFF_BC((ins)))) +#define DUK__REGCONSTP_B(ins) \ + ((duk_tval *) (void *) ((duk_uint8_t *) (((ins) &DUK__RCBIT_B) ? consts : thr->valstack_bottom) + DUK__BYTEOFF_B((ins)))) +#define DUK__REGCONSTP_C(ins) \ + ((duk_tval *) (void *) ((duk_uint8_t *) (((ins) &DUK__RCBIT_C) ? consts : thr->valstack_bottom) + DUK__BYTEOFF_C((ins)))) +#else /* DUK_USE_EXEC_REGCONST_OPTIMIZE */ /* Safe alternatives, no assumption about duk_tval size. */ -#define DUK__REGP_A(ins) DUK__REGP(DUK_DEC_A((ins))) -#define DUK__REGP_B(ins) DUK__REGP(DUK_DEC_B((ins))) -#define DUK__REGP_C(ins) DUK__REGP(DUK_DEC_C((ins))) -#define DUK__REGP_BC(ins) DUK__REGP(DUK_DEC_BC((ins))) -#define DUK__CONSTP_A(ins) DUK__CONSTP(DUK_DEC_A((ins))) -#define DUK__CONSTP_B(ins) DUK__CONSTP(DUK_DEC_B((ins))) -#define DUK__CONSTP_C(ins) DUK__CONSTP(DUK_DEC_C((ins))) -#define DUK__CONSTP_BC(ins) DUK__CONSTP(DUK_DEC_BC((ins))) -#define DUK__REGCONSTP_B(ins) ((((ins) & DUK__RCBIT_B) ? consts : thr->valstack_bottom) + DUK_DEC_B((ins))) -#define DUK__REGCONSTP_C(ins) ((((ins) & DUK__RCBIT_C) ? consts : thr->valstack_bottom) + DUK_DEC_C((ins))) -#endif /* DUK_USE_EXEC_REGCONST_OPTIMIZE */ +#define DUK__REGP_A(ins) DUK__REGP(DUK_DEC_A((ins))) +#define DUK__REGP_B(ins) DUK__REGP(DUK_DEC_B((ins))) +#define DUK__REGP_C(ins) DUK__REGP(DUK_DEC_C((ins))) +#define DUK__REGP_BC(ins) DUK__REGP(DUK_DEC_BC((ins))) +#define DUK__CONSTP_A(ins) DUK__CONSTP(DUK_DEC_A((ins))) +#define DUK__CONSTP_B(ins) DUK__CONSTP(DUK_DEC_B((ins))) +#define DUK__CONSTP_C(ins) DUK__CONSTP(DUK_DEC_C((ins))) +#define DUK__CONSTP_BC(ins) DUK__CONSTP(DUK_DEC_BC((ins))) +#define DUK__REGCONSTP_B(ins) ((((ins) &DUK__RCBIT_B) ? consts : thr->valstack_bottom) + DUK_DEC_B((ins))) +#define DUK__REGCONSTP_C(ins) ((((ins) &DUK__RCBIT_C) ? consts : thr->valstack_bottom) + DUK_DEC_C((ins))) +#endif /* DUK_USE_EXEC_REGCONST_OPTIMIZE */ #if defined(DUK_USE_VERBOSE_EXECUTOR_ERRORS) -#define DUK__INTERNAL_ERROR(msg) do { \ +#define DUK__INTERNAL_ERROR(msg) \ + do { \ DUK_ERROR_ERROR(thr, (msg)); \ DUK_WO_NORETURN(return;); \ } while (0) #else -#define DUK__INTERNAL_ERROR(msg) do { \ +#define DUK__INTERNAL_ERROR(msg) \ + do { \ goto internal_error; \ } while (0) #endif -#define DUK__SYNC_CURR_PC() do { \ +#define DUK__SYNC_CURR_PC() \ + do { \ duk_activation *duk__act; \ duk__act = thr->callstack_curr; \ duk__act->curr_pc = curr_pc; \ } while (0) -#define DUK__SYNC_AND_NULL_CURR_PC() do { \ +#define DUK__SYNC_AND_NULL_CURR_PC() \ + do { \ duk_activation *duk__act; \ duk__act = thr->callstack_curr; \ duk__act->curr_pc = curr_pc; \ @@ -78722,19 +80025,22 @@ DUK_LOCAL duk_bool_t duk__executor_handle_call(duk_hthread *thr, duk_idx_t idx, } while (0) #if defined(DUK_USE_EXEC_PREFER_SIZE) -#define DUK__LOOKUP_INDIRECT(idx) do { \ +#define DUK__LOOKUP_INDIRECT(idx) \ + do { \ (idx) = (duk_uint_fast_t) duk_get_uint(thr, (duk_idx_t) (idx)); \ } while (0) #elif defined(DUK_USE_FASTINT) -#define DUK__LOOKUP_INDIRECT(idx) do { \ +#define DUK__LOOKUP_INDIRECT(idx) \ + do { \ duk_tval *tv_ind; \ tv_ind = DUK__REGP((idx)); \ DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_ind)); \ - DUK_ASSERT(DUK_TVAL_IS_FASTINT(tv_ind)); /* compiler guarantees */ \ + DUK_ASSERT(DUK_TVAL_IS_FASTINT(tv_ind)); /* compiler guarantees */ \ (idx) = (duk_uint_fast_t) DUK_TVAL_GET_FASTINT_U32(tv_ind); \ } while (0) #else -#define DUK__LOOKUP_INDIRECT(idx) do { \ +#define DUK__LOOKUP_INDIRECT(idx) \ + do { \ duk_tval *tv_ind; \ tv_ind = DUK__REGP(idx); \ DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_ind)); \ @@ -78787,8 +80093,8 @@ DUK_LOCAL void duk__handle_executor_error(duk_heap *heap, * will be re-bumped by the longjmp. */ - DUK_ASSERT(lj_ret == DUK__LONGJMP_RETHROW); /* Rethrow error to calling state. */ - DUK_ASSERT(heap->lj.jmpbuf_ptr == entry_jmpbuf_ptr); /* Longjmp handling has restored jmpbuf_ptr. */ + DUK_ASSERT(lj_ret == DUK__LONGJMP_RETHROW); /* Rethrow error to calling state. */ + DUK_ASSERT(heap->lj.jmpbuf_ptr == entry_jmpbuf_ptr); /* Longjmp handling has restored jmpbuf_ptr. */ /* Thread may have changed, e.g. YIELD converted to THROW. */ duk_err_longjmp(heap->curr_thread); @@ -78811,7 +80117,7 @@ DUK_INTERNAL void duk_js_execute_bytecode(duk_hthread *exec_thr) { DUK_ASSERT(exec_thr->heap != NULL); DUK_ASSERT(exec_thr->heap->curr_thread != NULL); DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR((duk_heaphdr *) exec_thr); - DUK_ASSERT(exec_thr->callstack_top >= 1); /* at least one activation, ours */ + DUK_ASSERT(exec_thr->callstack_top >= 1); /* at least one activation, ours */ DUK_ASSERT(exec_thr->callstack_curr != NULL); DUK_ASSERT(DUK_ACT_GET_FUNC(exec_thr->callstack_curr) != NULL); DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC(DUK_ACT_GET_FUNC(exec_thr->callstack_curr))); @@ -78877,7 +80183,7 @@ DUK_INTERNAL void duk_js_execute_bytecode(duk_hthread *exec_thr) { entry_act, entry_call_recursion_depth, entry_jmpbuf_ptr, - &delayed_catch_setup); + &delayed_catch_setup); } #if defined(DUK_USE_CPP_EXCEPTIONS) catch (duk_fatal_exception &exc) { @@ -78893,7 +80199,10 @@ DUK_INTERNAL void duk_js_execute_bytecode(duk_hthread *exec_thr) { DUK_STATS_INC(exec_thr->heap, stats_exec_throw); try { DUK_ASSERT(heap->curr_thread != NULL); - DUK_ERROR_FMT1(heap->curr_thread, DUK_ERR_TYPE_ERROR, "caught invalid c++ std::exception '%s' (perhaps thrown by user code)", what); + DUK_ERROR_FMT1(heap->curr_thread, + DUK_ERR_TYPE_ERROR, + "caught invalid c++ std::exception '%s' (perhaps thrown by user code)", + what); DUK_WO_NORETURN(return;); } catch (duk_internal_exception exc) { DUK_D(DUK_DPRINT("caught api error thrown from unexpected c++ std::exception")); @@ -78902,7 +80211,7 @@ DUK_INTERNAL void duk_js_execute_bytecode(duk_hthread *exec_thr) { entry_act, entry_call_recursion_depth, entry_jmpbuf_ptr, - &delayed_catch_setup); + &delayed_catch_setup); } } catch (...) { DUK_D(DUK_DPRINT("unexpected c++ exception (perhaps thrown by user code)")); @@ -78918,7 +80227,7 @@ DUK_INTERNAL void duk_js_execute_bytecode(duk_hthread *exec_thr) { entry_act, entry_call_recursion_depth, entry_jmpbuf_ptr, - &delayed_catch_setup); + &delayed_catch_setup); } } #endif @@ -78934,13 +80243,13 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * * but that eliminates performance benefits; aliasing guarantees * should be enough though. */ - duk_instr_t *curr_pc; /* bytecode has a stable pointer */ + duk_instr_t *curr_pc; /* bytecode has a stable pointer */ /* Hot variables for interpretation. Critical for performance, * but must add sparingly to minimize register shuffling. */ - duk_hthread *thr; /* stable */ - duk_tval *consts; /* stable */ + duk_hthread *thr; /* stable */ + duk_tval *consts; /* stable */ duk_uint_fast32_t ins; /* 'funcs' is quite rarely used, so no local for it */ #if defined(DUK_USE_EXEC_FUN_LOCAL) @@ -78954,7 +80263,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * #endif #if defined(DUK_USE_ASSERTIONS) - duk_size_t valstack_top_base; /* valstack top, should match before interpreting each op (no leftovers) */ + duk_size_t valstack_top_base; /* valstack top, should match before interpreting each op (no leftovers) */ #endif /* Optimized reg/const access macros assume sizeof(duk_tval) to be @@ -79010,7 +80319,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * * See execution.rst for discussion. */ - restart_execution: +restart_execution: /* Lookup current thread; use the stable 'entry_thread' for this to * avoid clobber warnings. Any valid, reachable 'thr' value would be @@ -79051,7 +80360,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_ASSERT(act == thr->callstack_curr); DUK_ASSERT(act != NULL); } -#endif /* DUK_USE_DEBUGGER_SUPPORT */ +#endif /* DUK_USE_DEBUGGER_SUPPORT */ #if defined(DUK_USE_ASSERTIONS) valstack_top_base = (duk_size_t) (thr->valstack_top - thr->valstack); @@ -79115,7 +80424,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * */ #if defined(DUK_USE_DEBUGGER_SUPPORT) if (thr->heap->dbg_force_restart) { - DUK_DD(DUK_DDPRINT("dbg_force_restart flag forced restart execution")); /* GH-303 */ + DUK_DD(DUK_DDPRINT("dbg_force_restart flag forced restart execution")); /* GH-303 */ thr->heap->dbg_force_restart = 0; goto restart_execution; } @@ -79127,7 +80436,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * goto restart_execution; } } -#endif /* DUK_USE_INTERRUPT_COUNTER */ +#endif /* DUK_USE_INTERRUPT_COUNTER */ #if defined(DUK_USE_INTERRUPT_COUNTER) && defined(DUK_USE_DEBUG) /* For cross-checking during development: ensure dispatch count * matches cumulative interrupt counter init value sums. @@ -79141,16 +80450,17 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * act = thr->callstack_curr; DUK_ASSERT(curr_pc >= DUK_HCOMPFUNC_GET_CODE_BASE(thr->heap, DUK__FUN())); DUK_ASSERT(curr_pc < DUK_HCOMPFUNC_GET_CODE_END(thr->heap, DUK__FUN())); - DUK_UNREF(act); /* if debugging disabled */ + DUK_UNREF(act); /* if debugging disabled */ - DUK_DDD(DUK_DDDPRINT("executing bytecode: pc=%ld, ins=0x%08lx, op=%ld, valstack_top=%ld/%ld, nregs=%ld --> %!I", - (long) (curr_pc - DUK_HCOMPFUNC_GET_CODE_BASE(thr->heap, DUK__FUN())), - (unsigned long) *curr_pc, - (long) DUK_DEC_OP(*curr_pc), - (long) (thr->valstack_top - thr->valstack), - (long) (thr->valstack_end - thr->valstack), - (long) (DUK__FUN() ? DUK__FUN()->nregs : -1), - (duk_instr_t) *curr_pc)); + DUK_DDD(DUK_DDDPRINT( + "executing bytecode: pc=%ld, ins=0x%08lx, op=%ld, valstack_top=%ld/%ld, nregs=%ld --> %!I", + (long) (curr_pc - DUK_HCOMPFUNC_GET_CODE_BASE(thr->heap, DUK__FUN())), + (unsigned long) *curr_pc, + (long) DUK_DEC_OP(*curr_pc), + (long) (thr->valstack_top - thr->valstack), + (long) (thr->valstack_end - thr->valstack), + (long) (DUK__FUN() ? DUK__FUN()->nregs : -1), + (duk_instr_t) *curr_pc)); } #endif @@ -79187,14 +80497,16 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * */ op = (duk_uint8_t) DUK_DEC_OP(ins); switch (op) { - - /* Some useful macros. These access inner executor variables - * directly so they only apply within the executor. - */ + /* Some useful macros. These access inner executor variables + * directly so they only apply within the executor. + */ #if defined(DUK_USE_EXEC_PREFER_SIZE) -#define DUK__REPLACE_TOP_A_BREAK() { goto replace_top_a; } -#define DUK__REPLACE_TOP_BC_BREAK() { goto replace_top_bc; } -#define DUK__REPLACE_BOOL_A_BREAK(bval) { \ +#define DUK__REPLACE_TOP_A_BREAK() \ + { goto replace_top_a; } +#define DUK__REPLACE_TOP_BC_BREAK() \ + { goto replace_top_bc; } +#define DUK__REPLACE_BOOL_A_BREAK(bval) \ + { \ duk_bool_t duk__bval; \ duk__bval = (bval); \ DUK_ASSERT(duk__bval == 0 || duk__bval == 1); \ @@ -79202,9 +80514,18 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK__REPLACE_TOP_A_BREAK(); \ } #else -#define DUK__REPLACE_TOP_A_BREAK() { DUK__REPLACE_TO_TVPTR(thr, DUK__REGP_A(ins)); break; } -#define DUK__REPLACE_TOP_BC_BREAK() { DUK__REPLACE_TO_TVPTR(thr, DUK__REGP_BC(ins)); break; } -#define DUK__REPLACE_BOOL_A_BREAK(bval) { \ +#define DUK__REPLACE_TOP_A_BREAK() \ + { \ + DUK__REPLACE_TO_TVPTR(thr, DUK__REGP_A(ins)); \ + break; \ + } +#define DUK__REPLACE_TOP_BC_BREAK() \ + { \ + DUK__REPLACE_TO_TVPTR(thr, DUK__REGP_BC(ins)); \ + break; \ + } +#define DUK__REPLACE_BOOL_A_BREAK(bval) \ + { \ duk_bool_t duk__bval; \ duk_tval *duk__tvdst; \ duk__bval = (bval); \ @@ -79228,7 +80549,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * tv1 = DUK__REGP_A(ins); tv2 = DUK__REGP_BC(ins); - DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv1, tv2); /* side effects */ break; } @@ -79237,7 +80558,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * tv1 = DUK__REGP_A(ins); tv2 = DUK__REGP_BC(ins); - DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv2, tv1); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv2, tv1); /* side effects */ break; } @@ -79246,7 +80567,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * tv1 = DUK__REGP_A(ins); tv2 = DUK__CONSTP_BC(ins); - DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv1, tv2); /* side effects */ break; } @@ -79266,18 +80587,18 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk_int32_t val; val = (duk_int32_t) duk_get_int(thr, DUK_DEC_A(ins)); - val = (val << DUK_BC_LDINTX_SHIFT) + (duk_int32_t) DUK_DEC_BC(ins); /* no bias */ + val = (val << DUK_BC_LDINTX_SHIFT) + (duk_int32_t) DUK_DEC_BC(ins); /* no bias */ duk_push_int(thr, val); DUK__REPLACE_TOP_A_BREAK(); } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_LDINT: { duk_tval *tv1; duk_int32_t val; val = (duk_int32_t) DUK_DEC_BC(ins) - (duk_int32_t) DUK_BC_LDINT_BIAS; tv1 = DUK__REGP_A(ins); - DUK_TVAL_SET_I32_UPDREF(thr, tv1, val); /* side effects */ + DUK_TVAL_SET_I32_UPDREF(thr, tv1, val); /* side effects */ break; } case DUK_OP_LDINTX: { @@ -79293,11 +80614,12 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * /* XXX: fast double-to-int conversion, we know number is integer in [-0x80000000,0xffffffff]. */ val = (duk_int32_t) DUK_TVAL_GET_NUMBER(tv1); #endif - val = (duk_int32_t) ((duk_uint32_t) val << DUK_BC_LDINTX_SHIFT) + (duk_int32_t) DUK_DEC_BC(ins); /* no bias */ - DUK_TVAL_SET_I32_UPDREF(thr, tv1, val); /* side effects */ + val = + (duk_int32_t) ((duk_uint32_t) val << DUK_BC_LDINTX_SHIFT) + (duk_int32_t) DUK_DEC_BC(ins); /* no bias */ + DUK_TVAL_SET_I32_UPDREF(thr, tv1, val); /* side effects */ break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ #if defined(DUK_USE_EXEC_PREFER_SIZE) case DUK_OP_LDTHIS: { @@ -79320,46 +80642,46 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk_push_false(thr); DUK__REPLACE_TOP_BC_BREAK(); } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_LDTHIS: { /* Note: 'this' may be bound to any value, not just an object */ duk_tval *tv1, *tv2; tv1 = DUK__REGP_BC(ins); - tv2 = thr->valstack_bottom - 1; /* 'this binding' is just under bottom */ + tv2 = thr->valstack_bottom - 1; /* 'this binding' is just under bottom */ DUK_ASSERT(tv2 >= thr->valstack); - DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv1, tv2); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF_FAST(thr, tv1, tv2); /* side effects */ break; } case DUK_OP_LDUNDEF: { duk_tval *tv1; tv1 = DUK__REGP_BC(ins); - DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv1); /* side effects */ + DUK_TVAL_SET_UNDEFINED_UPDREF(thr, tv1); /* side effects */ break; } case DUK_OP_LDNULL: { duk_tval *tv1; tv1 = DUK__REGP_BC(ins); - DUK_TVAL_SET_NULL_UPDREF(thr, tv1); /* side effects */ + DUK_TVAL_SET_NULL_UPDREF(thr, tv1); /* side effects */ break; } case DUK_OP_LDTRUE: { duk_tval *tv1; tv1 = DUK__REGP_BC(ins); - DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv1, 1); /* side effects */ + DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv1, 1); /* side effects */ break; } case DUK_OP_LDFALSE: { duk_tval *tv1; tv1 = DUK__REGP_BC(ins); - DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv1, 0); /* side effects */ + DUK_TVAL_SET_BOOLEAN_UPDREF(thr, tv1, 0); /* side effects */ break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_BNOT: { duk__vm_bitwise_not(thr, DUK_DEC_BC(ins), DUK_DEC_A(ins)); @@ -79377,7 +80699,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_arith_unary_op(thr, DUK_DEC_BC(ins), DUK_DEC_A(ins), op); break; } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_UNM: { duk__vm_arith_unary_op(thr, DUK_DEC_BC(ins), DUK_DEC_A(ins), DUK_OP_UNM); break; @@ -79386,7 +80708,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_arith_unary_op(thr, DUK_DEC_BC(ins), DUK_DEC_A(ins), DUK_OP_UNP); break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ #if defined(DUK_USE_EXEC_PREFER_SIZE) case DUK_OP_TYPEOF: { @@ -79397,7 +80719,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk_push_hstring_stridx(thr, stridx); DUK__REPLACE_TOP_A_BREAK(); } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_TYPEOF: { duk_tval *tv; duk_small_uint_t stridx; @@ -79411,7 +80733,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_TVAL_SET_STRING_UPDREF(thr, tv, h_str); break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_TYPEOFID: { duk_small_uint_t stridx; @@ -79429,13 +80751,13 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * tv = DUK__CONSTP_BC(ins); DUK_ASSERT(DUK_TVAL_IS_STRING(tv)); name = DUK_TVAL_GET_STRING(tv); - tv = NULL; /* lookup has side effects */ + tv = NULL; /* lookup has side effects */ act = thr->callstack_curr; if (duk_js_getvar_activation(thr, act, name, 0 /*throw*/)) { /* -> [... val this] */ tv = DUK_GET_TVAL_NEGIDX(thr, -2); stridx = duk_js_typeof_stridx(tv); - tv = NULL; /* no longer needed */ + tv = NULL; /* no longer needed */ duk_pop_2_unsafe(thr); } else { /* unresolvable, no stack changes */ @@ -79445,36 +80767,40 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * #if defined(DUK_USE_EXEC_PREFER_SIZE) duk_push_hstring_stridx(thr, stridx); DUK__REPLACE_TOP_A_BREAK(); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ h_str = DUK_HTHREAD_GET_STRING(thr, stridx); tv = DUK__REGP_A(ins); DUK_TVAL_SET_STRING_UPDREF(thr, tv, h_str); break; -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ } /* Equality: E5 Sections 11.9.1, 11.9.3 */ -#define DUK__EQ_BODY(barg,carg) { \ +#define DUK__EQ_BODY(barg, carg) \ + { \ duk_bool_t tmp; \ tmp = duk_js_equals(thr, (barg), (carg)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ DUK__REPLACE_BOOL_A_BREAK(tmp); \ } -#define DUK__NEQ_BODY(barg,carg) { \ +#define DUK__NEQ_BODY(barg, carg) \ + { \ duk_bool_t tmp; \ tmp = duk_js_equals(thr, (barg), (carg)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ tmp ^= 1; \ DUK__REPLACE_BOOL_A_BREAK(tmp); \ } -#define DUK__SEQ_BODY(barg,carg) { \ +#define DUK__SEQ_BODY(barg, carg) \ + { \ duk_bool_t tmp; \ tmp = duk_js_strict_equals((barg), (carg)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ DUK__REPLACE_BOOL_A_BREAK(tmp); \ } -#define DUK__SNEQ_BODY(barg,carg) { \ +#define DUK__SNEQ_BODY(barg, carg) \ + { \ duk_bool_t tmp; \ tmp = duk_js_strict_equals((barg), (carg)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ @@ -79502,7 +80828,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_SNEQ_RC: case DUK_OP_SNEQ_CC: DUK__SNEQ_BODY(DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins)); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_EQ_RR: DUK__EQ_BODY(DUK__REGP_B(ins), DUK__REGP_C(ins)); case DUK_OP_EQ_CR: @@ -79535,18 +80861,19 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK__SNEQ_BODY(DUK__REGP_B(ins), DUK__CONSTP_C(ins)); case DUK_OP_SNEQ_CC: DUK__SNEQ_BODY(DUK__CONSTP_B(ins), DUK__CONSTP_C(ins)); -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ -#define DUK__COMPARE_BODY(arg1,arg2,flags) { \ +#define DUK__COMPARE_BODY(arg1, arg2, flags) \ + { \ duk_bool_t tmp; \ tmp = duk_js_compare_helper(thr, (arg1), (arg2), (flags)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ DUK__REPLACE_BOOL_A_BREAK(tmp); \ } -#define DUK__GT_BODY(barg,carg) DUK__COMPARE_BODY((carg), (barg), 0) -#define DUK__GE_BODY(barg,carg) DUK__COMPARE_BODY((barg), (carg), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST | DUK_COMPARE_FLAG_NEGATE) -#define DUK__LT_BODY(barg,carg) DUK__COMPARE_BODY((barg), (carg), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST) -#define DUK__LE_BODY(barg,carg) DUK__COMPARE_BODY((carg), (barg), DUK_COMPARE_FLAG_NEGATE) +#define DUK__GT_BODY(barg, carg) DUK__COMPARE_BODY((carg), (barg), 0) +#define DUK__GE_BODY(barg, carg) DUK__COMPARE_BODY((barg), (carg), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST | DUK_COMPARE_FLAG_NEGATE) +#define DUK__LT_BODY(barg, carg) DUK__COMPARE_BODY((barg), (carg), DUK_COMPARE_FLAG_EVAL_LEFT_FIRST) +#define DUK__LE_BODY(barg, carg) DUK__COMPARE_BODY((carg), (barg), DUK_COMPARE_FLAG_NEGATE) #if defined(DUK_USE_EXEC_PREFER_SIZE) case DUK_OP_GT_RR: case DUK_OP_GT_CR: @@ -79568,7 +80895,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_LE_RC: case DUK_OP_LE_CC: DUK__LE_BODY(DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins)); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_GT_RR: DUK__GT_BODY(DUK__REGP_B(ins), DUK__REGP_C(ins)); case DUK_OP_GT_CR: @@ -79601,7 +80928,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK__LE_BODY(DUK__REGP_B(ins), DUK__CONSTP_C(ins)); case DUK_OP_LE_CC: DUK__LE_BODY(DUK__CONSTP_B(ins), DUK__CONSTP_C(ins)); -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ /* No size optimized variant at present for IF. */ case DUK_OP_IFTRUE_R: { @@ -79638,7 +80965,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_arith_add(thr, DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins), DUK_DEC_A(ins)); break; } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_ADD_RR: { duk__vm_arith_add(thr, DUK__REGP_B(ins), DUK__REGP_C(ins), DUK_DEC_A(ins)); break; @@ -79655,7 +80982,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_arith_add(thr, DUK__CONSTP_B(ins), DUK__CONSTP_C(ins), DUK_DEC_A(ins)); break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ #if defined(DUK_USE_EXEC_PREFER_SIZE) case DUK_OP_SUB_RR: @@ -79679,13 +81006,13 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_EXP_CR: case DUK_OP_EXP_RC: case DUK_OP_EXP_CC: -#endif /* DUK_USE_ES7_EXP_OPERATOR */ +#endif /* DUK_USE_ES7_EXP_OPERATOR */ { /* XXX: could leave value on stack top and goto replace_top_a; */ duk__vm_arith_binary_op(thr, DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins), DUK_DEC_A(ins), op); break; } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_SUB_RR: { duk__vm_arith_binary_op(thr, DUK__REGP_B(ins), DUK__REGP_C(ins), DUK_DEC_A(ins), DUK_OP_SUB); break; @@ -79767,8 +81094,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_arith_binary_op(thr, DUK__CONSTP_B(ins), DUK__CONSTP_C(ins), DUK_DEC_A(ins), DUK_OP_EXP); break; } -#endif /* DUK_USE_ES7_EXP_OPERATOR */ -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_ES7_EXP_OPERATOR */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ #if defined(DUK_USE_EXEC_PREFER_SIZE) case DUK_OP_BAND_RR: @@ -79799,7 +81126,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_bitwise_binary_op(thr, DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins), DUK_DEC_A(ins), op); break; } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_BAND_RR: { duk__vm_bitwise_binary_op(thr, DUK__REGP_B(ins), DUK__REGP_C(ins), DUK_DEC_A(ins), DUK_OP_BAND); break; @@ -79896,16 +81223,18 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__vm_bitwise_binary_op(thr, DUK__CONSTP_B(ins), DUK__CONSTP_C(ins), DUK_DEC_A(ins), DUK_OP_BASR); break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ /* For INSTOF and IN, B is always a register. */ -#define DUK__INSTOF_BODY(barg,carg) { \ +#define DUK__INSTOF_BODY(barg, carg) \ + { \ duk_bool_t tmp; \ tmp = duk_js_instanceof(thr, (barg), (carg)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ DUK__REPLACE_BOOL_A_BREAK(tmp); \ } -#define DUK__IN_BODY(barg,carg) { \ +#define DUK__IN_BODY(barg, carg) \ + { \ duk_bool_t tmp; \ tmp = duk_js_in(thr, (barg), (carg)); \ DUK_ASSERT(tmp == 0 || tmp == 1); \ @@ -79922,7 +81251,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_IN_RC: case DUK_OP_IN_CC: DUK__IN_BODY(DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins)); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_INSTOF_RR: DUK__INSTOF_BODY(DUK__REGP_B(ins), DUK__REGP_C(ins)); case DUK_OP_INSTOF_CR: @@ -79939,9 +81268,9 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK__IN_BODY(DUK__REGP_B(ins), DUK__CONSTP_C(ins)); case DUK_OP_IN_CC: DUK__IN_BODY(DUK__CONSTP_B(ins), DUK__CONSTP_C(ins)); -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ - /* Pre/post inc/dec for register variables, important for loops. */ + /* Pre/post inc/dec for register variables, important for loops. */ #if defined(DUK_USE_EXEC_PREFER_SIZE) case DUK_OP_PREINCR: case DUK_OP_PREDECR: @@ -79957,7 +81286,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__prepost_incdec_var_helper(thr, DUK_DEC_A(ins), DUK__CONSTP_BC(ins), op, DUK__STRICT()); break; } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_PREINCR: { duk__prepost_incdec_reg_helper(thr, DUK__REGP_A(ins), DUK__REGP_BC(ins), DUK_OP_PREINCR); break; @@ -79990,7 +81319,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk__prepost_incdec_var_helper(thr, DUK_DEC_A(ins), DUK__CONSTP_BC(ins), DUK_OP_POSTDECV, DUK__STRICT()); break; } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ /* XXX: Move to separate helper, optimize for perf/size separately. */ /* Preinc/predec for object properties. */ @@ -80017,7 +81346,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk_double_t x, y, z; #if !defined(DUK_USE_EXEC_PREFER_SIZE) duk_tval *tv_dst; -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ /* A -> target reg * B -> object reg/const (may be const e.g. in "'foo'[1]") @@ -80035,10 +81364,10 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * tv_obj = DUK__REGCONSTP_B(ins); tv_key = DUK__REGCONSTP_C(ins); - rc = duk_hobject_getprop(thr, tv_obj, tv_key); /* -> [val] */ - DUK_UNREF(rc); /* ignore */ - tv_obj = NULL; /* invalidated */ - tv_key = NULL; /* invalidated */ + rc = duk_hobject_getprop(thr, tv_obj, tv_key); /* -> [val] */ + DUK_UNREF(rc); /* ignore */ + tv_obj = NULL; /* invalidated */ + tv_key = NULL; /* invalidated */ /* XXX: Fastint fast path would be useful here. Also fastints * now lose their fastint status in current handling which is @@ -80059,9 +81388,9 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * tv_obj = DUK__REGCONSTP_B(ins); tv_key = DUK__REGCONSTP_C(ins); rc = duk_hobject_putprop(thr, tv_obj, tv_key, tv_val, DUK__STRICT()); - DUK_UNREF(rc); /* ignore */ - tv_obj = NULL; /* invalidated */ - tv_key = NULL; /* invalidated */ + DUK_UNREF(rc); /* ignore */ + tv_obj = NULL; /* invalidated */ + tv_key = NULL; /* invalidated */ duk_pop_unsafe(thr); z = (ins & DUK_BC_INCDECP_FLAG_POST) ? x : y; @@ -80079,7 +81408,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * * Occurs relatively often in object oriented code. */ -#define DUK__GETPROP_BODY(barg,carg) { \ +#define DUK__GETPROP_BODY(barg, carg) \ + { \ /* A -> target reg \ * B -> object reg/const (may be const e.g. in "'foo'[1]") \ * C -> key reg/const \ @@ -80087,7 +81417,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * (void) duk_hobject_getprop(thr, (barg), (carg)); \ DUK__REPLACE_TOP_A_BREAK(); \ } -#define DUK__GETPROPC_BODY(barg,carg) { \ +#define DUK__GETPROPC_BODY(barg, carg) \ + { \ /* Same as GETPROP but callability check for property-based calls. */ \ duk_tval *tv__targ; \ (void) duk_hobject_getprop(thr, (barg), (carg)); \ @@ -80102,7 +81433,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * } \ DUK__REPLACE_TOP_A_BREAK(); \ } -#define DUK__PUTPROP_BODY(aarg,barg,carg) { \ +#define DUK__PUTPROP_BODY(aarg, barg, carg) \ + { \ /* A -> object reg \ * B -> key reg/const \ * C -> value reg/const \ @@ -80113,7 +81445,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * (void) duk_hobject_putprop(thr, (aarg), (barg), (carg), DUK__STRICT()); \ break; \ } -#define DUK__DELPROP_BODY(barg,carg) { \ +#define DUK__DELPROP_BODY(barg, carg) \ + { \ /* A -> result reg \ * B -> object reg \ * C -> key reg/const \ @@ -80142,9 +81475,9 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_PUTPROP_CC: DUK__PUTPROP_BODY(DUK__REGP_A(ins), DUK__REGCONSTP_B(ins), DUK__REGCONSTP_C(ins)); case DUK_OP_DELPROP_RR: - case DUK_OP_DELPROP_RC: /* B is always reg */ + case DUK_OP_DELPROP_RC: /* B is always reg */ DUK__DELPROP_BODY(DUK__REGP_B(ins), DUK__REGCONSTP_C(ins)); -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_GETPROP_RR: DUK__GETPROP_BODY(DUK__REGP_B(ins), DUK__REGP_C(ins)); case DUK_OP_GETPROP_CR: @@ -80171,11 +81504,11 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK__PUTPROP_BODY(DUK__REGP_A(ins), DUK__REGP_B(ins), DUK__CONSTP_C(ins)); case DUK_OP_PUTPROP_CC: DUK__PUTPROP_BODY(DUK__REGP_A(ins), DUK__CONSTP_B(ins), DUK__CONSTP_C(ins)); - case DUK_OP_DELPROP_RR: /* B is always reg */ + case DUK_OP_DELPROP_RR: /* B is always reg */ DUK__DELPROP_BODY(DUK__REGP_B(ins), DUK__REGP_C(ins)); case DUK_OP_DELPROP_RC: DUK__DELPROP_BODY(DUK__REGP_B(ins), DUK__CONSTP_C(ins)); -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ /* No fast path for DECLVAR now, it's quite a rare instruction. */ case DUK_OP_DECLVAR_RR: @@ -80208,7 +81541,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * if (is_func_decl) { duk_push_tval(thr, DUK__REGCONSTP_C(ins)); } else { - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* valstack policy */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* valstack policy */ thr->valstack_top++; } tv1 = DUK_GET_TVAL_NEGIDX(thr, -1); @@ -80244,11 +81577,11 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * */ duk_push_tval(thr, DUK__REGCONSTP_C(ins)); - duk_push_tval(thr, DUK__REGCONSTP_B(ins)); /* -> [ ... escaped_source bytecode ] */ - duk_regexp_create_instance(thr); /* -> [ ... regexp_instance ] */ + duk_push_tval(thr, DUK__REGCONSTP_B(ins)); /* -> [ ... escaped_source bytecode ] */ + duk_regexp_create_instance(thr); /* -> [ ... regexp_instance ] */ DUK__REPLACE_TOP_A_BREAK(); } -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* XXX: 'c' is unused, use whole BC, etc. */ case DUK_OP_CSVAR_RR: @@ -80277,13 +81610,13 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * name = DUK_TVAL_GET_STRING(tv1); DUK_ASSERT(name != NULL); act = thr->callstack_curr; - (void) duk_js_getvar_activation(thr, act, name, 1 /*throw*/); /* -> [... val this] */ + (void) duk_js_getvar_activation(thr, act, name, 1 /*throw*/); /* -> [... val this] */ idx = (duk_uint_fast_t) DUK_DEC_A(ins); /* Could add direct value stack handling. */ - duk_replace(thr, (duk_idx_t) (idx + 1)); /* 'this' binding */ - duk_replace(thr, (duk_idx_t) idx); /* variable value (function, we hope, not checked here) */ + duk_replace(thr, (duk_idx_t) (idx + 1)); /* 'this' binding */ + duk_replace(thr, (duk_idx_t) idx); /* variable value (function, we hope, not checked here) */ break; } @@ -80298,7 +81631,9 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * */ DUK_DDD(DUK_DDDPRINT("CLOSURE to target register %ld, fnum %ld (count %ld)", - (long) DUK_DEC_A(ins), (long) DUK_DEC_BC(ins), (long) DUK_HCOMPFUNC_GET_FUNCS_COUNT(thr->heap, DUK__FUN()))); + (long) DUK_DEC_A(ins), + (long) DUK_DEC_BC(ins), + (long) DUK_HCOMPFUNC_GET_FUNCS_COUNT(thr->heap, DUK__FUN()))); DUK_ASSERT_DISABLE(bc >= 0); /* unsigned */ DUK_ASSERT((duk_uint_t) bc < (duk_uint_t) DUK_HCOMPFUNC_GET_FUNCS_COUNT(thr->heap, DUK__FUN())); @@ -80309,8 +81644,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_ASSERT(fun_temp != NULL); DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC(fun_temp)); - DUK_DDD(DUK_DDDPRINT("CLOSURE: function template is: %p -> %!O", - (void *) fun_temp, (duk_heaphdr *) fun_temp)); + DUK_DDD( + DUK_DDDPRINT("CLOSURE: function template is: %p -> %!O", (void *) fun_temp, (duk_heaphdr *) fun_temp)); if (act->lex_env == NULL) { DUK_ASSERT(act->var_env == NULL); @@ -80324,11 +81659,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * * new variable declaration environment, so only lex_env * matters here. */ - duk_js_push_closure(thr, - (duk_hcompfunc *) fun_temp, - act->var_env, - act->lex_env, - 1 /*add_auto_proto*/); + duk_js_push_closure(thr, (duk_hcompfunc *) fun_temp, act->var_env, act->lex_env, 1 /*add_auto_proto*/); DUK__REPLACE_TOP_A_BREAK(); } @@ -80343,8 +81674,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_ASSERT(name != NULL); act = thr->callstack_curr; DUK_ASSERT(act != NULL); - (void) duk_js_getvar_activation(thr, act, name, 1 /*throw*/); /* -> [... val this] */ - duk_pop_unsafe(thr); /* 'this' binding is not needed here */ + (void) duk_js_getvar_activation(thr, act, name, 1 /*throw*/); /* -> [... val this] */ + duk_pop_unsafe(thr); /* 'this' binding is not needed here */ DUK__REPLACE_TOP_A_BREAK(); } @@ -80362,7 +81693,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * * should be reworked. */ - tv1 = DUK__REGP_A(ins); /* val */ + tv1 = DUK__REGP_A(ins); /* val */ act = thr->callstack_curr; duk_js_putvar_activation(thr, act, name, tv1, DUK__STRICT()); break; @@ -80392,7 +81723,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * break; } -#define DUK__RETURN_SHARED() do { \ +#define DUK__RETURN_SHARED() \ + do { \ duk_small_uint_t ret_result; \ /* duk__handle_return() is guaranteed never to throw, except \ * for potential out-of-memory situations which will then \ @@ -80411,14 +81743,14 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_RETCONST: case DUK_OP_RETCONSTN: case DUK_OP_RETUNDEF: { - /* BC -> return value reg/const */ + /* BC -> return value reg/const */ DUK__SYNC_AND_NULL_CURR_PC(); if (op == DUK_OP_RETREG) { duk_push_tval(thr, DUK__REGP_BC(ins)); } else if (op == DUK_OP_RETUNDEF) { - DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* valstack policy */ + DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); /* valstack policy */ thr->valstack_top++; } else { DUK_ASSERT(op == DUK_OP_RETCONST || op == DUK_OP_RETCONSTN); @@ -80427,7 +81759,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK__RETURN_SHARED(); } -#else /* DUK_USE_EXEC_PREFER_SIZE */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_RETREG: { duk_tval *tv; @@ -80457,18 +81789,18 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_TVAL_SET_TVAL(thr->valstack_top, tv); #if defined(DUK_USE_REFERENCE_COUNTING) /* Without refcounting only RETCONSTN is used. */ - DUK_ASSERT(!DUK_TVAL_IS_HEAP_ALLOCATED(tv)); /* no INCREF for this constant */ + DUK_ASSERT(!DUK_TVAL_IS_HEAP_ALLOCATED(tv)); /* no INCREF for this constant */ #endif thr->valstack_top++; DUK__RETURN_SHARED(); } case DUK_OP_RETUNDEF: { DUK__SYNC_AND_NULL_CURR_PC(); - thr->valstack_top++; /* value at valstack top is already undefined by valstack policy */ + thr->valstack_top++; /* value at valstack top is already undefined by valstack policy */ DUK_ASSERT(DUK_TVAL_IS_UNDEFINED(thr->valstack_top)); DUK__RETURN_SHARED(); } -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ case DUK_OP_LABEL: { duk_activation *act; @@ -80481,8 +81813,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_ASSERT(cat != NULL); cat->flags = (duk_uint32_t) (DUK_CAT_TYPE_LABEL | (bc << DUK_CAT_LABEL_SHIFT)); - cat->pc_base = (duk_instr_t *) curr_pc; /* pre-incremented, points to first jump slot */ - cat->idx_base = 0; /* unused for label */ + cat->pc_base = (duk_instr_t *) curr_pc; /* pre-incremented, points to first jump slot */ + cat->idx_base = 0; /* unused for label */ cat->h_varname = NULL; act = thr->callstack_curr; @@ -80492,10 +81824,13 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_DDD(DUK_DDDPRINT("LABEL catcher: flags=0x%08lx, pc_base=%ld, " "idx_base=%ld, h_varname=%!O, label_id=%ld", - (long) cat->flags, (long) cat->pc_base, - (long) cat->idx_base, (duk_heaphdr *) cat->h_varname, (long) DUK_CAT_GET_LABEL(cat))); + (long) cat->flags, + (long) cat->pc_base, + (long) cat->idx_base, + (duk_heaphdr *) cat->h_varname, + (long) DUK_CAT_GET_LABEL(cat))); - curr_pc += 2; /* skip jump slots */ + curr_pc += 2; /* skip jump slots */ break; } @@ -80537,7 +81872,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * /* XXX: move to helper, too large to be inline here */ case DUK_OP_TRYCATCH: { duk__handle_op_trycatch(thr, ins, curr_pc); - curr_pc += 2; /* skip jump slots */ + curr_pc += 2; /* skip jump slots */ break; } @@ -80582,8 +81917,8 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * (duk_tval *) duk_get_tval(thr, -1))); #if defined(DUK_USE_AUGMENT_ERROR_THROW) duk_err_augment_error_throw(thr); - DUK_DDD(DUK_DDDPRINT("THROW ERROR (BYTECODE): %!dT (after throw augment)", - (duk_tval *) duk_get_tval(thr, -1))); + DUK_DDD( + DUK_DDDPRINT("THROW ERROR (BYTECODE): %!dT (after throw augment)", (duk_tval *) duk_get_tval(thr, -1))); #endif duk_err_setup_ljstate1(thr, DUK_LJ_TYPE_THROW, DUK_GET_TVAL_NEGIDX(thr, -1)); @@ -80591,7 +81926,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk_err_check_debugger_integration(thr); #endif - DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* always in executor */ + DUK_ASSERT(thr->heap->lj.jmpbuf_ptr != NULL); /* always in executor */ duk_err_longjmp(thr); DUK_UNREACHABLE(); break; @@ -80628,20 +81963,19 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_TVAL_SET_TVAL(&tv_tmp2, tv2); tv3 = DUK__REGP(a); DUK_TVAL_SET_TVAL(tv1, tv3); - DUK_TVAL_INCREF(thr, tv1); /* no side effects */ - DUK_TVAL_SET_UNDEFINED(tv2); /* no need for incref */ + DUK_TVAL_INCREF(thr, tv1); /* no side effects */ + DUK_TVAL_SET_UNDEFINED(tv2); /* no need for incref */ DUK_TVAL_DECREF(thr, &tv_tmp1); DUK_TVAL_DECREF(thr, &tv_tmp2); #endif break; } - - /* XXX: in some cases it's faster NOT to reuse the value - * stack but rather copy the arguments on top of the stack - * (mainly when the calling value stack is large and the value - * stack resize would be large). - */ + /* XXX: in some cases it's faster NOT to reuse the value + * stack but rather copy the arguments on top of the stack + * (mainly when the calling value stack is large and the value + * stack resize would be large). + */ case DUK_OP_CALL0: case DUK_OP_CALL1: @@ -80802,7 +82136,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * } count = (duk_small_uint_fast_t) DUK_DEC_C(ins); - DUK_ASSERT(count > 0); /* compiler guarantees */ + DUK_ASSERT(count > 0); /* compiler guarantees */ idx_end = idx + count; #if defined(DUK_USE_EXEC_INDIRECT_BOUND_CHECK) @@ -80826,11 +82160,10 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * /* XXX: faster initialization (direct access or better primitives) */ duk_dup(thr, (duk_idx_t) idx); duk_dup(thr, (duk_idx_t) (idx + 1)); - duk_def_prop(thr, obj_idx, DUK_DEFPROP_HAVE_VALUE | - DUK_DEFPROP_FORCE | - DUK_DEFPROP_SET_WRITABLE | - DUK_DEFPROP_SET_ENUMERABLE | - DUK_DEFPROP_SET_CONFIGURABLE); + duk_def_prop(thr, + obj_idx, + DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_FORCE | DUK_DEFPROP_SET_WRITABLE | + DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE); idx += 2; } while (idx < idx_end); break; @@ -80865,7 +82198,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * } count = (duk_small_uint_fast_t) DUK_DEC_C(ins); - DUK_ASSERT(count > 0 + 1); /* compiler guarantees */ + DUK_ASSERT(count > 0 + 1); /* compiler guarantees */ idx_end = idx + count; #if defined(DUK_USE_EXEC_INDIRECT_BOUND_CHECK) @@ -80992,7 +82325,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * duk_push_new_target(thr); DUK__REPLACE_TOP_BC_BREAK(); } -#endif /* DUK_USE_ES6 */ +#endif /* DUK_USE_ES6 */ #if !defined(DUK_USE_EXEC_PREFER_SIZE) #if !defined(DUK_USE_ES7_EXP_OPERATOR) @@ -81055,16 +82388,16 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * case DUK_OP_UNUSED253: case DUK_OP_UNUSED254: case DUK_OP_UNUSED255: - /* Force all case clauses to map to an actual handler - * so that the compiler can emit a jump without a bounds - * check: the switch argument is a duk_uint8_t so that - * the compiler may be able to figure it out. This is - * a small detail and obviously compiler dependent. - */ - /* default: clause omitted on purpose */ -#else /* DUK_USE_EXEC_PREFER_SIZE */ + /* Force all case clauses to map to an actual handler + * so that the compiler can emit a jump without a bounds + * check: the switch argument is a duk_uint8_t so that + * the compiler may be able to figure it out. This is + * a small detail and obviously compiler dependent. + */ + /* default: clause omitted on purpose */ +#else /* DUK_USE_EXEC_PREFER_SIZE */ default: -#endif /* DUK_USE_EXEC_PREFER_SIZE */ +#endif /* DUK_USE_EXEC_PREFER_SIZE */ { /* Default case catches invalid/unsupported opcodes. */ DUK_D(DUK_DPRINT("invalid opcode: %ld - %!I", (long) op, ins)); @@ -81072,7 +82405,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * break; } - } /* end switch */ + } /* end switch */ continue; @@ -81083,10 +82416,10 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * */ #if defined(DUK_USE_EXEC_PREFER_SIZE) - replace_top_a: + replace_top_a: DUK__REPLACE_TO_TVPTR(thr, DUK__REGP_A(ins)); continue; - replace_top_bc: + replace_top_bc: DUK__REPLACE_TO_TVPTR(thr, DUK__REGP_BC(ins)); continue; #endif @@ -81094,7 +82427,7 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread * DUK_WO_NORETURN(return;); #if !defined(DUK_USE_VERBOSE_EXECUTOR_ERRORS) - internal_error: +internal_error: DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return;); #endif @@ -81325,19 +82658,10 @@ DUK_LOCAL duk_double_t duk__tonumber_string_raw(duk_hthread *thr) { /* Quite lenient, e.g. allow empty as zero, but don't allow trailing * garbage. */ - s2n_flags = DUK_S2N_FLAG_TRIM_WHITE | - DUK_S2N_FLAG_ALLOW_EXP | - DUK_S2N_FLAG_ALLOW_PLUS | - DUK_S2N_FLAG_ALLOW_MINUS | - DUK_S2N_FLAG_ALLOW_INF | - DUK_S2N_FLAG_ALLOW_FRAC | - DUK_S2N_FLAG_ALLOW_NAKED_FRAC | - DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | - DUK_S2N_FLAG_ALLOW_EMPTY_AS_ZERO | - DUK_S2N_FLAG_ALLOW_LEADING_ZERO | - DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT | - DUK_S2N_FLAG_ALLOW_AUTO_OCT_INT | - DUK_S2N_FLAG_ALLOW_AUTO_BIN_INT; + s2n_flags = DUK_S2N_FLAG_TRIM_WHITE | DUK_S2N_FLAG_ALLOW_EXP | DUK_S2N_FLAG_ALLOW_PLUS | DUK_S2N_FLAG_ALLOW_MINUS | + DUK_S2N_FLAG_ALLOW_INF | DUK_S2N_FLAG_ALLOW_FRAC | DUK_S2N_FLAG_ALLOW_NAKED_FRAC | + DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | DUK_S2N_FLAG_ALLOW_EMPTY_AS_ZERO | DUK_S2N_FLAG_ALLOW_LEADING_ZERO | + DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT | DUK_S2N_FLAG_ALLOW_AUTO_OCT_INT | DUK_S2N_FLAG_ALLOW_AUTO_BIN_INT; duk_numconv_parse(thr, 10 /*radix*/, s2n_flags); @@ -81347,9 +82671,9 @@ DUK_LOCAL duk_double_t duk__tonumber_string_raw(duk_hthread *thr) { #else thr->valstack_top--; DUK_ASSERT(DUK_TVAL_IS_NUMBER(thr->valstack_top)); - DUK_ASSERT(DUK_TVAL_IS_DOUBLE(thr->valstack_top)); /* no fastint conversion in numconv now */ + DUK_ASSERT(DUK_TVAL_IS_DOUBLE(thr->valstack_top)); /* no fastint conversion in numconv now */ DUK_ASSERT(!DUK_TVAL_NEEDS_REFCOUNT_UPDATE(thr->valstack_top)); - d = DUK_TVAL_GET_DOUBLE(thr->valstack_top); /* assumes not a fastint */ + d = DUK_TVAL_GET_DOUBLE(thr->valstack_top); /* assumes not a fastint */ DUK_TVAL_SET_UNDEFINED(thr->valstack_top); #endif @@ -81388,11 +82712,11 @@ DUK_INTERNAL duk_double_t duk_js_tonumber(duk_hthread *thr, duk_tval *tv) { duk_push_hstring(thr, h); return duk__tonumber_string_raw(thr); } - case DUK_TAG_BUFFER: /* plain buffer treated like object */ + case DUK_TAG_BUFFER: /* plain buffer treated like object */ case DUK_TAG_OBJECT: { duk_double_t d; duk_push_tval(thr, tv); - duk_to_primitive(thr, -1, DUK_HINT_NUMBER); /* 'tv' becomes invalid */ + duk_to_primitive(thr, -1, DUK_HINT_NUMBER); /* 'tv' becomes invalid */ /* recursive call for a primitive value (guaranteed not to cause second * recursion). @@ -81447,7 +82771,7 @@ DUK_INTERNAL duk_double_t duk_js_tointeger_number(duk_double_t x) { */ return duk_double_trunc_towards_zero(x); } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ /* NaN and Infinity have the same exponent so it's a cheap * initial check for the rare path. */ @@ -81460,12 +82784,12 @@ DUK_INTERNAL duk_double_t duk_js_tointeger_number(duk_double_t x) { } else { return duk_double_trunc_towards_zero(x); } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ } DUK_INTERNAL duk_double_t duk_js_tointeger(duk_hthread *thr, duk_tval *tv) { /* XXX: fastint */ - duk_double_t d = duk_js_tonumber(thr, tv); /* invalidates tv */ + duk_double_t d = duk_js_tonumber(thr, tv); /* invalidates tv */ return duk_js_tointeger_number(d); } @@ -81475,11 +82799,11 @@ DUK_INTERNAL duk_double_t duk_js_tointeger(duk_hthread *thr, duk_tval *tv) { /* combined algorithm matching E5 Sections 9.5 and 9.6 */ DUK_LOCAL duk_double_t duk__toint32_touint32_helper(duk_double_t x, duk_bool_t is_toint32) { -#if defined (DUK_USE_PREFER_SIZE) +#if defined(DUK_USE_PREFER_SIZE) duk_small_int_t c; #endif -#if defined (DUK_USE_PREFER_SIZE) +#if defined(DUK_USE_PREFER_SIZE) c = (duk_small_int_t) DUK_FPCLASSIFY(x); if (c == DUK_FP_NAN || c == DUK_FP_ZERO || c == DUK_FP_INFINITE) { return 0.0; @@ -81497,18 +82821,18 @@ DUK_LOCAL duk_double_t duk__toint32_touint32_helper(duk_double_t x, duk_bool_t i * differs from what Javascript wants (see Section 9.6). */ - x = DUK_FMOD(x, DUK_DOUBLE_2TO32); /* -> x in ]-2**32, 2**32[ */ + x = DUK_FMOD(x, DUK_DOUBLE_2TO32); /* -> x in ]-2**32, 2**32[ */ if (x < 0.0) { x += DUK_DOUBLE_2TO32; } - DUK_ASSERT(x >= 0 && x < DUK_DOUBLE_2TO32); /* -> x in [0, 2**32[ */ + DUK_ASSERT(x >= 0 && x < DUK_DOUBLE_2TO32); /* -> x in [0, 2**32[ */ if (is_toint32) { if (x >= DUK_DOUBLE_2TO31) { /* x in [2**31, 2**32[ */ - x -= DUK_DOUBLE_2TO32; /* -> x in [-2**31,2**31[ */ + x -= DUK_DOUBLE_2TO32; /* -> x in [-2**31,2**31[ */ } } @@ -81524,15 +82848,14 @@ DUK_INTERNAL duk_int32_t duk_js_toint32(duk_hthread *thr, duk_tval *tv) { } #endif - d = duk_js_tonumber(thr, tv); /* invalidates tv */ + d = duk_js_tonumber(thr, tv); /* invalidates tv */ d = duk__toint32_touint32_helper(d, 1); DUK_ASSERT(DUK_FPCLASSIFY(d) == DUK_FP_ZERO || DUK_FPCLASSIFY(d) == DUK_FP_NORMAL); - DUK_ASSERT(d >= -2147483648.0 && d <= 2147483647.0); /* [-0x80000000,0x7fffffff] */ - DUK_ASSERT(duk_double_equals(d, (duk_double_t) ((duk_int32_t) d))); /* whole, won't clip */ + DUK_ASSERT(d >= -2147483648.0 && d <= 2147483647.0); /* [-0x80000000,0x7fffffff] */ + DUK_ASSERT(duk_double_equals(d, (duk_double_t) ((duk_int32_t) d))); /* whole, won't clip */ return (duk_int32_t) d; } - DUK_INTERNAL duk_uint32_t duk_js_touint32(duk_hthread *thr, duk_tval *tv) { duk_double_t d; @@ -81542,13 +82865,12 @@ DUK_INTERNAL duk_uint32_t duk_js_touint32(duk_hthread *thr, duk_tval *tv) { } #endif - d = duk_js_tonumber(thr, tv); /* invalidates tv */ + d = duk_js_tonumber(thr, tv); /* invalidates tv */ d = duk__toint32_touint32_helper(d, 0); DUK_ASSERT(DUK_FPCLASSIFY(d) == DUK_FP_ZERO || DUK_FPCLASSIFY(d) == DUK_FP_NORMAL); - DUK_ASSERT(d >= 0.0 && d <= 4294967295.0); /* [0x00000000, 0xffffffff] */ - DUK_ASSERT(duk_double_equals(d, (duk_double_t) ((duk_uint32_t) d))); /* whole, won't clip */ + DUK_ASSERT(d >= 0.0 && d <= 4294967295.0); /* [0x00000000, 0xffffffff] */ + DUK_ASSERT(duk_double_equals(d, (duk_double_t) ((duk_uint32_t) d))); /* whole, won't clip */ return (duk_uint32_t) d; - } DUK_INTERNAL duk_uint16_t duk_js_touint16(duk_hthread *thr, duk_tval *tv) { @@ -81598,7 +82920,7 @@ DUK_LOCAL duk_bool_t duk__js_equals_number(duk_double_t x, duk_double_t y) { return 1; } return 0; -#else /* DUK_USE_PARANOID_MATH */ +#else /* DUK_USE_PARANOID_MATH */ /* Better equivalent algorithm. If the compiler is compliant, C and * ECMAScript semantics are identical for this particular comparison. * In particular, NaNs must never compare equal and zeroes must compare @@ -81618,7 +82940,7 @@ DUK_LOCAL duk_bool_t duk__js_equals_number(duk_double_t x, duk_double_t y) { DUK_ASSERT(!(DUK_FPCLASSIFY(x) == DUK_FP_ZERO && DUK_FPCLASSIFY(y) == DUK_FP_ZERO)); return 0; } -#endif /* DUK_USE_PARANOID_MATH */ +#endif /* DUK_USE_PARANOID_MATH */ } DUK_LOCAL duk_bool_t duk__js_samevalue_number(duk_double_t x, duk_double_t y) { @@ -81648,7 +82970,7 @@ DUK_LOCAL duk_bool_t duk__js_samevalue_number(duk_double_t x, duk_double_t y) { */ return (x == y); -#else /* DUK_USE_PARANOID_MATH */ +#else /* DUK_USE_PARANOID_MATH */ duk_small_int_t cx = (duk_small_int_t) DUK_FPCLASSIFY(x); duk_small_int_t cy = (duk_small_int_t) DUK_FPCLASSIFY(y); @@ -81683,7 +83005,7 @@ DUK_LOCAL duk_bool_t duk__js_samevalue_number(duk_double_t x, duk_double_t y) { } return 0; } -#endif /* DUK_USE_PARANOID_MATH */ +#endif /* DUK_USE_PARANOID_MATH */ } DUK_INTERNAL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_t flags) { @@ -81709,10 +83031,9 @@ DUK_INTERNAL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, d } else { return 0; } - } - else + } else #endif - if (DUK_TVAL_IS_NUMBER(tv_x) && DUK_TVAL_IS_NUMBER(tv_y)) { + if (DUK_TVAL_IS_NUMBER(tv_x) && DUK_TVAL_IS_NUMBER(tv_y)) { duk_double_t d1, d2; /* Catches both doubles and cases where only one argument is @@ -81786,7 +83107,7 @@ DUK_INTERNAL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, d return 0; } - DUK_ASSERT(flags == 0); /* non-strict equality from here on */ + DUK_ASSERT(flags == 0); /* non-strict equality from here on */ /* * Types are different; various cases for non-strict comparison @@ -81843,34 +83164,29 @@ DUK_INTERNAL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, d } /* String-number-symbol/object -> coerce object to primitive (apparently without hint), then try again. */ - if ((type_mask_x & (DUK_TYPE_MASK_STRING | DUK_TYPE_MASK_NUMBER)) && - (type_mask_y & DUK_TYPE_MASK_OBJECT)) { + if ((type_mask_x & (DUK_TYPE_MASK_STRING | DUK_TYPE_MASK_NUMBER)) && (type_mask_y & DUK_TYPE_MASK_OBJECT)) { /* No symbol check needed because symbols and strings are accepted. */ duk_push_tval(thr, tv_x); duk_push_tval(thr, tv_y); - duk_to_primitive(thr, -1, DUK_HINT_NONE); /* apparently no hint? */ + duk_to_primitive(thr, -1, DUK_HINT_NONE); /* apparently no hint? */ goto recursive_call; } - if ((type_mask_x & DUK_TYPE_MASK_OBJECT) && - (type_mask_y & (DUK_TYPE_MASK_STRING | DUK_TYPE_MASK_NUMBER))) { + if ((type_mask_x & DUK_TYPE_MASK_OBJECT) && (type_mask_y & (DUK_TYPE_MASK_STRING | DUK_TYPE_MASK_NUMBER))) { /* No symbol check needed because symbols and strings are accepted. */ duk_push_tval(thr, tv_x); duk_push_tval(thr, tv_y); - duk_to_primitive(thr, -2, DUK_HINT_NONE); /* apparently no hint? */ + duk_to_primitive(thr, -2, DUK_HINT_NONE); /* apparently no hint? */ goto recursive_call; } /* Nothing worked -> not equal. */ return 0; - recursive_call: +recursive_call: /* Shared code path to call the helper again with arguments on stack top. */ { duk_bool_t rc; - rc = duk_js_equals_helper(thr, - DUK_GET_TVAL_NEGIDX(thr, -2), - DUK_GET_TVAL_NEGIDX(thr, -1), - 0 /*flags:nonstrict*/); + rc = duk_js_equals_helper(thr, DUK_GET_TVAL_NEGIDX(thr, -2), DUK_GET_TVAL_NEGIDX(thr, -1), 0 /*flags:nonstrict*/); duk_pop_2_unsafe(thr); return rc; } @@ -81887,7 +83203,10 @@ DUK_INTERNAL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, d * needs to push stuff on the stack anyway... */ -DUK_INTERNAL duk_small_int_t duk_js_data_compare(const duk_uint8_t *buf1, const duk_uint8_t *buf2, duk_size_t len1, duk_size_t len2) { +DUK_INTERNAL duk_small_int_t duk_js_data_compare(const duk_uint8_t *buf1, + const duk_uint8_t *buf2, + duk_size_t len1, + duk_size_t len2) { duk_size_t prefix_len; duk_small_int_t rc; @@ -81896,9 +83215,7 @@ DUK_INTERNAL duk_small_int_t duk_js_data_compare(const duk_uint8_t *buf1, const /* duk_memcmp() is guaranteed to return zero (equal) for zero length * inputs. */ - rc = duk_memcmp_unsafe((const void *) buf1, - (const void *) buf2, - (size_t) prefix_len); + rc = duk_memcmp_unsafe((const void *) buf1, (const void *) buf2, (size_t) prefix_len); if (rc < 0) { return -1; @@ -81940,7 +83257,7 @@ DUK_INTERNAL duk_small_int_t duk_js_string_compare(duk_hstring *h1, duk_hstring (duk_size_t) DUK_HSTRING_GET_BYTELEN(h2)); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_INTERNAL duk_small_int_t duk_js_buffer_compare(duk_heap *heap, duk_hbuffer *h1, duk_hbuffer *h2) { /* Similar to String comparison. */ @@ -81977,47 +83294,47 @@ DUK_LOCAL duk_bool_t duk__compare_number(duk_bool_t retval, duk_double_t d1, duk s2 = (duk_small_int_t) DUK_SIGNBIT(d2); if (c1 == DUK_FP_NAN || c2 == DUK_FP_NAN) { - return 0; /* Always false, regardless of negation. */ + return 0; /* Always false, regardless of negation. */ } if (c1 == DUK_FP_ZERO && c2 == DUK_FP_ZERO) { /* For all combinations: +0 < +0, +0 < -0, -0 < +0, -0 < -0, * steps e, f, and g. */ - return retval; /* false */ + return retval; /* false */ } if (d1 == d2) { - return retval; /* false */ + return retval; /* false */ } if (c1 == DUK_FP_INFINITE && s1 == 0) { /* x == +Infinity */ - return retval; /* false */ + return retval; /* false */ } if (c2 == DUK_FP_INFINITE && s2 == 0) { /* y == +Infinity */ - return retval ^ 1; /* true */ + return retval ^ 1; /* true */ } if (c2 == DUK_FP_INFINITE && s2 != 0) { /* y == -Infinity */ - return retval; /* false */ + return retval; /* false */ } if (c1 == DUK_FP_INFINITE && s1 != 0) { /* x == -Infinity */ - return retval ^ 1; /* true */ + return retval ^ 1; /* true */ } if (d1 < d2) { - return retval ^ 1; /* true */ + return retval ^ 1; /* true */ } - return retval; /* false */ + return retval; /* false */ } -#else /* DUK_USE_PARANOID_MATH */ +#else /* DUK_USE_PARANOID_MATH */ DUK_LOCAL duk_bool_t duk__compare_number(duk_bool_t retval, duk_double_t d1, duk_double_t d2) { /* This comparison tree relies doesn't match the exact steps in * E5 Section 11.8.5 but should produce the same results. The @@ -82054,39 +83371,35 @@ DUK_LOCAL duk_bool_t duk__compare_number(duk_bool_t retval, duk_double_t d1, duk * results in false return (see e.g. Section * 11.8.3) - hence special treatment here. */ - return 0; /* zero regardless of negation */ + return 0; /* zero regardless of negation */ } else { return retval; } } } } -#endif /* DUK_USE_PARANOID_MATH */ +#endif /* DUK_USE_PARANOID_MATH */ DUK_INTERNAL duk_bool_t duk_js_compare_helper(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_t flags) { duk_double_t d1, d2; duk_small_int_t rc; duk_bool_t retval; - DUK_ASSERT(DUK_COMPARE_FLAG_NEGATE == 1); /* Rely on this flag being lowest. */ + DUK_ASSERT(DUK_COMPARE_FLAG_NEGATE == 1); /* Rely on this flag being lowest. */ retval = flags & DUK_COMPARE_FLAG_NEGATE; DUK_ASSERT(retval == 0 || retval == 1); /* Fast path for fastints */ #if defined(DUK_USE_FASTINT) if (DUK_LIKELY(DUK_TVAL_IS_FASTINT(tv_x) && DUK_TVAL_IS_FASTINT(tv_y))) { - return duk__compare_fastint(retval, - DUK_TVAL_GET_FASTINT(tv_x), - DUK_TVAL_GET_FASTINT(tv_y)); + return duk__compare_fastint(retval, DUK_TVAL_GET_FASTINT(tv_x), DUK_TVAL_GET_FASTINT(tv_y)); } -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ /* Fast path for numbers (one of which may be a fastint) */ #if !defined(DUK_USE_PREFER_SIZE) if (DUK_LIKELY(DUK_TVAL_IS_NUMBER(tv_x) && DUK_TVAL_IS_NUMBER(tv_y))) { - return duk__compare_number(retval, - DUK_TVAL_GET_NUMBER(tv_x), - DUK_TVAL_GET_NUMBER(tv_y)); + return duk__compare_number(retval, DUK_TVAL_GET_NUMBER(tv_x), DUK_TVAL_GET_NUMBER(tv_y)); } #endif @@ -82153,7 +83466,7 @@ DUK_INTERNAL duk_bool_t duk_js_compare_helper(duk_hthread *thr, duk_tval *tv_x, thr->valstack_top -= 2; tv_x = thr->valstack_top; tv_y = tv_x + 1; - DUK_TVAL_SET_UNDEFINED(tv_x); /* Value stack policy */ + DUK_TVAL_SET_UNDEFINED(tv_x); /* Value stack policy */ DUK_TVAL_SET_UNDEFINED(tv_y); #endif @@ -82207,8 +83520,8 @@ DUK_LOCAL duk_bool_t duk__js_instanceof_helper(duk_hthread *thr, duk_tval *tv_x, if (!skip_sym_check) { if (duk_get_method_stridx(thr, -1, DUK_STRIDX_WELLKNOWN_SYMBOL_HAS_INSTANCE)) { /* [ ... lhs rhs func ] */ - duk_insert(thr, -3); /* -> [ ... func lhs rhs ] */ - duk_swap_top(thr, -2); /* -> [ ... func rhs(this) lhs ] */ + duk_insert(thr, -3); /* -> [ ... func lhs rhs ] */ + duk_swap_top(thr, -2); /* -> [ ... func rhs(this) lhs ] */ duk_call_method(thr, 1); return duk_to_boolean_top_pop(thr); } @@ -82240,7 +83553,7 @@ DUK_LOCAL duk_bool_t duk__js_instanceof_helper(duk_hthread *thr, duk_tval *tv_x, if (DUK_HOBJECT_HAS_BOUNDFUNC(func)) { duk_push_tval(thr, &((duk_hboundfunc *) (void *) func)->target); duk_replace(thr, -2); - func = duk_require_hobject(thr, -1); /* lightfunc throws */ + func = duk_require_hobject(thr, -1); /* lightfunc throws */ /* Rely on Function.prototype.bind() never creating bound * functions whose target is not proper. @@ -82280,19 +83593,19 @@ DUK_LOCAL duk_bool_t duk__js_instanceof_helper(duk_hthread *thr, duk_tval *tv_x, DUK_ASSERT(val != NULL); break; case DUK_TAG_OBJECT: - skip_first = 1; /* Ignore object itself on first round. */ + skip_first = 1; /* Ignore object itself on first round. */ val = DUK_TVAL_GET_OBJECT(tv); DUK_ASSERT(val != NULL); break; default: goto pop2_and_false; } - DUK_ASSERT(val != NULL); /* Loop doesn't actually rely on this. */ + DUK_ASSERT(val != NULL); /* Loop doesn't actually rely on this. */ /* Look up .prototype of rval. Leave it on the value stack in case it * has been virtualized (e.g. getter, Proxy trap). */ - duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_PROTOTYPE); /* -> [ ... lval rval rval.prototype ] */ + duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_PROTOTYPE); /* -> [ ... lval rval rval.prototype ] */ #if defined(DUK_USE_VERBOSE_ERRORS) proto = duk_get_hobject(thr, -1); if (proto == NULL) { @@ -82345,24 +83658,24 @@ DUK_LOCAL duk_bool_t duk__js_instanceof_helper(duk_hthread *thr, duk_tval *tv_x, DUK_ERROR_RANGE(thr, DUK_STR_PROTOTYPE_CHAIN_LIMIT); DUK_WO_NORETURN(return 0;); - pop2_and_false: +pop2_and_false: duk_pop_2_unsafe(thr); return 0; - pop3_and_false: +pop3_and_false: duk_pop_3_unsafe(thr); return 0; - pop3_and_true: +pop3_and_true: duk_pop_3_unsafe(thr); return 1; - error_invalid_rval: +error_invalid_rval: DUK_ERROR_TYPE(thr, DUK_STR_INVALID_INSTANCEOF_RVAL); DUK_WO_NORETURN(return 0;); #if defined(DUK_USE_VERBOSE_ERRORS) - error_invalid_rval_noproto: +error_invalid_rval_noproto: DUK_ERROR_TYPE(thr, DUK_STR_INVALID_INSTANCEOF_RVAL_NOPROTO); DUK_WO_NORETURN(return 0;); #endif @@ -82414,9 +83727,7 @@ DUK_INTERNAL duk_bool_t duk_js_in(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv (void) duk_to_property_key_hstring(thr, -2); - retval = duk_hobject_hasprop(thr, - DUK_GET_TVAL_NEGIDX(thr, -1), - DUK_GET_TVAL_NEGIDX(thr, -2)); + retval = duk_hobject_hasprop(thr, DUK_GET_TVAL_NEGIDX(thr, -1), DUK_GET_TVAL_NEGIDX(thr, -2)); duk_pop_2_unsafe(thr); return retval; @@ -82576,7 +83887,7 @@ DUK_INTERNAL duk_uarridx_t duk_js_to_arrayindex_string(const duk_uint8_t *str, d } res = 0xfffffffaUL + dig; DUK_ASSERT(res >= 0xfffffffaUL); - DUK_ASSERT_DISABLE(res <= 0xffffffffUL); /* range */ + DUK_ASSERT_DISABLE(res <= 0xffffffffUL); /* range */ } else { res = res * 10U + dig; if (DUK_UNLIKELY(res == 0)) { @@ -82601,7 +83912,7 @@ DUK_INTERNAL duk_uarridx_t duk_js_to_arrayindex_string(const duk_uint8_t *str, d return res; - parse_fail: +parse_fail: return DUK_HSTRING_NO_ARRAY_INDEX; } @@ -82639,7 +83950,7 @@ DUK_INTERNAL duk_uarridx_t duk_js_to_arrayindex_hstring_fast(duk_hstring *h) { } return duk_js_to_arrayindex_hstring_fast_known(h); } -#endif /* DUK_USE_HSTRING_ARRIDX */ +#endif /* DUK_USE_HSTRING_ARRIDX */ /* * Identifier access and function closure handling. * @@ -82680,10 +83991,10 @@ DUK_INTERNAL duk_uarridx_t duk_js_to_arrayindex_hstring_fast(duk_hstring *h) { typedef struct { duk_hobject *env; - duk_hobject *holder; /* for object-bound identifiers */ - duk_tval *value; /* for register-bound and declarative env identifiers */ - duk_uint_t attrs; /* property attributes for identifier (relevant if value != NULL) */ - duk_bool_t has_this; /* for object-bound identifiers: provide 'this' binding */ + duk_hobject *holder; /* for object-bound identifiers */ + duk_tval *value; /* for register-bound and declarative env identifiers */ + duk_uint_t attrs; /* property attributes for identifier (relevant if value != NULL) */ + duk_bool_t has_this; /* for object-bound identifiers: provide 'this' binding */ } duk__id_lookup_result; /* @@ -82787,7 +84098,7 @@ void duk_js_push_closure(duk_hthread *thr, DUK_ASSERT(fun_clos != NULL); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) fun_clos) == thr->builtins[DUK_BIDX_FUNCTION_PROTOTYPE]); - duk_push_hobject(thr, &fun_temp->obj); /* -> [ ... closure template ] */ + duk_push_hobject(thr, &fun_temp->obj); /* -> [ ... closure template ] */ DUK_ASSERT(DUK_HOBJECT_IS_COMPFUNC((duk_hobject *) fun_clos)); DUK_ASSERT(DUK_HCOMPFUNC_GET_DATA(thr->heap, fun_clos) == NULL); @@ -82895,9 +84206,9 @@ void duk_js_push_closure(duk_hthread *thr, } /* -> [ ... closure template env ] */ - new_env = duk_hdecenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); + new_env = + duk_hdecenv_alloc(thr, + DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); DUK_ASSERT(new_env != NULL); duk_push_hobject(thr, (duk_hobject *) new_env); @@ -82905,7 +84216,7 @@ void duk_js_push_closure(duk_hthread *thr, DUK_HOBJECT_SET_PROTOTYPE(thr->heap, (duk_hobject *) new_env, proto); DUK_HOBJECT_INCREF_ALLOWNULL(thr, proto); - DUK_ASSERT(new_env->thread == NULL); /* Closed. */ + DUK_ASSERT(new_env->thread == NULL); /* Closed. */ DUK_ASSERT(new_env->varmap == NULL); /* It's important that duk_xdef_prop() is a 'raw define' so that any @@ -82919,8 +84230,8 @@ void duk_js_push_closure(duk_hthread *thr, */ (void) duk_get_prop_stridx_short(thr, -2, DUK_STRIDX_NAME); /* -> [ ... closure template env funcname ] */ - duk_dup_m4(thr); /* -> [ ... closure template env funcname closure ] */ - duk_xdef_prop(thr, -3, DUK_PROPDESC_FLAGS_NONE); /* -> [ ... closure template env ] */ + duk_dup_m4(thr); /* -> [ ... closure template env funcname closure ] */ + duk_xdef_prop(thr, -3, DUK_PROPDESC_FLAGS_NONE); /* -> [ ... closure template env ] */ /* env[funcname] = closure */ /* [ ... closure template env ] */ @@ -82932,9 +84243,8 @@ void duk_js_push_closure(duk_hthread *thr, duk_pop_unsafe(thr); /* [ ... closure template ] */ - } - else -#endif /* DUK_USE_FUNC_NAME_PROPERTY */ + } else +#endif /* DUK_USE_FUNC_NAME_PROPERTY */ { /* * Other cases (function declaration, anonymous function expression, @@ -82962,7 +84272,7 @@ void duk_js_push_closure(duk_hthread *thr, DUK_HCOMPFUNC_SET_LEXENV(thr->heap, fun_clos, outer_lex_env); DUK_HCOMPFUNC_SET_VARENV(thr->heap, fun_clos, outer_var_env); - DUK_HOBJECT_INCREF(thr, outer_lex_env); /* NULLs not allowed; asserted on entry */ + DUK_HOBJECT_INCREF(thr, outer_lex_env); /* NULLs not allowed; asserted on entry */ DUK_HOBJECT_INCREF(thr, outer_var_env); } DUK_DDD(DUK_DDDPRINT("closure varenv -> %!ipO, lexenv -> %!ipO", @@ -83021,7 +84331,7 @@ void duk_js_push_closure(duk_hthread *thr, DUK_DD(DUK_DDPRINT("closure length defaulted from nargs -> %ld", (long) len_value)); } - duk_push_uint(thr, len_value); /* [ ... closure template len_value ] */ + duk_push_uint(thr, len_value); /* [ ... closure template len_value ] */ duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_C); /* @@ -83041,11 +84351,14 @@ void duk_js_push_closure(duk_hthread *thr, /* [ ... closure template ] */ if (add_auto_proto) { - duk_push_object(thr); /* -> [ ... closure template newobj ] */ - duk_dup_m3(thr); /* -> [ ... closure template newobj closure ] */ - duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_CONSTRUCTOR, DUK_PROPDESC_FLAGS_WC); /* -> [ ... closure template newobj ] */ - duk_compact(thr, -1); /* compact the prototype */ - duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_PROTOTYPE, DUK_PROPDESC_FLAGS_W); /* -> [ ... closure template ] */ + duk_push_object(thr); /* -> [ ... closure template newobj ] */ + duk_dup_m3(thr); /* -> [ ... closure template newobj closure ] */ + duk_xdef_prop_stridx_short(thr, + -2, + DUK_STRIDX_CONSTRUCTOR, + DUK_PROPDESC_FLAGS_WC); /* -> [ ... closure template newobj ] */ + duk_compact(thr, -1); /* compact the prototype */ + duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_PROTOTYPE, DUK_PROPDESC_FLAGS_W); /* -> [ ... closure template ] */ } /* @@ -83086,7 +84399,7 @@ void duk_js_push_closure(duk_hthread *thr, /* [ ... closure template name ] */ DUK_ASSERT(duk_is_string(thr, -1)); DUK_DD(DUK_DDPRINT("setting function instance name to %!T", duk_get_tval(thr, -1))); - duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_NAME, DUK_PROPDESC_FLAGS_C); /* -> [ ... closure template ] */ + duk_xdef_prop_stridx_short(thr, -3, DUK_STRIDX_NAME, DUK_PROPDESC_FLAGS_C); /* -> [ ... closure template ] */ } else { /* Anonymous functions don't have a .name in ES2015, so don't set * it on the instance either. The instance will then inherit @@ -83118,10 +84431,8 @@ void duk_js_push_closure(duk_hthread *thr, DUK_ASSERT(duk_has_prop_stridx(thr, -2, DUK_STRIDX_LENGTH) != 0); DUK_ASSERT(add_auto_proto == 0 || duk_has_prop_stridx(thr, -2, DUK_STRIDX_PROTOTYPE) != 0); /* May be missing .name */ - DUK_ASSERT(!DUK_HOBJECT_HAS_STRICT(&fun_clos->obj) || - duk_has_prop_stridx(thr, -2, DUK_STRIDX_CALLER) != 0); - DUK_ASSERT(!DUK_HOBJECT_HAS_STRICT(&fun_clos->obj) || - duk_has_prop_stridx(thr, -2, DUK_STRIDX_LC_ARGUMENTS) != 0); + DUK_ASSERT(!DUK_HOBJECT_HAS_STRICT(&fun_clos->obj) || duk_has_prop_stridx(thr, -2, DUK_STRIDX_CALLER) != 0); + DUK_ASSERT(!DUK_HOBJECT_HAS_STRICT(&fun_clos->obj) || duk_has_prop_stridx(thr, -2, DUK_STRIDX_LC_ARGUMENTS) != 0); /* * Finish @@ -83152,8 +84463,8 @@ DUK_LOCAL void duk__preallocate_env_entries(duk_hthread *thr, duk_hobject *varma duk_hstring *key; key = DUK_HOBJECT_E_GET_KEY(thr->heap, varmap, i); - DUK_ASSERT(key != NULL); /* assume keys are compact in _Varmap */ - DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, varmap, i)); /* assume plain values */ + DUK_ASSERT(key != NULL); /* assume keys are compact in _Varmap */ + DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, varmap, i)); /* assume plain values */ /* Predefine as 'undefined' to reserve a property slot. * This makes the unwind process (where register values @@ -83170,9 +84481,7 @@ DUK_LOCAL void duk__preallocate_env_entries(duk_hthread *thr, duk_hobject *varma /* shared helper */ DUK_INTERNAL -duk_hobject *duk_create_activation_environment_record(duk_hthread *thr, - duk_hobject *func, - duk_size_t bottom_byteoff) { +duk_hobject *duk_create_activation_environment_record(duk_hthread *thr, duk_hobject *func, duk_size_t bottom_byteoff) { duk_hdecenv *env; duk_hobject *parent; duk_hcompfunc *f; @@ -83188,15 +84497,13 @@ duk_hobject *duk_create_activation_environment_record(duk_hthread *thr, parent = thr->builtins[DUK_BIDX_GLOBAL_ENV]; } - env = duk_hdecenv_alloc(thr, - DUK_HOBJECT_FLAG_EXTENSIBLE | - DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); + env = duk_hdecenv_alloc(thr, DUK_HOBJECT_FLAG_EXTENSIBLE | DUK_HOBJECT_CLASS_AS_FLAGS(DUK_HOBJECT_CLASS_DECENV)); DUK_ASSERT(env != NULL); duk_push_hobject(thr, (duk_hobject *) env); DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) env) == NULL); DUK_HOBJECT_SET_PROTOTYPE(thr->heap, (duk_hobject *) env, parent); - DUK_HOBJECT_INCREF_ALLOWNULL(thr, parent); /* parent env is the prototype */ + DUK_HOBJECT_INCREF_ALLOWNULL(thr, parent); /* parent env is the prototype */ /* open scope information, for compiled functions only */ @@ -83230,15 +84537,14 @@ duk_hobject *duk_create_activation_environment_record(duk_hthread *thr, } DUK_INTERNAL -void duk_js_init_activation_environment_records_delayed(duk_hthread *thr, - duk_activation *act) { +void duk_js_init_activation_environment_records_delayed(duk_hthread *thr, duk_activation *act) { duk_hobject *func; duk_hobject *env; DUK_ASSERT(thr != NULL); func = DUK_ACT_GET_FUNC(act); DUK_ASSERT(func != NULL); - DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(func)); /* bound functions are never in act 'func' */ + DUK_ASSERT(!DUK_HOBJECT_HAS_BOUNDFUNC(func)); /* bound functions are never in act 'func' */ /* * Delayed initialization only occurs for 'NEWENV' functions. @@ -83267,7 +84573,7 @@ void duk_js_init_activation_environment_records_delayed(duk_hthread *thr, act->lex_env = env; act->var_env = env; - DUK_HOBJECT_INCREF(thr, env); /* XXX: incref by count (here 2 times) */ + DUK_HOBJECT_INCREF(thr, env); /* XXX: incref by count (here 2 times) */ DUK_HOBJECT_INCREF(thr, env); duk_pop_unsafe(thr); @@ -83337,12 +84643,12 @@ DUK_INTERNAL void duk_js_close_environment_record(duk_hthread *thr, duk_hobject duk_size_t regbase_byteoff; key = DUK_HOBJECT_E_GET_KEY(thr->heap, varmap, i); - DUK_ASSERT(key != NULL); /* assume keys are compact in _Varmap */ - DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, varmap, i)); /* assume plain values */ + DUK_ASSERT(key != NULL); /* assume keys are compact in _Varmap */ + DUK_ASSERT(!DUK_HOBJECT_E_SLOT_IS_ACCESSOR(thr->heap, varmap, i)); /* assume plain values */ tv = DUK_HOBJECT_E_GET_VALUE_TVAL_PTR(thr->heap, varmap, i); DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv)); - DUK_ASSERT(DUK_TVAL_GET_NUMBER(tv) <= (duk_double_t) DUK_UINT32_MAX); /* limits */ + DUK_ASSERT(DUK_TVAL_GET_NUMBER(tv) <= (duk_double_t) DUK_UINT32_MAX); /* limits */ #if defined(DUK_USE_FASTINT) DUK_ASSERT(DUK_TVAL_IS_FASTINT(tv)); regnum = (duk_uint_t) DUK_TVAL_GET_FASTINT_U32(tv); @@ -83351,8 +84657,10 @@ DUK_INTERNAL void duk_js_close_environment_record(duk_hthread *thr, duk_hobject #endif regbase_byteoff = ((duk_hdecenv *) env)->regbase_byteoff; - DUK_ASSERT((duk_uint8_t *) thr->valstack + regbase_byteoff + sizeof(duk_tval) * regnum >= (duk_uint8_t *) thr->valstack); - DUK_ASSERT((duk_uint8_t *) thr->valstack + regbase_byteoff + sizeof(duk_tval) * regnum < (duk_uint8_t *) thr->valstack_top); + DUK_ASSERT((duk_uint8_t *) thr->valstack + regbase_byteoff + sizeof(duk_tval) * regnum >= + (duk_uint8_t *) thr->valstack); + DUK_ASSERT((duk_uint8_t *) thr->valstack + regbase_byteoff + sizeof(duk_tval) * regnum < + (duk_uint8_t *) thr->valstack_top); /* Write register value into env as named properties. * If property already exists, overwrites silently. @@ -83366,7 +84674,8 @@ DUK_INTERNAL void duk_js_close_environment_record(duk_hthread *thr, duk_hobject * out-of-memory error should be possible. If this guarantee * is not provided, problems like GH-476 may happen. */ - duk_push_tval(thr, (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + regbase_byteoff + sizeof(duk_tval) * regnum)); + duk_push_tval(thr, + (duk_tval *) (void *) ((duk_uint8_t *) thr->valstack + regbase_byteoff + sizeof(duk_tval) * regnum)); DUK_DDD(DUK_DDDPRINT("closing identifier %!O -> reg %ld, value %!T", (duk_heaphdr *) key, (long) regnum, @@ -83408,10 +84717,7 @@ DUK_INTERNAL void duk_js_close_environment_record(duk_hthread *thr, duk_hobject /* lookup name from an open declarative record's registers */ DUK_LOCAL -duk_bool_t duk__getid_open_decl_env_regs(duk_hthread *thr, - duk_hstring *name, - duk_hdecenv *env, - duk__id_lookup_result *out) { +duk_bool_t duk__getid_open_decl_env_regs(duk_hthread *thr, duk_hstring *name, duk_hdecenv *env, duk__id_lookup_result *out) { duk_tval *tv; duk_size_t reg_rel; @@ -83435,20 +84741,20 @@ duk_bool_t duk__getid_open_decl_env_regs(duk_hthread *thr, } DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv)); - DUK_ASSERT(DUK_TVAL_GET_NUMBER(tv) <= (duk_double_t) DUK_UINT32_MAX); /* limits */ + DUK_ASSERT(DUK_TVAL_GET_NUMBER(tv) <= (duk_double_t) DUK_UINT32_MAX); /* limits */ #if defined(DUK_USE_FASTINT) DUK_ASSERT(DUK_TVAL_IS_FASTINT(tv)); reg_rel = (duk_size_t) DUK_TVAL_GET_FASTINT_U32(tv); #else reg_rel = (duk_size_t) DUK_TVAL_GET_NUMBER(tv); #endif - DUK_ASSERT_DISABLE(reg_rel >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(reg_rel >= 0); /* unsigned */ tv = (duk_tval *) (void *) ((duk_uint8_t *) env->thread->valstack + env->regbase_byteoff + sizeof(duk_tval) * reg_rel); - DUK_ASSERT(tv >= env->thread->valstack && tv < env->thread->valstack_end); /* XXX: more accurate? */ + DUK_ASSERT(tv >= env->thread->valstack && tv < env->thread->valstack_end); /* XXX: more accurate? */ out->value = tv; - out->attrs = DUK_PROPDESC_FLAGS_W; /* registers are mutable, non-deletable */ + out->attrs = DUK_PROPDESC_FLAGS_W; /* registers are mutable, non-deletable */ out->env = (duk_hobject *) env; out->holder = NULL; out->has_this = 0; @@ -83457,10 +84763,7 @@ duk_bool_t duk__getid_open_decl_env_regs(duk_hthread *thr, /* lookup name from current activation record's functions' registers */ DUK_LOCAL -duk_bool_t duk__getid_activation_regs(duk_hthread *thr, - duk_hstring *name, - duk_activation *act, - duk__id_lookup_result *out) { +duk_bool_t duk__getid_activation_regs(duk_hthread *thr, duk_hstring *name, duk_activation *act, duk__id_lookup_result *out) { duk_tval *tv; duk_hobject *func; duk_hobject *varmap; @@ -83498,7 +84801,7 @@ duk_bool_t duk__getid_activation_regs(duk_hthread *thr, tv += reg_rel; out->value = tv; - out->attrs = DUK_PROPDESC_FLAGS_W; /* registers are mutable, non-deletable */ + out->attrs = DUK_PROPDESC_FLAGS_W; /* registers are mutable, non-deletable */ out->env = NULL; out->holder = NULL; out->has_this = 0; @@ -83554,9 +84857,12 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("duk__get_identifier_reference successful: " "name=%!O -> value=%!T, attrs=%ld, has_this=%ld, env=%!O, holder=%!O " "(found from register bindings when env=NULL)", - (duk_heaphdr *) name, (duk_tval *) out->value, - (long) out->attrs, (long) out->has_this, - (duk_heaphdr *) out->env, (duk_heaphdr *) out->holder)); + (duk_heaphdr *) name, + (duk_tval *) out->value, + (long) out->attrs, + (long) out->has_this, + (duk_heaphdr *) out->env, + (duk_heaphdr *) out->holder)); return 1; } @@ -83593,8 +84899,7 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, env = thr->builtins[DUK_BIDX_GLOBAL_ENV]; } - DUK_DDD(DUK_DDDPRINT("continue lookup from env: %!iO", - (duk_heaphdr *) env)); + DUK_DDD(DUK_DDDPRINT("continue lookup from env: %!iO", (duk_heaphdr *) env)); } /* @@ -83637,9 +84942,12 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("duk__get_identifier_reference successful: " "name=%!O -> value=%!T, attrs=%ld, has_this=%ld, env=%!O, holder=%!O " "(declarative environment record, scope open, found in regs)", - (duk_heaphdr *) name, (duk_tval *) out->value, - (long) out->attrs, (long) out->has_this, - (duk_heaphdr *) out->env, (duk_heaphdr *) out->holder)); + (duk_heaphdr *) name, + (duk_tval *) out->value, + (long) out->attrs, + (long) out->has_this, + (duk_heaphdr *) out->env, + (duk_heaphdr *) out->holder)); return 1; } @@ -83654,9 +84962,12 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("duk__get_identifier_reference successful: " "name=%!O -> value=%!T, attrs=%ld, has_this=%ld, env=%!O, holder=%!O " "(declarative environment record, found in properties)", - (duk_heaphdr *) name, (duk_tval *) out->value, - (long) out->attrs, (long) out->has_this, - (duk_heaphdr *) out->env, (duk_heaphdr *) out->holder)); + (duk_heaphdr *) name, + (duk_tval *) out->value, + (long) out->attrs, + (long) out->has_this, + (duk_heaphdr *) out->env, + (duk_heaphdr *) out->holder)); return 1; } } else { @@ -83701,7 +85012,7 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, found = duk_hobject_hasprop(thr, &tv_target_tmp, &tv_name); } else -#endif /* DUK_USE_ES6_PROXY */ +#endif /* DUK_USE_ES6_PROXY */ { /* XXX: duk_hobject_hasprop() would be correct for * non-Proxy objects too, but it is about ~20-25% @@ -83712,8 +85023,8 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, } if (found) { - out->value = NULL; /* can't get value, may be accessor */ - out->attrs = 0; /* irrelevant when out->value == NULL */ + out->value = NULL; /* can't get value, may be accessor */ + out->attrs = 0; /* irrelevant when out->value == NULL */ out->env = env; out->holder = target; out->has_this = ((duk_hobjenv *) env)->has_this; @@ -83721,9 +85032,12 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("duk__get_identifier_reference successful: " "name=%!O -> value=%!T, attrs=%ld, has_this=%ld, env=%!O, holder=%!O " "(object environment record)", - (duk_heaphdr *) name, (duk_tval *) out->value, - (long) out->attrs, (long) out->has_this, - (duk_heaphdr *) out->env, (duk_heaphdr *) out->holder)); + (duk_heaphdr *) name, + (duk_tval *) out->value, + (long) out->attrs, + (long) out->has_this, + (duk_heaphdr *) out->env, + (duk_heaphdr *) out->holder)); return 1; } } @@ -83734,10 +85048,10 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, goto fail_not_found; } - if (DUK_UNLIKELY(sanity-- == 0)) { - DUK_ERROR_RANGE(thr, DUK_STR_PROTOTYPE_CHAIN_LIMIT); + if (DUK_UNLIKELY(sanity-- == 0)) { + DUK_ERROR_RANGE(thr, DUK_STR_PROTOTYPE_CHAIN_LIMIT); DUK_WO_NORETURN(return 0;); - } + } env = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, env); } @@ -83745,7 +85059,7 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, * Not found (even in global object) */ - fail_not_found: +fail_not_found: return 0; } @@ -83764,7 +85078,7 @@ duk_bool_t duk__get_identifier_reference(duk_hthread *thr, * a 'strict' parameter. */ -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL duk_bool_t duk_js_hasvar_envrec(duk_hthread *thr, duk_hobject *env, @@ -83820,11 +85134,7 @@ duk_bool_t duk_js_hasvar_envrec(duk_hthread *thr, */ DUK_LOCAL -duk_bool_t duk__getvar_helper(duk_hthread *thr, - duk_hobject *env, - duk_activation *act, - duk_hstring *name, - duk_bool_t throw_flag) { +duk_bool_t duk__getvar_helper(duk_hthread *thr, duk_hobject *env, duk_activation *act, duk_hstring *name, duk_bool_t throw_flag) { duk__id_lookup_result ref; duk_tval tv_tmp_obj; duk_tval tv_tmp_key; @@ -83832,8 +85142,11 @@ duk_bool_t duk__getvar_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("getvar: thr=%p, env=%p, act=%p, name=%!O " "(env -> %!dO)", - (void *) thr, (void *) env, (void *) act, - (duk_heaphdr *) name, (duk_heaphdr *) env)); + (void *) thr, + (void *) env, + (void *) act, + (duk_heaphdr *) name, + (duk_heaphdr *) env)); DUK_ASSERT(thr != NULL); DUK_ASSERT(name != NULL); @@ -83841,10 +85154,10 @@ duk_bool_t duk__getvar_helper(duk_hthread *thr, DUK_STATS_INC(thr->heap, stats_getvar_all); - DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(env); - DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name); + DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(env); + DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name); - parents = 1; /* follow parent chain */ + parents = 1; /* follow parent chain */ if (duk__get_identifier_reference(thr, env, name, act, parents, &ref)) { if (ref.value) { duk_push_tval(thr, ref.value); @@ -83859,7 +85172,7 @@ duk_bool_t duk__getvar_helper(duk_hthread *thr, DUK_TVAL_SET_OBJECT(&tv_tmp_obj, ref.holder); DUK_TVAL_SET_STRING(&tv_tmp_key, name); - (void) duk_hobject_getprop(thr, &tv_tmp_obj, &tv_tmp_key); /* [value] */ + (void) duk_hobject_getprop(thr, &tv_tmp_obj, &tv_tmp_key); /* [value] */ if (ref.has_this) { duk_push_hobject(thr, ref.holder); @@ -83873,7 +85186,8 @@ duk_bool_t duk__getvar_helper(duk_hthread *thr, return 1; } else { if (throw_flag) { - DUK_ERROR_FMT1(thr, DUK_ERR_REFERENCE_ERROR, + DUK_ERROR_FMT1(thr, + DUK_ERR_REFERENCE_ERROR, "identifier '%s' undefined", (const char *) DUK_HSTRING_GET_DATA(name)); DUK_WO_NORETURN(return 0;); @@ -83884,18 +85198,12 @@ duk_bool_t duk__getvar_helper(duk_hthread *thr, } DUK_INTERNAL -duk_bool_t duk_js_getvar_envrec(duk_hthread *thr, - duk_hobject *env, - duk_hstring *name, - duk_bool_t throw_flag) { +duk_bool_t duk_js_getvar_envrec(duk_hthread *thr, duk_hobject *env, duk_hstring *name, duk_bool_t throw_flag) { return duk__getvar_helper(thr, env, NULL, name, throw_flag); } DUK_INTERNAL -duk_bool_t duk_js_getvar_activation(duk_hthread *thr, - duk_activation *act, - duk_hstring *name, - duk_bool_t throw_flag) { +duk_bool_t duk_js_getvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name, duk_bool_t throw_flag) { DUK_ASSERT(act != NULL); return duk__getvar_helper(thr, act->lex_env, act, name, throw_flag); } @@ -83932,9 +85240,14 @@ void duk__putvar_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("putvar: thr=%p, env=%p, act=%p, name=%!O, val=%p, strict=%ld " "(env -> %!dO, val -> %!T)", - (void *) thr, (void *) env, (void *) act, - (duk_heaphdr *) name, (void *) val, (long) strict, - (duk_heaphdr *) env, (duk_tval *) val)); + (void *) thr, + (void *) env, + (void *) act, + (duk_heaphdr *) name, + (void *) val, + (long) strict, + (duk_heaphdr *) env, + (duk_tval *) val)); DUK_ASSERT(thr != NULL); DUK_ASSERT(name != NULL); @@ -83945,7 +85258,7 @@ void duk__putvar_helper(duk_hthread *thr, DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name); DUK_ASSERT_REFCOUNT_NONZERO_TVAL(val); - DUK_TVAL_SET_TVAL(&tv_tmp_val, val); /* Stabilize. */ + DUK_TVAL_SET_TVAL(&tv_tmp_val, val); /* Stabilize. */ val = NULL; /* @@ -83958,15 +85271,13 @@ void duk__putvar_helper(duk_hthread *thr, * and name 'eval' or 'arguments'. */ - DUK_ASSERT(!strict || - (name != DUK_HTHREAD_STRING_EVAL(thr) && - name != DUK_HTHREAD_STRING_LC_ARGUMENTS(thr))); + DUK_ASSERT(!strict || (name != DUK_HTHREAD_STRING_EVAL(thr) && name != DUK_HTHREAD_STRING_LC_ARGUMENTS(thr))); /* * Lookup variable and update in-place if found. */ - parents = 1; /* follow parent chain */ + parents = 1; /* follow parent chain */ if (duk__get_identifier_reference(thr, env, name, act, parents, &ref)) { if (ref.value && (ref.attrs & DUK_PROPDESC_FLAG_WRITABLE)) { @@ -83979,7 +85290,7 @@ void duk__putvar_helper(duk_hthread *thr, tv_val = ref.value; DUK_ASSERT(tv_val != NULL); - DUK_TVAL_SET_TVAL_UPDREF(thr, tv_val, &tv_tmp_val); /* side effects */ + DUK_TVAL_SET_TVAL_UPDREF(thr, tv_val, &tv_tmp_val); /* side effects */ /* ref.value invalidated here */ } else { @@ -84002,7 +85313,8 @@ void duk__putvar_helper(duk_hthread *thr, if (strict) { DUK_DDD(DUK_DDDPRINT("identifier binding not found, strict => reference error")); - DUK_ERROR_FMT1(thr, DUK_ERR_REFERENCE_ERROR, + DUK_ERROR_FMT1(thr, + DUK_ERR_REFERENCE_ERROR, "identifier '%s' undefined", (const char *) DUK_HSTRING_GET_DATA(name)); DUK_WO_NORETURN(return;); @@ -84012,7 +85324,7 @@ void duk__putvar_helper(duk_hthread *thr, DUK_TVAL_SET_OBJECT(&tv_tmp_obj, thr->builtins[DUK_BIDX_GLOBAL]); DUK_TVAL_SET_STRING(&tv_tmp_key, name); - (void) duk_hobject_putprop(thr, &tv_tmp_obj, &tv_tmp_key, &tv_tmp_val, 0); /* 0 = no throw */ + (void) duk_hobject_putprop(thr, &tv_tmp_obj, &tv_tmp_key, &tv_tmp_val, 0); /* 0 = no throw */ /* NB: 'val' may be invalidated here because put_value may realloc valstack, * caller beware. @@ -84020,20 +85332,12 @@ void duk__putvar_helper(duk_hthread *thr, } DUK_INTERNAL -void duk_js_putvar_envrec(duk_hthread *thr, - duk_hobject *env, - duk_hstring *name, - duk_tval *val, - duk_bool_t strict) { +void duk_js_putvar_envrec(duk_hthread *thr, duk_hobject *env, duk_hstring *name, duk_tval *val, duk_bool_t strict) { duk__putvar_helper(thr, env, NULL, name, val, strict); } DUK_INTERNAL -void duk_js_putvar_activation(duk_hthread *thr, - duk_activation *act, - duk_hstring *name, - duk_tval *val, - duk_bool_t strict) { +void duk_js_putvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name, duk_tval *val, duk_bool_t strict) { DUK_ASSERT(act != NULL); duk__putvar_helper(thr, act->lex_env, act, name, val, strict); } @@ -84058,25 +85362,25 @@ void duk_js_putvar_activation(duk_hthread *thr, */ DUK_LOCAL -duk_bool_t duk__delvar_helper(duk_hthread *thr, - duk_hobject *env, - duk_activation *act, - duk_hstring *name) { +duk_bool_t duk__delvar_helper(duk_hthread *thr, duk_hobject *env, duk_activation *act, duk_hstring *name) { duk__id_lookup_result ref; duk_bool_t parents; DUK_DDD(DUK_DDDPRINT("delvar: thr=%p, env=%p, act=%p, name=%!O " "(env -> %!dO)", - (void *) thr, (void *) env, (void *) act, - (duk_heaphdr *) name, (duk_heaphdr *) env)); + (void *) thr, + (void *) env, + (void *) act, + (duk_heaphdr *) name, + (duk_heaphdr *) env)); DUK_ASSERT(thr != NULL); DUK_ASSERT(name != NULL); /* env and act may be NULL */ - DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name); + DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name); - parents = 1; /* follow parent chain */ + parents = 1; /* follow parent chain */ if (duk__get_identifier_reference(thr, env, name, act, parents, &ref)) { if (ref.value && !(ref.attrs & DUK_PROPDESC_FLAG_CONFIGURABLE)) { @@ -84104,7 +85408,7 @@ duk_bool_t duk__delvar_helper(duk_hthread *thr, return 1; } -#if 0 /*unused*/ +#if 0 /*unused*/ DUK_INTERNAL duk_bool_t duk_js_delvar_envrec(duk_hthread *thr, duk_hobject *env, @@ -84114,9 +85418,7 @@ duk_bool_t duk_js_delvar_envrec(duk_hthread *thr, #endif DUK_INTERNAL -duk_bool_t duk_js_delvar_activation(duk_hthread *thr, - duk_activation *act, - duk_hstring *name) { +duk_bool_t duk_js_delvar_activation(duk_hthread *thr, duk_activation *act, duk_hstring *name) { DUK_ASSERT(act != NULL); return duk__delvar_helper(thr, act->lex_env, act, name); } @@ -84185,9 +85487,13 @@ duk_bool_t duk__declvar_helper(duk_hthread *thr, DUK_DDD(DUK_DDDPRINT("declvar: thr=%p, env=%p, name=%!O, val=%!T, prop_flags=0x%08lx, is_func_decl=%ld " "(env -> %!iO)", - (void *) thr, (void *) env, (duk_heaphdr *) name, - (duk_tval *) val, (unsigned long) prop_flags, - (unsigned int) is_func_decl, (duk_heaphdr *) env)); + (void *) thr, + (void *) env, + (duk_heaphdr *) name, + (duk_tval *) val, + (unsigned long) prop_flags, + (unsigned int) is_func_decl, + (duk_heaphdr *) env)); DUK_ASSERT(thr != NULL); DUK_ASSERT(env != NULL); @@ -84214,7 +85520,7 @@ duk_bool_t duk__declvar_helper(duk_hthread *thr, * environment target object. */ - parents = 0; /* just check 'env' */ + parents = 0; /* just check 'env' */ if (duk__get_identifier_reference(thr, env, name, NULL, parents, &ref)) { duk_int_t e_idx; duk_int_t h_idx; @@ -84229,7 +85535,7 @@ duk_bool_t duk__declvar_helper(duk_hthread *thr, if (!(is_func_decl && env == thr->builtins[DUK_BIDX_GLOBAL_ENV])) { DUK_DDD(DUK_DDDPRINT("re-declare a binding, ignoring")); - return 1; /* 1 -> needs a PUTVAR */ + return 1; /* 1 -> needs a PUTVAR */ } /* @@ -84259,7 +85565,7 @@ duk_bool_t duk__declvar_helper(duk_hthread *thr, * where the property was found (see duk__get_identifier_reference()). */ DUK_ASSERT(DUK_HOBJECT_GET_CLASS_NUMBER(holder) == DUK_HOBJECT_CLASS_GLOBAL); - DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARRAY(holder)); /* global object doesn't have array part */ + DUK_ASSERT(!DUK_HOBJECT_HAS_EXOTIC_ARRAY(holder)); /* global object doesn't have array part */ /* XXX: use a helper for prototype traversal; no loop check here */ /* must be found: was found earlier, and cannot be inherited */ @@ -84292,8 +85598,7 @@ duk_bool_t duk__declvar_helper(duk_hthread *thr, "accessor -> reject")); goto fail_existing_attributes; } - if (!((flags & DUK_PROPDESC_FLAG_WRITABLE) && - (flags & DUK_PROPDESC_FLAG_ENUMERABLE))) { + if (!((flags & DUK_PROPDESC_FLAG_WRITABLE) && (flags & DUK_PROPDESC_FLAG_ENUMERABLE))) { DUK_DDD(DUK_DDDPRINT("existing property is a non-configurable " "plain property which is not writable and " "enumerable -> reject")); @@ -84388,13 +85693,13 @@ duk_bool_t duk__declvar_helper(duk_hthread *thr, duk_push_hobject(thr, holder); duk_push_hstring(thr, name); duk_push_tval(thr, val); - duk_xdef_prop(thr, -3, prop_flags); /* [holder name val] -> [holder] */ + duk_xdef_prop(thr, -3, prop_flags); /* [holder name val] -> [holder] */ duk_pop_unsafe(thr); return 0; - fail_existing_attributes: - fail_not_extensible: +fail_existing_attributes: +fail_not_extensible: DUK_ERROR_TYPE(thr, "declaration failed"); DUK_WO_NORETURN(return 0;); } @@ -84515,34 +85820,34 @@ duk_bool_t duk_js_declvar_activation(duk_hthread *thr, * Various defines and file specific helper macros */ -#define DUK__MAX_RE_DECESC_DIGITS 9 -#define DUK__MAX_RE_QUANT_DIGITS 9 /* Does not allow e.g. 2**31-1, but one more would allow overflows of u32. */ +#define DUK__MAX_RE_DECESC_DIGITS 9 +#define DUK__MAX_RE_QUANT_DIGITS 9 /* Does not allow e.g. 2**31-1, but one more would allow overflows of u32. */ /* whether to use macros or helper function depends on call count */ -#define DUK__ISDIGIT(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_9) -#define DUK__ISHEXDIGIT(x) duk__is_hex_digit((x)) -#define DUK__ISOCTDIGIT(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_7) -#define DUK__ISDIGIT03(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_3) -#define DUK__ISDIGIT47(x) ((x) >= DUK_ASC_4 && (x) <= DUK_ASC_7) +#define DUK__ISDIGIT(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_9) +#define DUK__ISHEXDIGIT(x) duk__is_hex_digit((x)) +#define DUK__ISOCTDIGIT(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_7) +#define DUK__ISDIGIT03(x) ((x) >= DUK_ASC_0 && (x) <= DUK_ASC_3) +#define DUK__ISDIGIT47(x) ((x) >= DUK_ASC_4 && (x) <= DUK_ASC_7) /* lexer character window helpers */ -#define DUK__LOOKUP(lex_ctx,idx) ((lex_ctx)->window[(idx)].codepoint) -#define DUK__ADVANCECHARS(lex_ctx,count) duk__advance_chars((lex_ctx), (count)) -#define DUK__ADVANCEBYTES(lex_ctx,count) duk__advance_bytes((lex_ctx), (count)) +#define DUK__LOOKUP(lex_ctx, idx) ((lex_ctx)->window[(idx)].codepoint) +#define DUK__ADVANCECHARS(lex_ctx, count) duk__advance_chars((lex_ctx), (count)) +#define DUK__ADVANCEBYTES(lex_ctx, count) duk__advance_bytes((lex_ctx), (count)) #define DUK__INITBUFFER(lex_ctx) duk__initbuffer((lex_ctx)) -#define DUK__APPENDBUFFER(lex_ctx,x) duk__appendbuffer((lex_ctx), (duk_codepoint_t) (x)) -#define DUK__APPENDBUFFER_ASCII(lex_ctx,x) duk__appendbuffer_ascii((lex_ctx), (duk_codepoint_t) (x)) +#define DUK__APPENDBUFFER(lex_ctx, x) duk__appendbuffer((lex_ctx), (duk_codepoint_t) (x)) +#define DUK__APPENDBUFFER_ASCII(lex_ctx, x) duk__appendbuffer_ascii((lex_ctx), (duk_codepoint_t) (x)) /* lookup shorthands (note: assume context variable is named 'lex_ctx') */ -#define DUK__L0() DUK__LOOKUP(lex_ctx, 0) -#define DUK__L1() DUK__LOOKUP(lex_ctx, 1) -#define DUK__L2() DUK__LOOKUP(lex_ctx, 2) -#define DUK__L3() DUK__LOOKUP(lex_ctx, 3) -#define DUK__L4() DUK__LOOKUP(lex_ctx, 4) -#define DUK__L5() DUK__LOOKUP(lex_ctx, 5) +#define DUK__L0() DUK__LOOKUP(lex_ctx, 0) +#define DUK__L1() DUK__LOOKUP(lex_ctx, 1) +#define DUK__L2() DUK__LOOKUP(lex_ctx, 2) +#define DUK__L3() DUK__LOOKUP(lex_ctx, 3) +#define DUK__L4() DUK__LOOKUP(lex_ctx, 4) +#define DUK__L5() DUK__LOOKUP(lex_ctx, 5) /* packed advance/token number macro used by multiple functions */ -#define DUK__ADVTOK(advbytes,tok) ((((advbytes) * sizeof(duk_lexer_codepoint)) << 8) + (tok)) +#define DUK__ADVTOK(advbytes, tok) ((((advbytes) * sizeof(duk_lexer_codepoint)) << 8) + (tok)) /* * Advance lookup window by N characters, filling in new characters as @@ -84652,10 +85957,9 @@ DUK_LOCAL void duk__fill_lexer_buffer(duk_lexer_ctx *lex_ctx, duk_small_uint_t s /* Fast path. */ if (DUK_LIKELY(x < 0x80UL)) { - DUK_ASSERT(x != 0x2028UL && x != 0x2029UL); /* not LS/PS */ + DUK_ASSERT(x != 0x2028UL && x != 0x2029UL); /* not LS/PS */ if (DUK_UNLIKELY(x <= 0x000dUL)) { - if ((x == 0x000aUL) || - ((x == 0x000dUL) && (p >= p_end || *p != 0x000aUL))) { + if ((x == 0x000aUL) || ((x == 0x000dUL) && (p >= p_end || *p != 0x000aUL))) { /* lookup for 0x000a above assumes shortest encoding now */ /* E5 Section 7.3, treat the following as newlines: @@ -84746,8 +86050,8 @@ DUK_LOCAL void duk__fill_lexer_buffer(duk_lexer_ctx *lex_ctx, duk_small_uint_t s lex_ctx->input_line = input_line; return; - error_clipped: /* clipped codepoint */ - error_encoding: /* invalid codepoint encoding or codepoint */ +error_clipped: /* clipped codepoint */ +error_encoding: /* invalid codepoint encoding or codepoint */ lex_ctx->input_offset = (duk_size_t) (p - lex_ctx->input); lex_ctx->input_line = input_line; @@ -84758,26 +86062,25 @@ DUK_LOCAL void duk__fill_lexer_buffer(duk_lexer_ctx *lex_ctx, duk_small_uint_t s DUK_LOCAL void duk__advance_bytes(duk_lexer_ctx *lex_ctx, duk_small_uint_t count_bytes) { duk_small_uint_t used_bytes, avail_bytes; - DUK_ASSERT_DISABLE(count_bytes >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(count_bytes >= 0); /* unsigned */ DUK_ASSERT(count_bytes <= (duk_small_uint_t) (DUK_LEXER_WINDOW_SIZE * sizeof(duk_lexer_codepoint))); DUK_ASSERT(lex_ctx->window >= lex_ctx->buffer); DUK_ASSERT(lex_ctx->window < lex_ctx->buffer + DUK_LEXER_BUFFER_SIZE); - DUK_ASSERT((duk_uint8_t *) lex_ctx->window + count_bytes <= (duk_uint8_t *) lex_ctx->buffer + DUK_LEXER_BUFFER_SIZE * sizeof(duk_lexer_codepoint)); + DUK_ASSERT((duk_uint8_t *) lex_ctx->window + count_bytes <= + (duk_uint8_t *) lex_ctx->buffer + DUK_LEXER_BUFFER_SIZE * sizeof(duk_lexer_codepoint)); /* Zero 'count' is also allowed to make call sites easier. * Arithmetic in bytes generates better code in GCC. */ - lex_ctx->window = (duk_lexer_codepoint *) (void *) ((duk_uint8_t *) lex_ctx->window + count_bytes); /* avoid multiply */ + lex_ctx->window = (duk_lexer_codepoint *) (void *) ((duk_uint8_t *) lex_ctx->window + count_bytes); /* avoid multiply */ used_bytes = (duk_small_uint_t) ((duk_uint8_t *) lex_ctx->window - (duk_uint8_t *) lex_ctx->buffer); avail_bytes = DUK_LEXER_BUFFER_SIZE * sizeof(duk_lexer_codepoint) - used_bytes; if (avail_bytes < (duk_small_uint_t) (DUK_LEXER_WINDOW_SIZE * sizeof(duk_lexer_codepoint))) { /* Not enough data to provide a full window, so "scroll" window to * start of buffer and fill up the rest. */ - duk_memmove((void *) lex_ctx->buffer, - (const void *) lex_ctx->window, - (size_t) avail_bytes); + duk_memmove((void *) lex_ctx->buffer, (const void *) lex_ctx->window, (size_t) avail_bytes); lex_ctx->window = lex_ctx->buffer; duk__fill_lexer_buffer(lex_ctx, avail_bytes); } @@ -84787,7 +86090,7 @@ DUK_LOCAL void duk__init_lexer_window(duk_lexer_ctx *lex_ctx) { lex_ctx->window = lex_ctx->buffer; duk__fill_lexer_buffer(lex_ctx, 0); } -#else /* DUK_USE_LEXER_SLIDING_WINDOW */ +#else /* DUK_USE_LEXER_SLIDING_WINDOW */ DUK_LOCAL duk_codepoint_t duk__read_char(duk_lexer_ctx *lex_ctx) { duk_ucodepoint_t x; duk_small_uint_t len; @@ -84817,11 +86120,10 @@ DUK_LOCAL duk_codepoint_t duk__read_char(duk_lexer_ctx *lex_ctx) { /* input offset tracking */ lex_ctx->input_offset++; - DUK_ASSERT(x != 0x2028UL && x != 0x2029UL); /* not LS/PS */ + DUK_ASSERT(x != 0x2028UL && x != 0x2029UL); /* not LS/PS */ if (DUK_UNLIKELY(x <= 0x000dUL)) { - if ((x == 0x000aUL) || - ((x == 0x000dUL) && (lex_ctx->input_offset >= lex_ctx->input_length || - lex_ctx->input[lex_ctx->input_offset] != 0x000aUL))) { + if ((x == 0x000aUL) || ((x == 0x000dUL) && (lex_ctx->input_offset >= lex_ctx->input_length || + lex_ctx->input[lex_ctx->input_offset] != 0x000aUL))) { /* lookup for 0x000a above assumes shortest encoding now */ /* E5 Section 7.3, treat the following as newlines: @@ -84910,8 +86212,8 @@ DUK_LOCAL duk_codepoint_t duk__read_char(duk_lexer_ctx *lex_ctx) { return (duk_codepoint_t) x; - error_clipped: /* clipped codepoint */ - error_encoding: /* invalid codepoint encoding or codepoint */ +error_clipped: /* clipped codepoint */ +error_encoding: /* invalid codepoint encoding or codepoint */ DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_SOURCE_DECODE_FAILED); DUK_WO_NORETURN(return 0;); } @@ -84920,15 +86222,13 @@ DUK_LOCAL void duk__advance_bytes(duk_lexer_ctx *lex_ctx, duk_small_uint_t count duk_small_uint_t keep_bytes; duk_lexer_codepoint *cp, *cp_end; - DUK_ASSERT_DISABLE(count_bytes >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(count_bytes >= 0); /* unsigned */ DUK_ASSERT(count_bytes <= (duk_small_uint_t) (DUK_LEXER_WINDOW_SIZE * sizeof(duk_lexer_codepoint))); /* Zero 'count' is also allowed to make call sites easier. */ keep_bytes = DUK_LEXER_WINDOW_SIZE * sizeof(duk_lexer_codepoint) - count_bytes; - duk_memmove((void *) lex_ctx->window, - (const void *) ((duk_uint8_t *) lex_ctx->window + count_bytes), - (size_t) keep_bytes); + duk_memmove((void *) lex_ctx->window, (const void *) ((duk_uint8_t *) lex_ctx->window + count_bytes), (size_t) keep_bytes); cp = (duk_lexer_codepoint *) ((duk_uint8_t *) lex_ctx->window + keep_bytes); cp_end = lex_ctx->window + DUK_LEXER_WINDOW_SIZE; @@ -84941,9 +86241,9 @@ DUK_LOCAL void duk__advance_bytes(duk_lexer_ctx *lex_ctx, duk_small_uint_t count DUK_LOCAL void duk__init_lexer_window(duk_lexer_ctx *lex_ctx) { /* Call with count == DUK_LEXER_WINDOW_SIZE to fill buffer initially. */ - duk__advance_bytes(lex_ctx, DUK_LEXER_WINDOW_SIZE * sizeof(duk_lexer_codepoint)); /* fill window */ + duk__advance_bytes(lex_ctx, DUK_LEXER_WINDOW_SIZE * sizeof(duk_lexer_codepoint)); /* fill window */ } -#endif /* DUK_USE_LEXER_SLIDING_WINDOW */ +#endif /* DUK_USE_LEXER_SLIDING_WINDOW */ DUK_LOCAL void duk__advance_chars(duk_lexer_ctx *lex_ctx, duk_small_uint_t count_chars) { duk__advance_bytes(lex_ctx, count_chars * sizeof(duk_lexer_codepoint)); @@ -85036,7 +86336,7 @@ DUK_INTERNAL void duk_lexer_getpoint(duk_lexer_ctx *lex_ctx, duk_lexer_point *pt } DUK_INTERNAL void duk_lexer_setpoint(duk_lexer_ctx *lex_ctx, duk_lexer_point *pt) { - DUK_ASSERT_DISABLE(pt->offset >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(pt->offset >= 0); /* unsigned */ DUK_ASSERT(pt->line >= 1); lex_ctx->input_offset = pt->offset; lex_ctx->input_line = pt->line; @@ -85070,8 +86370,7 @@ DUK_LOCAL duk_codepoint_t duk__hexval_validate(duk_codepoint_t x) { DUK_LOCAL duk_codepoint_t duk__hexval(duk_codepoint_t x) { duk_codepoint_t ret; - DUK_ASSERT((x >= DUK_ASC_0 && x <= DUK_ASC_9) || - (x >= DUK_ASC_LC_A && x <= DUK_ASC_LC_F) || + DUK_ASSERT((x >= DUK_ASC_0 && x <= DUK_ASC_9) || (x >= DUK_ASC_LC_A && x <= DUK_ASC_LC_F) || (x >= DUK_ASC_UC_A && x <= DUK_ASC_UC_F)); ret = duk__hexval_validate(x); DUK_ASSERT(ret >= 0 && ret <= 15); @@ -85090,12 +86389,12 @@ DUK_LOCAL duk_bool_t duk__is_hex_digit(duk_codepoint_t x) { * source and RegExp parsing. */ DUK_LOCAL duk_codepoint_t duk__lexer_parse_escape(duk_lexer_ctx *lex_ctx, duk_bool_t allow_es6) { - duk_small_int_t digits; /* Initial value 2 or 4 for fixed length escapes, 0 for ES2015 \u{H+}. */ + duk_small_int_t digits; /* Initial value 2 or 4 for fixed length escapes, 0 for ES2015 \u{H+}. */ duk_codepoint_t escval; duk_codepoint_t x; duk_small_uint_t adv; - DUK_ASSERT(DUK__L0() == DUK_ASC_BACKSLASH); /* caller responsibilities */ + DUK_ASSERT(DUK__L0() == DUK_ASC_BACKSLASH); /* caller responsibilities */ DUK_ASSERT(DUK__L1() == DUK_ASC_LC_X || DUK__L1() == DUK_ASC_LC_U); DUK_UNREF(allow_es6); @@ -85169,16 +86468,16 @@ DUK_LOCAL duk_codepoint_t duk__lexer_parse_escape(duk_lexer_ctx *lex_ctx, duk_bo } else { goto fail_escape; } - digits = -1; /* Indicate we have at least one digit. */ -#else /* DUK_USE_ES6_UNICODE_ESCAPE */ - DUK_ASSERT(0); /* Never happens if \u{H+} support disabled. */ -#endif /* DUK_USE_ES6_UNICODE_ESCAPE */ + digits = -1; /* Indicate we have at least one digit. */ +#else /* DUK_USE_ES6_UNICODE_ESCAPE */ + DUK_ASSERT(0); /* Never happens if \u{H+} support disabled. */ +#endif /* DUK_USE_ES6_UNICODE_ESCAPE */ } } return escval; - fail_escape: +fail_escape: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_ESCAPE); DUK_WO_NORETURN(return 0;); } @@ -85188,7 +86487,9 @@ DUK_LOCAL duk_codepoint_t duk__lexer_parse_escape(duk_lexer_ctx *lex_ctx, duk_bo * RegExp octal escape parsing. Window[0] must be the slash '\' and the first * digit must already be validated to be in [0-9] by the caller. */ -DUK_LOCAL duk_codepoint_t duk__lexer_parse_legacy_octal(duk_lexer_ctx *lex_ctx, duk_small_uint_t *out_adv, duk_bool_t reject_annex_b) { +DUK_LOCAL duk_codepoint_t duk__lexer_parse_legacy_octal(duk_lexer_ctx *lex_ctx, + duk_small_uint_t *out_adv, + duk_bool_t reject_annex_b) { duk_codepoint_t cp; duk_small_uint_t lookup_idx; duk_small_uint_t adv; @@ -85223,7 +86524,7 @@ DUK_LOCAL duk_codepoint_t duk__lexer_parse_legacy_octal(duk_lexer_ctx *lex_ctx, DUK_DDD(DUK_DDDPRINT("\\8 or \\9 -> treat as literal, accept in strict mode too")); DUK_ASSERT(tmp == DUK_ASC_8 || tmp == DUK_ASC_9); cp = tmp; - adv++; /* correction to above, eat offending character */ + adv++; /* correction to above, eat offending character */ } else if (lookup_idx == 2 && cp == 0) { /* Note: 'foo\0bar' is OK in strict mode, but 'foo\00bar' is not. * It won't be interpreted as 'foo\u{0}0bar' but as a SyntaxError. @@ -85247,18 +86548,21 @@ DUK_LOCAL duk_codepoint_t duk__lexer_parse_legacy_octal(duk_lexer_ctx *lex_ctx, } /* XXX: move strict mode to lex_ctx? */ -DUK_LOCAL void duk__lexer_parse_string_literal(duk_lexer_ctx *lex_ctx, duk_token *out_token, duk_small_int_t quote, duk_bool_t strict_mode) { +DUK_LOCAL void duk__lexer_parse_string_literal(duk_lexer_ctx *lex_ctx, + duk_token *out_token, + duk_small_int_t quote, + duk_bool_t strict_mode) { duk_small_uint_t adv; - for (adv = 1 /* initial quote */ ;;) { + for (adv = 1 /* initial quote */;;) { duk_codepoint_t x; - DUK__ADVANCECHARS(lex_ctx, adv); /* eat opening quote on first loop */ + DUK__ADVANCECHARS(lex_ctx, adv); /* eat opening quote on first loop */ x = DUK__L0(); adv = 1; if (x == quote) { - DUK__ADVANCECHARS(lex_ctx, 1); /* eat closing quote */ + DUK__ADVANCECHARS(lex_ctx, 1); /* eat closing quote */ break; } else if (x == '\\') { /* DUK__L0 -> '\' char @@ -85269,7 +86573,7 @@ DUK_LOCAL void duk__lexer_parse_string_literal(duk_lexer_ctx *lex_ctx, duk_token x = DUK__L1(); /* How much to advance before next loop. */ - adv = 2; /* note: long live range */ + adv = 2; /* note: long live range */ switch (x) { case '\'': @@ -85312,7 +86616,7 @@ DUK_LOCAL void duk__lexer_parse_string_literal(duk_lexer_ctx *lex_ctx, duk_token /* line continuation */ if (x == 0x000d && DUK__L2() == 0x000a) { /* CR LF again a special case */ - adv = 3; /* line terminator, CR, LF */ + adv = 3; /* line terminator, CR, LF */ } } else if (DUK__ISDIGIT(x)) { /* @@ -85341,8 +86645,8 @@ DUK_LOCAL void duk__lexer_parse_string_literal(duk_lexer_ctx *lex_ctx, duk_token /* escaped NonEscapeCharacter */ DUK__APPENDBUFFER(lex_ctx, x); } - } /* end default clause */ - } /* end switch */ + } /* end default clause */ + } /* end switch */ /* Shared handling for single codepoint escapes. */ if (emitcp >= 0) { @@ -85375,11 +86679,11 @@ DUK_LOCAL void duk__lexer_parse_string_literal(duk_lexer_ctx *lex_ctx, duk_token return; - fail_escape: +fail_escape: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_ESCAPE); DUK_WO_NORETURN(return;); - fail_unterminated: +fail_unterminated: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_UNTERMINATED_STRING); DUK_WO_NORETURN(return;); } @@ -85466,19 +86770,19 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, duk_token *out_token, duk_bool_t strict_mode, duk_bool_t regexp_mode) { - duk_codepoint_t x; /* temporary, must be signed and 32-bit to hold Unicode code points */ + duk_codepoint_t x; /* temporary, must be signed and 32-bit to hold Unicode code points */ duk_small_uint_t advtok = 0; /* (advance << 8) + token_type, updated at function end, * init is unnecessary but suppresses "may be used uninitialized" warnings. */ - duk_bool_t got_lineterm = 0; /* got lineterm preceding non-whitespace, non-lineterm token */ + duk_bool_t got_lineterm = 0; /* got lineterm preceding non-whitespace, non-lineterm token */ if (++lex_ctx->token_count >= lex_ctx->token_limit) { goto fail_token_limit; } out_token->t = DUK_TOK_EOF; - out_token->t_nores = DUK_TOK_INVALID; /* marker: copy t if not changed */ -#if 0 /* not necessary to init, disabled for faster parsing */ + out_token->t_nores = DUK_TOK_INVALID; /* marker: copy t if not changed */ +#if 0 /* not necessary to init, disabled for faster parsing */ out_token->num = DUK_DOUBLE_NAN; out_token->str1 = NULL; out_token->str2 = NULL; @@ -85518,35 +86822,34 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, * in the clauses, so it's not trivial to convert to a switch. */ - restart_lineupdate: +restart_lineupdate: out_token->start_line = lex_ctx->window[0].line; - restart: +restart: out_token->start_offset = lex_ctx->window[0].offset; x = DUK__L0(); switch (x) { case DUK_ASC_SPACE: - case DUK_ASC_HT: /* fast paths for space and tab */ + case DUK_ASC_HT: /* fast paths for space and tab */ DUK__ADVANCECHARS(lex_ctx, 1); goto restart; - case DUK_ASC_LF: /* LF line terminator; CR LF and Unicode lineterms are handled in slow path */ + case DUK_ASC_LF: /* LF line terminator; CR LF and Unicode lineterms are handled in slow path */ DUK__ADVANCECHARS(lex_ctx, 1); got_lineterm = 1; goto restart_lineupdate; #if defined(DUK_USE_SHEBANG_COMMENTS) - case DUK_ASC_HASH: /* '#' */ - if (DUK__L1() == DUK_ASC_EXCLAMATION && lex_ctx->window[0].offset == 0 && - (lex_ctx->flags & DUK_COMPILE_SHEBANG)) { + case DUK_ASC_HASH: /* '#' */ + if (DUK__L1() == DUK_ASC_EXCLAMATION && lex_ctx->window[0].offset == 0 && (lex_ctx->flags & DUK_COMPILE_SHEBANG)) { /* "Shebang" comment ('#! ...') on first line. */ /* DUK__ADVANCECHARS(lex_ctx, 2) would be correct here, but not necessary */ duk__lexer_skip_to_endofline(lex_ctx); - goto restart; /* line terminator will be handled on next round */ + goto restart; /* line terminator will be handled on next round */ } goto fail_token; -#endif /* DUK_USE_SHEBANG_COMMENTS */ - case DUK_ASC_SLASH: /* '/' */ +#endif /* DUK_USE_SHEBANG_COMMENTS */ + case DUK_ASC_SLASH: /* '/' */ if (DUK__L1() == DUK_ASC_SLASH) { /* * E5 Section 7.4, allow SourceCharacter (which is any 16-bit @@ -85555,7 +86858,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, /* DUK__ADVANCECHARS(lex_ctx, 2) would be correct here, but not necessary */ duk__lexer_skip_to_endofline(lex_ctx); - goto restart; /* line terminator will be handled on next round */ + goto restart; /* line terminator will be handled on next round */ } else if (DUK__L1() == DUK_ASC_STAR) { /* * E5 Section 7.4. If the multi-line comment contains a newline, @@ -85639,19 +86942,19 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, /* first, parse regexp body roughly */ - duk_small_int_t state = 0; /* 0=base, 1=esc, 2=class, 3=class+esc */ + duk_small_int_t state = 0; /* 0=base, 1=esc, 2=class, 3=class+esc */ DUK__INITBUFFER(lex_ctx); for (;;) { - DUK__ADVANCECHARS(lex_ctx, 1); /* skip opening slash on first loop */ + DUK__ADVANCECHARS(lex_ctx, 1); /* skip opening slash on first loop */ x = DUK__L0(); if (x < 0 || duk_unicode_is_line_terminator(x)) { goto fail_unterm_regexp; } - x = DUK__L0(); /* re-read to avoid spill / fetch */ + x = DUK__L0(); /* re-read to avoid spill / fetch */ if (state == 0) { if (x == DUK_ASC_SLASH) { - DUK__ADVANCECHARS(lex_ctx, 1); /* eat closing slash */ + DUK__ADVANCECHARS(lex_ctx, 1); /* eat closing slash */ break; } else if (x == DUK_ASC_BACKSLASH) { state = 1; @@ -85681,20 +86984,20 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, if (!duk_unicode_is_identifier_part(x)) { break; } - x = DUK__L0(); /* re-read to avoid spill / fetch */ + x = DUK__L0(); /* re-read to avoid spill / fetch */ DUK__APPENDBUFFER(lex_ctx, x); DUK__ADVANCECHARS(lex_ctx, 1); } out_token->str2 = duk__internbuffer(lex_ctx, lex_ctx->slot2_idx); - DUK__INITBUFFER(lex_ctx); /* free some memory */ + DUK__INITBUFFER(lex_ctx); /* free some memory */ /* validation of the regexp is caller's responsibility */ advtok = DUK__ADVTOK(0, DUK_TOK_REGEXP); -#else /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ goto fail_regexp_support; -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ } else if (DUK__L1() == DUK_ASC_EQUALS) { /* "/=" and not in regexp mode */ advtok = DUK__ADVTOK(2, DUK_TOK_DIV_EQ); @@ -85703,25 +87006,25 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_DIV); } break; - case DUK_ASC_LCURLY: /* '{' */ + case DUK_ASC_LCURLY: /* '{' */ advtok = DUK__ADVTOK(1, DUK_TOK_LCURLY); break; - case DUK_ASC_RCURLY: /* '}' */ + case DUK_ASC_RCURLY: /* '}' */ advtok = DUK__ADVTOK(1, DUK_TOK_RCURLY); break; - case DUK_ASC_LPAREN: /* '(' */ + case DUK_ASC_LPAREN: /* '(' */ advtok = DUK__ADVTOK(1, DUK_TOK_LPAREN); break; - case DUK_ASC_RPAREN: /* ')' */ + case DUK_ASC_RPAREN: /* ')' */ advtok = DUK__ADVTOK(1, DUK_TOK_RPAREN); break; - case DUK_ASC_LBRACKET: /* '[' */ + case DUK_ASC_LBRACKET: /* '[' */ advtok = DUK__ADVTOK(1, DUK_TOK_LBRACKET); break; - case DUK_ASC_RBRACKET: /* ']' */ + case DUK_ASC_RBRACKET: /* ']' */ advtok = DUK__ADVTOK(1, DUK_TOK_RBRACKET); break; - case DUK_ASC_PERIOD: /* '.' */ + case DUK_ASC_PERIOD: /* '.' */ if (DUK__ISDIGIT(DUK__L1())) { /* Period followed by a digit can only start DecimalLiteral * (handled in slow path). We could jump straight into the @@ -85732,13 +87035,13 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, } advtok = DUK__ADVTOK(1, DUK_TOK_PERIOD); break; - case DUK_ASC_SEMICOLON: /* ';' */ + case DUK_ASC_SEMICOLON: /* ';' */ advtok = DUK__ADVTOK(1, DUK_TOK_SEMICOLON); break; - case DUK_ASC_COMMA: /* ',' */ + case DUK_ASC_COMMA: /* ',' */ advtok = DUK__ADVTOK(1, DUK_TOK_COMMA); break; - case DUK_ASC_LANGLE: /* '<' */ + case DUK_ASC_LANGLE: /* '<' */ #if defined(DUK_USE_HTML_COMMENTS) if (DUK__L1() == DUK_ASC_EXCLAMATION && DUK__L2() == DUK_ASC_MINUS && DUK__L3() == DUK_ASC_MINUS) { /* @@ -85747,11 +87050,10 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, /* DUK__ADVANCECHARS(lex_ctx, 4) would be correct here, but not necessary */ duk__lexer_skip_to_endofline(lex_ctx); - goto restart; /* line terminator will be handled on next round */ - } - else -#endif /* DUK_USE_HTML_COMMENTS */ - if (DUK__L1() == DUK_ASC_LANGLE && DUK__L2() == DUK_ASC_EQUALS) { + goto restart; /* line terminator will be handled on next round */ + } else +#endif /* DUK_USE_HTML_COMMENTS */ + if (DUK__L1() == DUK_ASC_LANGLE && DUK__L2() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(3, DUK_TOK_ALSHIFT_EQ); } else if (DUK__L1() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(2, DUK_TOK_LE); @@ -85761,7 +87063,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_LT); } break; - case DUK_ASC_RANGLE: /* '>' */ + case DUK_ASC_RANGLE: /* '>' */ if (DUK__L1() == DUK_ASC_RANGLE && DUK__L2() == DUK_ASC_RANGLE && DUK__L3() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(4, DUK_TOK_RSHIFT_EQ); } else if (DUK__L1() == DUK_ASC_RANGLE && DUK__L2() == DUK_ASC_RANGLE) { @@ -85776,7 +87078,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_GT); } break; - case DUK_ASC_EQUALS: /* '=' */ + case DUK_ASC_EQUALS: /* '=' */ if (DUK__L1() == DUK_ASC_EQUALS && DUK__L2() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(3, DUK_TOK_SEQ); } else if (DUK__L1() == DUK_ASC_EQUALS) { @@ -85785,7 +87087,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_EQUALSIGN); } break; - case DUK_ASC_EXCLAMATION: /* '!' */ + case DUK_ASC_EXCLAMATION: /* '!' */ if (DUK__L1() == DUK_ASC_EQUALS && DUK__L2() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(3, DUK_TOK_SNEQ); } else if (DUK__L1() == DUK_ASC_EQUALS) { @@ -85794,7 +87096,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_LNOT); } break; - case DUK_ASC_PLUS: /* '+' */ + case DUK_ASC_PLUS: /* '+' */ if (DUK__L1() == DUK_ASC_PLUS) { advtok = DUK__ADVTOK(2, DUK_TOK_INCREMENT); } else if (DUK__L1() == DUK_ASC_EQUALS) { @@ -85803,7 +87105,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_ADD); } break; - case DUK_ASC_MINUS: /* '-' */ + case DUK_ASC_MINUS: /* '-' */ #if defined(DUK_USE_HTML_COMMENTS) if (got_lineterm && DUK__L1() == DUK_ASC_MINUS && DUK__L2() == DUK_ASC_RANGLE) { /* @@ -85820,10 +87122,10 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, /* DUK__ADVANCECHARS(lex_ctx, 3) would be correct here, but not necessary */ duk__lexer_skip_to_endofline(lex_ctx); - goto restart; /* line terminator will be handled on next round */ + goto restart; /* line terminator will be handled on next round */ } else -#endif /* DUK_USE_HTML_COMMENTS */ - if (DUK__L1() == DUK_ASC_MINUS) { +#endif /* DUK_USE_HTML_COMMENTS */ + if (DUK__L1() == DUK_ASC_MINUS) { advtok = DUK__ADVTOK(2, DUK_TOK_DECREMENT); } else if (DUK__L1() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(2, DUK_TOK_SUB_EQ); @@ -85831,7 +87133,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_SUB); } break; - case DUK_ASC_STAR: /* '*' */ + case DUK_ASC_STAR: /* '*' */ #if defined(DUK_USE_ES7_EXP_OPERATOR) if (DUK__L1() == DUK_ASC_STAR && DUK__L2() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(3, DUK_TOK_EXP_EQ); @@ -85839,20 +87141,20 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(2, DUK_TOK_EXP); } else #endif - if (DUK__L1() == DUK_ASC_EQUALS) { + if (DUK__L1() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(2, DUK_TOK_MUL_EQ); } else { advtok = DUK__ADVTOK(1, DUK_TOK_MUL); } break; - case DUK_ASC_PERCENT: /* '%' */ + case DUK_ASC_PERCENT: /* '%' */ if (DUK__L1() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(2, DUK_TOK_MOD_EQ); } else { advtok = DUK__ADVTOK(1, DUK_TOK_MOD); } break; - case DUK_ASC_AMP: /* '&' */ + case DUK_ASC_AMP: /* '&' */ if (DUK__L1() == DUK_ASC_AMP) { advtok = DUK__ADVTOK(2, DUK_TOK_LAND); } else if (DUK__L1() == DUK_ASC_EQUALS) { @@ -85861,7 +87163,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_BAND); } break; - case DUK_ASC_PIPE: /* '|' */ + case DUK_ASC_PIPE: /* '|' */ if (DUK__L1() == DUK_ASC_PIPE) { advtok = DUK__ADVTOK(2, DUK_TOK_LOR); } else if (DUK__L1() == DUK_ASC_EQUALS) { @@ -85870,41 +87172,41 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(1, DUK_TOK_BOR); } break; - case DUK_ASC_CARET: /* '^' */ + case DUK_ASC_CARET: /* '^' */ if (DUK__L1() == DUK_ASC_EQUALS) { advtok = DUK__ADVTOK(2, DUK_TOK_BXOR_EQ); } else { advtok = DUK__ADVTOK(1, DUK_TOK_BXOR); } break; - case DUK_ASC_TILDE: /* '~' */ + case DUK_ASC_TILDE: /* '~' */ advtok = DUK__ADVTOK(1, DUK_TOK_BNOT); break; - case DUK_ASC_QUESTION: /* '?' */ + case DUK_ASC_QUESTION: /* '?' */ advtok = DUK__ADVTOK(1, DUK_TOK_QUESTION); break; - case DUK_ASC_COLON: /* ':' */ + case DUK_ASC_COLON: /* ':' */ advtok = DUK__ADVTOK(1, DUK_TOK_COLON); break; - case DUK_ASC_DOUBLEQUOTE: /* '"' */ - case DUK_ASC_SINGLEQUOTE: { /* '\'' */ + case DUK_ASC_DOUBLEQUOTE: /* '"' */ + case DUK_ASC_SINGLEQUOTE: { /* '\'' */ DUK__INITBUFFER(lex_ctx); duk__lexer_parse_string_literal(lex_ctx, out_token, x /*quote*/, strict_mode); duk__internbuffer(lex_ctx, lex_ctx->slot1_idx); out_token->str1 = duk_known_hstring(lex_ctx->thr, lex_ctx->slot1_idx); - DUK__INITBUFFER(lex_ctx); /* free some memory */ + DUK__INITBUFFER(lex_ctx); /* free some memory */ advtok = DUK__ADVTOK(0, DUK_TOK_STRING); break; } default: goto slow_path; - } /* switch */ + } /* switch */ goto skip_slow_path; - slow_path: +slow_path: if (duk_unicode_is_line_terminator(x)) { if (x == 0x000d && DUK__L1() == 0x000a) { /* @@ -85995,7 +87297,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, str = out_token->str1; out_token->t_nores = DUK_TOK_IDENTIFIER; - DUK__INITBUFFER(lex_ctx); /* free some memory */ + DUK__INITBUFFER(lex_ctx); /* free some memory */ /* * Interned identifier is compared against reserved words, which are @@ -86022,7 +87324,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, advtok = DUK__ADVTOK(0, DUK_TOK_IDENTIFIER); if (out_token->num_escapes == 0) { for (i = DUK_STRIDX_START_RESERVED; i < i_end; i++) { - DUK_ASSERT_DISABLE(i >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(i >= 0); /* unsigned */ DUK_ASSERT(i < DUK_HEAP_NUM_STRINGS); if (DUK_HTHREAD_GET_STRING(lex_ctx->thr, i) == str) { advtok = DUK__ADVTOK(0, DUK_STRIDX_TO_TOK(i)); @@ -86057,11 +87359,11 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, duk_double_t val; duk_bool_t legacy_oct = 0; - duk_small_int_t state; /* 0=before period/exp, - * 1=after period, before exp - * 2=after exp, allow '+' or '-' - * 3=after exp and exp sign - */ + duk_small_int_t state; /* 0=before period/exp, + * 1=after period, before exp + * 2=after exp, allow '+' or '-' + * 3=after exp and exp sign + */ duk_small_uint_t s2n_flags; duk_codepoint_t y, z; duk_small_int_t s2n_radix = 10; @@ -86073,7 +87375,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, if (x == DUK_ASC_0) { z = DUK_LOWERCASE_CHAR_ASCII(y); - pre_adv = 2; /* default for 0xNNN, 0oNNN, 0bNNN. */ + pre_adv = 2; /* default for 0xNNN, 0oNNN, 0bNNN. */ if (z == DUK_ASC_LC_X) { s2n_radix = 16; } else if (z == DUK_ASC_LC_O) { @@ -86096,7 +87398,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, DUK__APPENDBUFFER(lex_ctx, x); pre_adv = 1; legacy_oct = 1; - s2n_radix = 8; /* tentative unless conflicting digits found */ + s2n_radix = 8; /* tentative unless conflicting digits found */ } } } @@ -86110,7 +87412,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, */ state = 0; for (;;) { - x = DUK__L0(); /* re-lookup curr char on first round */ + x = DUK__L0(); /* re-lookup curr char on first round */ if (DUK__ISDIGIT(x)) { /* Note: intentionally allow leading zeroes here, as the * actual parser will check for them. @@ -86163,11 +87465,8 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, /* For bases other than 10, integer only. */ s2n_flags = DUK_S2N_FLAG_ALLOW_LEADING_ZERO; } else { - s2n_flags = DUK_S2N_FLAG_ALLOW_EXP | - DUK_S2N_FLAG_ALLOW_FRAC | - DUK_S2N_FLAG_ALLOW_NAKED_FRAC | - DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | - DUK_S2N_FLAG_ALLOW_LEADING_ZERO; + s2n_flags = DUK_S2N_FLAG_ALLOW_EXP | DUK_S2N_FLAG_ALLOW_FRAC | DUK_S2N_FLAG_ALLOW_NAKED_FRAC | + DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | DUK_S2N_FLAG_ALLOW_LEADING_ZERO; } duk_dup(lex_ctx->thr, lex_ctx->slot1_idx); @@ -86176,9 +87475,9 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, if (DUK_ISNAN(val)) { goto fail_number_literal; } - duk_replace(lex_ctx->thr, lex_ctx->slot1_idx); /* could also just pop? */ + duk_replace(lex_ctx->thr, lex_ctx->slot1_idx); /* could also just pop? */ - DUK__INITBUFFER(lex_ctx); /* free some memory */ + DUK__INITBUFFER(lex_ctx); /* free some memory */ /* Section 7.8.3 (note): NumericLiteral must be followed by something other than * IdentifierStart or DecimalDigit. @@ -86198,7 +87497,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, } else { goto fail_token; } - skip_slow_path: +skip_slow_path: /* * Shared exit path @@ -86223,32 +87522,32 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, return; - fail_token_limit: +fail_token_limit: DUK_ERROR_RANGE(lex_ctx->thr, DUK_STR_TOKEN_LIMIT); DUK_WO_NORETURN(return;); - fail_token: +fail_token: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_TOKEN); DUK_WO_NORETURN(return;); - fail_number_literal: +fail_number_literal: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_NUMBER_LITERAL); DUK_WO_NORETURN(return;); - fail_escape: +fail_escape: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_ESCAPE); DUK_WO_NORETURN(return;); - fail_unterm_regexp: +fail_unterm_regexp: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_UNTERMINATED_REGEXP); DUK_WO_NORETURN(return;); - fail_unterm_comment: +fail_unterm_comment: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_UNTERMINATED_COMMENT); DUK_WO_NORETURN(return;); #if !defined(DUK_USE_REGEXP_SUPPORT) - fail_regexp_support: +fail_regexp_support: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_REGEXP_SUPPORT_DISABLED); DUK_WO_NORETURN(return;); #endif @@ -86266,7 +87565,7 @@ void duk_lexer_parse_js_input_element(duk_lexer_ctx *lex_ctx, */ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token *out_token) { - duk_small_uint_t advtok = 0; /* init is unnecessary but suppresses "may be used uninitialized" warnings */ + duk_small_uint_t advtok = 0; /* init is unnecessary but suppresses "may be used uninitialized" warnings */ duk_codepoint_t x, y; if (++lex_ctx->token_count >= lex_ctx->token_limit) { @@ -86344,7 +87643,7 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token #endif for (;;) { - DUK__ADVANCECHARS(lex_ctx, 1); /* eat '{' on entry */ + DUK__ADVANCECHARS(lex_ctx, 1); /* eat '{' on entry */ x = DUK__L0(); if (DUK__ISDIGIT(x)) { digits++; @@ -86368,7 +87667,7 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token } val2 = val1; val1 = 0; - digits = 0; /* not strictly necessary because of lookahead '}' above */ + digits = 0; /* not strictly necessary because of lookahead '}' above */ } else if (x == DUK_ASC_RCURLY) { if (digits > DUK__MAX_RE_QUANT_DIGITS) { goto invalid_quantifier; @@ -86399,7 +87698,7 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token } advtok = DUK__ADVTOK(0, DUK_RETOK_QUANTIFIER); break; - invalid_quantifier: + invalid_quantifier: #if defined(DUK_USE_ES6_REGEXP_SYNTAX) /* Failed to match the quantifier, restore lexer and parse * opening brace as a literal. @@ -86425,7 +87724,7 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token * ES2015 Annex B relaxes the rules to allow these (and other) real world forms. */ - advtok = DUK__ADVTOK(2, DUK_RETOK_ATOM_CHAR); /* default: char escape (two chars) */ + advtok = DUK__ADVTOK(2, DUK_RETOK_ATOM_CHAR); /* default: char escape (two chars) */ if (y == DUK_ASC_LC_B) { advtok = DUK__ADVTOK(2, DUK_RETOK_ASSERT_WORD_BOUNDARY); } else if (y == DUK_ASC_UC_B) { @@ -86442,8 +87741,7 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token out_token->num = 0x000b; } else if (y == DUK_ASC_LC_C) { x = DUK__L2(); - if ((x >= DUK_ASC_LC_A && x <= DUK_ASC_LC_Z) || - (x >= DUK_ASC_UC_A && x <= DUK_ASC_UC_Z)) { + if ((x >= DUK_ASC_LC_A && x <= DUK_ASC_LC_Z) || (x >= DUK_ASC_UC_A && x <= DUK_ASC_UC_Z)) { out_token->num = (duk_uint32_t) (x % 32); advtok = DUK__ADVTOK(3, DUK_RETOK_ATOM_CHAR); } else { @@ -86481,11 +87779,11 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token /* XXX: shared parsing? */ duk_uint32_t val = 0; duk_small_int_t i; - for (i = 0; ; i++) { + for (i = 0;; i++) { if (i >= DUK__MAX_RE_DECESC_DIGITS) { goto fail_escape; } - DUK__ADVANCECHARS(lex_ctx, 1); /* eat backslash on entry */ + DUK__ADVANCECHARS(lex_ctx, 1); /* eat backslash on entry */ x = DUK__L0(); if (!DUK__ISDIGIT(x)) { break; @@ -86505,17 +87803,15 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token * This is not yet full ES2015 Annex B because cases above * (like hex escape) won't backtrack. */ - DUK_ASSERT(y != DUK_ASC_LC_C); /* covered above */ -#else /* DUK_USE_ES6_REGEXP_SYNTAX */ - } else if ((y >= 0 && !duk_unicode_is_identifier_part(y)) || - y == DUK_UNICODE_CP_ZWNJ || - y == DUK_UNICODE_CP_ZWJ) { + DUK_ASSERT(y != DUK_ASC_LC_C); /* covered above */ +#else /* DUK_USE_ES6_REGEXP_SYNTAX */ + } else if ((y >= 0 && !duk_unicode_is_identifier_part(y)) || y == DUK_UNICODE_CP_ZWNJ || y == DUK_UNICODE_CP_ZWJ) { /* For ES5.1 identity escapes are not allowed for identifier * parts. This conflicts with a lot of real world code as this * doesn't e.g. allow escaping a dollar sign as /\$/, see * test-regexp-identity-escape-dollar.js. */ -#endif /* DUK_USE_ES6_REGEXP_SYNTAX */ +#endif /* DUK_USE_ES6_REGEXP_SYNTAX */ out_token->num = (duk_uint32_t) y; } else { goto fail_escape; @@ -86596,24 +87892,24 @@ DUK_INTERNAL void duk_lexer_parse_re_token(duk_lexer_ctx *lex_ctx, duk_re_token out_token->t = advtok & 0xff; return; - fail_token_limit: +fail_token_limit: DUK_ERROR_RANGE(lex_ctx->thr, DUK_STR_TOKEN_LIMIT); DUK_WO_NORETURN(return;); - fail_escape: +fail_escape: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_REGEXP_ESCAPE); DUK_WO_NORETURN(return;); - fail_group: +fail_group: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_REGEXP_GROUP); DUK_WO_NORETURN(return;); #if !defined(DUK_USE_ES6_REGEXP_SYNTAX) - fail_invalid_char: +fail_invalid_char: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_REGEXP_CHARACTER); DUK_WO_NORETURN(return;); - fail_quantifier: +fail_quantifier: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_QUANTIFIER); DUK_WO_NORETURN(return;); #endif @@ -86672,7 +87968,7 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range x = DUK__L0(); - ch = -1; /* not strictly necessary, but avoids "uninitialized variable" warnings */ + ch = -1; /* not strictly necessary, but avoids "uninitialized variable" warnings */ DUK_UNREF(ch); if (x < 0) { @@ -86681,7 +87977,7 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range if (start >= 0) { gen_range(userdata, start, start, 0); } - DUK__ADVANCECHARS(lex_ctx, 1); /* eat ']' before finishing */ + DUK__ADVANCECHARS(lex_ctx, 1); /* eat ']' before finishing */ break; } else if (x == DUK_ASC_MINUS) { if (start >= 0 && !dash && DUK__L1() != DUK_ASC_RBRACKET) { @@ -86726,8 +88022,7 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range } else if (x == DUK_ASC_LC_C) { x = DUK__L2(); adv = 3; - if ((x >= DUK_ASC_LC_A && x <= DUK_ASC_LC_Z) || - (x >= DUK_ASC_UC_A && x <= DUK_ASC_UC_Z)) { + if ((x >= DUK_ASC_LC_A && x <= DUK_ASC_LC_Z) || (x >= DUK_ASC_UC_A && x <= DUK_ASC_UC_Z)) { ch = (x % 32); } else { goto fail_escape; @@ -86791,7 +88086,7 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range #if defined(DUK_USE_ES6_REGEXP_SYNTAX) ch = duk__lexer_parse_legacy_octal(lex_ctx, &adv, 0 /*reject_annex_b*/); - DUK_ASSERT(ch >= 0); /* no rejections */ + DUK_ASSERT(ch >= 0); /* no rejections */ #else if (x == DUK_ASC_0 && !DUK__ISDIGIT(DUK__L2())) { ch = 0x0000; @@ -86806,7 +88101,7 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range * EOF here. */ ch = x; -#else /* DUK_USE_ES6_REGEXP_SYNTAX */ +#else /* DUK_USE_ES6_REGEXP_SYNTAX */ } else if (!duk_unicode_is_identifier_part(x)) { /* IdentityEscape: ES5.1 doesn't allow identity escape * for identifier part characters, which conflicts with @@ -86814,7 +88109,7 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range * /[\$]/ which is awkward. */ ch = x; -#endif /* DUK_USE_ES6_REGEXP_SYNTAX */ +#endif /* DUK_USE_ES6_REGEXP_SYNTAX */ } else { goto fail_escape; } @@ -86862,20 +88157,20 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range return; - fail_escape: +fail_escape: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_REGEXP_ESCAPE); DUK_WO_NORETURN(return;); - fail_range: +fail_range: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_INVALID_RANGE); DUK_WO_NORETURN(return;); - fail_unterm_charclass: +fail_unterm_charclass: DUK_ERROR_SYNTAX(lex_ctx->thr, DUK_STR_UNTERMINATED_CHARCLASS); DUK_WO_NORETURN(return;); } -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* automatic undefs */ #undef DUK__ADVANCEBYTES @@ -86912,10 +88207,10 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range /* #include duk_internal.h -> already included */ -#define DUK__IEEE_DOUBLE_EXP_BIAS 1023 -#define DUK__IEEE_DOUBLE_EXP_MIN (-1022) /* biased exp == 0 -> denormal, exp -1022 */ +#define DUK__IEEE_DOUBLE_EXP_BIAS 1023 +#define DUK__IEEE_DOUBLE_EXP_MIN (-1022) /* biased exp == 0 -> denormal, exp -1022 */ -#define DUK__DIGITCHAR(x) duk_lc_digits[(x)] +#define DUK__DIGITCHAR(x) duk_lc_digits[(x)] /* * Tables generated with util/gennumdigits.py. @@ -86933,10 +88228,10 @@ DUK_INTERNAL void duk_lexer_parse_re_ranges(duk_lexer_ctx *lex_ctx, duk_re_range */ DUK_LOCAL const duk_uint8_t duk__str2num_digits_for_radix[] = { - 69, 44, 35, 30, 27, 25, 23, 22, 20, 20, /* 2 to 11 */ - 20, 19, 19, 18, 18, 17, 17, 17, 16, 16, /* 12 to 21 */ - 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, /* 22 to 31 */ - 14, 14, 14, 14, 14 /* 31 to 36 */ + 69, 44, 35, 30, 27, 25, 23, 22, 20, 20, /* 2 to 11 */ + 20, 19, 19, 18, 18, 17, 17, 17, 16, 16, /* 12 to 21 */ + 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, /* 22 to 31 */ + 14, 14, 14, 14, 14 /* 31 to 36 */ }; typedef struct { @@ -86945,15 +88240,11 @@ typedef struct { } duk__exp_limits; DUK_LOCAL const duk__exp_limits duk__str2num_exp_limits[] = { - { 957, -1147 }, { 605, -725 }, { 479, -575 }, { 414, -496 }, - { 372, -446 }, { 342, -411 }, { 321, -384 }, { 304, -364 }, - { 291, -346 }, { 279, -334 }, { 268, -323 }, { 260, -312 }, - { 252, -304 }, { 247, -296 }, { 240, -289 }, { 236, -283 }, - { 231, -278 }, { 227, -273 }, { 223, -267 }, { 220, -263 }, - { 216, -260 }, { 213, -256 }, { 210, -253 }, { 208, -249 }, - { 205, -246 }, { 203, -244 }, { 201, -241 }, { 198, -239 }, - { 196, -237 }, { 195, -234 }, { 193, -232 }, { 191, -230 }, - { 190, -228 }, { 188, -226 }, { 187, -225 }, + { 957, -1147 }, { 605, -725 }, { 479, -575 }, { 414, -496 }, { 372, -446 }, { 342, -411 }, { 321, -384 }, + { 304, -364 }, { 291, -346 }, { 279, -334 }, { 268, -323 }, { 260, -312 }, { 252, -304 }, { 247, -296 }, + { 240, -289 }, { 236, -283 }, { 231, -278 }, { 227, -273 }, { 223, -267 }, { 220, -263 }, { 216, -260 }, + { 213, -256 }, { 210, -253 }, { 208, -249 }, { 205, -246 }, { 203, -244 }, { 201, -241 }, { 198, -239 }, + { 196, -237 }, { 195, -234 }, { 193, -232 }, { 191, -230 }, { 190, -228 }, { 188, -226 }, { 187, -225 }, }; /* @@ -86971,18 +88262,18 @@ DUK_LOCAL const duk__exp_limits duk__str2num_exp_limits[] = { /* This upper value has been experimentally determined; debug build will check * bigint size with assertions. */ -#define DUK__BI_MAX_PARTS 37 /* 37x32 = 1184 bits */ +#define DUK__BI_MAX_PARTS 37 /* 37x32 = 1184 bits */ #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 2) -#define DUK__BI_PRINT(name,x) duk__bi_print((name),(x)) +#define DUK__BI_PRINT(name, x) duk__bi_print((name), (x)) #else -#define DUK__BI_PRINT(name,x) +#define DUK__BI_PRINT(name, x) #endif /* Current size is about 152 bytes. */ typedef struct { duk_small_int_t n; - duk_uint32_t v[DUK__BI_MAX_PARTS]; /* low to high */ + duk_uint32_t v[DUK__BI_MAX_PARTS]; /* low to high */ } duk__bigint; #if defined(DUK_USE_DEBUG_LEVEL) && (DUK_USE_DEBUG_LEVEL >= 2) @@ -87007,9 +88298,8 @@ DUK_LOCAL void duk__bi_print(const char *name, duk__bigint *x) { #if defined(DUK_USE_ASSERTIONS) DUK_LOCAL duk_small_int_t duk__bi_is_valid(duk__bigint *x) { - return (duk_small_int_t) - ( ((x->n >= 0) && (x->n <= DUK__BI_MAX_PARTS)) /* is valid size */ && - ((x->n == 0) || (x->v[x->n - 1] != 0)) /* is normalized */ ); + return (duk_small_int_t) (((x->n >= 0) && (x->n <= DUK__BI_MAX_PARTS)) /* is valid size */ && + ((x->n == 0) || (x->v[x->n - 1] != 0)) /* is normalized */); } #endif @@ -87080,10 +88370,10 @@ DUK_LOCAL int duk__bi_compare(duk__bigint *x, duk__bigint *y) { return 0; - ret_gt: +ret_gt: return 1; - ret_lt: +ret_lt: return -1; } @@ -87098,11 +88388,14 @@ DUK_LOCAL void duk__bi_add(duk__bigint *x, duk__bigint *y, duk__bigint *z) { if (z->n > y->n) { duk__bigint *t; - t = y; y = z; z = t; + t = y; + y = z; + z = t; } DUK_ASSERT(y->n >= z->n); - ny = y->n; nz = z->n; + ny = y->n; + nz = z->n; tmp = 0U; for (i = 0; i < ny; i++) { DUK_ASSERT(i < DUK__BI_MAX_PARTS); @@ -87123,7 +88416,7 @@ DUK_LOCAL void duk__bi_add(duk__bigint *x, duk__bigint *y, duk__bigint *z) { /* no need to normalize */ DUK_ASSERT(duk__bi_is_valid(x)); } -#else /* DUK_USE_64BIT_OPS */ +#else /* DUK_USE_64BIT_OPS */ DUK_LOCAL void duk__bi_add(duk__bigint *x, duk__bigint *y, duk__bigint *z) { duk_uint32_t carry, tmp1, tmp2; duk_small_int_t i, ny, nz; @@ -87133,11 +88426,14 @@ DUK_LOCAL void duk__bi_add(duk__bigint *x, duk__bigint *y, duk__bigint *z) { if (z->n > y->n) { duk__bigint *t; - t = y; y = z; z = t; + t = y; + y = z; + z = t; } DUK_ASSERT(y->n >= z->n); - ny = y->n; nz = z->n; + ny = y->n; + nz = z->n; carry = 0U; for (i = 0; i < ny; i++) { /* Carry is detected based on wrapping which relies on exact 32-bit @@ -87174,7 +88470,7 @@ DUK_LOCAL void duk__bi_add(duk__bigint *x, duk__bigint *y, duk__bigint *z) { /* no need to normalize */ DUK_ASSERT(duk__bi_is_valid(x)); } -#endif /* DUK_USE_64BIT_OPS */ +#endif /* DUK_USE_64BIT_OPS */ /* x <- y + z */ DUK_LOCAL void duk__bi_add_small(duk__bigint *x, duk__bigint *y, duk_uint32_t z) { @@ -87189,7 +88485,7 @@ DUK_LOCAL void duk__bi_add_small(duk__bigint *x, duk__bigint *y, duk_uint32_t z) DUK_ASSERT(duk__bi_is_valid(x)); } -#if 0 /* unused */ +#if 0 /* unused */ /* x <- x + y, use t as temp */ DUK_LOCAL void duk__bi_add_copy(duk__bigint *x, duk__bigint *y, duk__bigint *t) { duk__bi_add(t, x, y); @@ -87209,7 +88505,8 @@ DUK_LOCAL void duk__bi_sub(duk__bigint *x, duk__bigint *y, duk__bigint *z) { DUK_ASSERT(duk__bi_compare(y, z) >= 0); DUK_ASSERT(y->n >= z->n); - ny = y->n; nz = z->n; + ny = y->n; + nz = z->n; tmp = 0; for (i = 0; i < ny; i++) { ty = y->v[i]; @@ -87220,12 +88517,12 @@ DUK_LOCAL void duk__bi_sub(duk__bigint *x, duk__bigint *y, duk__bigint *z) { } tmp = (duk_int64_t) ty - (duk_int64_t) tz + tmp; x->v[i] = (duk_uint32_t) ((duk_uint64_t) tmp & 0xffffffffUL); - tmp = tmp >> 32; /* 0 or -1 */ + tmp = tmp >> 32; /* 0 or -1 */ } DUK_ASSERT(tmp == 0); x->n = i; - duk__bi_normalize(x); /* need to normalize, may even cancel to 0 */ + duk__bi_normalize(x); /* need to normalize, may even cancel to 0 */ DUK_ASSERT(duk__bi_is_valid(x)); } #else @@ -87238,7 +88535,8 @@ DUK_LOCAL void duk__bi_sub(duk__bigint *x, duk__bigint *y, duk__bigint *z) { DUK_ASSERT(duk__bi_compare(y, z) >= 0); DUK_ASSERT(y->n >= z->n); - ny = y->n; nz = z->n; + ny = y->n; + nz = z->n; borrow = 0U; for (i = 0; i < ny; i++) { /* Borrow is detected based on wrapping which relies on exact 32-bit @@ -87266,12 +88564,12 @@ DUK_LOCAL void duk__bi_sub(duk__bigint *x, duk__bigint *y, duk__bigint *z) { DUK_ASSERT(borrow == 0U); x->n = i; - duk__bi_normalize(x); /* need to normalize, may even cancel to 0 */ + duk__bi_normalize(x); /* need to normalize, may even cancel to 0 */ DUK_ASSERT(duk__bi_is_valid(x)); } #endif -#if 0 /* unused */ +#if 0 /* unused */ /* x <- y - z */ DUK_LOCAL void duk__bi_sub_small(duk__bigint *x, duk__bigint *y, duk_uint32_t z) { duk__bigint tmp; @@ -87299,7 +88597,7 @@ DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) { DUK_ASSERT(duk__bi_is_valid(y)); DUK_ASSERT(duk__bi_is_valid(z)); - nx = y->n + z->n; /* max possible */ + nx = y->n + z->n; /* max possible */ DUK_ASSERT(nx <= DUK__BI_MAX_PARTS); if (nx == 0) { @@ -87318,15 +88616,15 @@ DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) { #if defined(DUK_USE_64BIT_OPS) duk_uint64_t tmp = 0U; for (j = 0; j < nz; j++) { - tmp += (duk_uint64_t) y->v[i] * (duk_uint64_t) z->v[j] + x->v[i+j]; - x->v[i+j] = (duk_uint32_t) (tmp & 0xffffffffUL); + tmp += (duk_uint64_t) y->v[i] * (duk_uint64_t) z->v[j] + x->v[i + j]; + x->v[i + j] = (duk_uint32_t) (tmp & 0xffffffffUL); tmp = tmp >> 32; } if (tmp > 0) { DUK_ASSERT(i + j < nx); DUK_ASSERT(i + j < DUK__BI_MAX_PARTS); - DUK_ASSERT(x->v[i+j] == 0U); - x->v[i+j] = (duk_uint32_t) tmp; + DUK_ASSERT(x->v[i + j] == 0U); + x->v[i + j] = (duk_uint32_t) tmp; } #else /* @@ -87346,12 +88644,16 @@ DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) { duk_uint32_t a, b, c, d, e, f; duk_uint32_t r, s, t; - a = y->v[i]; b = a & 0xffffUL; a = a >> 16; + a = y->v[i]; + b = a & 0xffffUL; + a = a >> 16; f = 0; for (j = 0; j < nz; j++) { - c = z->v[j]; d = c & 0xffffUL; c = c >> 16; - e = x->v[i+j]; + c = z->v[j]; + d = c & 0xffffUL; + c = c >> 16; + e = x->v[i + j]; /* build result as: (r << 32) + s: start with (BD + E + F) */ r = 0; @@ -87359,26 +88661,34 @@ DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) { /* add E */ t = s + e; - if (t < s) { r++; } /* carry */ + if (t < s) { + r++; + } /* carry */ s = t; /* add F */ t = s + f; - if (t < s) { r++; } /* carry */ + if (t < s) { + r++; + } /* carry */ s = t; /* add BC*2^16 */ t = b * c; r += (t >> 16); t = s + ((t & 0xffffUL) << 16); - if (t < s) { r++; } /* carry */ + if (t < s) { + r++; + } /* carry */ s = t; /* add AD*2^16 */ t = a * d; r += (t >> 16); t = s + ((t & 0xffffUL) << 16); - if (t < s) { r++; } /* carry */ + if (t < s) { + r++; + } /* carry */ s = t; /* add AC*2^32 */ @@ -87386,20 +88696,22 @@ DUK_LOCAL void duk__bi_mul(duk__bigint *x, duk__bigint *y, duk__bigint *z) { r += t; DUK_DDD(DUK_DDDPRINT("ab=%08lx cd=%08lx ef=%08lx -> rs=%08lx %08lx", - (unsigned long) y->v[i], (unsigned long) z->v[j], - (unsigned long) x->v[i+j], (unsigned long) r, + (unsigned long) y->v[i], + (unsigned long) z->v[j], + (unsigned long) x->v[i + j], + (unsigned long) r, (unsigned long) s)); - x->v[i+j] = s; + x->v[i + j] = s; f = r; } if (f > 0U) { DUK_ASSERT(i + j < nx); DUK_ASSERT(i + j < DUK__BI_MAX_PARTS); - DUK_ASSERT(x->v[i+j] == 0U); - x->v[i+j] = (duk_uint32_t) f; + DUK_ASSERT(x->v[i + j] == 0U); + x->v[i + j] = (duk_uint32_t) f; } -#endif /* DUK_USE_64BIT_OPS */ +#endif /* DUK_USE_64BIT_OPS */ } duk__bi_normalize(x); @@ -87438,7 +88750,7 @@ DUK_LOCAL int duk__bi_is_even(duk__bigint *x) { DUK_LOCAL int duk__bi_is_zero(duk__bigint *x) { DUK_ASSERT(duk__bi_is_valid(x)); - return (x->n == 0); /* this is the case for normalized numbers */ + return (x->n == 0); /* this is the case for normalized numbers */ } /* Bigint is 2^52. Used to detect normalized IEEE double mantissa values @@ -87449,8 +88761,7 @@ DUK_LOCAL int duk__bi_is_zero(duk__bigint *x) { */ DUK_LOCAL duk_small_int_t duk__bi_is_2to52(duk__bigint *x) { DUK_ASSERT(duk__bi_is_valid(x)); - return (duk_small_int_t) - (x->n == 2) && (x->v[0] == 0U) && (x->v[1] == (1U << (52-32))); + return (duk_small_int_t) (x->n == 2) && (x->v[0] == 0U) && (x->v[1] == (1U << (52 - 32))); } /* x <- (1<= 0); DUK_ASSERT(y >= 0); @@ -87524,14 +88835,14 @@ DUK_LOCAL void duk__bi_exp_small(duk__bigint *x, duk_small_int_t b, duk_small_in */ /* Maximum number of digits generated. */ -#define DUK__MAX_OUTPUT_DIGITS 1040 /* (Number.MAX_VALUE).toString(2).length == 1024, + slack */ +#define DUK__MAX_OUTPUT_DIGITS 1040 /* (Number.MAX_VALUE).toString(2).length == 1024, + slack */ /* Maximum number of characters in formatted value. */ -#define DUK__MAX_FORMATTED_LENGTH 1040 /* (-Number.MAX_VALUE).toString(2).length == 1025, + slack */ +#define DUK__MAX_FORMATTED_LENGTH 1040 /* (-Number.MAX_VALUE).toString(2).length == 1025, + slack */ /* Number and (minimum) size of bigints in the nc_ctx structure. */ -#define DUK__NUMCONV_CTX_NUM_BIGINTS 7 -#define DUK__NUMCONV_CTX_BIGINTS_SIZE (sizeof(duk__bigint) * DUK__NUMCONV_CTX_NUM_BIGINTS) +#define DUK__NUMCONV_CTX_NUM_BIGINTS 7 +#define DUK__NUMCONV_CTX_BIGINTS_SIZE (sizeof(duk__bigint) * DUK__NUMCONV_CTX_NUM_BIGINTS) typedef struct { /* Currently about 7*152 = 1064 bytes. The space for these @@ -87541,31 +88852,32 @@ typedef struct { */ duk__bigint f, r, s, mp, mm, t1, t2; - duk_small_int_t is_s2n; /* if 1, doing a string-to-number; else doing a number-to-string */ - duk_small_int_t is_fixed; /* if 1, doing a fixed format output (not free format) */ - duk_small_int_t req_digits; /* requested number of output digits; 0 = free-format */ - duk_small_int_t abs_pos; /* digit position is absolute, not relative */ - duk_small_int_t e; /* exponent for 'f' */ - duk_small_int_t b; /* input radix */ - duk_small_int_t B; /* output radix */ - duk_small_int_t k; /* see algorithm */ - duk_small_int_t low_ok; /* see algorithm */ - duk_small_int_t high_ok; /* see algorithm */ - duk_small_int_t unequal_gaps; /* m+ != m- (very rarely) */ + duk_small_int_t is_s2n; /* if 1, doing a string-to-number; else doing a number-to-string */ + duk_small_int_t is_fixed; /* if 1, doing a fixed format output (not free format) */ + duk_small_int_t req_digits; /* requested number of output digits; 0 = free-format */ + duk_small_int_t abs_pos; /* digit position is absolute, not relative */ + duk_small_int_t e; /* exponent for 'f' */ + duk_small_int_t b; /* input radix */ + duk_small_int_t B; /* output radix */ + duk_small_int_t k; /* see algorithm */ + duk_small_int_t low_ok; /* see algorithm */ + duk_small_int_t high_ok; /* see algorithm */ + duk_small_int_t unequal_gaps; /* m+ != m- (very rarely) */ /* Buffer used for generated digits, values are in the range [0,B-1]. */ duk_uint8_t digits[DUK__MAX_OUTPUT_DIGITS]; - duk_small_int_t count; /* digit count */ + duk_small_int_t count; /* digit count */ } duk__numconv_stringify_ctx; /* Note: computes with 'idx' in assertions, so caller beware. * 'idx' is preincremented, i.e. '1' on first call, because it * is more convenient for the caller. */ -#define DUK__DRAGON4_OUTPUT_PREINC(nc_ctx,preinc_idx,x) do { \ - DUK_ASSERT((preinc_idx) - 1 >= 0); \ - DUK_ASSERT((preinc_idx) - 1 < DUK__MAX_OUTPUT_DIGITS); \ - ((nc_ctx)->digits[(preinc_idx) - 1]) = (duk_uint8_t) (x); \ +#define DUK__DRAGON4_OUTPUT_PREINC(nc_ctx, preinc_idx, x) \ + do { \ + DUK_ASSERT((preinc_idx) -1 >= 0); \ + DUK_ASSERT((preinc_idx) -1 < DUK__MAX_OUTPUT_DIGITS); \ + ((nc_ctx)->digits[(preinc_idx) -1]) = (duk_uint8_t) (x); \ } while (0) DUK_LOCAL duk_size_t duk__dragon4_format_uint32(duk_uint8_t *buf, duk_uint32_t x, duk_small_int_t radix) { @@ -87664,11 +88976,11 @@ DUK_LOCAL void duk__dragon4_prepare(duk__numconv_stringify_ctx *nc_ctx) { "lowest mantissa value for this exponent -> " "unequal gaps")); - duk__bi_exp_small(&nc_ctx->mm, nc_ctx->b, nc_ctx->e, &nc_ctx->t1, &nc_ctx->t2); /* mm <- b^e */ - duk__bi_mul_small(&nc_ctx->mp, &nc_ctx->mm, (duk_uint32_t) nc_ctx->b); /* mp <- b^(e+1) */ + duk__bi_exp_small(&nc_ctx->mm, nc_ctx->b, nc_ctx->e, &nc_ctx->t1, &nc_ctx->t2); /* mm <- b^e */ + duk__bi_mul_small(&nc_ctx->mp, &nc_ctx->mm, (duk_uint32_t) nc_ctx->b); /* mp <- b^(e+1) */ duk__bi_mul_small(&nc_ctx->t1, &nc_ctx->f, 2); - duk__bi_mul(&nc_ctx->r, &nc_ctx->t1, &nc_ctx->mp); /* r <- (2 * f) * b^(e+1) */ - duk__bi_set_small(&nc_ctx->s, (duk_uint32_t) (nc_ctx->b * 2)); /* s <- 2 * b */ + duk__bi_mul(&nc_ctx->r, &nc_ctx->t1, &nc_ctx->mp); /* r <- (2 * f) * b^(e+1) */ + duk__bi_set_small(&nc_ctx->s, (duk_uint32_t) (nc_ctx->b * 2)); /* s <- 2 * b */ nc_ctx->unequal_gaps = 1; } else { /* (>= e 0) AND (not (= f (expt b (- p 1)))) @@ -87688,11 +89000,11 @@ DUK_LOCAL void duk__dragon4_prepare(duk__numconv_stringify_ctx *nc_ctx) { "not lowest mantissa for this exponent -> " "equal gaps")); - duk__bi_exp_small(&nc_ctx->mm, nc_ctx->b, nc_ctx->e, &nc_ctx->t1, &nc_ctx->t2); /* mm <- b^e */ - duk__bi_copy(&nc_ctx->mp, &nc_ctx->mm); /* mp <- b^e */ + duk__bi_exp_small(&nc_ctx->mm, nc_ctx->b, nc_ctx->e, &nc_ctx->t1, &nc_ctx->t2); /* mm <- b^e */ + duk__bi_copy(&nc_ctx->mp, &nc_ctx->mm); /* mp <- b^e */ duk__bi_mul_small(&nc_ctx->t1, &nc_ctx->f, 2); - duk__bi_mul(&nc_ctx->r, &nc_ctx->t1, &nc_ctx->mp); /* r <- (2 * f) * b^e */ - duk__bi_set_small(&nc_ctx->s, 2); /* s <- 2 */ + duk__bi_mul(&nc_ctx->r, &nc_ctx->t1, &nc_ctx->mp); /* r <- (2 * f) * b^e */ + duk__bi_set_small(&nc_ctx->s, 2); /* s <- 2 */ } } else { /* When doing string-to-number, lowest_mantissa is always 0 so @@ -87714,9 +89026,13 @@ DUK_LOCAL void duk__dragon4_prepare(duk__numconv_stringify_ctx *nc_ctx) { "lowest mantissa for this exponent -> " "unequal gaps")); - duk__bi_mul_small(&nc_ctx->r, &nc_ctx->f, (duk_uint32_t) (nc_ctx->b * 2)); /* r <- (2 * b) * f */ - duk__bi_exp_small(&nc_ctx->t1, nc_ctx->b, 1 - nc_ctx->e, &nc_ctx->s, &nc_ctx->t2); /* NB: use 's' as temp on purpose */ - duk__bi_mul_small(&nc_ctx->s, &nc_ctx->t1, 2); /* s <- b^(1-e) * 2 */ + duk__bi_mul_small(&nc_ctx->r, &nc_ctx->f, (duk_uint32_t) (nc_ctx->b * 2)); /* r <- (2 * b) * f */ + duk__bi_exp_small(&nc_ctx->t1, + nc_ctx->b, + 1 - nc_ctx->e, + &nc_ctx->s, + &nc_ctx->t2); /* NB: use 's' as temp on purpose */ + duk__bi_mul_small(&nc_ctx->s, &nc_ctx->t1, 2); /* s <- b^(1-e) * 2 */ duk__bi_set_small(&nc_ctx->mp, 2); duk__bi_set_small(&nc_ctx->mm, 1); nc_ctx->unequal_gaps = 1; @@ -87735,9 +89051,13 @@ DUK_LOCAL void duk__dragon4_prepare(duk__numconv_stringify_ctx *nc_ctx) { "lowest mantissa for this exponent -> " "equal gaps")); - duk__bi_mul_small(&nc_ctx->r, &nc_ctx->f, 2); /* r <- 2 * f */ - duk__bi_exp_small(&nc_ctx->t1, nc_ctx->b, -nc_ctx->e, &nc_ctx->s, &nc_ctx->t2); /* NB: use 's' as temp on purpose */ - duk__bi_mul_small(&nc_ctx->s, &nc_ctx->t1, 2); /* s <- b^(-e) * 2 */ + duk__bi_mul_small(&nc_ctx->r, &nc_ctx->f, 2); /* r <- 2 * f */ + duk__bi_exp_small(&nc_ctx->t1, + nc_ctx->b, + -nc_ctx->e, + &nc_ctx->s, + &nc_ctx->t2); /* NB: use 's' as temp on purpose */ + duk__bi_mul_small(&nc_ctx->s, &nc_ctx->t1, 2); /* s <- b^(-e) * 2 */ duk__bi_set_small(&nc_ctx->mp, 1); duk__bi_set_small(&nc_ctx->mm, 1); } @@ -87769,8 +89089,8 @@ DUK_LOCAL void duk__dragon4_scale(duk__numconv_stringify_ctx *nc_ctx) { * impact for very large and very small numbers. */ - DUK_DDD(DUK_DDDPRINT("scale: B=%ld, low_ok=%ld, high_ok=%ld", - (long) nc_ctx->B, (long) nc_ctx->low_ok, (long) nc_ctx->high_ok)); + DUK_DDD( + DUK_DDDPRINT("scale: B=%ld, low_ok=%ld, high_ok=%ld", (long) nc_ctx->B, (long) nc_ctx->low_ok, (long) nc_ctx->high_ok)); DUK__BI_PRINT("r(init)", &nc_ctx->r); DUK__BI_PRINT("s(init)", &nc_ctx->s); DUK__BI_PRINT("mp(init)", &nc_ctx->mp); @@ -87783,7 +89103,7 @@ DUK_LOCAL void duk__dragon4_scale(duk__numconv_stringify_ctx *nc_ctx) { DUK__BI_PRINT("m+", &nc_ctx->mp); DUK__BI_PRINT("m-", &nc_ctx->mm); - duk__bi_add(&nc_ctx->t1, &nc_ctx->r, &nc_ctx->mp); /* t1 = (+ r m+) */ + duk__bi_add(&nc_ctx->t1, &nc_ctx->r, &nc_ctx->mp); /* t1 = (+ r m+) */ if (duk__bi_compare(&nc_ctx->t1, &nc_ctx->s) >= (nc_ctx->high_ok ? 0 : 1)) { DUK_DDD(DUK_DDDPRINT("k is too low")); /* r <- r @@ -87812,8 +89132,8 @@ DUK_LOCAL void duk__dragon4_scale(duk__numconv_stringify_ctx *nc_ctx) { DUK__BI_PRINT("m+", &nc_ctx->mp); DUK__BI_PRINT("m-", &nc_ctx->mm); - duk__bi_add(&nc_ctx->t1, &nc_ctx->r, &nc_ctx->mp); /* t1 = (+ r m+) */ - duk__bi_mul_small(&nc_ctx->t2, &nc_ctx->t1, (duk_uint32_t) nc_ctx->B); /* t2 = (* (+ r m+) B) */ + duk__bi_add(&nc_ctx->t1, &nc_ctx->r, &nc_ctx->mp); /* t1 = (+ r m+) */ + duk__bi_mul_small(&nc_ctx->t2, &nc_ctx->t1, (duk_uint32_t) nc_ctx->B); /* t2 = (* (+ r m+) B) */ if (duk__bi_compare(&nc_ctx->t2, &nc_ctx->s) <= (nc_ctx->high_ok ? -1 : 0)) { DUK_DDD(DUK_DDDPRINT("k is too high")); /* r <- (* r B) @@ -87834,11 +89154,11 @@ DUK_LOCAL void duk__dragon4_scale(duk__numconv_stringify_ctx *nc_ctx) { } } - skip_dec_k: +skip_dec_k: if (!nc_ctx->unequal_gaps) { DUK_DDD(DUK_DDDPRINT("equal gaps, copy m- from m+")); - duk__bi_copy(&nc_ctx->mm, &nc_ctx->mp); /* mm <- mp */ + duk__bi_copy(&nc_ctx->mm, &nc_ctx->mp); /* mm <- mp */ } nc_ctx->k = k; @@ -87850,9 +89170,9 @@ DUK_LOCAL void duk__dragon4_scale(duk__numconv_stringify_ctx *nc_ctx) { } DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { - duk_small_int_t tc1, tc2; /* terminating conditions */ - duk_small_int_t d; /* current digit */ - duk_small_int_t count = 0; /* digit count */ + duk_small_int_t tc1, tc2; /* terminating conditions */ + duk_small_int_t d; /* current digit */ + duk_small_int_t count = 0; /* digit count */ /* * Digit generation loop. @@ -87874,25 +89194,28 @@ DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { for (;;) { DUK_DDD(DUK_DDDPRINT("generate loop, count=%ld, k=%ld, B=%ld, low_ok=%ld, high_ok=%ld", - (long) count, (long) nc_ctx->k, (long) nc_ctx->B, - (long) nc_ctx->low_ok, (long) nc_ctx->high_ok)); + (long) count, + (long) nc_ctx->k, + (long) nc_ctx->B, + (long) nc_ctx->low_ok, + (long) nc_ctx->high_ok)); DUK__BI_PRINT("r", &nc_ctx->r); DUK__BI_PRINT("s", &nc_ctx->s); DUK__BI_PRINT("m+", &nc_ctx->mp); DUK__BI_PRINT("m-", &nc_ctx->mm); /* (quotient-remainder (* r B) s) using a dummy subtraction loop */ - duk__bi_mul_small(&nc_ctx->t1, &nc_ctx->r, (duk_uint32_t) nc_ctx->B); /* t1 <- (* r B) */ + duk__bi_mul_small(&nc_ctx->t1, &nc_ctx->r, (duk_uint32_t) nc_ctx->B); /* t1 <- (* r B) */ d = 0; for (;;) { if (duk__bi_compare(&nc_ctx->t1, &nc_ctx->s) < 0) { break; } - duk__bi_sub_copy(&nc_ctx->t1, &nc_ctx->s, &nc_ctx->t2); /* t1 <- t1 - s */ + duk__bi_sub_copy(&nc_ctx->t1, &nc_ctx->s, &nc_ctx->t2); /* t1 <- t1 - s */ d++; } - duk__bi_copy(&nc_ctx->r, &nc_ctx->t1); /* r <- (remainder (* r B) s) */ - /* d <- (quotient (* r B) s) (in range 0...B-1) */ + duk__bi_copy(&nc_ctx->r, &nc_ctx->t1); /* r <- (remainder (* r B) s) */ + /* d <- (quotient (* r B) s) (in range 0...B-1) */ DUK_DDD(DUK_DDDPRINT("-> d(quot)=%ld", (long) d)); DUK__BI_PRINT("r(rem)", &nc_ctx->r); @@ -87911,7 +89234,7 @@ DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { /* free-form */ tc1 = (duk__bi_compare(&nc_ctx->r, &nc_ctx->mm) <= (nc_ctx->low_ok ? 0 : -1)); - duk__bi_add(&nc_ctx->t1, &nc_ctx->r, &nc_ctx->mp); /* t1 <- (+ r m+) */ + duk__bi_add(&nc_ctx->t1, &nc_ctx->r, &nc_ctx->mp); /* t1 <- (+ r m+) */ tc2 = (duk__bi_compare(&nc_ctx->t1, &nc_ctx->s) >= (nc_ctx->high_ok ? 0 : 1)); DUK_DDD(DUK_DDDPRINT("tc1=%ld, tc2=%ld", (long) tc1, (long) tc2)); @@ -87930,20 +89253,21 @@ DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { if (tc2) { /* tc1 = true, tc2 = true */ duk__bi_mul_small(&nc_ctx->t1, &nc_ctx->r, 2); - if (duk__bi_compare(&nc_ctx->t1, &nc_ctx->s) < 0) { /* (< (* r 2) s) */ + if (duk__bi_compare(&nc_ctx->t1, &nc_ctx->s) < 0) { /* (< (* r 2) s) */ DUK_DDD(DUK_DDDPRINT("tc1=true, tc2=true, 2r > s: output d --> %ld (k=%ld)", - (long) d, (long) nc_ctx->k)); + (long) d, + (long) nc_ctx->k)); DUK__DRAGON4_OUTPUT_PREINC(nc_ctx, count, d); } else { DUK_DDD(DUK_DDDPRINT("tc1=true, tc2=true, 2r <= s: output d+1 --> %ld (k=%ld)", - (long) (d + 1), (long) nc_ctx->k)); + (long) (d + 1), + (long) nc_ctx->k)); DUK__DRAGON4_OUTPUT_PREINC(nc_ctx, count, d + 1); } break; } else { /* tc1 = true, tc2 = false */ - DUK_DDD(DUK_DDDPRINT("tc1=true, tc2=false: output d --> %ld (k=%ld)", - (long) d, (long) nc_ctx->k)); + DUK_DDD(DUK_DDDPRINT("tc1=true, tc2=false: output d --> %ld (k=%ld)", (long) d, (long) nc_ctx->k)); DUK__DRAGON4_OUTPUT_PREINC(nc_ctx, count, d); break; } @@ -87951,13 +89275,13 @@ DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { if (tc2) { /* tc1 = false, tc2 = true */ DUK_DDD(DUK_DDDPRINT("tc1=false, tc2=true: output d+1 --> %ld (k=%ld)", - (long) (d + 1), (long) nc_ctx->k)); + (long) (d + 1), + (long) nc_ctx->k)); DUK__DRAGON4_OUTPUT_PREINC(nc_ctx, count, d + 1); break; } else { /* tc1 = false, tc2 = false */ - DUK_DDD(DUK_DDDPRINT("tc1=false, tc2=false: output d --> %ld (k=%ld)", - (long) d, (long) nc_ctx->k)); + DUK_DDD(DUK_DDDPRINT("tc1=false, tc2=false: output d --> %ld (k=%ld)", (long) d, (long) nc_ctx->k)); DUK__DRAGON4_OUTPUT_PREINC(nc_ctx, count, d); /* r <- r (updated above: r <- (remainder (* r B) s) @@ -87974,23 +89298,28 @@ DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { /* fixed-format termination conditions */ if (nc_ctx->is_fixed) { if (nc_ctx->abs_pos) { - int pos = nc_ctx->k - count + 1; /* count is already incremented, take into account */ + int pos = nc_ctx->k - count + 1; /* count is already incremented, take into account */ DUK_DDD(DUK_DDDPRINT("fixed format, absolute: abs pos=%ld, k=%ld, count=%ld, req=%ld", - (long) pos, (long) nc_ctx->k, (long) count, (long) nc_ctx->req_digits)); + (long) pos, + (long) nc_ctx->k, + (long) count, + (long) nc_ctx->req_digits)); if (pos <= nc_ctx->req_digits) { DUK_DDD(DUK_DDDPRINT("digit position reached req_digits, end generate loop")); break; } } else { DUK_DDD(DUK_DDDPRINT("fixed format, relative: k=%ld, count=%ld, req=%ld", - (long) nc_ctx->k, (long) count, (long) nc_ctx->req_digits)); + (long) nc_ctx->k, + (long) count, + (long) nc_ctx->req_digits)); if (count >= nc_ctx->req_digits) { DUK_DDD(DUK_DDDPRINT("digit count reached req_digits, end generate loop")); break; } } } - } /* for */ + } /* for */ nc_ctx->count = count; @@ -88009,8 +89338,7 @@ DUK_LOCAL void duk__dragon4_generate(duk__numconv_stringify_ctx *nc_ctx) { buf[i] = (duk_uint8_t) DUK__DIGITCHAR(t); } } - DUK_DDD(DUK_DDDPRINT("-> generated digits; k=%ld, digits='%s'", - (long) nc_ctx->k, (const char *) buf)); + DUK_DDD(DUK_DDDPRINT("-> generated digits; k=%ld, digits='%s'", (long) nc_ctx->k, (const char *) buf)); } #endif } @@ -88039,11 +89367,11 @@ DUK_LOCAL duk_small_int_t duk__dragon4_fixed_format_round(duk__numconv_stringify if (round_idx >= nc_ctx->count) { DUK_DDD(DUK_DDDPRINT("round_idx out of bounds (%ld >= %ld (count)) -> no rounding", - (long) round_idx, (long) nc_ctx->count)); + (long) round_idx, + (long) nc_ctx->count)); return 0; } else if (round_idx < 0) { - DUK_DDD(DUK_DDDPRINT("round_idx out of bounds (%ld < 0) -> no rounding", - (long) round_idx)); + DUK_DDD(DUK_DDDPRINT("round_idx out of bounds (%ld < 0) -> no rounding", (long) round_idx)); return 0; } @@ -88068,15 +89396,18 @@ DUK_LOCAL duk_small_int_t duk__dragon4_fixed_format_round(duk__numconv_stringify duk_memmove((void *) (&nc_ctx->digits[1]), (const void *) (&nc_ctx->digits[0]), (size_t) (sizeof(char) * (size_t) nc_ctx->count)); - nc_ctx->digits[0] = 1; /* don't increase 'count' */ - nc_ctx->k++; /* position of highest digit changed */ - nc_ctx->count++; /* number of digits changed */ + nc_ctx->digits[0] = 1; /* don't increase 'count' */ + nc_ctx->k++; /* position of highest digit changed */ + nc_ctx->count++; /* number of digits changed */ ret = 1; break; } DUK_DDD(DUK_DDDPRINT("fixed-format rounding carry: B=%ld, roundup_limit=%ld, p=%p, digits=%p", - (long) nc_ctx->B, (long) roundup_limit, (void *) p, (void *) nc_ctx->digits)); + (long) nc_ctx->B, + (long) roundup_limit, + (void *) p, + (void *) nc_ctx->digits)); p--; t = *p; DUK_DDD(DUK_DDDPRINT("digit before carry: %ld", (long) t)); @@ -88093,7 +89424,7 @@ DUK_LOCAL duk_small_int_t duk__dragon4_fixed_format_round(duk__numconv_stringify return ret; } -#define DUK__NO_EXP (65536) /* arbitrary marker, outside valid exp range */ +#define DUK__NO_EXP (65536) /* arbitrary marker, outside valid exp range */ DUK_LOCAL void duk__dragon4_convert_and_push(duk__numconv_stringify_ctx *nc_ctx, duk_hthread *thr, @@ -88136,7 +89467,7 @@ DUK_LOCAL void duk__dragon4_convert_and_push(duk__numconv_stringify_ctx *nc_ctx, DUK_ASSERT(nc_ctx->count >= 1); k = nc_ctx->k; - buf = (duk_uint8_t *) &nc_ctx->f; /* XXX: union would be more correct */ + buf = (duk_uint8_t *) &nc_ctx->f; /* XXX: union would be more correct */ q = buf; /* Exponent handling: if exponent format is used, record exponent value and @@ -88148,14 +89479,13 @@ DUK_LOCAL void duk__dragon4_convert_and_push(duk__numconv_stringify_ctx *nc_ctx, expt = DUK__NO_EXP; if (!nc_ctx->abs_pos /* toFixed() */) { - if ((flags & DUK_N2S_FLAG_FORCE_EXP) || /* exponential notation forced */ - ((flags & DUK_N2S_FLAG_NO_ZERO_PAD) && /* fixed precision and zero padding would be required */ - (k - digits >= 1)) || /* (e.g. k=3, digits=2 -> "12X") */ - ((k > 21 || k <= -6) && (radix == 10))) { /* toString() conditions */ - DUK_DDD(DUK_DDDPRINT("use exponential notation: k=%ld -> expt=%ld", - (long) k, (long) (k - 1))); - expt = k - 1; /* e.g. 12.3 -> digits="123" k=2 -> 1.23e1 */ - k = 1; /* generate mantissa with a single leading whole number digit */ + if ((flags & DUK_N2S_FLAG_FORCE_EXP) || /* exponential notation forced */ + ((flags & DUK_N2S_FLAG_NO_ZERO_PAD) && /* fixed precision and zero padding would be required */ + (k - digits >= 1)) || /* (e.g. k=3, digits=2 -> "12X") */ + ((k > 21 || k <= -6) && (radix == 10))) { /* toString() conditions */ + DUK_DDD(DUK_DDDPRINT("use exponential notation: k=%ld -> expt=%ld", (long) k, (long) (k - 1))); + expt = k - 1; /* e.g. 12.3 -> digits="123" k=2 -> 1.23e1 */ + k = 1; /* generate mantissa with a single leading whole number digit */ } } @@ -88181,13 +89511,18 @@ DUK_LOCAL void duk__dragon4_convert_and_push(duk__numconv_stringify_ctx *nc_ctx, DUK_DDD(DUK_DDDPRINT("expt=%ld, k=%ld, count=%ld, pos=%ld, pos_end=%ld, is_fixed=%ld, " "digits=%ld, abs_pos=%ld", - (long) expt, (long) k, (long) nc_ctx->count, (long) pos, (long) pos_end, - (long) nc_ctx->is_fixed, (long) digits, (long) nc_ctx->abs_pos)); + (long) expt, + (long) k, + (long) nc_ctx->count, + (long) pos, + (long) pos_end, + (long) nc_ctx->is_fixed, + (long) digits, + (long) nc_ctx->abs_pos)); /* Digit generation */ while (pos > pos_end) { - DUK_DDD(DUK_DDDPRINT("digit generation: pos=%ld, pos_end=%ld", - (long) pos, (long) pos_end)); + DUK_DDD(DUK_DDDPRINT("digit generation: pos=%ld, pos_end=%ld", (long) pos, (long) pos_end)); if (pos == 0) { *q++ = (duk_uint8_t) '.'; } @@ -88280,7 +89615,7 @@ DUK_LOCAL void duk__dragon4_double_to_ctx(duk__numconv_stringify_ctx *nc_ctx, du /* normal: implicit leading 1-bit */ nc_ctx->f.v[1] |= 0x00100000UL; expt = expt - DUK__IEEE_DOUBLE_EXP_BIAS - 52; - DUK_ASSERT(duk__bi_is_valid(&nc_ctx->f)); /* true, because v[1] has at least one bit set */ + DUK_ASSERT(duk__bi_is_valid(&nc_ctx->f)); /* true, because v[1] has at least one bit set */ } DUK_ASSERT(duk__bi_is_valid(&nc_ctx->f)); @@ -88303,7 +89638,7 @@ DUK_LOCAL void duk__dragon4_ctx_to_double(duk__numconv_stringify_ctx *nc_ctx, du /* Sometimes this assert is not true right now; it will be true after * rounding. See: test-bug-numconv-mantissa-assert.js. */ - DUK_ASSERT_DISABLE(nc_ctx->digits[0] == 1); /* zero handled by caller */ + DUK_ASSERT_DISABLE(nc_ctx->digits[0] == 1); /* zero handled by caller */ /* Should not be required because the code below always sets both high * and low parts, but at least gcc-4.4.5 fails to deduce this correctly @@ -88348,31 +89683,30 @@ DUK_LOCAL void duk__dragon4_ctx_to_double(duk__numconv_stringify_ctx *nc_ctx, du skip_round = 0; - recheck_exp: +recheck_exp: - expt = nc_ctx->k - 1; /* IEEE exp without bias */ + expt = nc_ctx->k - 1; /* IEEE exp without bias */ if (expt > 1023) { /* Infinity */ - bitstart = -255; /* needed for inf: causes mantissa to become zero, - * and rounding to be skipped. - */ + bitstart = -255; /* needed for inf: causes mantissa to become zero, + * and rounding to be skipped. + */ expt = 2047; } else if (expt >= -1022) { /* normal */ - bitstart = 1; /* skip leading digit */ + bitstart = 1; /* skip leading digit */ expt += DUK__IEEE_DOUBLE_EXP_BIAS; DUK_ASSERT(expt >= 1 && expt <= 2046); } else { /* denormal or zero */ - bitstart = 1023 + expt; /* expt==-1023 -> bitstart=0 (leading 1); - * expt==-1024 -> bitstart=-1 (one left of leading 1), etc - */ + bitstart = 1023 + expt; /* expt==-1023 -> bitstart=0 (leading 1); + * expt==-1024 -> bitstart=-1 (one left of leading 1), etc + */ expt = 0; } bitround = bitstart + 52; - DUK_DDD(DUK_DDDPRINT("ieee expt=%ld, bitstart=%ld, bitround=%ld", - (long) expt, (long) bitstart, (long) bitround)); + DUK_DDD(DUK_DDDPRINT("ieee expt=%ld, bitstart=%ld, bitround=%ld", (long) expt, (long) bitstart, (long) bitround)); if (!skip_round) { if (duk__dragon4_fixed_format_round(nc_ctx, bitround)) { @@ -88410,13 +89744,11 @@ DUK_LOCAL void duk__dragon4_ctx_to_double(duk__numconv_stringify_ctx *nc_ctx, du } /* t has high mantissa */ - DUK_DDD(DUK_DDDPRINT("mantissa is complete: %08lx %08lx", - (unsigned long) t, - (unsigned long) DUK_DBLUNION_GET_LOW32(&u))); + DUK_DDD(DUK_DDDPRINT("mantissa is complete: %08lx %08lx", (unsigned long) t, (unsigned long) DUK_DBLUNION_GET_LOW32(&u))); DUK_ASSERT(expt >= 0 && expt <= 0x7ffL); t += ((duk_uint32_t) expt) << 20; -#if 0 /* caller handles sign change */ +#if 0 /* caller handles sign change */ if (negative) { t |= 0x80000000U; } @@ -88437,12 +89769,15 @@ DUK_LOCAL void duk__dragon4_ctx_to_double(duk__numconv_stringify_ctx *nc_ctx, du * Output: [ string ] */ -DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_small_int_t radix, duk_small_int_t digits, duk_small_uint_t flags) { +DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, + duk_small_int_t radix, + duk_small_int_t digits, + duk_small_uint_t flags) { duk_double_t x; duk_small_int_t c; duk_small_int_t neg; duk_uint32_t uval; - duk__numconv_stringify_ctx nc_ctx_alloc; /* large context; around 2kB now */ + duk__numconv_stringify_ctx nc_ctx_alloc; /* large context; around 2kB now */ duk__numconv_stringify_ctx *nc_ctx = &nc_ctx_alloc; x = (duk_double_t) duk_require_number(thr, -1); @@ -88494,13 +89829,13 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma */ uval = duk_double_to_uint32_t(x); - if (duk_double_equals((double) uval, x) && /* integer number in range */ - flags == 0) { /* no special formatting */ + if (duk_double_equals((double) uval, x) && /* integer number in range */ + flags == 0) { /* no special formatting */ /* use bigint area as a temp */ duk_uint8_t *buf = (duk_uint8_t *) (&nc_ctx->f); duk_uint8_t *p = buf; - DUK_ASSERT(DUK__NUMCONV_CTX_BIGINTS_SIZE >= 32 + 1); /* max size: radix=2 + sign */ + DUK_ASSERT(DUK__NUMCONV_CTX_BIGINTS_SIZE >= 32 + 1); /* max size: radix=2 + sign */ if (neg && uval != 0) { /* no negative sign for zero */ *p++ = (duk_uint8_t) '-'; @@ -88556,9 +89891,9 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma duk_small_int_t count; if (nc_ctx->is_fixed) { if (nc_ctx->abs_pos) { - count = digits + 2; /* lead zero + 'digits' fractions + 1 for rounding */ + count = digits + 2; /* lead zero + 'digits' fractions + 1 for rounding */ } else { - count = digits + 1; /* + 1 for rounding */ + count = digits + 1; /* + 1 for rounding */ } } else { count = 1; @@ -88567,12 +89902,12 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma DUK_ASSERT(count >= 1); duk_memzero((void *) nc_ctx->digits, (size_t) count); nc_ctx->count = count; - nc_ctx->k = 1; /* 0.000... */ + nc_ctx->k = 1; /* 0.000... */ neg = 0; goto zero_skip; } - duk__dragon4_double_to_ctx(nc_ctx, x); /* -> sets 'f' and 'e' */ + duk__dragon4_double_to_ctx(nc_ctx, x); /* -> sets 'f' and 'e' */ DUK__BI_PRINT("f", &nc_ctx->f); DUK_DDD(DUK_DDDPRINT("e=%ld", (long) nc_ctx->e)); @@ -88580,7 +89915,7 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma * Dragon4 slow path digit generation. */ - duk__dragon4_prepare(nc_ctx); /* setup many variables in nc_ctx */ + duk__dragon4_prepare(nc_ctx); /* setup many variables in nc_ctx */ DUK_DDD(DUK_DDDPRINT("after prepare:")); DUK__BI_PRINT("r", &nc_ctx->r); @@ -88602,7 +89937,7 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma * Convert and push final string. */ - zero_skip: +zero_skip: if (flags & DUK_N2S_FLAG_FIXED_FORMAT) { /* Perform fixed-format rounding. */ @@ -88611,13 +89946,16 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma /* 'roundpos' is relative to nc_ctx->k and increases to the right * (opposite of how 'k' changes). */ - roundpos = -digits; /* absolute position for digit considered for rounding */ + roundpos = -digits; /* absolute position for digit considered for rounding */ roundpos = nc_ctx->k - roundpos; } else { roundpos = digits; } DUK_DDD(DUK_DDDPRINT("rounding: k=%ld, count=%ld, digits=%ld, roundpos=%ld", - (long) nc_ctx->k, (long) nc_ctx->count, (long) digits, (long) roundpos)); + (long) nc_ctx->k, + (long) nc_ctx->count, + (long) digits, + (long) roundpos)); (void) duk__dragon4_fixed_format_round(nc_ctx, roundpos); /* Note: 'count' is currently not adjusted by rounding (i.e. the @@ -88646,7 +89984,7 @@ DUK_INTERNAL void duk_numconv_stringify(duk_hthread *thr, duk_small_int_t radix, */ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_int_t radix, duk_small_uint_t flags) { - duk__numconv_stringify_ctx nc_ctx_alloc; /* large context; around 2kB now */ + duk__numconv_stringify_ctx nc_ctx_alloc; /* large context; around 2kB now */ duk__numconv_stringify_ctx *nc_ctx = &nc_ctx_alloc; duk_double_t res; duk_hstring *h_str; @@ -88666,7 +90004,8 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i DUK_DDD(DUK_DDDPRINT("parse number: %!T, radix=%ld, flags=0x%08lx", (duk_tval *) duk_get_tval(thr, -1), - (long) radix, (unsigned long) flags)); + (long) radix, + (unsigned long) flags)); DUK_ASSERT(radix >= 2 && radix <= 36); DUK_ASSERT(radix - 2 < (duk_small_int_t) sizeof(duk__str2num_digits_for_radix)); @@ -88739,7 +90078,7 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i ch = *p; if (ch == (duk_small_int_t) '0') { duk_small_int_t detect_radix = 0; - ch = DUK_LOWERCASE_CHAR_ASCII(p[1]); /* 'x' or 'X' -> 'x' */ + ch = DUK_LOWERCASE_CHAR_ASCII(p[1]); /* 'x' or 'X' -> 'x' */ if ((flags & DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT) && ch == DUK_ASC_LC_X) { DUK_DDD(DUK_DDDPRINT("detected 0x/0X hex prefix, changing radix and preventing fractions and exponent")); detect_radix = 16; @@ -88766,10 +90105,9 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i if (detect_radix > 0) { radix = detect_radix; /* Clear empty as zero flag: interpret e.g. '0x' and '0xg' as a NaN (= parse error) */ - flags &= ~(DUK_S2N_FLAG_ALLOW_EXP | DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | - DUK_S2N_FLAG_ALLOW_FRAC | DUK_S2N_FLAG_ALLOW_NAKED_FRAC | - DUK_S2N_FLAG_ALLOW_EMPTY_AS_ZERO); - flags |= DUK_S2N_FLAG_ALLOW_LEADING_ZERO; /* allow e.g. '0x0009' and '0b00010001' */ + flags &= ~(DUK_S2N_FLAG_ALLOW_EXP | DUK_S2N_FLAG_ALLOW_EMPTY_FRAC | DUK_S2N_FLAG_ALLOW_FRAC | + DUK_S2N_FLAG_ALLOW_NAKED_FRAC | DUK_S2N_FLAG_ALLOW_EMPTY_AS_ZERO); + flags |= DUK_S2N_FLAG_ALLOW_LEADING_ZERO; /* allow e.g. '0x0009' and '0b00010001' */ p += 2; } } @@ -88827,16 +90165,23 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i dig_frac = -1; dig_expt = -1; expt = 0; - expt_adj = 0; /* essentially tracks digit position of lowest 'f' digit */ + expt_adj = 0; /* essentially tracks digit position of lowest 'f' digit */ expt_neg = 0; for (;;) { ch = *p++; DUK_DDD(DUK_DDDPRINT("parse digits: p=%p, ch='%c' (%ld), expt=%ld, expt_adj=%ld, " "dig_whole=%ld, dig_frac=%ld, dig_expt=%ld, dig_lzero=%ld, dig_prec=%ld", - (const void *) p, (int) ((ch >= 0x20 && ch <= 0x7e) ? ch : '?'), (long) ch, - (long) expt, (long) expt_adj, (long) dig_whole, (long) dig_frac, - (long) dig_expt, (long) dig_lzero, (long) dig_prec)); + (const void *) p, + (int) ((ch >= 0x20 && ch <= 0x7e) ? ch : '?'), + (long) ch, + (long) expt, + (long) expt_adj, + (long) dig_whole, + (long) dig_frac, + (long) dig_expt, + (long) dig_lzero, + (long) dig_prec)); DUK__BI_PRINT("f", &nc_ctx->f); /* Most common cases first. */ @@ -88875,8 +90220,8 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i } else if (ch == (duk_small_int_t) 0) { DUK_DDD(DUK_DDDPRINT("NUL termination")); break; - } else if ((flags & DUK_S2N_FLAG_ALLOW_EXP) && - dig_expt < 0 && (ch == (duk_small_int_t) 'e' || ch == (duk_small_int_t) 'E')) { + } else if ((flags & DUK_S2N_FLAG_ALLOW_EXP) && dig_expt < 0 && + (ch == (duk_small_int_t) 'e' || ch == (duk_small_int_t) 'E')) { /* Note: we don't parse back exponent notation for anything else * than radix 10, so this is not an ambiguous check (e.g. hex * exponent values may have 'e' either as a significand digit @@ -88906,7 +90251,7 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i } else if (ch >= (duk_small_int_t) 'A' && ch <= (duk_small_int_t) 'Z') { dig = (duk_small_int_t) (ch - (duk_small_int_t) 'A' + 0x0a); } else { - dig = 255; /* triggers garbage digit check below */ + dig = 255; /* triggers garbage digit check below */ } DUK_ASSERT((dig >= 0 && dig <= 35) || dig == 255); @@ -89039,14 +90384,14 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i if (expt_neg) { expt = -expt; } - DUK_DDD(DUK_DDDPRINT("expt=%ld, expt_adj=%ld, net exponent -> %ld", - (long) expt, (long) expt_adj, (long) (expt + expt_adj))); + DUK_DDD( + DUK_DDDPRINT("expt=%ld, expt_adj=%ld, net exponent -> %ld", (long) expt, (long) expt_adj, (long) (expt + expt_adj))); expt += expt_adj; /* Fast path check. */ - if (nc_ctx->f.n <= 1 && /* 32-bit value */ - expt == 0 /* no net exponent */) { + if (nc_ctx->f.n <= 1 && /* 32-bit value */ + expt == 0 /* no net exponent */) { /* Fast path is triggered for no exponent and also for balanced exponent * and fraction parts, e.g. for "1.23e2" == "123". Remember to respect * zero sign. @@ -89088,7 +90433,6 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i goto negcheck_and_ret; } - /* Quick reject of too large or too small exponents. This check * would be incorrect for zero (e.g. "0e1000" is zero, not Infinity) * so zero check must be above. @@ -89121,7 +90465,7 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i * An extra digit is generated for rounding. */ - duk__dragon4_prepare(nc_ctx); /* setup many variables in nc_ctx */ + duk__dragon4_prepare(nc_ctx); /* setup many variables in nc_ctx */ DUK_DDD(DUK_DDDPRINT("after prepare:")); DUK__BI_PRINT("r", &nc_ctx->r); @@ -89153,7 +90497,7 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i duk__dragon4_ctx_to_double(nc_ctx, &res); goto negcheck_and_ret; - negcheck_and_ret: +negcheck_and_ret: if (neg) { res = -res; } @@ -89162,13 +90506,13 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_parse_raw(duk_hthread *thr, duk_small_i DUK_DDD(DUK_DDDPRINT("result: %!T", (duk_tval *) duk_get_tval(thr, -1))); return; - parse_fail: +parse_fail: DUK_DDD(DUK_DDDPRINT("parse failed")); duk_pop(thr); duk_push_nan(thr); return; - parse_explimit_error: +parse_explimit_error: DUK_DDD(DUK_DDDPRINT("parse failed, internal error, can't return a value")); DUK_ERROR_RANGE(thr, "exponent too large"); DUK_WO_NORETURN(return;); @@ -89221,8 +90565,7 @@ DUK_INTERNAL void duk_numconv_parse(duk_hthread *thr, duk_small_int_t radix, duk #define DUK__RE_INITIAL_BUFSIZE 64 -#define DUK__RE_BUFLEN(re_ctx) \ - DUK_BW_GET_SIZE(re_ctx->thr, &re_ctx->bw) +#define DUK__RE_BUFLEN(re_ctx) DUK_BW_GET_SIZE(re_ctx->thr, &re_ctx->bw) /* * Disjunction struct: result of parsing a disjunction @@ -89312,7 +90655,7 @@ DUK_LOCAL void duk__append_reop(duk_re_compiler_ctx *re_ctx, duk_uint32_t reop) (void) duk__append_7bit(re_ctx, reop); } -#if 0 /* unused */ +#if 0 /* unused */ DUK_LOCAL void duk__append_i32(duk_re_compiler_ctx *re_ctx, duk_int32_t x) { duk__append_u32(re_ctx, duk__encode_i32(x)); } @@ -89326,7 +90669,10 @@ DUK_LOCAL void duk__append_u16_list(duk_re_compiler_ctx *re_ctx, const duk_uint1 } } -DUK_LOCAL void duk__insert_slice(duk_re_compiler_ctx *re_ctx, duk_uint32_t offset, duk_uint32_t data_offset, duk_uint32_t data_length) { +DUK_LOCAL void duk__insert_slice(duk_re_compiler_ctx *re_ctx, + duk_uint32_t offset, + duk_uint32_t data_offset, + duk_uint32_t data_length) { DUK_BW_INSERT_ENSURE_SLICE(re_ctx->thr, &re_ctx->bw, offset, data_offset, data_length); } @@ -89389,7 +90735,7 @@ DUK_LOCAL duk_uint32_t duk__insert_jump_offset(duk_re_compiler_ctx *re_ctx, duk_ skip--; } } -#else /* DUK_USE_PREFER_SIZE */ +#else /* DUK_USE_PREFER_SIZE */ /* Closed form solution, this produces fastest code. * See re_neg_jump_offset (closed1). */ @@ -89410,7 +90756,7 @@ DUK_LOCAL duk_uint32_t duk__insert_jump_offset(duk_re_compiler_ctx *re_ctx, duk_ skip -= 7; } } -#endif /* DUK_USE_PREFER_SIZE */ +#endif /* DUK_USE_PREFER_SIZE */ return duk__insert_i32(re_ctx, offset, skip); } @@ -89543,10 +90889,10 @@ DUK_LOCAL duk_codepoint_t duk__re_canon_next_discontinuity(duk_codepoint_t start } } } - DUK_ASSERT(blk == end_blk + 1); /* Reached end block which is continuous. */ + DUK_ASSERT(blk == end_blk + 1); /* Reached end block which is continuous. */ return end; } -#else /* DUK_USE_REGEXP_CANON_BITMAP */ +#else /* DUK_USE_REGEXP_CANON_BITMAP */ DUK_LOCAL duk_codepoint_t duk__re_canon_next_discontinuity(duk_codepoint_t start, duk_codepoint_t end) { DUK_ASSERT(start >= 0); DUK_ASSERT(end >= 0); @@ -89557,7 +90903,7 @@ DUK_LOCAL duk_codepoint_t duk__re_canon_next_discontinuity(duk_codepoint_t start } return start; } -#endif /* DUK_USE_REGEXP_CANON_BITMAP */ +#endif /* DUK_USE_REGEXP_CANON_BITMAP */ DUK_LOCAL void duk__regexp_generate_ranges(void *userdata, duk_codepoint_t r1, duk_codepoint_t r2, duk_bool_t direct) { duk_re_compiler_ctx *re_ctx = (duk_re_compiler_ctx *) userdata; @@ -89568,9 +90914,12 @@ DUK_LOCAL void duk__regexp_generate_ranges(void *userdata, duk_codepoint_t r1, d duk_codepoint_t r_disc; DUK_DD(DUK_DDPRINT("duk__regexp_generate_ranges(): re_ctx=%p, range=[%ld,%ld] direct=%ld", - (void *) re_ctx, (long) r1, (long) r2, (long) direct)); + (void *) re_ctx, + (long) r1, + (long) r2, + (long) direct)); - DUK_ASSERT(r2 >= r1); /* SyntaxError for out of order range. */ + DUK_ASSERT(r2 >= r1); /* SyntaxError for out of order range. */ if (direct || (re_ctx->re_flags & DUK_RE_FLAG_IGNORE_CASE) == 0) { DUK_DD(DUK_DDPRINT("direct or not case sensitive, emit range: [%ld,%ld]", (long) r1, (long) r2)); @@ -89592,7 +90941,7 @@ DUK_LOCAL void duk__regexp_generate_ranges(void *userdata, duk_codepoint_t r1, d DUK_ASSERT(r_disc >= i); DUK_ASSERT(r_disc <= r2); - r_end += r_disc - i; /* May be zero. */ + r_end += r_disc - i; /* May be zero. */ t = duk_unicode_re_canonicalize_char(re_ctx->thr, r_disc); if (t == r_end + 1) { /* Not actually a discontinuity, continue range @@ -89604,11 +90953,11 @@ DUK_LOCAL void duk__regexp_generate_ranges(void *userdata, duk_codepoint_t r1, d r_start = t; r_end = t; } - i = r_disc + 1; /* Guarantees progress. */ + i = r_disc + 1; /* Guarantees progress. */ } duk__regexp_emit_range(re_ctx, r_start, r_end); -#if 0 /* Exhaustive search, very slow. */ +#if 0 /* Exhaustive search, very slow. */ r_start = duk_unicode_re_canonicalize_char(re_ctx->thr, r1); r_end = r_start; for (i = r1 + 1; i <= r2; i++) { @@ -89681,18 +91030,17 @@ DUK_LOCAL void duk__regexp_generate_ranges(void *userdata, duk_codepoint_t r1, d * as complex though. */ -DUK_LOCAL const duk_uint16_t * const duk__re_range_lookup1[3] = { - duk_unicode_re_ranges_digit, - duk_unicode_re_ranges_white, - duk_unicode_re_ranges_wordchar -}; -DUK_LOCAL const duk_uint8_t duk__re_range_lookup2[3] = { - sizeof(duk_unicode_re_ranges_digit) / (2 * sizeof(duk_uint16_t)), - sizeof(duk_unicode_re_ranges_white) / (2 * sizeof(duk_uint16_t)), - sizeof(duk_unicode_re_ranges_wordchar) / (2 * sizeof(duk_uint16_t)) -}; +DUK_LOCAL const duk_uint16_t * const duk__re_range_lookup1[3] = { duk_unicode_re_ranges_digit, + duk_unicode_re_ranges_white, + duk_unicode_re_ranges_wordchar }; +DUK_LOCAL const duk_uint8_t duk__re_range_lookup2[3] = { sizeof(duk_unicode_re_ranges_digit) / (2 * sizeof(duk_uint16_t)), + sizeof(duk_unicode_re_ranges_white) / (2 * sizeof(duk_uint16_t)), + sizeof(duk_unicode_re_ranges_wordchar) / (2 * sizeof(duk_uint16_t)) }; -DUK_LOCAL void duk__append_range_atom_matcher(duk_re_compiler_ctx *re_ctx, duk_small_uint_t re_op, const duk_uint16_t *ranges, duk_small_uint_t count) { +DUK_LOCAL void duk__append_range_atom_matcher(duk_re_compiler_ctx *re_ctx, + duk_small_uint_t re_op, + const duk_uint16_t *ranges, + duk_small_uint_t count) { #if 0 DUK_ASSERT(re_op <= 0x7fUL); DUK_ASSERT(count <= 0x7fUL); @@ -89704,13 +91052,13 @@ DUK_LOCAL void duk__append_range_atom_matcher(duk_re_compiler_ctx *re_ctx, duk_s } DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t expect_eof, duk__re_disjunction_info *out_atom_info) { - duk_int32_t atom_start_offset = -1; /* negative -> no atom matched on previous round */ - duk_int32_t atom_char_length = 0; /* negative -> complex atom */ - duk_uint32_t atom_start_captures = re_ctx->captures; /* value of re_ctx->captures at start of atom */ + duk_int32_t atom_start_offset = -1; /* negative -> no atom matched on previous round */ + duk_int32_t atom_char_length = 0; /* negative -> complex atom */ + duk_uint32_t atom_start_captures = re_ctx->captures; /* value of re_ctx->captures at start of atom */ duk_int32_t unpatched_disjunction_split = -1; duk_int32_t unpatched_disjunction_jump = -1; duk_uint32_t entry_offset = (duk_uint32_t) DUK__RE_BUFLEN(re_ctx); - duk_int32_t res_charlen = 0; /* -1 if disjunction is complex, char length if simple */ + duk_int32_t res_charlen = 0; /* -1 if disjunction is complex, char length if simple */ duk__re_disjunction_info tmp_disj; DUK_ASSERT(out_atom_info != NULL); @@ -89733,19 +91081,19 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex * new_atom_char_length etc are for the atom parsed on this round; * they're written to atom_char_length etc at the end of the round. */ - duk_int32_t new_atom_char_length; /* char length of the atom parsed in this loop */ - duk_int32_t new_atom_start_offset; /* bytecode start offset of the atom parsed in this loop - * (allows quantifiers to copy the atom bytecode) - */ - duk_uint32_t new_atom_start_captures; /* re_ctx->captures at the start of the atom parsed in this loop */ + duk_int32_t new_atom_char_length; /* char length of the atom parsed in this loop */ + duk_int32_t new_atom_start_offset; /* bytecode start offset of the atom parsed in this loop + * (allows quantifiers to copy the atom bytecode) + */ + duk_uint32_t new_atom_start_captures; /* re_ctx->captures at the start of the atom parsed in this loop */ duk_lexer_parse_re_token(&re_ctx->lex, &re_ctx->curr_token); - DUK_DD(DUK_DDPRINT("re token: %ld (num=%ld, char=%c)", - (long) re_ctx->curr_token.t, - (long) re_ctx->curr_token.num, - (re_ctx->curr_token.num >= 0x20 && re_ctx->curr_token.num <= 0x7e) ? - (int) re_ctx->curr_token.num : (int) '?')); + DUK_DD(DUK_DDPRINT( + "re token: %ld (num=%ld, char=%c)", + (long) re_ctx->curr_token.t, + (long) re_ctx->curr_token.num, + (re_ctx->curr_token.num >= 0x20 && re_ctx->curr_token.num <= 0x7e) ? (int) re_ctx->curr_token.num : (int) '?')); /* set by atom case clauses */ new_atom_start_offset = -1; @@ -89766,9 +91114,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex DUK_ASSERT(unpatched_disjunction_split >= 0); offset = (duk_uint32_t) unpatched_disjunction_jump; - offset += duk__insert_jump_offset(re_ctx, - offset, - (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - offset)); + offset += duk__insert_jump_offset(re_ctx, offset, (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - offset)); /* offset is now target of the pending split (right after jump) */ duk__insert_jump_offset(re_ctx, (duk_uint32_t) unpatched_disjunction_split, @@ -89776,10 +91122,8 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex } /* add a new pending split to the beginning of the entire disjunction */ - (void) duk__insert_u32(re_ctx, - entry_offset, - DUK_REOP_SPLIT1); /* prefer direct execution */ - unpatched_disjunction_split = (duk_int32_t) (entry_offset + 1); /* +1 for opcode */ + (void) duk__insert_u32(re_ctx, entry_offset, DUK_REOP_SPLIT1); /* prefer direct execution */ + unpatched_disjunction_split = (duk_int32_t) (entry_offset + 1); /* +1 for opcode */ /* add a new pending match jump for latest finished alternative */ duk__append_reop(re_ctx, DUK_REOP_JUMP); @@ -89827,7 +91171,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex } } - duk__append_reop(re_ctx, DUK_REOP_MATCH); /* complete 'sub atom' */ + duk__append_reop(re_ctx, DUK_REOP_MATCH); /* complete 'sub atom' */ atom_code_length = (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - (duk_size_t) atom_start_offset); offset = (duk_uint32_t) atom_start_offset; @@ -89843,7 +91187,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex offset += duk__insert_u32(re_ctx, offset, qmax); offset += duk__insert_jump_offset(re_ctx, offset, atom_code_length); } - DUK_UNREF(offset); /* silence scan-build warning */ + DUK_UNREF(offset); /* silence scan-build warning */ } else { /* * Complex atom @@ -89861,8 +91205,8 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex duk_uint32_t tmp_qmin, tmp_qmax; /* pre-check how many atom copies we're willing to make (atom_copies not needed below) */ - atom_copies = (re_ctx->curr_token.qmax == DUK_RE_QUANTIFIER_INFINITE) ? - re_ctx->curr_token.qmin : re_ctx->curr_token.qmax; + atom_copies = (re_ctx->curr_token.qmax == DUK_RE_QUANTIFIER_INFINITE) ? re_ctx->curr_token.qmin : + re_ctx->curr_token.qmax; if (atom_copies > DUK_RE_MAX_ATOM_COPIES) { DUK_ERROR_RANGE(re_ctx->thr, DUK_STR_QUANTIFIER_TOO_MANY_COPIES); DUK_WO_NORETURN(return;); @@ -89873,15 +91217,19 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex if (atom_start_captures != re_ctx->captures) { DUK_ASSERT(atom_start_captures < re_ctx->captures); DUK_DDD(DUK_DDDPRINT("must wipe ]atom_start_captures,re_ctx->captures]: ]%ld,%ld]", - (long) atom_start_captures, (long) re_ctx->captures)); + (long) atom_start_captures, + (long) re_ctx->captures)); /* insert (DUK_REOP_WIPERANGE, start, count) in reverse order so the order ends up right */ - duk__insert_u32(re_ctx, (duk_uint32_t) atom_start_offset, (re_ctx->captures - atom_start_captures) * 2U); + duk__insert_u32(re_ctx, + (duk_uint32_t) atom_start_offset, + (re_ctx->captures - atom_start_captures) * 2U); duk__insert_u32(re_ctx, (duk_uint32_t) atom_start_offset, (atom_start_captures + 1) * 2); duk__insert_u32(re_ctx, (duk_uint32_t) atom_start_offset, DUK_REOP_WIPERANGE); } else { - DUK_DDD(DUK_DDDPRINT("no need to wipe captures: atom_start_captures == re_ctx->captures == %ld", - (long) atom_start_captures)); + DUK_DDD( + DUK_DDDPRINT("no need to wipe captures: atom_start_captures == re_ctx->captures == %ld", + (long) atom_start_captures)); } atom_code_length = (duk_int32_t) DUK__RE_BUFLEN(re_ctx) - atom_start_offset; @@ -89890,7 +91238,9 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex tmp_qmin = re_ctx->curr_token.qmin; tmp_qmax = re_ctx->curr_token.qmax; while (tmp_qmin > 0) { - duk__append_slice(re_ctx, (duk_uint32_t) atom_start_offset, (duk_uint32_t) atom_code_length); + duk__append_slice(re_ctx, + (duk_uint32_t) atom_start_offset, + (duk_uint32_t) atom_code_length); tmp_qmin--; if (tmp_qmax != DUK_RE_QUANTIFIER_INFINITE) { tmp_qmax--; @@ -89908,14 +91258,16 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex */ duk__append_reop(re_ctx, DUK_REOP_JUMP); duk__append_jump_offset(re_ctx, atom_code_length); - duk__append_slice(re_ctx, (duk_uint32_t) atom_start_offset, (duk_uint32_t) atom_code_length); + duk__append_slice(re_ctx, + (duk_uint32_t) atom_start_offset, + (duk_uint32_t) atom_code_length); } if (re_ctx->curr_token.greedy) { - duk__append_reop(re_ctx, DUK_REOP_SPLIT2); /* prefer jump */ + duk__append_reop(re_ctx, DUK_REOP_SPLIT2); /* prefer jump */ } else { - duk__append_reop(re_ctx, DUK_REOP_SPLIT1); /* prefer direct */ + duk__append_reop(re_ctx, DUK_REOP_SPLIT1); /* prefer direct */ } - duk__append_jump_offset(re_ctx, -atom_code_length - 1); /* -1 for opcode */ + duk__append_jump_offset(re_ctx, -atom_code_length - 1); /* -1 for opcode */ } else { /* * The remaining matches are emitted as sequence of SPLITs and atom @@ -89935,14 +91287,17 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex */ duk_uint32_t offset = (duk_uint32_t) DUK__RE_BUFLEN(re_ctx); while (tmp_qmax > 0) { - duk__insert_slice(re_ctx, offset, (duk_uint32_t) atom_start_offset, (duk_uint32_t) atom_code_length); + duk__insert_slice(re_ctx, + offset, + (duk_uint32_t) atom_start_offset, + (duk_uint32_t) atom_code_length); if (re_ctx->curr_token.greedy) { - duk__insert_u32(re_ctx, offset, DUK_REOP_SPLIT1); /* prefer direct */ + duk__insert_u32(re_ctx, offset, DUK_REOP_SPLIT1); /* prefer direct */ } else { - duk__insert_u32(re_ctx, offset, DUK_REOP_SPLIT2); /* prefer jump */ + duk__insert_u32(re_ctx, offset, DUK_REOP_SPLIT2); /* prefer jump */ } duk__insert_jump_offset(re_ctx, - offset + 1, /* +1 for opcode */ + offset + 1, /* +1 for opcode */ (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - (offset + 1))); tmp_qmax--; } @@ -89975,8 +91330,8 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex case DUK_RETOK_ASSERT_START_POS_LOOKAHEAD: case DUK_RETOK_ASSERT_START_NEG_LOOKAHEAD: { duk_uint32_t offset; - duk_uint32_t opcode = (re_ctx->curr_token.t == DUK_RETOK_ASSERT_START_POS_LOOKAHEAD) ? - DUK_REOP_LOOKPOS : DUK_REOP_LOOKNEG; + duk_uint32_t opcode = + (re_ctx->curr_token.t == DUK_RETOK_ASSERT_START_POS_LOOKAHEAD) ? DUK_REOP_LOOKPOS : DUK_REOP_LOOKNEG; offset = (duk_uint32_t) DUK__RE_BUFLEN(re_ctx); duk__parse_disjunction(re_ctx, 0, &tmp_disj); @@ -89984,7 +91339,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex (void) duk__insert_u32(re_ctx, offset, opcode); (void) duk__insert_jump_offset(re_ctx, - offset + 1, /* +1 for opcode */ + offset + 1, /* +1 for opcode */ (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - (offset + 1))); /* 'taint' result as complex -- this is conservative, @@ -90045,7 +91400,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex DUK_ASSERT(DUK_RETOK_ATOM_WHITE == DUK_RETOK_ATOM_DIGIT + 2); DUK_ASSERT(DUK_RETOK_ATOM_WORD_CHAR == DUK_RETOK_ATOM_DIGIT + 4); idx = (duk_small_uint_t) ((re_ctx->curr_token.t - DUK_RETOK_ATOM_DIGIT) >> 1U); - DUK_ASSERT(idx <= 2U); /* Assume continuous token numbers; also checks negative underflow. */ + DUK_ASSERT(idx <= 2U); /* Assume continuous token numbers; also checks negative underflow. */ duk__append_range_atom_matcher(re_ctx, re_op, duk__re_range_lookup1[idx], duk__re_range_lookup2[idx]); break; @@ -90055,7 +91410,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex if (backref > re_ctx->highest_backref) { re_ctx->highest_backref = backref; } - new_atom_char_length = -1; /* mark as complex */ + new_atom_char_length = -1; /* mark as complex */ new_atom_start_offset = (duk_int32_t) DUK__RE_BUFLEN(re_ctx); duk__append_reop(re_ctx, DUK_REOP_BACKREFERENCE); duk__append_u32(re_ctx, backref); @@ -90064,12 +91419,14 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex case DUK_RETOK_ATOM_START_CAPTURE_GROUP: { duk_uint32_t cap; - new_atom_char_length = -1; /* mark as complex (capture handling) */ + new_atom_char_length = -1; /* mark as complex (capture handling) */ new_atom_start_offset = (duk_int32_t) DUK__RE_BUFLEN(re_ctx); cap = ++re_ctx->captures; duk__append_reop(re_ctx, DUK_REOP_SAVE); duk__append_u32(re_ctx, cap * 2); - duk__parse_disjunction(re_ctx, 0, &tmp_disj); /* retval (sub-atom char length) unused, tainted as complex above */ + duk__parse_disjunction(re_ctx, + 0, + &tmp_disj); /* retval (sub-atom char length) unused, tainted as complex above */ duk__append_reop(re_ctx, DUK_REOP_SAVE); duk__append_u32(re_ctx, cap * 2 + 1); break; @@ -90114,12 +91471,12 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex new_atom_char_length = 1; new_atom_start_offset = (duk_int32_t) DUK__RE_BUFLEN(re_ctx); duk__append_reop(re_ctx, - (re_ctx->curr_token.t == DUK_RETOK_ATOM_START_CHARCLASS) ? - DUK_REOP_RANGES : DUK_REOP_INVRANGES); - offset = (duk_uint32_t) DUK__RE_BUFLEN(re_ctx); /* patch in range count later */ + (re_ctx->curr_token.t == DUK_RETOK_ATOM_START_CHARCLASS) ? DUK_REOP_RANGES : + DUK_REOP_INVRANGES); + offset = (duk_uint32_t) DUK__RE_BUFLEN(re_ctx); /* patch in range count later */ /* parse ranges until character class ends */ - re_ctx->nranges = 0; /* note: ctx-wide temporary */ + re_ctx->nranges = 0; /* note: ctx-wide temporary */ duk_lexer_parse_re_ranges(&re_ctx->lex, duk__regexp_generate_ranges, (void *) re_ctx); /* insert range count */ @@ -90162,7 +91519,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex atom_start_captures = new_atom_start_captures; } - done: +done: /* finish up pending jump and split for last alternative */ if (unpatched_disjunction_jump >= 0) { @@ -90170,9 +91527,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex DUK_ASSERT(unpatched_disjunction_split >= 0); offset = (duk_uint32_t) unpatched_disjunction_jump; - offset += duk__insert_jump_offset(re_ctx, - offset, - (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - offset)); + offset += duk__insert_jump_offset(re_ctx, offset, (duk_int32_t) (DUK__RE_BUFLEN(re_ctx) - offset)); /* offset is now target of the pending split (right after jump) */ duk__insert_jump_offset(re_ctx, (duk_uint32_t) unpatched_disjunction_split, @@ -90183,8 +91538,7 @@ DUK_LOCAL void duk__parse_disjunction(duk_re_compiler_ctx *re_ctx, duk_bool_t ex out_atom_info->end_captures = re_ctx->captures; #endif out_atom_info->charlen = res_charlen; - DUK_DDD(DUK_DDDPRINT("parse disjunction finished: charlen=%ld", - (long) out_atom_info->charlen)); + DUK_DDD(DUK_DDDPRINT("parse disjunction finished: charlen=%ld", (long) out_atom_info->charlen)); re_ctx->recursion_depth--; } @@ -90235,7 +91589,7 @@ DUK_LOCAL duk_uint32_t duk__parse_regexp_flags(duk_hthread *thr, duk_hstring *h) return flags; - flags_error: +flags_error: DUK_ERROR_SYNTAX(thr, DUK_STR_INVALID_REGEXP_FLAGS); DUK_WO_NORETURN(return 0U;); } @@ -90301,7 +91655,7 @@ DUK_LOCAL void duk__create_escaped_source(duk_hthread *thr, int idx_pattern) { } DUK_BW_SETPTR_AND_COMPACT(thr, bw, q); - (void) duk_buffer_to_string(thr, -1); /* Safe if input is safe. */ + (void) duk_buffer_to_string(thr, -1); /* Safe if input is safe. */ /* [ ... escaped_source ] */ } @@ -90355,7 +91709,7 @@ DUK_INTERNAL void duk_regexp_compile(duk_hthread *thr) { /* [ ... pattern flags escaped_source buffer ] */ duk_memzero(&re_ctx, sizeof(re_ctx)); - DUK_LEXER_INITCTX(&re_ctx.lex); /* duplicate zeroing, expect for (possible) NULL inits */ + DUK_LEXER_INITCTX(&re_ctx.lex); /* duplicate zeroing, expect for (possible) NULL inits */ re_ctx.thr = thr; re_ctx.lex.thr = thr; re_ctx.lex.input = DUK_HSTRING_GET_DATA(h_pattern); @@ -90367,13 +91721,14 @@ DUK_INTERNAL void duk_regexp_compile(duk_hthread *thr) { DUK_BW_INIT_PUSHBUF(thr, &re_ctx.bw, DUK__RE_INITIAL_BUFSIZE); DUK_DD(DUK_DDPRINT("regexp compiler ctx initialized, flags=0x%08lx, recursion_limit=%ld", - (unsigned long) re_ctx.re_flags, (long) re_ctx.recursion_limit)); + (unsigned long) re_ctx.re_flags, + (long) re_ctx.recursion_limit)); /* * Init lexer */ - lex_point.offset = 0; /* expensive init, just want to fill window */ + lex_point.offset = 0; /* expensive init, just want to fill window */ lex_point.line = 1; DUK_LEXER_SETPOINT(&re_ctx.lex, &lex_point); @@ -90415,7 +91770,7 @@ DUK_INTERNAL void duk_regexp_compile(duk_hthread *thr) { /* [ ... pattern flags escaped_source buffer ] */ DUK_BW_COMPACT(thr, &re_ctx.bw); - (void) duk_buffer_to_string(thr, -1); /* Safe because flags is at most 7 bit. */ + (void) duk_buffer_to_string(thr, -1); /* Safe because flags is at most 7 bit. */ /* [ ... pattern flags escaped_source bytecode ] */ @@ -90423,11 +91778,12 @@ DUK_INTERNAL void duk_regexp_compile(duk_hthread *thr) { * Finalize stack */ - duk_remove(thr, -4); /* -> [ ... flags escaped_source bytecode ] */ - duk_remove(thr, -3); /* -> [ ... escaped_source bytecode ] */ + duk_remove(thr, -4); /* -> [ ... flags escaped_source bytecode ] */ + duk_remove(thr, -3); /* -> [ ... escaped_source bytecode ] */ DUK_DD(DUK_DDPRINT("regexp compilation successful, bytecode: %!T, escaped source: %!T", - (duk_tval *) duk_get_tval(thr, -1), (duk_tval *) duk_get_tval(thr, -2))); + (duk_tval *) duk_get_tval(thr, -1), + (duk_tval *) duk_get_tval(thr, -2))); } /* @@ -90473,11 +91829,11 @@ DUK_INTERNAL void duk_regexp_create_instance(duk_hthread *thr) { /* [ ... regexp_object ] */ } -#else /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ /* regexp support disabled */ -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* automatic undefs */ #undef DUK__RE_BUFLEN @@ -90525,7 +91881,11 @@ DUK_LOCAL duk_int32_t duk__bc_get_i32(duk_re_matcher_ctx *re_ctx, const duk_uint } } -DUK_LOCAL const duk_uint8_t *duk__utf8_backtrack(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end, duk_uint_fast32_t count) { +DUK_LOCAL const duk_uint8_t *duk__utf8_backtrack(duk_hthread *thr, + const duk_uint8_t **ptr, + const duk_uint8_t *ptr_start, + const duk_uint8_t *ptr_end, + duk_uint_fast32_t count) { const duk_uint8_t *p; /* Note: allow backtracking from p == ptr_end */ @@ -90550,12 +91910,16 @@ DUK_LOCAL const duk_uint8_t *duk__utf8_backtrack(duk_hthread *thr, const duk_uin *ptr = p; return p; - fail: +fail: DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return NULL;); } -DUK_LOCAL const duk_uint8_t *duk__utf8_advance(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end, duk_uint_fast32_t count) { +DUK_LOCAL const duk_uint8_t *duk__utf8_advance(duk_hthread *thr, + const duk_uint8_t **ptr, + const duk_uint8_t *ptr_start, + const duk_uint8_t *ptr_end, + duk_uint_fast32_t count) { const duk_uint8_t *p; p = *ptr; @@ -90581,7 +91945,7 @@ DUK_LOCAL const duk_uint8_t *duk__utf8_advance(duk_hthread *thr, const duk_uint8 *ptr = p; return p; - fail: +fail: DUK_ERROR_INTERNAL(thr); DUK_WO_NORETURN(return NULL;); } @@ -90685,7 +92049,7 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const c1 = (duk_codepoint_t) duk__bc_get_u32(re_ctx, &pc); DUK_ASSERT(!(re_ctx->re_flags & DUK_RE_FLAG_IGNORE_CASE) || - c1 == duk_unicode_re_canonicalize_char(re_ctx->thr, c1)); /* canonicalized by compiler */ + c1 == duk_unicode_re_canonicalize_char(re_ctx->thr, c1)); /* canonicalized by compiler */ c2 = duk__inp_get_cp(re_ctx, &sp); /* No need to check for c2 < 0 (end of input): because c1 >= 0, it * will fail the match below automatically and cause goto fail. @@ -90731,7 +92095,10 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const r1 = (duk_codepoint_t) duk__bc_get_u32(re_ctx, &pc); r2 = (duk_codepoint_t) duk__bc_get_u32(re_ctx, &pc); DUK_DDD(DUK_DDDPRINT("matching ranges/invranges, n=%ld, r1=%ld, r2=%ld, c=%ld", - (long) n, (long) r1, (long) r2, (long) c)); + (long) n, + (long) r1, + (long) r2, + (long) c)); if (c >= r1 && c <= r2) { /* Note: don't bail out early, we must read all the ranges from * bytecode. Another option is to skip them efficiently after @@ -90800,16 +92167,16 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const duk_small_int_t w1, w2; if (sp <= re_ctx->input) { - w1 = 0; /* not a wordchar */ + w1 = 0; /* not a wordchar */ } else { duk_codepoint_t c; c = duk__inp_get_prev_cp(re_ctx, sp); w1 = duk_unicode_re_is_wordchar(c); } if (sp >= re_ctx->input_end) { - w2 = 0; /* not a wordchar */ + w2 = 0; /* not a wordchar */ } else { - const duk_uint8_t *tmp_sp = sp; /* dummy so sp won't get updated */ + const duk_uint8_t *tmp_sp = sp; /* dummy so sp won't get updated */ duk_codepoint_t c; c = duk__inp_get_cp(re_ctx, &tmp_sp); w2 = duk_unicode_re_is_wordchar(c); @@ -90870,7 +92237,9 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const qmax = duk__bc_get_u32(re_ctx, &pc); skip = duk__bc_get_i32(re_ctx, &pc); DUK_DDD(DUK_DDDPRINT("minimal quantifier, qmin=%lu, qmax=%lu, skip=%ld", - (unsigned long) qmin, (unsigned long) qmax, (long) skip)); + (unsigned long) qmin, + (unsigned long) qmax, + (long) skip)); q = 0; while (q <= qmax) { @@ -90900,7 +92269,10 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const atomlen = duk__bc_get_u32(re_ctx, &pc); skip = duk__bc_get_i32(re_ctx, &pc); DUK_DDD(DUK_DDDPRINT("greedy quantifier, qmin=%lu, qmax=%lu, atomlen=%lu, skip=%ld", - (unsigned long) qmin, (unsigned long) qmax, (unsigned long) atomlen, (long) skip)); + (unsigned long) qmin, + (unsigned long) qmax, + (unsigned long) atomlen, + (long) skip)); q = 0; while (q < qmax) { @@ -90926,8 +92298,7 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const * do not allow captures in their atom now, so this is not an issue. */ - DUK_DDD(DUK_DDDPRINT("greedy quantifier, backtrack %ld characters (atomlen)", - (long) atomlen)); + DUK_DDD(DUK_DDDPRINT("greedy quantifier, backtrack %ld characters (atomlen)", (long) atomlen)); sp = duk__inp_backtrack(re_ctx, &sp, (duk_uint_fast32_t) atomlen); q--; } @@ -90973,20 +92344,23 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const idx_start = duk__bc_get_u32(re_ctx, &pc); idx_count = duk__bc_get_u32(re_ctx, &pc); DUK_DDD(DUK_DDDPRINT("wipe saved range: start=%ld, count=%ld -> [%ld,%ld] (captures [%ld,%ld])", - (long) idx_start, (long) idx_count, - (long) idx_start, (long) (idx_start + idx_count - 1), - (long) (idx_start / 2), (long) ((idx_start + idx_count - 1) / 2))); + (long) idx_start, + (long) idx_count, + (long) idx_start, + (long) (idx_start + idx_count - 1), + (long) (idx_start / 2), + (long) ((idx_start + idx_count - 1) / 2))); if (idx_start + idx_count > re_ctx->nsaved || idx_count == 0) { /* idx is unsigned, < 0 check is not necessary */ DUK_D(DUK_DPRINT("internal error, regexp wipe indices insane: idx_start=%ld, idx_count=%ld", - (long) idx_start, (long) idx_count)); + (long) idx_start, + (long) idx_count)); goto internal_error; } DUK_ASSERT(idx_count > 0); duk_require_stack(re_ctx->thr, 1); - range_save = (duk_uint8_t **) duk_push_fixed_buffer_nozero(re_ctx->thr, - sizeof(duk_uint8_t *) * idx_count); + range_save = (duk_uint8_t **) duk_push_fixed_buffer_nozero(re_ctx->thr, sizeof(duk_uint8_t *) * idx_count); DUK_ASSERT(range_save != NULL); duk_memcpy(range_save, re_ctx->saved + idx_start, sizeof(duk_uint8_t *) * idx_count); #if defined(DUK_USE_EXPLICIT_NULL_INIT) @@ -91002,8 +92376,10 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const if (sub_sp) { /* match: keep wiped/resaved values */ DUK_DDD(DUK_DDDPRINT("match: keep wiped/resaved values [%ld,%ld] (captures [%ld,%ld])", - (long) idx_start, (long) (idx_start + idx_count - 1), - (long) (idx_start / 2), (long) ((idx_start + idx_count - 1) / 2))); + (long) idx_start, + (long) (idx_start + idx_count - 1), + (long) (idx_start / 2), + (long) ((idx_start + idx_count - 1) / 2))); duk_pop_unsafe(re_ctx->thr); sp = sub_sp; goto match; @@ -91011,8 +92387,10 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const /* fail: restore saves */ DUK_DDD(DUK_DDDPRINT("fail: restore wiped/resaved values [%ld,%ld] (captures [%ld,%ld])", - (long) idx_start, (long) (idx_start + idx_count - 1), - (long) (idx_start / 2), (long) ((idx_start + idx_count - 1) / 2))); + (long) idx_start, + (long) (idx_start + idx_count - 1), + (long) (idx_start / 2), + (long) ((idx_start + idx_count - 1) / 2))); duk_memcpy((void *) (re_ctx->saved + idx_start), (const void *) range_save, sizeof(duk_uint8_t *) * idx_count); @@ -91042,8 +92420,8 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const DUK_ASSERT(re_ctx->nsaved > 0); duk_require_stack(re_ctx->thr, 1); - full_save = (duk_uint8_t **) duk_push_fixed_buffer_nozero(re_ctx->thr, - sizeof(duk_uint8_t *) * re_ctx->nsaved); + full_save = + (duk_uint8_t **) duk_push_fixed_buffer_nozero(re_ctx->thr, sizeof(duk_uint8_t *) * re_ctx->nsaved); DUK_ASSERT(full_save != NULL); duk_memcpy(full_save, re_ctx->saved, sizeof(duk_uint8_t *) * re_ctx->nsaved); @@ -91068,11 +92446,9 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const /* fall through */ - lookahead_fail: + lookahead_fail: /* fail: restore saves */ - duk_memcpy((void *) re_ctx->saved, - (const void *) full_save, - sizeof(duk_uint8_t *) * re_ctx->nsaved); + duk_memcpy((void *) re_ctx->saved, (const void *) full_save, sizeof(duk_uint8_t *) * re_ctx->nsaved); duk_pop_unsafe(re_ctx->thr); goto fail; } @@ -91095,22 +92471,23 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const const duk_uint8_t *p; idx = duk__bc_get_u32(re_ctx, &pc); - idx = idx << 1; /* backref n -> saved indices [n*2, n*2+1] */ + idx = idx << 1; /* backref n -> saved indices [n*2, n*2+1] */ if (idx < 2 || idx + 1 >= re_ctx->nsaved) { /* regexp compiler should catch these */ DUK_D(DUK_DPRINT("internal error, backreference index insane")); goto internal_error; } - if (!re_ctx->saved[idx] || !re_ctx->saved[idx+1]) { + if (!re_ctx->saved[idx] || !re_ctx->saved[idx + 1]) { /* capture is 'undefined', always matches! */ DUK_DDD(DUK_DDDPRINT("backreference: saved[%ld,%ld] not complete, always match", - (long) idx, (long) (idx + 1))); + (long) idx, + (long) (idx + 1))); break; } DUK_DDD(DUK_DDDPRINT("backreference: match saved[%ld,%ld]", (long) idx, (long) (idx + 1))); p = re_ctx->saved[idx]; - while (p < re_ctx->saved[idx+1]) { + while (p < re_ctx->saved[idx + 1]) { duk_codepoint_t c1, c2; /* Note: not necessary to check p against re_ctx->input_end: @@ -91142,15 +92519,15 @@ DUK_LOCAL const duk_uint8_t *duk__match_regexp(duk_re_matcher_ctx *re_ctx, const } } - match: +match: re_ctx->recursion_depth--; return sp; - fail: +fail: re_ctx->recursion_depth--; return NULL; - internal_error: +internal_error: DUK_ERROR_INTERNAL(re_ctx->thr); DUK_WO_NORETURN(return NULL;); } @@ -91202,8 +92579,9 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ h_input = duk_to_hstring(thr, -1); DUK_ASSERT(h_input != NULL); - duk_xget_owndataprop_stridx_short(thr, -2, DUK_STRIDX_INT_BYTECODE); /* [ ... re_obj input ] -> [ ... re_obj input bc ] */ - h_bytecode = duk_require_hstring(thr, -1); /* no regexp instance should exist without a non-configurable bytecode property */ + duk_xget_owndataprop_stridx_short(thr, -2, DUK_STRIDX_INT_BYTECODE); /* [ ... re_obj input ] -> [ ... re_obj input bc ] */ + h_bytecode = + duk_require_hstring(thr, -1); /* no regexp instance should exist without a non-configurable bytecode property */ DUK_ASSERT(h_bytecode != NULL); /* @@ -91235,13 +92613,13 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ re_ctx.nsaved = duk__bc_get_u32(&re_ctx, &pc); re_ctx.bytecode = pc; - DUK_ASSERT(DUK_RE_FLAG_GLOBAL < 0x10000UL); /* must fit into duk_small_int_t */ + DUK_ASSERT(DUK_RE_FLAG_GLOBAL < 0x10000UL); /* must fit into duk_small_int_t */ global = (duk_small_int_t) (force_global | (duk_small_int_t) (re_ctx.re_flags & DUK_RE_FLAG_GLOBAL)); DUK_ASSERT(re_ctx.nsaved >= 2); DUK_ASSERT((re_ctx.nsaved % 2) == 0); - p_buf = (duk_uint8_t *) duk_push_fixed_buffer(thr, sizeof(duk_uint8_t *) * re_ctx.nsaved); /* rely on zeroing */ + p_buf = (duk_uint8_t *) duk_push_fixed_buffer(thr, sizeof(duk_uint8_t *) * re_ctx.nsaved); /* rely on zeroing */ DUK_UNREF(p_buf); re_ctx.saved = (const duk_uint8_t **) duk_get_buffer(thr, -1, NULL); DUK_ASSERT(re_ctx.saved != NULL); @@ -91259,7 +92637,9 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ #endif DUK_DDD(DUK_DDDPRINT("regexp ctx initialized, flags=0x%08lx, nsaved=%ld, recursion_limit=%ld, steps_limit=%ld", - (unsigned long) re_ctx.re_flags, (long) re_ctx.nsaved, (long) re_ctx.recursion_limit, + (unsigned long) re_ctx.re_flags, + (long) re_ctx.nsaved, + (long) re_ctx.recursion_limit, (long) re_ctx.steps_limit)); /* @@ -91281,15 +92661,15 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ /* [ ... re_obj input bc saved_buf ] */ - duk_get_prop_stridx_short(thr, -4, DUK_STRIDX_LAST_INDEX); /* -> [ ... re_obj input bc saved_buf lastIndex ] */ - (void) duk_to_int(thr, -1); /* ToInteger(lastIndex) */ - d = duk_get_number(thr, -1); /* integer, but may be +/- Infinite, +/- zero (not NaN, though) */ + duk_get_prop_stridx_short(thr, -4, DUK_STRIDX_LAST_INDEX); /* -> [ ... re_obj input bc saved_buf lastIndex ] */ + (void) duk_to_int(thr, -1); /* ToInteger(lastIndex) */ + d = duk_get_number(thr, -1); /* integer, but may be +/- Infinite, +/- zero (not NaN, though) */ duk_pop_nodecref_unsafe(thr); if (global) { if (d < 0.0 || d > (double) DUK_HSTRING_GET_CHARLEN(h_input)) { /* match fail */ - char_offset = 0; /* not really necessary */ + char_offset = 0; /* not really necessary */ DUK_ASSERT(match == 0); goto match_over; } @@ -91325,8 +92705,10 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ DUK_ASSERT(re_ctx.recursion_depth == 0); DUK_DDD(DUK_DDDPRINT("attempt match at char offset %ld; %p [%p,%p]", - (long) char_offset, (const void *) sp, - (const void *) re_ctx.input, (const void *) re_ctx.input_end)); + (long) char_offset, + (const void *) sp, + (const void *) re_ctx.input, + (const void *) re_ctx.input_end)); /* * Note: @@ -91373,7 +92755,7 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ (void) duk__utf8_advance(thr, &sp, re_ctx.input, re_ctx.input_end, (duk_uint_fast32_t) 1); } - match_over: +match_over: /* * Matching complete, create result array or return a 'null'. Update lastIndex @@ -91399,8 +92781,8 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ DUK_DDD(DUK_DDDPRINT("regexp matches at char_offset %ld", (long) char_offset)); - DUK_ASSERT(re_ctx.nsaved >= 2); /* must have start and end */ - DUK_ASSERT((re_ctx.nsaved % 2) == 0); /* and even number */ + DUK_ASSERT(re_ctx.nsaved >= 2); /* must have start and end */ + DUK_ASSERT((re_ctx.nsaved % 2) == 0); /* and even number */ /* XXX: Array size is known before and (2 * re_ctx.nsaved) but not taken * advantage of now. The array is not compacted either, as regexp match @@ -91441,7 +92823,7 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_ * will be zero). Also assumes clen reflects the * correct char length. */ - char_end_offset = char_offset + (duk_uint32_t) duk_get_length(thr, -1); /* add charlen */ + char_end_offset = char_offset + (duk_uint32_t) duk_get_length(thr, -1); /* add charlen */ } } else { duk_push_undefined(thr); @@ -91506,11 +92888,11 @@ DUK_INTERNAL void duk_regexp_match_force_global(duk_hthread *thr) { duk__regexp_match_helper(thr, 1 /*force_global*/); } -#else /* DUK_USE_REGEXP_SUPPORT */ +#else /* DUK_USE_REGEXP_SUPPORT */ /* regexp support disabled */ -#endif /* DUK_USE_REGEXP_SUPPORT */ +#endif /* DUK_USE_REGEXP_SUPPORT */ /* * Self tests to ensure execution environment is sane. Intended to catch * compiler/platform problems which cannot be detected at compile time. @@ -91530,18 +92912,21 @@ typedef union { } duk__test_double_union; /* Self test failed. Expects a local variable 'error_count' to exist. */ -#define DUK__FAILED(msg) do { \ +#define DUK__FAILED(msg) \ + do { \ DUK_D(DUK_DPRINT("self test failed: " #msg " at " DUK_FILE_MACRO ":" DUK_MACRO_STRINGIFY(DUK_LINE_MACRO))); \ error_count++; \ } while (0) -#define DUK__DBLUNION_CMP_TRUE(a,b) do { \ +#define DUK__DBLUNION_CMP_TRUE(a, b) \ + do { \ if (duk_memcmp((const void *) (a), (const void *) (b), sizeof(duk__test_double_union)) != 0) { \ DUK__FAILED("double union compares false (expected true)"); \ } \ } while (0) -#define DUK__DBLUNION_CMP_FALSE(a,b) do { \ +#define DUK__DBLUNION_CMP_FALSE(a, b) \ + do { \ if (duk_memcmp((const void *) (a), (const void *) (b), sizeof(duk__test_double_union)) == 0) { \ DUK__FAILED("double union compares true (expected false)"); \ } \ @@ -91553,43 +92938,72 @@ typedef union { } duk__test_u32_union; #if defined(DUK_USE_INTEGER_LE) -#define DUK__U32_INIT(u, a, b, c, d) do { \ - (u)->x[0] = (d); (u)->x[1] = (c); (u)->x[2] = (b); (u)->x[3] = (a); \ +#define DUK__U32_INIT(u, a, b, c, d) \ + do { \ + (u)->x[0] = (d); \ + (u)->x[1] = (c); \ + (u)->x[2] = (b); \ + (u)->x[3] = (a); \ } while (0) #elif defined(DUK_USE_INTEGER_ME) #error integer mixed endian not supported now #elif defined(DUK_USE_INTEGER_BE) -#define DUK__U32_INIT(u, a, b, c, d) do { \ - (u)->x[0] = (a); (u)->x[1] = (b); (u)->x[2] = (c); (u)->x[3] = (d); \ +#define DUK__U32_INIT(u, a, b, c, d) \ + do { \ + (u)->x[0] = (a); \ + (u)->x[1] = (b); \ + (u)->x[2] = (c); \ + (u)->x[3] = (d); \ } while (0) #else #error unknown integer endianness #endif #if defined(DUK_USE_DOUBLE_LE) -#define DUK__DOUBLE_INIT(u, a, b, c, d, e, f, g, h) do { \ - (u)->x[0] = (h); (u)->x[1] = (g); (u)->x[2] = (f); (u)->x[3] = (e); \ - (u)->x[4] = (d); (u)->x[5] = (c); (u)->x[6] = (b); (u)->x[7] = (a); \ +#define DUK__DOUBLE_INIT(u, a, b, c, d, e, f, g, h) \ + do { \ + (u)->x[0] = (h); \ + (u)->x[1] = (g); \ + (u)->x[2] = (f); \ + (u)->x[3] = (e); \ + (u)->x[4] = (d); \ + (u)->x[5] = (c); \ + (u)->x[6] = (b); \ + (u)->x[7] = (a); \ } while (0) #define DUK__DOUBLE_COMPARE(u, a, b, c, d, e, f, g, h) \ - ((u)->x[0] == (h) && (u)->x[1] == (g) && (u)->x[2] == (f) && (u)->x[3] == (e) && \ - (u)->x[4] == (d) && (u)->x[5] == (c) && (u)->x[6] == (b) && (u)->x[7] == (a)) + ((u)->x[0] == (h) && (u)->x[1] == (g) && (u)->x[2] == (f) && (u)->x[3] == (e) && (u)->x[4] == (d) && (u)->x[5] == (c) && \ + (u)->x[6] == (b) && (u)->x[7] == (a)) #elif defined(DUK_USE_DOUBLE_ME) -#define DUK__DOUBLE_INIT(u, a, b, c, d, e, f, g, h) do { \ - (u)->x[0] = (d); (u)->x[1] = (c); (u)->x[2] = (b); (u)->x[3] = (a); \ - (u)->x[4] = (h); (u)->x[5] = (g); (u)->x[6] = (f); (u)->x[7] = (e); \ +#define DUK__DOUBLE_INIT(u, a, b, c, d, e, f, g, h) \ + do { \ + (u)->x[0] = (d); \ + (u)->x[1] = (c); \ + (u)->x[2] = (b); \ + (u)->x[3] = (a); \ + (u)->x[4] = (h); \ + (u)->x[5] = (g); \ + (u)->x[6] = (f); \ + (u)->x[7] = (e); \ } while (0) #define DUK__DOUBLE_COMPARE(u, a, b, c, d, e, f, g, h) \ - ((u)->x[0] == (d) && (u)->x[1] == (c) && (u)->x[2] == (b) && (u)->x[3] == (a) && \ - (u)->x[4] == (h) && (u)->x[5] == (g) && (u)->x[6] == (f) && (u)->x[7] == (e)) + ((u)->x[0] == (d) && (u)->x[1] == (c) && (u)->x[2] == (b) && (u)->x[3] == (a) && (u)->x[4] == (h) && (u)->x[5] == (g) && \ + (u)->x[6] == (f) && (u)->x[7] == (e)) #elif defined(DUK_USE_DOUBLE_BE) -#define DUK__DOUBLE_INIT(u, a, b, c, d, e, f, g, h) do { \ - (u)->x[0] = (a); (u)->x[1] = (b); (u)->x[2] = (c); (u)->x[3] = (d); \ - (u)->x[4] = (e); (u)->x[5] = (f); (u)->x[6] = (g); (u)->x[7] = (h); \ +#define DUK__DOUBLE_INIT(u, a, b, c, d, e, f, g, h) \ + do { \ + (u)->x[0] = (a); \ + (u)->x[1] = (b); \ + (u)->x[2] = (c); \ + (u)->x[3] = (d); \ + (u)->x[4] = (e); \ + (u)->x[5] = (f); \ + (u)->x[6] = (g); \ + (u)->x[7] = (h); \ } while (0) #define DUK__DOUBLE_COMPARE(u, a, b, c, d, e, f, g, h) \ - ((u)->x[0] == (a) && (u)->x[1] == (b) && (u)->x[2] == (c) && (u)->x[3] == (d) && \ - (u)->x[4] == (e) && (u)->x[5] == (f) && (u)->x[6] == (g) && (u)->x[7] == (h)) + ((u)->x[0] == (a) && (u)->x[1] == (b) && (u)->x[2] == (c) && (u)->x[3] == (d) && (u)->x[4] == (e) && (u)->x[5] == (f) && \ + (u)->x[6] == (g) && (u)->x[7] == (h)) #else #error unknown double endianness #endif @@ -91601,17 +93015,12 @@ typedef union { DUK_LOCAL duk_uint_t duk__selftest_types(void) { duk_uint_t error_count = 0; - if (!(sizeof(duk_int8_t) == 1 && - sizeof(duk_uint8_t) == 1 && - sizeof(duk_int16_t) == 2 && - sizeof(duk_uint16_t) == 2 && - sizeof(duk_int32_t) == 4 && - sizeof(duk_uint32_t) == 4)) { + if (!(sizeof(duk_int8_t) == 1 && sizeof(duk_uint8_t) == 1 && sizeof(duk_int16_t) == 2 && sizeof(duk_uint16_t) == 2 && + sizeof(duk_int32_t) == 4 && sizeof(duk_uint32_t) == 4)) { DUK__FAILED("duk_(u)int{8,16,32}_t size"); } #if defined(DUK_USE_64BIT_OPS) - if (!(sizeof(duk_int64_t) == 8 && - sizeof(duk_uint64_t) == 8)) { + if (!(sizeof(duk_int64_t) == 8 && sizeof(duk_uint64_t) == 8)) { DUK__FAILED("duk_(u)int64_t size"); } #endif @@ -91763,8 +93172,14 @@ DUK_LOCAL duk_uint_t duk__selftest_bswap_macros(void) { * (2.008366013071895,) */ - du.uc[0] = 0x40; du.uc[1] = 0x00; du.uc[2] = 0x11; du.uc[3] = 0x22; - du.uc[4] = 0x33; du.uc[5] = 0x44; du.uc[6] = 0x55; du.uc[7] = 0x66; + du.uc[0] = 0x40; + du.uc[1] = 0x00; + du.uc[2] = 0x11; + du.uc[3] = 0x22; + du.uc[4] = 0x33; + du.uc[5] = 0x44; + du.uc[6] = 0x55; + du.uc[7] = 0x66; DUK_DBLUNION_DOUBLE_NTOH(&du); du_diff = du.d - 2.008366013071895; #if 0 @@ -91819,20 +93234,38 @@ DUK_LOCAL duk_uint_t duk__selftest_double_aliasing(void) { */ /* little endian */ - a.x[0] = 0x11; a.x[1] = 0x22; a.x[2] = 0x33; a.x[3] = 0x44; - a.x[4] = 0x00; a.x[5] = 0x00; a.x[6] = 0xf1; a.x[7] = 0xff; + a.x[0] = 0x11; + a.x[1] = 0x22; + a.x[2] = 0x33; + a.x[3] = 0x44; + a.x[4] = 0x00; + a.x[5] = 0x00; + a.x[6] = 0xf1; + a.x[7] = 0xff; b = a; DUK__DBLUNION_CMP_TRUE(&a, &b); /* big endian */ - a.x[0] = 0xff; a.x[1] = 0xf1; a.x[2] = 0x00; a.x[3] = 0x00; - a.x[4] = 0x44; a.x[5] = 0x33; a.x[6] = 0x22; a.x[7] = 0x11; + a.x[0] = 0xff; + a.x[1] = 0xf1; + a.x[2] = 0x00; + a.x[3] = 0x00; + a.x[4] = 0x44; + a.x[5] = 0x33; + a.x[6] = 0x22; + a.x[7] = 0x11; b = a; DUK__DBLUNION_CMP_TRUE(&a, &b); /* mixed endian */ - a.x[0] = 0x00; a.x[1] = 0x00; a.x[2] = 0xf1; a.x[3] = 0xff; - a.x[4] = 0x11; a.x[5] = 0x22; a.x[6] = 0x33; a.x[7] = 0x44; + a.x[0] = 0x00; + a.x[1] = 0x00; + a.x[2] = 0xf1; + a.x[3] = 0xff; + a.x[4] = 0x11; + a.x[5] = 0x22; + a.x[6] = 0x33; + a.x[7] = 0x44; b = a; DUK__DBLUNION_CMP_TRUE(&a, &b); @@ -91897,10 +93330,14 @@ DUK_LOCAL duk_uint_t duk__selftest_double_rounding(void) { c.d = a.d + b.d; if (!DUK__DOUBLE_COMPARE(&c, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)) { DUK_D(DUK_DPRINT("broken result (native endiannesss): %02x %02x %02x %02x %02x %02x %02x %02x", - (unsigned int) c.x[0], (unsigned int) c.x[1], - (unsigned int) c.x[2], (unsigned int) c.x[3], - (unsigned int) c.x[4], (unsigned int) c.x[5], - (unsigned int) c.x[6], (unsigned int) c.x[7])); + (unsigned int) c.x[0], + (unsigned int) c.x[1], + (unsigned int) c.x[2], + (unsigned int) c.x[3], + (unsigned int) c.x[4], + (unsigned int) c.x[5], + (unsigned int) c.x[6], + (unsigned int) c.x[7])); DUK__FAILED("invalid result from 1.0 + 0.5ulp"); } @@ -91917,10 +93354,14 @@ DUK_LOCAL duk_uint_t duk__selftest_double_rounding(void) { c.d = a.d + b.d; if (!DUK__DOUBLE_COMPARE(&c, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02)) { DUK_D(DUK_DPRINT("broken result (native endiannesss): %02x %02x %02x %02x %02x %02x %02x %02x", - (unsigned int) c.x[0], (unsigned int) c.x[1], - (unsigned int) c.x[2], (unsigned int) c.x[3], - (unsigned int) c.x[4], (unsigned int) c.x[5], - (unsigned int) c.x[6], (unsigned int) c.x[7])); + (unsigned int) c.x[0], + (unsigned int) c.x[1], + (unsigned int) c.x[2], + (unsigned int) c.x[3], + (unsigned int) c.x[4], + (unsigned int) c.x[5], + (unsigned int) c.x[6], + (unsigned int) c.x[7])); DUK__FAILED("invalid result from (1.0 + ulp) + 0.5ulp"); } @@ -92091,7 +93532,7 @@ DUK_LOCAL duk_uint_t duk__selftest_cast_double_to_uint32(void) { duk_double_t dv; duk_uint32_t uv; - dv = 3735928559.0; /* 0xdeadbeef in decimal */ + dv = 3735928559.0; /* 0xdeadbeef in decimal */ uv = (duk_uint32_t) dv; if (uv != 0xdeadbeefUL) { @@ -92128,7 +93569,7 @@ DUK_LOCAL duk_uint_t duk__selftest_alloc_funcs(duk_alloc_function alloc_func, ptr = alloc_func(udata, (duk_size_t) i); if (ptr == NULL) { DUK_D(DUK_DPRINT("alloc failed, ignore")); - continue; /* alloc failed, ignore */ + continue; /* alloc failed, ignore */ } for (j = 0; j < i; j++) { ((unsigned char *) ptr)[j] = (unsigned char) (0x80 + j); @@ -92137,14 +93578,15 @@ DUK_LOCAL duk_uint_t duk__selftest_alloc_funcs(duk_alloc_function alloc_func, if (new_ptr == NULL) { DUK_D(DUK_DPRINT("realloc failed, ignore")); free_func(udata, ptr); - continue; /* realloc failed, ignore */ + continue; /* realloc failed, ignore */ } ptr = new_ptr; for (j = 0; j < i; j++) { x = ((unsigned char *) ptr)[j]; if (x != (unsigned char) (0x80 + j)) { DUK_D(DUK_DPRINT("byte at index %ld doesn't match after realloc: %02lx", - (long) j, (unsigned long) x)); + (long) j, + (unsigned long) x)); DUK__FAILED("byte compare after realloc"); break; } @@ -92188,7 +93630,7 @@ DUK_INTERNAL duk_uint_t duk_selftest_run_tests(duk_alloc_function alloc_func, return error_count; } -#endif /* DUK_USE_SELF_TESTS */ +#endif /* DUK_USE_SELF_TESTS */ /* automatic undefs */ #undef DUK__DBLUNION_CMP_FALSE @@ -92231,11 +93673,11 @@ DUK_INTERNAL DUK_ALWAYS_INLINE void duk_tval_set_number_chkfast_fast(duk_tval *t expt = (duk_small_int_t) ((i >> 52) & 0x07ff); shift = expt - 1023; - if (shift >= 0 && shift <= 46) { /* exponents 1023 to 1069 */ + if (shift >= 0 && shift <= 46) { /* exponents 1023 to 1069 */ duk_int64_t t; if (((DUK_I64_CONSTANT(0x000fffffffffffff) >> shift) & i) == 0) { - t = i | DUK_I64_CONSTANT(0x0010000000000000); /* implicit leading one */ + t = i | DUK_I64_CONSTANT(0x0010000000000000); /* implicit leading one */ t = t & DUK_I64_CONSTANT(0x001fffffffffffff); t = t >> (52 - shift); if (i < 0) { @@ -92244,13 +93686,13 @@ DUK_INTERNAL DUK_ALWAYS_INLINE void duk_tval_set_number_chkfast_fast(duk_tval *t DUK_TVAL_SET_FASTINT(tv, t); return; } - } else if (shift == -1023) { /* exponent 0 */ + } else if (shift == -1023) { /* exponent 0 */ if (i >= 0 && (i & DUK_I64_CONSTANT(0x000fffffffffffff)) == 0) { /* Note: reject negative zero. */ DUK_TVAL_SET_FASTINT(tv, (duk_int64_t) 0); return; } - } else if (shift == 47) { /* exponent 1070 */ + } else if (shift == 47) { /* exponent 1070 */ if (i < 0 && (i & DUK_I64_CONSTANT(0x000fffffffffffff)) == 0) { DUK_TVAL_SET_FASTINT(tv, (duk_int64_t) DUK_FASTINT_MIN); return; @@ -92278,23 +93720,23 @@ DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_tval_get_number_packed(duk_tval if ((t >> 48) != DUK_TAG_FASTINT) { return tv->d; } else if (t & DUK_U64_CONSTANT(0x0000800000000000)) { - t = (duk_uint64_t) (-((duk_int64_t) t)); /* avoid unary minus on unsigned */ - t = t & DUK_U64_CONSTANT(0x0000ffffffffffff); /* negative */ + t = (duk_uint64_t) (-((duk_int64_t) t)); /* avoid unary minus on unsigned */ + t = t & DUK_U64_CONSTANT(0x0000ffffffffffff); /* negative */ t |= DUK_U64_CONSTANT(0xc330000000000000); DUK_DBLUNION_SET_UINT64(&du, t); - return du.d + 4503599627370496.0; /* 1 << 52 */ + return du.d + 4503599627370496.0; /* 1 << 52 */ } else if (t != 0) { - t &= DUK_U64_CONSTANT(0x0000ffffffffffff); /* positive */ + t &= DUK_U64_CONSTANT(0x0000ffffffffffff); /* positive */ t |= DUK_U64_CONSTANT(0x4330000000000000); DUK_DBLUNION_SET_UINT64(&du, t); - return du.d - 4503599627370496.0; /* 1 << 52 */ + return du.d - 4503599627370496.0; /* 1 << 52 */ } else { - return 0.0; /* zero */ + return 0.0; /* zero */ } } -#endif /* DUK_USE_FASTINT && DUK_USE_PACKED_TVAL */ +#endif /* DUK_USE_FASTINT && DUK_USE_PACKED_TVAL */ -#if 0 /* unused */ +#if 0 /* unused */ #if defined(DUK_USE_FASTINT) && !defined(DUK_USE_PACKED_TVAL) DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_tval_get_number_unpacked(duk_tval *tv) { duk_double_union du; @@ -92316,8 +93758,8 @@ DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_tval_get_number_unpacked(duk_tva return tv->v.d; } } -#endif /* DUK_USE_FASTINT && DUK_USE_PACKED_TVAL */ -#endif /* 0 */ +#endif /* DUK_USE_FASTINT && DUK_USE_PACKED_TVAL */ +#endif /* 0 */ #if defined(DUK_USE_FASTINT) && !defined(DUK_USE_PACKED_TVAL) DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_tval_get_number_unpacked_fastint(duk_tval *tv) { @@ -92329,16 +93771,16 @@ DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_tval_get_number_unpacked_fastint if (tv->v.fi >= 0) { t = DUK_U64_CONSTANT(0x4330000000000000) | (duk_uint64_t) tv->v.fi; DUK_DBLUNION_SET_UINT64(&du, t); - return du.d - 4503599627370496.0; /* 1 << 52 */ + return du.d - 4503599627370496.0; /* 1 << 52 */ } else { t = DUK_U64_CONSTANT(0xc330000000000000) | (duk_uint64_t) (-tv->v.fi); DUK_DBLUNION_SET_UINT64(&du, t); - return du.d + 4503599627370496.0; /* 1 << 52 */ + return du.d + 4503599627370496.0; /* 1 << 52 */ } } -#endif /* DUK_USE_FASTINT && DUK_USE_PACKED_TVAL */ +#endif /* DUK_USE_FASTINT && DUK_USE_PACKED_TVAL */ -#endif /* DUK_USE_FASTINT */ +#endif /* DUK_USE_FASTINT */ /* * Assertion helpers. @@ -98569,7 +100011,7 @@ DUK_INTERNAL duk_uint32_t duk_bd_decode(duk_bitdecoder_ctx *ctx, duk_small_int_t shift = ctx->currbits - bits; mask = (((duk_uint32_t) 1U) << bits) - 1U; tmp = (ctx->currval >> shift) & mask; - ctx->currbits = shift; /* remaining */ + ctx->currbits = shift; /* remaining */ #if 0 DUK_DDD(DUK_DDDPRINT("decode_bits: %ld bits -> 0x%08lx (%ld), currbits=%ld, currval=0x%08lx", @@ -98608,17 +100050,17 @@ DUK_INTERNAL duk_uint32_t duk_bd_decode_varuint(duk_bitdecoder_ctx *ctx) { */ switch (duk_bd_decode(ctx, 2)) { case 0: - return 0; /* [0,0] */ + return 0; /* [0,0] */ case 1: - return duk_bd_decode(ctx, 2) + 1; /* [1,4] */ + return duk_bd_decode(ctx, 2) + 1; /* [1,4] */ case 2: - return duk_bd_decode(ctx, 5) + 5; /* [5,36] */ + return duk_bd_decode(ctx, 5) + 5; /* [5,36] */ default: t = duk_bd_decode(ctx, 7); if (t == 0) { return duk_bd_decode(ctx, 20); } - return (t - 1) + 37; /* [37,163] */ + return (t - 1) + 37; /* [37,163] */ } } @@ -98627,20 +100069,18 @@ DUK_INTERNAL duk_uint32_t duk_bd_decode_varuint(duk_bitdecoder_ctx *ctx) { * Caller must supply the output buffer whose size is NOT checked! */ -#define DUK__BITPACK_LETTER_LIMIT 26 -#define DUK__BITPACK_LOOKUP1 26 -#define DUK__BITPACK_LOOKUP2 27 -#define DUK__BITPACK_SWITCH1 28 -#define DUK__BITPACK_SWITCH 29 -#define DUK__BITPACK_UNUSED1 30 -#define DUK__BITPACK_EIGHTBIT 31 +#define DUK__BITPACK_LETTER_LIMIT 26 +#define DUK__BITPACK_LOOKUP1 26 +#define DUK__BITPACK_LOOKUP2 27 +#define DUK__BITPACK_SWITCH1 28 +#define DUK__BITPACK_SWITCH 29 +#define DUK__BITPACK_UNUSED1 30 +#define DUK__BITPACK_EIGHTBIT 31 -DUK_LOCAL const duk_uint8_t duk__bitpacked_lookup[16] = { - DUK_ASC_0, DUK_ASC_1, DUK_ASC_2, DUK_ASC_3, - DUK_ASC_4, DUK_ASC_5, DUK_ASC_6, DUK_ASC_7, - DUK_ASC_8, DUK_ASC_9, DUK_ASC_UNDERSCORE, DUK_ASC_SPACE, - 0x82, 0x80, DUK_ASC_DOUBLEQUOTE, DUK_ASC_LCURLY -}; +DUK_LOCAL const duk_uint8_t duk__bitpacked_lookup[16] = { DUK_ASC_0, DUK_ASC_1, DUK_ASC_2, DUK_ASC_3, + DUK_ASC_4, DUK_ASC_5, DUK_ASC_6, DUK_ASC_7, + DUK_ASC_8, DUK_ASC_9, DUK_ASC_UNDERSCORE, DUK_ASC_SPACE, + 0x82, 0x80, DUK_ASC_DOUBLEQUOTE, DUK_ASC_LCURLY }; DUK_INTERNAL duk_small_uint_t duk_bd_decode_bitpacked_string(duk_bitdecoder_ctx *bd, duk_uint8_t *out) { duk_small_uint_t len; @@ -98650,10 +100090,10 @@ DUK_INTERNAL duk_small_uint_t duk_bd_decode_bitpacked_string(duk_bitdecoder_ctx len = duk_bd_decode(bd, 5); if (len == 31) { - len = duk_bd_decode(bd, 8); /* Support up to 256 bytes; rare. */ + len = duk_bd_decode(bd, 8); /* Support up to 256 bytes; rare. */ } - mode = 32; /* 0 = uppercase, 32 = lowercase (= 'a' - 'A') */ + mode = 32; /* 0 = uppercase, 32 = lowercase (= 'a' - 'A') */ for (i = 0; i < len; i++) { t = duk_bd_decode(bd, 5); if (t < DUK__BITPACK_LETTER_LIMIT) { @@ -98664,7 +100104,7 @@ DUK_INTERNAL duk_small_uint_t duk_bd_decode_bitpacked_string(duk_bitdecoder_ctx t = duk__bitpacked_lookup[8 + duk_bd_decode(bd, 3)]; } else if (t == DUK__BITPACK_SWITCH1) { t = duk_bd_decode(bd, 5); - DUK_ASSERT_DISABLE(t >= 0); /* unsigned */ + DUK_ASSERT_DISABLE(t >= 0); /* unsigned */ DUK_ASSERT(t <= 25); t = t + DUK_ASC_UC_A + (mode ^ 32); } else if (t == DUK__BITPACK_SWITCH) { @@ -98806,7 +100246,7 @@ DUK_INTERNAL duk_uint8_t *duk_bw_resize(duk_hthread *thr, duk_bufwriter_ctx *bw_ DUK_ERROR_RANGE(thr, DUK_STR_BUFFER_TOO_LONG); DUK_WO_NORETURN(return NULL;); } -#if 0 /* for manual torture testing: tight allocation, useful with valgrind */ +#if 0 /* for manual torture testing: tight allocation, useful with valgrind */ new_sz = curr_off + sz; #endif @@ -98847,9 +100287,7 @@ DUK_INTERNAL void duk_bw_write_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw DUK_UNREF(thr); p_base = bw->p_base; - duk_memcpy_unsafe((void *) bw->p, - (const void *) (p_base + src_off), - (size_t) len); + duk_memcpy_unsafe((void *) bw->p, (const void *) (p_base + src_off), (size_t) len); bw->p += len; } @@ -98864,7 +100302,11 @@ DUK_INTERNAL void duk_bw_write_ensure_slice(duk_hthread *thr, duk_bufwriter_ctx duk_bw_write_raw_slice(thr, bw, src_off, len); } -DUK_INTERNAL void duk_bw_insert_raw_bytes(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, const duk_uint8_t *buf, duk_size_t len) { +DUK_INTERNAL void duk_bw_insert_raw_bytes(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + const duk_uint8_t *buf, + duk_size_t len) { duk_uint8_t *p_base; duk_size_t buf_sz, move_sz; @@ -98875,20 +100317,20 @@ DUK_INTERNAL void duk_bw_insert_raw_bytes(duk_hthread *thr, duk_bufwriter_ctx *b DUK_UNREF(thr); p_base = bw->p_base; - buf_sz = (duk_size_t) (bw->p - p_base); /* constrained by maximum buffer size */ + buf_sz = (duk_size_t) (bw->p - p_base); /* constrained by maximum buffer size */ move_sz = buf_sz - dst_off; - DUK_ASSERT(p_base != NULL); /* buffer size is >= 1 */ - duk_memmove_unsafe((void *) (p_base + dst_off + len), - (const void *) (p_base + dst_off), - (size_t) move_sz); - duk_memcpy_unsafe((void *) (p_base + dst_off), - (const void *) buf, - (size_t) len); + DUK_ASSERT(p_base != NULL); /* buffer size is >= 1 */ + duk_memmove_unsafe((void *) (p_base + dst_off + len), (const void *) (p_base + dst_off), (size_t) move_sz); + duk_memcpy_unsafe((void *) (p_base + dst_off), (const void *) buf, (size_t) len); bw->p += len; } -DUK_INTERNAL void duk_bw_insert_ensure_bytes(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, const duk_uint8_t *buf, duk_size_t len) { +DUK_INTERNAL void duk_bw_insert_ensure_bytes(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + const duk_uint8_t *buf, + duk_size_t len) { DUK_ASSERT(thr != NULL); DUK_ASSERT(bw != NULL); DUK_ASSERT(dst_off <= DUK_BW_GET_SIZE(thr, bw)); @@ -98898,7 +100340,11 @@ DUK_INTERNAL void duk_bw_insert_ensure_bytes(duk_hthread *thr, duk_bufwriter_ctx duk_bw_insert_raw_bytes(thr, bw, dst_off, buf, len); } -DUK_INTERNAL void duk_bw_insert_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, duk_size_t src_off, duk_size_t len) { +DUK_INTERNAL void duk_bw_insert_raw_slice(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + duk_size_t src_off, + duk_size_t len) { duk_uint8_t *p_base; duk_size_t buf_sz, move_sz; @@ -98925,17 +100371,17 @@ DUK_INTERNAL void duk_bw_insert_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *b buf_sz = (duk_size_t) (bw->p - p_base); move_sz = buf_sz - dst_off; - DUK_ASSERT(p_base != NULL); /* buffer size is >= 1 */ - duk_memmove_unsafe((void *) (p_base + dst_off + len), - (const void *) (p_base + dst_off), - (size_t) move_sz); - duk_memcpy_unsafe((void *) (p_base + dst_off), - (const void *) (p_base + src_off), - (size_t) len); + DUK_ASSERT(p_base != NULL); /* buffer size is >= 1 */ + duk_memmove_unsafe((void *) (p_base + dst_off + len), (const void *) (p_base + dst_off), (size_t) move_sz); + duk_memcpy_unsafe((void *) (p_base + dst_off), (const void *) (p_base + src_off), (size_t) len); bw->p += len; } -DUK_INTERNAL void duk_bw_insert_ensure_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t dst_off, duk_size_t src_off, duk_size_t len) { +DUK_INTERNAL void duk_bw_insert_ensure_slice(duk_hthread *thr, + duk_bufwriter_ctx *bw, + duk_size_t dst_off, + duk_size_t src_off, + duk_size_t len) { DUK_ASSERT(thr != NULL); DUK_ASSERT(bw != NULL); DUK_ASSERT(dst_off <= DUK_BW_GET_SIZE(thr, bw)); @@ -98965,7 +100411,7 @@ DUK_INTERNAL duk_uint8_t *duk_bw_insert_raw_area(duk_hthread *thr, duk_bufwriter p_dst = p_base + off + len; p_src = p_base + off; duk_memmove_unsafe((void *) p_dst, (const void *) p_src, (size_t) move_sz); - return p_src; /* point to start of 'reserved area' */ + return p_src; /* point to start of 'reserved area' */ } DUK_INTERNAL duk_uint8_t *duk_bw_insert_ensure_area(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t off, duk_size_t len) { @@ -98995,9 +100441,7 @@ DUK_INTERNAL void duk_bw_remove_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *b p_dst = p_base + off; p_src = p_dst + len; move_sz = (duk_size_t) (bw->p - p_src); - duk_memmove_unsafe((void *) p_dst, - (const void *) p_src, - (size_t) move_sz); + duk_memmove_unsafe((void *) p_dst, (const void *) p_src, (size_t) move_sz); bw->p -= len; } @@ -99011,12 +100455,8 @@ DUK_INTERNAL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx *bw_ct DUK_ASSERT(bw_ctx != NULL); DUK_ASSERT(bw_ctx->buf != NULL); DUK_ASSERT((DUK_HBUFFER_DYNAMIC_GET_SIZE(bw_ctx->buf) == 0) || - (bw_ctx->p != NULL && - bw_ctx->p_base != NULL && - bw_ctx->p_limit != NULL && - bw_ctx->p_limit >= bw_ctx->p_base && - bw_ctx->p >= bw_ctx->p_base && - bw_ctx->p <= bw_ctx->p_limit)); + (bw_ctx->p != NULL && bw_ctx->p_base != NULL && bw_ctx->p_limit != NULL && bw_ctx->p_limit >= bw_ctx->p_base && + bw_ctx->p >= bw_ctx->p_base && bw_ctx->p <= bw_ctx->p_limit)); } #endif /* @@ -99038,7 +100478,8 @@ DUK_INTERNAL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx *bw_ct * relying on fmin(), fmax(), or other intrinsics. Out-of-range results are * not assumed by caller, but here value is clamped, NaN converts to minval. */ -#define DUK__DOUBLE_INT_CAST1(tname,minval,maxval) do { \ +#define DUK__DOUBLE_INT_CAST1(tname, minval, maxval) \ + do { \ if (DUK_LIKELY(x >= (duk_double_t) (minval))) { \ DUK_ASSERT(!DUK_ISNAN(x)); \ if (DUK_LIKELY(x <= (duk_double_t) (maxval))) { \ @@ -99059,19 +100500,22 @@ DUK_INTERNAL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx *bw_ct * argument is a NaN, return the second argument. This avoids a * NaN-to-integer cast which is undefined behavior. */ -#define DUK__DOUBLE_INT_CAST2(tname,minval,maxval) do { \ +#define DUK__DOUBLE_INT_CAST2(tname, minval, maxval) \ + do { \ return (tname) duk_double_fmin(duk_double_fmax(x, (duk_double_t) (minval)), (duk_double_t) (maxval)); \ } while (0) /* Another solution which doesn't need C99+ behavior for fmin() and fmax(). */ -#define DUK__DOUBLE_INT_CAST3(tname,minval,maxval) do { \ +#define DUK__DOUBLE_INT_CAST3(tname, minval, maxval) \ + do { \ if (DUK_ISNAN(x)) { \ /* 0 or any other value is fine. */ \ return (tname) 0; \ } else \ return (tname) DUK_FMIN(DUK_FMAX(x, (duk_double_t) (minval)), (duk_double_t) (maxval)); \ - } \ - } while (0) + } \ + } \ + while (0) /* C99+ solution: relies on specific fmin() and fmax() behavior in C99: if * one argument is NaN but the other isn't, the non-NaN argument is returned. @@ -99080,7 +100524,8 @@ DUK_INTERNAL void duk_bw_assert_valid(duk_hthread *thr, duk_bufwriter_ctx *bw_ct * the fmin() and fmax() calls (unless one uses -ffast-math which we don't * support). */ -#define DUK__DOUBLE_INT_CAST4(tname,minval,maxval) do { \ +#define DUK__DOUBLE_INT_CAST4(tname, minval, maxval) \ + do { \ return (tname) DUK_FMIN(DUK_FMAX(x, (duk_double_t) (minval)), (duk_double_t) (maxval)); \ } while (0) @@ -99124,12 +100569,12 @@ DUK_INTERNAL duk_uint32_t duk_double_to_uint32_t(duk_double_t x) { * infinity, at least on x64. This number is one double unit below that * midpoint. See misc/float_cast.c. */ -#define DUK__FLOAT_ROUND_LIMIT 340282356779733623858607532500980858880.0 +#define DUK__FLOAT_ROUND_LIMIT 340282356779733623858607532500980858880.0 /* Maximum IEEE float. Double-to-float conversion above this would be out of * range and thus technically undefined behavior. */ -#define DUK__FLOAT_MAX 340282346638528859811704183484516925440.0 +#define DUK__FLOAT_MAX 340282346638528859811704183484516925440.0 DUK_INTERNAL duk_float_t duk_double_to_float_t(duk_double_t x) { /* Even a double-to-float cast is technically undefined behavior if @@ -99148,8 +100593,7 @@ DUK_INTERNAL duk_float_t duk_double_to_float_t(duk_double_t x) { duk_double_t t; t = DUK_FABS(x); - DUK_ASSERT((DUK_ISNAN(x) && DUK_ISNAN(t)) || - (!DUK_ISNAN(x) && !DUK_ISNAN(t))); + DUK_ASSERT((DUK_ISNAN(x) && DUK_ISNAN(t)) || (!DUK_ISNAN(x) && !DUK_ISNAN(t))); if (DUK_LIKELY(t <= DUK__FLOAT_MAX)) { /* Standard in-range case, try to get here with a minimum @@ -99297,7 +100741,7 @@ DUK_INTERNAL duk_small_uint_t duk_double_signbit(duk_double_t x) { DUK_INTERNAL duk_double_t duk_double_trunc_towards_zero(duk_double_t x) { /* XXX: optimize */ duk_small_uint_t s = duk_double_signbit(x); - x = DUK_FLOOR(DUK_FABS(x)); /* truncate towards zero */ + x = DUK_FLOOR(DUK_FABS(x)); /* truncate towards zero */ if (s) { x = -x; } @@ -99543,8 +100987,8 @@ DUK_INTERNAL DUK_ALWAYS_INLINE duk_bool_t duk_float_equals(duk_float_t x, duk_fl #if defined(DUK_USE_STRHASH_DENSE) /* 'magic' constants for Murmurhash2 */ -#define DUK__MAGIC_M ((duk_uint32_t) 0x5bd1e995UL) -#define DUK__MAGIC_R 24 +#define DUK__MAGIC_M ((duk_uint32_t) 0x5bd1e995UL) +#define DUK__MAGIC_R 24 DUK_INTERNAL duk_uint32_t duk_util_hashbytes(const duk_uint8_t *data, duk_size_t len, duk_uint32_t seed) { duk_uint32_t h = seed ^ ((duk_uint32_t) len); @@ -99558,9 +101002,7 @@ DUK_INTERNAL duk_uint32_t duk_util_hashbytes(const duk_uint8_t *data, duk_size_t #if defined(DUK_USE_HASHBYTES_UNALIGNED_U32_ACCESS) duk_uint32_t k = *((const duk_uint32_t *) (const void *) data); #else - duk_uint32_t k = ((duk_uint32_t) data[0]) | - (((duk_uint32_t) data[1]) << 8) | - (((duk_uint32_t) data[2]) << 16) | + duk_uint32_t k = ((duk_uint32_t) data[0]) | (((duk_uint32_t) data[1]) << 8) | (((duk_uint32_t) data[2]) << 16) | (((duk_uint32_t) data[3]) << 24); #endif @@ -99574,11 +101016,14 @@ DUK_INTERNAL duk_uint32_t duk_util_hashbytes(const duk_uint8_t *data, duk_size_t } switch (len) { - case 3: h ^= data[2] << 16; - case 2: h ^= data[1] << 8; - case 1: h ^= data[0]; - h *= DUK__MAGIC_M; - } + case 3: + h ^= data[2] << 16; + case 2: + h ^= data[1] << 8; + case 1: + h ^= data[0]; + h *= DUK__MAGIC_M; + } h ^= h >> 13; h *= DUK__MAGIC_M; @@ -99586,7 +101031,7 @@ DUK_INTERNAL duk_uint32_t duk_util_hashbytes(const duk_uint8_t *data, duk_size_t return h; } -#endif /* DUK_USE_STRHASH_DENSE */ +#endif /* DUK_USE_STRHASH_DENSE */ /* automatic undefs */ #undef DUK__MAGIC_M @@ -99609,7 +101054,7 @@ DUK_INTERNAL DUK_INLINE duk_small_int_t duk_memcmp(const void *s1, const void *s DUK_ASSERT(s2 != NULL); return DUK_MEMCMP(s1, s2, (size_t) len); } -#else /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ +#else /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ DUK_INTERNAL DUK_INLINE duk_small_int_t duk_memcmp_unsafe(const void *s1, const void *s2, duk_size_t len) { DUK_ASSERT(s1 != NULL || len == 0U); DUK_ASSERT(s2 != NULL || len == 0U); @@ -99626,7 +101071,7 @@ DUK_INTERNAL DUK_INLINE duk_small_int_t duk_memcmp(const void *s1, const void *s DUK_ASSERT(s2 != NULL); return DUK_MEMCMP(s1, s2, (size_t) len); } -#endif /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ +#endif /* DUK_USE_ALLOW_UNDEFINED_BEHAVIOR */ /* * A tiny random number generator used for Math.random() and other internals. * @@ -99650,15 +101095,16 @@ DUK_INTERNAL DUK_INLINE duk_small_int_t duk_memcmp(const void *s1, const void *s #endif #if defined(DUK__RANDOM_SHAMIR3OP) -#define DUK__UPDATE_RND(rnd) do { \ +#define DUK__UPDATE_RND(rnd) \ + do { \ (rnd) += ((rnd) * (rnd)) | 0x05UL; \ - (rnd) = ((rnd) & 0xffffffffUL); /* if duk_uint32_t is exactly 32 bits, this is a NOP */ \ + (rnd) = ((rnd) &0xffffffffUL); /* if duk_uint32_t is exactly 32 bits, this is a NOP */ \ } while (0) -#define DUK__RND_BIT(rnd) ((rnd) >> 31) /* only use the highest bit */ +#define DUK__RND_BIT(rnd) ((rnd) >> 31) /* only use the highest bit */ DUK_INTERNAL void duk_util_tinyrandom_prepare_seed(duk_hthread *thr) { - DUK_UNREF(thr); /* Nothing now. */ + DUK_UNREF(thr); /* Nothing now. */ } DUK_INTERNAL duk_double_t duk_util_tinyrandom_get_double(duk_hthread *thr) { @@ -99668,7 +101114,7 @@ DUK_INTERNAL duk_double_t duk_util_tinyrandom_get_double(duk_hthread *thr) { rnd = thr->heap->rnd_state; - n = 53; /* enough to cover the whole mantissa */ + n = 53; /* enough to cover the whole mantissa */ t = 0.0; do { @@ -99684,7 +101130,7 @@ DUK_INTERNAL duk_double_t duk_util_tinyrandom_get_double(duk_hthread *thr) { return t; } -#endif /* DUK__RANDOM_SHAMIR3OP */ +#endif /* DUK__RANDOM_SHAMIR3OP */ #if defined(DUK__RANDOM_XOROSHIRO128PLUS) DUK_LOCAL DUK_ALWAYS_INLINE duk_uint64_t duk__rnd_splitmix64(duk_uint64_t *x) { @@ -99723,9 +101169,9 @@ DUK_INTERNAL void duk_util_tinyrandom_prepare_seed(duk_hthread *thr) { * because current seed is Date.now()) result in different xoroshiro128+ * seeds. */ - x = thr->heap->rnd_state[0]; /* Only [0] is used as input here. */ + x = thr->heap->rnd_state[0]; /* Only [0] is used as input here. */ for (i = 0; i < 64; i++) { - thr->heap->rnd_state[i & 0x01] = duk__rnd_splitmix64(&x); /* Keep last 2 values. */ + thr->heap->rnd_state[i & 0x01] = duk__rnd_splitmix64(&x); /* Keep last 2 values. */ } } @@ -99749,9 +101195,9 @@ DUK_INTERNAL duk_double_t duk_util_tinyrandom_get_double(duk_hthread *thr) { #endif return du.d - 1.0; } -#endif /* DUK__RANDOM_XOROSHIRO128PLUS */ +#endif /* DUK__RANDOM_XOROSHIRO128PLUS */ -#endif /* !DUK_USE_GET_RANDOM_DOUBLE */ +#endif /* !DUK_USE_GET_RANDOM_DOUBLE */ /* automatic undefs */ #undef DUK__RANDOM_SHAMIR3OP diff --git a/src/thirdparty/duktape/duktape.h b/src/thirdparty/duktape/duktape.h index 8b33298ccf..d3cba119e3 100644 --- a/src/thirdparty/duktape/duktape.h +++ b/src/thirdparty/duktape/duktape.h @@ -1,5 +1,5 @@ /* - * Duktape public API for Duktape 2.6.0. + * Duktape public API for Duktape 2.7.0. * * See the API reference for documentation on call semantics. The exposed, * supported API is between the "BEGIN PUBLIC API" and "END PUBLIC API" @@ -21,7 +21,7 @@ * * (http://opensource.org/licenses/MIT) * - * Copyright (c) 2013-2019 by Duktape authors (see AUTHORS.rst) + * Copyright (c) 2013-present by Duktape authors (see AUTHORS.rst) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -110,6 +110,12 @@ * * Luis de Bethencourt (https://github.com/luisbg) * * Ian Whyman (https://github.com/v00d00) * * Rick Sayre (https://github.com/whorfin) + * * Craig Leres (https://github.com/leres) + * * Maurici Abad (https://github.com/mauriciabad) + * * Nancy Li (https://github.com/NancyLi1013) + * * William Parks (https://github.com/WilliamParks) + * * Sam Hellawell (https://github.com/samhellawell) + * * Vladislavs Sokurenko (https://github.com/sokurenko) * * Other contributions * =================== @@ -176,7 +182,7 @@ * development snapshots have 99 for patch level (e.g. 0.10.99 would be a * development version after 0.10.0 but before the next official release). */ -#define DUK_VERSION 20600L +#define DUK_VERSION 20700L /* Git commit, describe, and branch for Duktape build. Useful for * non-official snapshot builds so that application code can easily log diff --git a/test/tests/BitSetTests.cpp b/test/tests/BitSetTests.cpp index 157c422914..2610bc2027 100644 --- a/test/tests/BitSetTests.cpp +++ b/test/tests/BitSetTests.cpp @@ -97,21 +97,21 @@ TEST(BitTest, test_big) #if defined(_M_X64) || defined(_M_ARM64) static_assert(std::is_same_v); static_assert(bits.data().size() == 4); - ASSERT_EQ(bits.data()[0], ~0ULL); - ASSERT_EQ(bits.data()[1], ~0ULL); - ASSERT_EQ(bits.data()[2], ~0ULL); - ASSERT_EQ(bits.data()[3], ~0ULL); + ASSERT_EQ(bits.data()[0], ~0uLL); + ASSERT_EQ(bits.data()[1], ~0uLL); + ASSERT_EQ(bits.data()[2], ~0uLL); + ASSERT_EQ(bits.data()[3], ~0uLL); #else static_assert(std::is_same_v); static_assert(bits.data().size() == 8); - ASSERT_EQ(bits.data()[0], ~0UL); - ASSERT_EQ(bits.data()[1], ~0UL); - ASSERT_EQ(bits.data()[2], ~0UL); - ASSERT_EQ(bits.data()[3], ~0UL); - ASSERT_EQ(bits.data()[4], ~0UL); - ASSERT_EQ(bits.data()[5], ~0UL); - ASSERT_EQ(bits.data()[6], ~0UL); - ASSERT_EQ(bits.data()[7], ~0UL); + ASSERT_EQ(bits.data()[0], ~0uL); + ASSERT_EQ(bits.data()[1], ~0uL); + ASSERT_EQ(bits.data()[2], ~0uL); + ASSERT_EQ(bits.data()[3], ~0uL); + ASSERT_EQ(bits.data()[4], ~0uL); + ASSERT_EQ(bits.data()[5], ~0uL); + ASSERT_EQ(bits.data()[6], ~0uL); + ASSERT_EQ(bits.data()[7], ~0uL); #endif } diff --git a/test/tests/FormattingTests.cpp b/test/tests/FormattingTests.cpp index 15195a1ff1..3af0c7fce2 100644 --- a/test/tests/FormattingTests.cpp +++ b/test/tests/FormattingTests.cpp @@ -139,7 +139,7 @@ TEST_F(FormattingTests, comma_large) TEST_F(FormattingTests, currency) { - gConfigGeneral.currency_format = CurrencyType::Pounds; + gConfigGeneral.CurrencyFormat = CurrencyType::Pounds; ASSERT_EQ(u8"-£251", FormatString("{CURRENCY}", -2510)); ASSERT_EQ(u8"£1", FormatString("{CURRENCY}", 4)); ASSERT_EQ(u8"£1", FormatString("{CURRENCY}", 5)); @@ -150,7 +150,7 @@ TEST_F(FormattingTests, currency) TEST_F(FormattingTests, currency2dp) { - gConfigGeneral.currency_format = CurrencyType::Pounds; + gConfigGeneral.CurrencyFormat = CurrencyType::Pounds; ASSERT_EQ(u8"-£251.00", FormatString("{CURRENCY2DP}", -2510)); ASSERT_EQ(u8"£0.40", FormatString("{CURRENCY2DP}", 4)); ASSERT_EQ(u8"£0.50", FormatString("{CURRENCY2DP}", 5)); @@ -161,7 +161,7 @@ TEST_F(FormattingTests, currency2dp) TEST_F(FormattingTests, currency_yen) { - gConfigGeneral.currency_format = CurrencyType::Yen; + gConfigGeneral.CurrencyFormat = CurrencyType::Yen; ASSERT_EQ(u8"-¥25,100", FormatString("{CURRENCY}", -2510)); ASSERT_EQ(u8"¥40", FormatString("{CURRENCY2DP}", 4)); ASSERT_EQ(u8"¥50", FormatString("{CURRENCY2DP}", 5)); @@ -172,7 +172,7 @@ TEST_F(FormattingTests, currency_yen) TEST_F(FormattingTests, currency2dp_yen) { - gConfigGeneral.currency_format = CurrencyType::Yen; + gConfigGeneral.CurrencyFormat = CurrencyType::Yen; ASSERT_EQ(u8"-¥25,100", FormatString("{CURRENCY2DP}", -2510)); ASSERT_EQ(u8"¥40", FormatString("{CURRENCY2DP}", 4)); ASSERT_EQ(u8"¥50", FormatString("{CURRENCY2DP}", 5)); @@ -183,14 +183,14 @@ TEST_F(FormattingTests, currency2dp_yen) TEST_F(FormattingTests, currency_pts) { - gConfigGeneral.currency_format = CurrencyType::Peseta; + gConfigGeneral.CurrencyFormat = CurrencyType::Peseta; ASSERT_EQ("-251Pts", FormatString("{CURRENCY}", -2510)); ASSERT_EQ("112Pts", FormatString("{CURRENCY}", 1111)); } TEST_F(FormattingTests, currency2dp_pts) { - gConfigGeneral.currency_format = CurrencyType::Peseta; + gConfigGeneral.CurrencyFormat = CurrencyType::Peseta; ASSERT_EQ("-251.00Pts", FormatString("{CURRENCY2DP}", -2510)); ASSERT_EQ("0.40Pts", FormatString("{CURRENCY2DP}", 4)); ASSERT_EQ("111.10Pts", FormatString("{CURRENCY2DP}", 1111)); @@ -210,42 +210,42 @@ TEST_F(FormattingTests, escaped_braces) TEST_F(FormattingTests, velocity_mph) { - gConfigGeneral.measurement_format = MeasurementFormat::Imperial; + gConfigGeneral.MeasurementFormat = MeasurementFormat::Imperial; auto actual = FormatString("Train is going at {VELOCITY}.", 1024); ASSERT_EQ("Train is going at 1,024 mph.", actual); } TEST_F(FormattingTests, velocity_kph) { - gConfigGeneral.measurement_format = MeasurementFormat::Metric; + gConfigGeneral.MeasurementFormat = MeasurementFormat::Metric; auto actual = FormatString("Train is going at {VELOCITY}.", 1024); ASSERT_EQ("Train is going at 1,648 km/h.", actual); } TEST_F(FormattingTests, velocity_mps) { - gConfigGeneral.measurement_format = MeasurementFormat::SI; + gConfigGeneral.MeasurementFormat = MeasurementFormat::SI; auto actual = FormatString("Train is going at {VELOCITY}.", 1024); ASSERT_EQ("Train is going at 457.7 m/s.", actual); } TEST_F(FormattingTests, length_imperial) { - gConfigGeneral.measurement_format = MeasurementFormat::Imperial; + gConfigGeneral.MeasurementFormat = MeasurementFormat::Imperial; auto actual = FormatString("Height: {LENGTH}", 1024); ASSERT_EQ("Height: 3,360 ft", actual); } TEST_F(FormattingTests, length_metric) { - gConfigGeneral.measurement_format = MeasurementFormat::Metric; + gConfigGeneral.MeasurementFormat = MeasurementFormat::Metric; auto actual = FormatString("Height: {LENGTH}", 1024); ASSERT_EQ("Height: 1,024 m", actual); } TEST_F(FormattingTests, length_si) { - gConfigGeneral.measurement_format = MeasurementFormat::SI; + gConfigGeneral.MeasurementFormat = MeasurementFormat::SI; auto actual = FormatString("Height: {LENGTH}", 2048); ASSERT_EQ("Height: 2,048 m", actual); } @@ -318,7 +318,7 @@ TEST_F(FormattingTests, to_fixed_buffer) char buffer[16]; std::memset(buffer, '\xFF', sizeof(buffer)); auto len = FormatStringId(buffer, 8, STR_GUEST_X, 123); - ASSERT_EQ(len, 9U); + ASSERT_EQ(len, 9u); ASSERT_STREQ("Guest 1", buffer); // Ensure rest of the buffer was not overwritten @@ -337,7 +337,7 @@ TEST_F(FormattingTests, using_legacy_buffer_args) char buffer[32]{}; auto len = FormatStringLegacy(buffer, sizeof(buffer), STR_QUEUING_FOR, ft.Data()); - ASSERT_EQ(len, 23U); + ASSERT_EQ(len, 23u); ASSERT_STREQ("Queuing for Boat Hire 2", buffer); } diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp index 639d276efa..0a05a14047 100644 --- a/test/tests/LanguagePackTest.cpp +++ b/test/tests/LanguagePackTest.cpp @@ -25,17 +25,17 @@ TEST_F(LanguagePackTest, create_empty) { auto empty = LanguagePackFactory::FromText(0, ""); ASSERT_EQ(empty->GetId(), 0); - ASSERT_EQ(empty->GetCount(), 0U); + ASSERT_EQ(empty->GetCount(), 0u); } TEST_F(LanguagePackTest, create_mutable_id_1) { auto lang = LanguagePackFactory::FromText(1, "STR_0000:\n"); ASSERT_EQ(lang->GetId(), 1); - ASSERT_EQ(lang->GetCount(), 1U); + ASSERT_EQ(lang->GetCount(), 1u); ASSERT_STREQ(lang->GetString(0), nullptr); lang->SetString(0, "xx"); - ASSERT_EQ(lang->GetCount(), 1U); + ASSERT_EQ(lang->GetCount(), 1u); ASSERT_STREQ(lang->GetString(0), "xx"); } @@ -43,7 +43,7 @@ TEST_F(LanguagePackTest, language_pack_simple) { auto lang = LanguagePackFactory::FromText(0, LanguageEnGB); ASSERT_EQ(lang->GetId(), 0); - ASSERT_EQ(lang->GetCount(), 4U); + ASSERT_EQ(lang->GetCount(), 4u); ASSERT_STREQ(lang->GetString(2), "Spiral Roller Coaster"); ASSERT_EQ(lang->GetScenarioOverrideStringId("Arid Heights", 0), 0x7000); ASSERT_STREQ(lang->GetString(0x7000), "Arid Heights scenario string"); @@ -57,9 +57,9 @@ TEST_F(LanguagePackTest, language_pack_simple) TEST_F(LanguagePackTest, language_pack_multibyte) { - auto lang = LanguagePackFactory::FromText(0, (const utf8*)LanguageZhTW); + auto lang = LanguagePackFactory::FromText(0, reinterpret_cast(LanguageZhTW)); ASSERT_EQ(lang->GetId(), 0); - ASSERT_EQ(lang->GetCount(), 4U); + ASSERT_EQ(lang->GetCount(), 4u); ASSERT_STREQ(lang->GetString(2), u8"懸吊式雲霄飛車"); ASSERT_EQ(lang->GetScenarioOverrideStringId("Forest Frontiers", 0), 0x7000); ASSERT_EQ(lang->GetScenarioOverrideStringId("Forest Frontiers", 2), 0x7002); diff --git a/test/tests/MultiLaunch.cpp b/test/tests/MultiLaunch.cpp index 40158fa9b3..2773733137 100644 --- a/test/tests/MultiLaunch.cpp +++ b/test/tests/MultiLaunch.cpp @@ -41,7 +41,7 @@ TEST(MultiLaunchTest, all) bool initialised = context->Initialise(); ASSERT_TRUE(initialised); - load_from_sv6(path.c_str()); + GetContext()->LoadParkFromFile(path); game_load_init(); // Check ride count to check load was successful diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index f9e7f6609c..814589626f 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -38,7 +38,7 @@ public: ASSERT_TRUE(initialised); std::string parkPath = TestData::GetParkPath("pathfinding-tests.sv6"); - load_from_sv6(parkPath.c_str()); + GetContext()->LoadParkFromFile(parkPath); game_load_init(); } @@ -118,7 +118,7 @@ protected: // Check that the peep is still on a footpath. Use next_z instead of pos->z here because pos->z will change // when the peep is halfway up a slope, but next_z will not change until they move to the next tile. - EXPECT_NE(map_get_footpath_element({ pos->ToCoordsXY(), peep->NextLoc.z }), nullptr); + EXPECT_NE(MapGetFootpathElement({ pos->ToCoordsXY(), peep->NextLoc.z }), nullptr); } // Clean up the peep, because we're reusing this loaded context for all tests. @@ -137,7 +137,7 @@ protected: static ::testing::AssertionResult AssertIsStartPosition(const char*, const TileCoordsXYZ& location) { const uint32_t expectedSurfaceStyle = 11u; - const uint32_t style = map_get_surface_element_at(location.ToCoordsXYZ())->GetSurfaceStyle(); + const uint32_t style = MapGetSurfaceElementAt(location.ToCoordsXYZ())->GetSurfaceStyle(); if (style != expectedSurfaceStyle) return ::testing::AssertionFailure() @@ -152,7 +152,7 @@ protected: { const uint32_t forbiddenSurfaceStyle = 8u; - const uint32_t style = map_get_surface_element_at(location.ToCoordsXYZ())->GetSurfaceStyle(); + const uint32_t style = MapGetSurfaceElementAt(location.ToCoordsXYZ())->GetSurfaceStyle(); if (style == forbiddenSurfaceStyle) return ::testing::AssertionFailure() diff --git a/test/tests/Platform.cpp b/test/tests/Platform.cpp index 9ca0863bd0..1452e3eefe 100644 --- a/test/tests/Platform.cpp +++ b/test/tests/Platform.cpp @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2014-2019 OpenRCT2 developers + * Copyright (c) 2014-2022 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index e2da60464e..01db3b5295 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -55,10 +55,10 @@ static std::unique_ptr localStartGame(const std::string& parkPath) ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); load_palette(); EntityTweener::Get().Reset(); - AutoCreateMapAnimations(); + MapAnimationAutoCreate(); fix_invalid_vehicle_sprite_sizes(); gGameSpeed = 1; diff --git a/test/tests/RideRatings.cpp b/test/tests/RideRatings.cpp index b6ef57b1d3..3c18cb306f 100644 --- a/test/tests/RideRatings.cpp +++ b/test/tests/RideRatings.cpp @@ -66,7 +66,7 @@ TEST_F(RideRatings, all) bool initialised = context->Initialise(); ASSERT_TRUE(initialised); - load_from_sv6(path.c_str()); + GetContext()->LoadParkFromFile(path); // Check ride count to check load was successful ASSERT_EQ(ride_get_count(), 134); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 258fa5ee57..e5c07c89cc 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -64,10 +64,10 @@ static void GameInit(bool retainSpatialIndices) ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); - scenery_set_default_placement_configuration(); + ScenerySetDefaultPlacementConfiguration(); load_palette(); EntityTweener::Get().Reset(); - AutoCreateMapAnimations(); + MapAnimationAutoCreate(); fix_invalid_vehicle_sprite_sizes(); gGameSpeed = 1; diff --git a/test/tests/TileElements.cpp b/test/tests/TileElements.cpp index c301536f54..253b9eb1c9 100644 --- a/test/tests/TileElements.cpp +++ b/test/tests/TileElements.cpp @@ -32,7 +32,7 @@ protected: bool initialised = _context->Initialise(); ASSERT_TRUE(initialised); - load_from_sv6(parkPath.c_str()); + GetContext()->LoadParkFromFile(parkPath); game_load_init(); // Changed in some tests. Store to restore its value @@ -59,31 +59,31 @@ uint8_t TileElementWantsFootpathConnection::_gScreenFlags; TEST_F(TileElementWantsFootpathConnection, FlatPath) { // Flat paths want to connect to other paths in any direction - const TileElement* const pathElement = map_get_footpath_element(TileCoordsXYZ{ 19, 18, 14 }.ToCoordsXYZ()); + const TileElement* const pathElement = MapGetFootpathElement(TileCoordsXYZ{ 19, 18, 14 }.ToCoordsXYZ()); ASSERT_NE(pathElement, nullptr); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 19, 18, 14, 0 }, nullptr)); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 19, 18, 14, 1 }, nullptr)); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 19, 18, 14, 2 }, nullptr)); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 19, 18, 14, 3 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 19, 18, 14, 0 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 19, 18, 14, 1 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 19, 18, 14, 2 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 19, 18, 14, 3 }, nullptr)); SUCCEED(); } TEST_F(TileElementWantsFootpathConnection, SlopedPath) { // Sloped paths only want to connect in two directions, of which is one at a higher offset - const TileElement* const slopedPathElement = map_get_footpath_element(TileCoordsXYZ{ 18, 18, 14 }.ToCoordsXYZ()); + const TileElement* const slopedPathElement = MapGetFootpathElement(TileCoordsXYZ{ 18, 18, 14 }.ToCoordsXYZ()); ASSERT_NE(slopedPathElement, nullptr); ASSERT_TRUE(slopedPathElement->AsPath()->IsSloped()); // Bottom and top of sloped path want a path connection - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 18, 18, 14, 2 }, nullptr)); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 18, 18, 16, 0 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 18, 18, 14, 2 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 18, 18, 16, 0 }, nullptr)); // Other directions at both heights do not want a connection - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 14, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 14, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 14, 3 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 16, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 16, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 16, 3 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 14, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 14, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 14, 3 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 16, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 16, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 16, 3 }, nullptr)); SUCCEED(); } @@ -91,61 +91,60 @@ TEST_F(TileElementWantsFootpathConnection, Stall) { // Stalls usually have one path direction flag, but can have multiple (info kiosk for example) auto tileCoords = TileCoordsXYZ{ 19, 15, 14 }; - const TrackElement* const stallElement = map_get_track_element_at(tileCoords.ToCoordsXYZ()); + const TrackElement* const stallElement = MapGetTrackElementAt(tileCoords.ToCoordsXYZ()); ASSERT_NE(stallElement, nullptr); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 19, 15, 14, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 15, 14, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 15, 14, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 15, 14, 3 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 19, 15, 14, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 15, 14, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 15, 14, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 15, 14, 3 }, nullptr)); SUCCEED(); } TEST_F(TileElementWantsFootpathConnection, RideEntrance) { // Ride entrances and exits want a connection in one direction - const EntranceElement* const entranceElement = map_get_ride_entrance_element_at( - TileCoordsXYZ{ 18, 8, 14 }.ToCoordsXYZ(), false); + const EntranceElement* const entranceElement = MapGetRideEntranceElementAt(TileCoordsXYZ{ 18, 8, 14 }.ToCoordsXYZ(), false); ASSERT_NE(entranceElement, nullptr); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 18, 8, 14, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 8, 14, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 8, 14, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 8, 14, 3 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 18, 8, 14, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 8, 14, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 8, 14, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 8, 14, 3 }, nullptr)); SUCCEED(); } TEST_F(TileElementWantsFootpathConnection, RideExit) { // The exit has been rotated; it wants a path connection in direction 1, but not 0 like the entrance - const EntranceElement* const exitElement = map_get_ride_exit_element_at(TileCoordsXYZ{ 18, 10, 14 }.ToCoordsXYZ(), false); + const EntranceElement* const exitElement = MapGetRideExitElementAt(TileCoordsXYZ{ 18, 10, 14 }.ToCoordsXYZ(), false); ASSERT_NE(exitElement, nullptr); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 10, 14, 0 }, nullptr)); - EXPECT_TRUE(tile_element_wants_path_connection_towards({ 18, 10, 14, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 10, 14, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 10, 14, 3 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 10, 14, 0 }, nullptr)); + EXPECT_TRUE(TileElementWantsPathConnectionTowards({ 18, 10, 14, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 10, 14, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 10, 14, 3 }, nullptr)); SUCCEED(); } TEST_F(TileElementWantsFootpathConnection, DifferentHeight) { // Test at different heights, all of these should fail - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 4, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 4, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 4, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 4, 3 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 4, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 6, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 15, 4, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 8, 4, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 10, 4, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 24, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 24, 1 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 24, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 18, 24, 3 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 24, 2 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 18, 26, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 19, 15, 24, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 8, 24, 0 }, nullptr)); - EXPECT_FALSE(tile_element_wants_path_connection_towards({ 18, 10, 24, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 4, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 4, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 4, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 4, 3 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 4, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 6, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 15, 4, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 8, 4, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 10, 4, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 24, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 24, 1 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 24, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 18, 24, 3 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 24, 2 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 18, 26, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 19, 15, 24, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 8, 24, 0 }, nullptr)); + EXPECT_FALSE(TileElementWantsPathConnectionTowards({ 18, 10, 24, 1 }, nullptr)); SUCCEED(); } @@ -153,13 +152,13 @@ TEST_F(TileElementWantsFootpathConnection, MapEdge) { // Paths at the map edge should have edge flags turned on when placed in scenario editor // This tile is a single, unconnected footpath on the map edge - on load, GetEdges() returns 0 - TileElement* pathElement = map_get_footpath_element(TileCoordsXYZ{ 1, 4, 14 }.ToCoordsXYZ()); + TileElement* pathElement = MapGetFootpathElement(TileCoordsXYZ{ 1, 4, 14 }.ToCoordsXYZ()); // Enable flag to simulate enabling the scenario editor gScreenFlags |= SCREEN_FLAGS_SCENARIO_EDITOR; // Calculate the connected edges and set the appropriate edge flags - footpath_connect_edges({ 16, 64 }, pathElement, 0); + FootpathConnectEdges({ 16, 64 }, pathElement, 0); auto edges = pathElement->AsPath()->GetEdges(); // The tiles alongside in the Y direction are both on the map edge so should be marked as an edge diff --git a/test/tests/TileElementsView.cpp b/test/tests/TileElementsView.cpp index 1695a4c69a..32bedf194d 100644 --- a/test/tests/TileElementsView.cpp +++ b/test/tests/TileElementsView.cpp @@ -33,7 +33,7 @@ protected: bool initialised = _context->Initialise(); ASSERT_TRUE(initialised); - load_from_sv6(parkPath.c_str()); + GetContext()->LoadParkFromFile(parkPath); game_load_init(); // Changed in some tests. Store to restore its value @@ -61,7 +61,7 @@ template std::vector BuildListManual(const CoordsXY& pos) { std::vector res; - TileElement* element = map_get_first_element_at(pos); + TileElement* element = MapGetFirstElementAt(pos); if (element == nullptr) return res; diff --git a/test/tests/sawyercoding_test.cpp b/test/tests/sawyercoding_test.cpp index ed561b051c..fa6d1c22e6 100644 --- a/test/tests/sawyercoding_test.cpp +++ b/test/tests/sawyercoding_test.cpp @@ -38,7 +38,8 @@ protected: chdr_in.encoding = encoding_type; chdr_in.length = sizeof(randomdata); uint8_t* encodedDataBuffer = new uint8_t[BUFFER_SIZE]; - size_t encodedDataSize = sawyercoding_write_chunk_buffer(encodedDataBuffer, (const uint8_t*)randomdata, chdr_in); + size_t encodedDataSize = sawyercoding_write_chunk_buffer( + encodedDataBuffer, reinterpret_cast(randomdata), chdr_in); ASSERT_GT(encodedDataSize, sizeof(sawyercoding_chunk_header)); // Decode